vendor: 8,488 bytes, lines 1-226
1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="05712183-3e0c-5867-9604-61ae680444f1")}catch(e){}}(); 3import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime.D1cXj70v.js"; 4import { ft as require_browser$15 } from "./vendor~index~newNavigation~AccountTierManagementPage~AdminContainer~AISystemPromptManager~C~h0mf93xb.B-8UGg7U.js"; 5//#region node_modules/base64-js/index.js 6var require_base64_js = /* @__PURE__ */ __commonJSMin(((exports) => { 7 exports.byteLength = byteLength; 8 exports.toByteArray = toByteArray; 9 exports.fromByteArray = fromByteArray; 10 var lookup = []; 11 var revLookup = []; 12 var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; 13 var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 14 for (var i = 0, len = code.length; i < len; ++i) { 15 lookup[i] = code[i]; 16 revLookup[code.charCodeAt(i)] = i; 17 } 18 revLookup["-".charCodeAt(0)] = 62; 19 revLookup["_".charCodeAt(0)] = 63; 20 function getLens(b64) { 21 var len = b64.length; 22 if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); 23 var validLen = b64.indexOf("="); 24 if (validLen === -1) validLen = len; 25 var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; 26 return [validLen, placeHoldersLen]; 27 } 28 function byteLength(b64) { 29 var lens = getLens(b64); 30 var validLen = lens[0]; 31 var placeHoldersLen = lens[1]; 32 return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; 33 } 34 function _byteLength(b64, validLen, placeHoldersLen) { 35 return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; 36 } 37 function toByteArray(b64) { 38 var tmp; 39 var lens = getLens(b64); 40 var validLen = lens[0]; 41 var placeHoldersLen = lens[1]; 42 var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); 43 var curByte = 0; 44 var len = placeHoldersLen > 0 ? validLen - 4 : validLen; 45 var i; 46 for (i = 0; i < len; i += 4) { 47 tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; 48 arr[curByte++] = tmp >> 16 & 255; 49 arr[curByte++] = tmp >> 8 & 255; 50 arr[curByte++] = tmp & 255; 51 } 52 if (placeHoldersLen === 2) { 53 tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; 54 arr[curByte++] = tmp & 255; 55 } 56 if (placeHoldersLen === 1) { 57 tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; 58 arr[curByte++] = tmp >> 8 & 255; 59 arr[curByte++] = tmp & 255; 60 } 61 return arr; 62 } 63 function tripletToBase64(num) { 64 return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; 65 } 66 function encodeChunk(uint8, start, end) { 67 var tmp; 68 var output = []; 69 for (var i = start; i < end; i += 3) { 70 tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255); 71 output.push(tripletToBase64(tmp)); 72 } 73 return output.join(""); 74 } 75 function fromByteArray(uint8) { 76 var tmp; 77 var len = uint8.length; 78 var extraBytes = len % 3; 79 var parts = []; 80 var maxChunkLength = 16383; 81 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); 82 if (extraBytes === 1) { 83 tmp = uint8[len - 1]; 84 parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); 85 } else if (extraBytes === 2) { 86 tmp = (uint8[len - 2] << 8) + uint8[len - 1]; 87 parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); 88 } 89 return parts.join(""); 90 } 91})); 92//#endregion 93//#region node_modules/buffer/node_modules/ieee754/index.js 94var require_ieee754 = /* @__PURE__ */ __commonJSMin(((exports) => { 95 /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ 96 exports.read = function(buffer, offset, isLE, mLen, nBytes) { 97 var e, m; 98 var eLen = nBytes * 8 - mLen - 1; 99 var eMax = (1 << eLen) - 1; 100 var eBias = eMax >> 1; 101 var nBits = -7; 102 var i = isLE ? nBytes - 1 : 0; 103 var d = isLE ? -1 : 1; 104 var s = buffer[offset + i]; 105 i += d; 106 e = s & (1 << -nBits) - 1; 107 s >>= -nBits; 108 nBits += eLen; 109 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); 110 m = e & (1 << -nBits) - 1; 111 e >>= -nBits; 112 nBits += mLen; 113 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); 114 if (e === 0) e = 1 - eBias; 115 else if (e === eMax) return m ? NaN : (s ? -1 : 1) * Infinity; 116 else { 117 m = m + Math.pow(2, mLen); 118 e = e - eBias; 119 } 120 return (s ? -1 : 1) * m * Math.pow(2, e - mLen); 121 }; 122 exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { 123 var e, m, c; 124 var eLen = nBytes * 8 - mLen - 1; 125 var eMax = (1 << eLen) - 1; 126 var eBias = eMax >> 1; 127 var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; 128 var i = isLE ? 0 : nBytes - 1; 129 var d = isLE ? 1 : -1; 130 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; 131 value = Math.abs(value); 132 if (isNaN(value) || value === Infinity) { 133 m = isNaN(value) ? 1 : 0; 134 e = eMax; 135 } else { 136 e = Math.floor(Math.log(value) / Math.LN2); 137 if (value * (c = Math.pow(2, -e)) < 1) { 138 e--; 139 c *= 2; 140 } 141 if (e + eBias >= 1) value += rt / c; 142 else value += rt * Math.pow(2, 1 - eBias); 143 if (value * c >= 2) { 144 e++; 145 c /= 2; 146 } 147 if (e + eBias >= eMax) { 148 m = 0; 149 e = eMax; 150 } else if (e + eBias >= 1) { 151 m = (value * c - 1) * Math.pow(2, mLen); 152 e = e + eBias; 153 } else { 154 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); 155 e = 0; 156 } 157 } 158 for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8); 159 e = e << mLen | m; 160 eLen += mLen; 161 for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8); 162 buffer[offset + i - d] |= s * 128; 163 }; 164})); 165//#endregion 166//#region node_modules/buffer/index.js 167/*! 168* The buffer module from node.js, for the browser. 169* 170* @author Feross Aboukhadijeh <https://feross.org> 171* @license MIT 172*/ 173var require_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports) => { 174 var base64 = require_base64_js(); 175 var ieee754 = require_ieee754(); 176 var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; 177 exports.Buffer = Buffer; 178 exports.SlowBuffer = SlowBuffer; 179 exports.INSPECT_MAX_BYTES = 50; 180 var K_MAX_LENGTH = 2147483647; 181 exports.kMaxLength = K_MAX_LENGTH; 182 /** 183 * If `Buffer.TYPED_ARRAY_SUPPORT`: 184 * === true Use Uint8Array implementation (fastest) 185 * === false Print warning and recommend using `buffer` v4.x which has an Object 186 * implementation (most compatible, even IE6) 187 * 188 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, 189 * Opera 11.6+, iOS 4.2+. 190 * 191 * We report that the browser does not support typed arrays if the are not subclassable 192 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` 193 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support 194 * for __proto__ and has a buggy typed array implementation. 195 */ 196 Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); 197 if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); 198 function typedArraySupport() { 199 try { 200 const arr = /* @__PURE__ */ new Uint8Array(1); 201 const proto = { foo: function() { 202 return 42; 203 } }; 204 Object.setPrototypeOf(proto, Uint8Array.prototype); 205 Object.setPrototypeOf(arr, proto); 206 return arr.foo() === 42; 207 } catch (e) { 208 return false; 209 } 210 } 211 Object.defineProperty(Buffer.prototype, "parent", { 212 enumerable: true, 213 get: function() { 214 if (!Buffer.isBuffer(this)) return void 0; 215 return this.buffer; 216 } 217 }); 218 Object.defineProperty(Buffer.prototype, "offset", { 219 enumerable: true, 220 get: function() { 221 if (!Buffer.isBuffer(this)) return void 0; 222 return this.byteOffset; 223 } 224 }); 225 function createBuffer(length) { 226 if (length > K_MAX_LENGTH) throw new RangeError("The value \"" + length + "\" is invali
vendor: 45,473 bytes, lines 226-1390
226d for option \"size\""); 227 const buf = new Uint8Array(length); 228 Object.setPrototypeOf(buf, Buffer.prototype); 229 return buf; 230 } 231 /** 232 * The Buffer constructor returns instances of `Uint8Array` that have their 233 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of 234 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods 235 * and the `Uint8Array` methods. Square bracket notation works as expected -- it 236 * returns a single octet. 237 * 238 * The `Uint8Array` prototype remains unmodified. 239 */ 240 function Buffer(arg, encodingOrOffset, length) { 241 if (typeof arg === "number") { 242 if (typeof encodingOrOffset === "string") throw new TypeError("The \"string\" argument must be of type string. Received type number"); 243 return allocUnsafe(arg); 244 } 245 return from(arg, encodingOrOffset, length); 246 } 247 Buffer.poolSize = 8192; 248 function from(value, encodingOrOffset, length) { 249 if (typeof value === "string") return fromString(value, encodingOrOffset); 250 if (ArrayBuffer.isView(value)) return fromArrayView(value); 251 if (value == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); 252 if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) return fromArrayBuffer(value, encodingOrOffset, length); 253 if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) return fromArrayBuffer(value, encodingOrOffset, length); 254 if (typeof value === "number") throw new TypeError("The \"value\" argument must not be of type number. Received type number"); 255 const valueOf = value.valueOf && value.valueOf(); 256 if (valueOf != null && valueOf !== value) return Buffer.from(valueOf, encodingOrOffset, length); 257 const b = fromObject(value); 258 if (b) return b; 259 if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); 260 throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); 261 } 262 /** 263 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError 264 * if value is a number. 265 * Buffer.from(str[, encoding]) 266 * Buffer.from(array) 267 * Buffer.from(buffer) 268 * Buffer.from(arrayBuffer[, byteOffset[, length]]) 269 **/ 270 Buffer.from = function(value, encodingOrOffset, length) { 271 return from(value, encodingOrOffset, length); 272 }; 273 Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); 274 Object.setPrototypeOf(Buffer, Uint8Array); 275 function assertSize(size) { 276 if (typeof size !== "number") throw new TypeError("\"size\" argument must be of type number"); 277 else if (size < 0) throw new RangeError("The value \"" + size + "\" is invalid for option \"size\""); 278 } 279 function alloc(size, fill, encoding) { 280 assertSize(size); 281 if (size <= 0) return createBuffer(size); 282 if (fill !== void 0) return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); 283 return createBuffer(size); 284 } 285 /** 286 * Creates a new filled Buffer instance. 287 * alloc(size[, fill[, encoding]]) 288 **/ 289 Buffer.alloc = function(size, fill, encoding) { 290 return alloc(size, fill, encoding); 291 }; 292 function allocUnsafe(size) { 293 assertSize(size); 294 return createBuffer(size < 0 ? 0 : checked(size) | 0); 295 } 296 /** 297 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. 298 * */ 299 Buffer.allocUnsafe = function(size) { 300 return allocUnsafe(size); 301 }; 302 /** 303 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. 304 */ 305 Buffer.allocUnsafeSlow = function(size) { 306 return allocUnsafe(size); 307 }; 308 function fromString(string, encoding) { 309 if (typeof encoding !== "string" || encoding === "") encoding = "utf8"; 310 if (!Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding); 311 const length = byteLength(string, encoding) | 0; 312 let buf = createBuffer(length); 313 const actual = buf.write(string, encoding); 314 if (actual !== length) buf = buf.slice(0, actual); 315 return buf; 316 } 317 function fromArrayLike(array) { 318 const length = array.length < 0 ? 0 : checked(array.length) | 0; 319 const buf = createBuffer(length); 320 for (let i = 0; i < length; i += 1) buf[i] = array[i] & 255; 321 return buf; 322 } 323 function fromArrayView(arrayView) { 324 if (isInstance(arrayView, Uint8Array)) { 325 const copy = new Uint8Array(arrayView); 326 return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); 327 } 328 return fromArrayLike(arrayView); 329 } 330 function fromArrayBuffer(array, byteOffset, length) { 331 if (byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError("\"offset\" is outside of buffer bounds"); 332 if (array.byteLength < byteOffset + (length || 0)) throw new RangeError("\"length\" is outside of buffer bounds"); 333 let buf; 334 if (byteOffset === void 0 && length === void 0) buf = new Uint8Array(array); 335 else if (length === void 0) buf = new Uint8Array(array, byteOffset); 336 else buf = new Uint8Array(array, byteOffset, length); 337 Object.setPrototypeOf(buf, Buffer.prototype); 338 return buf; 339 } 340 function fromObject(obj) { 341 if (Buffer.isBuffer(obj)) { 342 const len = checked(obj.length) | 0; 343 const buf = createBuffer(len); 344 if (buf.length === 0) return buf; 345 obj.copy(buf, 0, 0, len); 346 return buf; 347 } 348 if (obj.length !== void 0) { 349 if (typeof obj.length !== "number" || numberIsNaN(obj.length)) return createBuffer(0); 350 return fromArrayLike(obj); 351 } 352 if (obj.type === "Buffer" && Array.isArray(obj.data)) return fromArrayLike(obj.data); 353 } 354 function checked(length) { 355 if (length >= K_MAX_LENGTH) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); 356 return length | 0; 357 } 358 function SlowBuffer(length) { 359 if (+length != length) length = 0; 360 return Buffer.alloc(+length); 361 } 362 Buffer.isBuffer = function isBuffer(b) { 363 return b != null && b._isBuffer === true && b !== Buffer.prototype; 364 }; 365 Buffer.compare = function compare(a, b) { 366 if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); 367 if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); 368 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array"); 369 if (a === b) return 0; 370 let x = a.length; 371 let y = b.length; 372 for (let i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) { 373 x = a[i]; 374 y = b[i]; 375 break; 376 } 377 if (x < y) return -1; 378 if (y < x) return 1; 379 return 0; 380 }; 381 Buffer.isEncoding = function isEncoding(encoding) { 382 switch (String(encoding).toLowerCase()) { 383 case "hex": 384 case "utf8": 385 case "utf-8": 386 case "ascii": 387 case "latin1": 388 case "binary": 389 case "base64": 390 case "ucs2": 391 case "ucs-2": 392 case "utf16le": 393 case "utf-16le": return true; 394 default: return false; 395 } 396 }; 397 Buffer.concat = function concat(list, length) { 398 if (!Array.isArray(list)) throw new TypeError("\"list\" argument must be an Array of Buffers"); 399 if (list.length === 0) return Buffer.alloc(0); 400 let i; 401 if (length === void 0) { 402 length = 0; 403 for (i = 0; i < list.length; ++i) length += list[i].length; 404 } 405 const buffer = Buffer.allocUnsafe(length); 406 let pos = 0; 407 for (i = 0; i < list.length; ++i) { 408 let buf = list[i]; 409 if (isInstance(buf, Uint8Array)) if (pos + buf.length > buffer.length) { 410 if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); 411 buf.copy(buffer, pos); 412 } else Uint8Array.prototype.set.call(buffer, buf, pos); 413 else if (!Buffer.isBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers"); 414 else buf.copy(buffer, pos); 415 pos += buf.length; 416 } 417 return buffer; 418 }; 419 function byteLength(string, encoding) { 420 if (Buffer.isBuffer(string)) return string.length; 421 if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) return string.byteLength; 422 if (typeof string !== "string") throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string); 423 const len = string.length; 424 const mustMatch = arguments.length > 2 && arguments[2] === true; 425 if (!mustMatch && len === 0) return 0; 426 let loweredCase = false; 427 for (;;) switch (encoding) { 428 case "ascii": 429 case "latin1": 430 case "binary": return len; 431 case "utf8": 432 case "utf-8": return utf8ToBytes(string).length; 433 case "ucs2": 434 case "ucs-2": 435 case "utf16le": 436 case "utf-16le": return len * 2; 437 case "hex": return len >>> 1; 438 case "base64": return base64ToBytes(string).length; 439 default: 440 if (loweredCase) return mustMatch ? -1 : utf8ToBytes(string).length; 441 encoding = ("" + encoding).toLowerCase(); 442 loweredCase = true; 443 } 444 } 445 Buffer.byteLength = byteLength; 446 function slowToString(encoding, start, end) { 447 let loweredCase = false; 448 if (start === void 0 || start < 0) start = 0; 449 if (start > this.length) return ""; 450 if (end === void 0 || end > this.length) end = this.length; 451 if (end <= 0) return ""; 452 end >>>= 0; 453 start >>>= 0; 454 if (end <= start) return ""; 455 if (!encoding) encoding = "utf8"; 456 while (true) switch (encoding) { 457 case "hex": return hexSlice(this, start, end); 458 case "utf8": 459 case "utf-8": return utf8Slice(this, start, end); 460 case "ascii": return asciiSlice(this, start, end); 461 case "latin1": 462 case "binary": return latin1Slice(this, start, end); 463 case "base64": return base64Slice(this, start, end); 464 case "ucs2": 465 case "ucs-2": 466 case "utf16le": 467 case "utf-16le": return utf16leSlice(this, start, end); 468 default: 469 if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); 470 encoding = (encoding + "").toLowerCase(); 471 loweredCase = true; 472 } 473 } 474 Buffer.prototype._isBuffer = true; 475 function swap(b, n, m) { 476 const i = b[n]; 477 b[n] = b[m]; 478 b[m] = i; 479 } 480 Buffer.prototype.swap16 = function swap16() { 481 const len = this.length; 482 if (len % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); 483 for (let i = 0; i < len; i += 2) swap(this, i, i + 1); 484 return this; 485 }; 486 Buffer.prototype.swap32 = function swap32() { 487 const len = this.length; 488 if (len % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); 489 for (let i = 0; i < len; i += 4) { 490 swap(this, i, i + 3); 491 swap(this, i + 1, i + 2); 492 } 493 return this; 494 }; 495 Buffer.prototype.swap64 = function swap64() { 496 const len = this.length; 497 if (len % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); 498 for (let i = 0; i < len; i += 8) { 499 swap(this, i, i + 7); 500 swap(this, i + 1, i + 6); 501 swap(this, i + 2, i + 5); 502 swap(this, i + 3, i + 4); 503 } 504 return this; 505 }; 506 Buffer.prototype.toString = function toString() { 507 const length = this.length; 508 if (length === 0) return ""; 509 if (arguments.length === 0) return utf8Slice(this, 0, length); 510 return slowToString.apply(this, arguments); 511 }; 512 Buffer.prototype.toLocaleString = Buffer.prototype.toString; 513 Buffer.prototype.equals = function equals(b) { 514 if (!Buffer.isBuffer(b)) throw new TypeError("Argument must be a Buffer"); 515 if (this === b) return true; 516 return Buffer.compare(this, b) === 0; 517 }; 518 Buffer.prototype.inspect = function inspect() { 519 let str = ""; 520 const max = exports.INSPECT_MAX_BYTES; 521 str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); 522 if (this.length > max) str += " ... "; 523 return "<Buffer " + str + ">"; 524 }; 525 if (customInspectSymbol) Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; 526 Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { 527 if (isInstance(target, Uint8Array)) target = Buffer.from(target, target.offset, target.byteLength); 528 if (!Buffer.isBuffer(target)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof target); 529 if (start === void 0) start = 0; 530 if (end === void 0) end = target ? target.length : 0; 531 if (thisStart === void 0) thisStart = 0; 532 if (thisEnd === void 0) thisEnd = this.length; 533 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) throw new RangeError("out of range index"); 534 if (thisStart >= thisEnd && start >= end) return 0; 535 if (thisStart >= thisEnd) return -1; 536 if (start >= end) return 1; 537 start >>>= 0; 538 end >>>= 0; 539 thisStart >>>= 0; 540 thisEnd >>>= 0; 541 if (this === target) return 0; 542 let x = thisEnd - thisStart; 543 let y = end - start; 544 const len = Math.min(x, y); 545 const thisCopy = this.slice(thisStart, thisEnd); 546 const targetCopy = target.slice(start, end); 547 for (let i = 0; i < len; ++i) if (thisCopy[i] !== targetCopy[i]) { 548 x = thisCopy[i]; 549 y = targetCopy[i]; 550 break; 551 } 552 if (x < y) return -1; 553 if (y < x) return 1; 554 return 0; 555 }; 556 function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { 557 if (buffer.length === 0) return -1; 558 if (typeof byteOffset === "string") { 559 encoding = byteOffset; 560 byteOffset = 0; 561 } else if (byteOffset > 2147483647) byteOffset = 2147483647; 562 else if (byteOffset < -2147483648) byteOffset = -2147483648; 563 byteOffset = +byteOffset; 564 if (numberIsNaN(byteOffset)) byteOffset = dir ? 0 : buffer.length - 1; 565 if (byteOffset < 0) byteOffset = buffer.length + byteOffset; 566 if (byteOffset >= buffer.length) if (dir) return -1; 567 else byteOffset = buffer.length - 1; 568 else if (byteOffset < 0) if (dir) byteOffset = 0; 569 else return -1; 570 if (typeof val === "string") val = Buffer.from(val, encoding); 571 if (Buffer.isBuffer(val)) { 572 if (val.length === 0) return -1; 573 return arrayIndexOf(buffer, val, byteOffset, encoding, dir); 574 } else if (typeof val === "number") { 575 val = val & 255; 576 if (typeof Uint8Array.prototype.indexOf === "function") if (dir) return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); 577 else return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); 578 return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); 579 } 580 throw new TypeError("val must be string, number or Buffer"); 581 } 582 function arrayIndexOf(arr, val, byteOffset, encoding, dir) { 583 let indexSize = 1; 584 let arrLength = arr.length; 585 let valLength = val.length; 586 if (encoding !== void 0) { 587 encoding = String(encoding).toLowerCase(); 588 if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { 589 if (arr.length < 2 || val.length < 2) return -1; 590 indexSize = 2; 591 arrLength /= 2; 592 valLength /= 2; 593 byteOffset /= 2; 594 } 595 } 596 function read(buf, i) { 597 if (indexSize === 1) return buf[i]; 598 else return buf.readUInt16BE(i * indexSize); 599 } 600 let i; 601 if (dir) { 602 let foundIndex = -1; 603 for (i = byteOffset; i < arrLength; i++) if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { 604 if (foundIndex === -1) foundIndex = i; 605 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; 606 } else { 607 if (foundIndex !== -1) i -= i - foundIndex; 608 foundIndex = -1; 609 } 610 } else { 611 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; 612 for (i = byteOffset; i >= 0; i--) { 613 let found = true; 614 for (let j = 0; j < valLength; j++) if (read(arr, i + j) !== read(val, j)) { 615 found = false; 616 break; 617 } 618 if (found) return i; 619 } 620 } 621 return -1; 622 } 623 Buffer.prototype.includes = function includes(val, byteOffset, encoding) { 624 return this.indexOf(val, byteOffset, encoding) !== -1; 625 }; 626 Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { 627 return bidirectionalIndexOf(this, val, byteOffset, encoding, true); 628 }; 629 Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { 630 return bidirectionalIndexOf(this, val, byteOffset, encoding, false); 631 }; 632 function hexWrite(buf, string, offset, length) { 633 offset = Number(offset) || 0; 634 const remaining = buf.length - offset; 635 if (!length) length = remaining; 636 else { 637 length = Number(length); 638 if (length > remaining) length = remaining; 639 } 640 const strLen = string.length; 641 if (length > strLen / 2) length = strLen / 2; 642 let i; 643 for (i = 0; i < length; ++i) { 644 const parsed = parseInt(string.substr(i * 2, 2), 16); 645 if (numberIsNaN(parsed)) return i; 646 buf[offset + i] = parsed; 647 } 648 return i; 649 } 650 function utf8Write(buf, string, offset, length) { 651 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); 652 } 653 function asciiWrite(buf, string, offset, length) { 654 return blitBuffer(asciiToBytes(string), buf, offset, length); 655 } 656 function base64Write(buf, string, offset, length) { 657 return blitBuffer(base64ToBytes(string), buf, offset, length); 658 } 659 function ucs2Write(buf, string, offset, length) { 660 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); 661 } 662 Buffer.prototype.write = function write(string, offset, length, encoding) { 663 if (offset === void 0) { 664 encoding = "utf8"; 665 length = this.length; 666 offset = 0; 667 } else if (length === void 0 && typeof offset === "string") { 668 encoding = offset; 669 length = this.length; 670 offset = 0; 671 } else if (isFinite(offset)) { 672 offset = offset >>> 0; 673 if (isFinite(length)) { 674 length = length >>> 0; 675 if (encoding === void 0) encoding = "utf8"; 676 } else { 677 encoding = length; 678 length = void 0; 679 } 680 } else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); 681 const remaining = this.length - offset; 682 if (length === void 0 || length > remaining) length = remaining; 683 if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds"); 684 if (!encoding) encoding = "utf8"; 685 let loweredCase = false; 686 for (;;) switch (encoding) { 687 case "hex": return hexWrite(this, string, offset, length); 688 case "utf8": 689 case "utf-8": return utf8Write(this, string, offset, length); 690 case "ascii": 691 case "latin1": 692 case "binary": return asciiWrite(this, string, offset, length); 693 case "base64": return base64Write(this, string, offset, length); 694 case "ucs2": 695 case "ucs-2": 696 case "utf16le": 697 case "utf-16le": return ucs2Write(this, string, offset, length); 698 default: 699 if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); 700 encoding = ("" + encoding).toLowerCase(); 701 loweredCase = true; 702 } 703 }; 704 Buffer.prototype.toJSON = function toJSON() { 705 return { 706 type: "Buffer", 707 data: Array.prototype.slice.call(this._arr || this, 0) 708 }; 709 }; 710 function base64Slice(buf, start, end) { 711 if (start === 0 && end === buf.length) return base64.fromByteArray(buf); 712 else return base64.fromByteArray(buf.slice(start, end)); 713 } 714 function utf8Slice(buf, start, end) { 715 end = Math.min(buf.length, end); 716 const res = []; 717 let i = start; 718 while (i < end) { 719 const firstByte = buf[i]; 720 let codePoint = null; 721 let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; 722 if (i + bytesPerSequence <= end) { 723 let secondByte, thirdByte, fourthByte, tempCodePoint; 724 switch (bytesPerSequence) { 725 case 1: 726 if (firstByte < 128) codePoint = firstByte; 727 break; 728 case 2: 729 secondByte = buf[i + 1]; 730 if ((secondByte & 192) === 128) { 731 tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; 732 if (tempCodePoint > 127) codePoint = tempCodePoint; 733 } 734 break; 735 case 3: 736 secondByte = buf[i + 1]; 737 thirdByte = buf[i + 2]; 738 if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { 739 tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; 740 if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint = tempCodePoint; 741 } 742 break; 743 case 4: 744 secondByte = buf[i + 1]; 745 thirdByte = buf[i + 2]; 746 fourthByte = buf[i + 3]; 747 if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { 748 tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; 749 if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint = tempCodePoint; 750 } 751 } 752 } 753 if (codePoint === null) { 754 codePoint = 65533; 755 bytesPerSequence = 1; 756 } else if (codePoint > 65535) { 757 codePoint -= 65536; 758 res.push(codePoint >>> 10 & 1023 | 55296); 759 codePoint = 56320 | codePoint & 1023; 760 } 761 res.push(codePoint); 762 i += bytesPerSequence; 763 } 764 return decodeCodePointsArray(res); 765 } 766 var MAX_ARGUMENTS_LENGTH = 4096; 767 function decodeCodePointsArray(codePoints) { 768 const len = codePoints.length; 769 if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints); 770 let res = ""; 771 let i = 0; 772 while (i < len) res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); 773 return res; 774 } 775 function asciiSlice(buf, start, end) { 776 let ret = ""; 777 end = Math.min(buf.length, end); 778 for (let i = start; i < end; ++i) ret += String.fromCharCode(buf[i] & 127); 779 return ret; 780 } 781 function latin1Slice(buf, start, end) { 782 let ret = ""; 783 end = Math.min(buf.length, end); 784 for (let i = start; i < end; ++i) ret += String.fromCharCode(buf[i]); 785 return ret; 786 } 787 function hexSlice(buf, start, end) { 788 const len = buf.length; 789 if (!start || start < 0) start = 0; 790 if (!end || end < 0 || end > len) end = len; 791 let out = ""; 792 for (let i = start; i < end; ++i) out += hexSliceLookupTable[buf[i]]; 793 return out; 794 } 795 function utf16leSlice(buf, start, end) { 796 const bytes = buf.slice(start, end); 797 let res = ""; 798 for (let i = 0; i < bytes.length - 1; i += 2) res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); 799 return res; 800 } 801 Buffer.prototype.slice = function slice(start, end) { 802 const len = this.length; 803 start = ~~start; 804 end = end === void 0 ? len : ~~end; 805 if (start < 0) { 806 start += len; 807 if (start < 0) start = 0; 808 } else if (start > len) start = len; 809 if (end < 0) { 810 end += len; 811 if (end < 0) end = 0; 812 } else if (end > len) end = len; 813 if (end < start) end = start; 814 const newBuf = this.subarray(start, end); 815 Object.setPrototypeOf(newBuf, Buffer.prototype); 816 return newBuf; 817 }; 818 function checkOffset(offset, ext, length) { 819 if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint"); 820 if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length"); 821 } 822 Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { 823 offset = offset >>> 0; 824 byteLength = byteLength >>> 0; 825 if (!noAssert) checkOffset(offset, byteLength, this.length); 826 let val = this[offset]; 827 let mul = 1; 828 let i = 0; 829 while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul; 830 return val; 831 }; 832 Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { 833 offset = offset >>> 0; 834 byteLength = byteLength >>> 0; 835 if (!noAssert) checkOffset(offset, byteLength, this.length); 836 let val = this[offset + --byteLength]; 837 let mul = 1; 838 while (byteLength > 0 && (mul *= 256)) val += this[offset + --byteLength] * mul; 839 return val; 840 }; 841 Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { 842 offset = offset >>> 0; 843 if (!noAssert) checkOffset(offset, 1, this.length); 844 return this[offset]; 845 }; 846 Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { 847 offset = offset >>> 0; 848 if (!noAssert) checkOffset(offset, 2, this.length); 849 return this[offset] | this[offset + 1] << 8; 850 }; 851 Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { 852 offset = offset >>> 0; 853 if (!noAssert) checkOffset(offset, 2, this.length); 854 return this[offset] << 8 | this[offset + 1]; 855 }; 856 Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { 857 offset = offset >>> 0; 858 if (!noAssert) checkOffset(offset, 4, this.length); 859 return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; 860 }; 861 Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { 862 offset = offset >>> 0; 863 if (!noAssert) checkOffset(offset, 4, this.length); 864 return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); 865 }; 866 Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { 867 offset = offset >>> 0; 868 validateNumber(offset, "offset"); 869 const first = this[offset]; 870 const last = this[offset + 7]; 871 if (first === void 0 || last === void 0) boundsError(offset, this.length - 8); 872 const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; 873 const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; 874 return BigInt(lo) + (BigInt(hi) << BigInt(32)); 875 }); 876 Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { 877 offset = offset >>> 0; 878 validateNumber(offset, "offset"); 879 const first = this[offset]; 880 const last = this[offset + 7]; 881 if (first === void 0 || last === void 0) boundsError(offset, this.length - 8); 882 const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; 883 const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; 884 return (BigInt(hi) << BigInt(32)) + BigInt(lo); 885 }); 886 Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { 887 offset = offset >>> 0; 888 byteLength = byteLength >>> 0; 889 if (!noAssert) checkOffset(offset, byteLength, this.length); 890 let val = this[offset]; 891 let mul = 1; 892 let i = 0; 893 while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul; 894 mul *= 128; 895 if (val >= mul) val -= Math.pow(2, 8 * byteLength); 896 return val; 897 }; 898 Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { 899 offset = offset >>> 0; 900 byteLength = byteLength >>> 0; 901 if (!noAssert) checkOffset(offset, byteLength, this.length); 902 let i = byteLength; 903 let mul = 1; 904 let val = this[offset + --i]; 905 while (i > 0 && (mul *= 256)) val += this[offset + --i] * mul; 906 mul *= 128; 907 if (val >= mul) val -= Math.pow(2, 8 * byteLength); 908 return val; 909 }; 910 Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { 911 offset = offset >>> 0; 912 if (!noAssert) checkOffset(offset, 1, this.length); 913 if (!(this[offset] & 128)) return this[offset]; 914 return (255 - this[offset] + 1) * -1; 915 }; 916 Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { 917 offset = offset >>> 0; 918 if (!noAssert) checkOffset(offset, 2, this.length); 919 const val = this[offset] | this[offset + 1] << 8; 920 return val & 32768 ? val | 4294901760 : val; 921 }; 922 Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { 923 offset = offset >>> 0; 924 if (!noAssert) checkOffset(offset, 2, this.length); 925 const val = this[offset + 1] | this[offset] << 8; 926 return val & 32768 ? val | 4294901760 : val; 927 }; 928 Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { 929 offset = offset >>> 0; 930 if (!noAssert) checkOffset(offset, 4, this.length); 931 return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; 932 }; 933 Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { 934 offset = offset >>> 0; 935 if (!noAssert) checkOffset(offset, 4, this.length); 936 return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; 937 }; 938 Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { 939 offset = offset >>> 0; 940 validateNumber(offset, "offset"); 941 const first = this[offset]; 942 const last = this[offset + 7]; 943 if (first === void 0 || last === void 0) boundsError(offset, this.length - 8); 944 const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); 945 return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); 946 }); 947 Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { 948 offset = offset >>> 0; 949 validateNumber(offset, "offset"); 950 const first = this[offset]; 951 const last = this[offset + 7]; 952 if (first === void 0 || last === void 0) boundsError(offset, this.length - 8); 953 const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; 954 return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); 955 }); 956 Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { 957 offset = offset >>> 0; 958 if (!noAssert) checkOffset(offset, 4, this.length); 959 return ieee754.read(this, offset, true, 23, 4); 960 }; 961 Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { 962 offset = offset >>> 0; 963 if (!noAssert) checkOffset(offset, 4, this.length); 964 return ieee754.read(this, offset, false, 23, 4); 965 }; 966 Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { 967 offset = offset >>> 0; 968 if (!noAssert) checkOffset(offset, 8, this.length); 969 return ieee754.read(this, offset, true, 52, 8); 970 }; 971 Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { 972 offset = offset >>> 0; 973 if (!noAssert) checkOffset(offset, 8, this.length); 974 return ieee754.read(this, offset, false, 52, 8); 975 }; 976 function checkInt(buf, value, offset, ext, max, min) { 977 if (!Buffer.isBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance"); 978 if (value > max || value < min) throw new RangeError("\"value\" argument is out of bounds"); 979 if (offset + ext > buf.length) throw new RangeError("Index out of range"); 980 } 981 Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { 982 value = +value; 983 offset = offset >>> 0; 984 byteLength = byteLength >>> 0; 985 if (!noAssert) { 986 const maxBytes = Math.pow(2, 8 * byteLength) - 1; 987 checkInt(this, value, offset, byteLength, maxBytes, 0); 988 } 989 let mul = 1; 990 let i = 0; 991 this[offset] = value & 255; 992 while (++i < byteLength && (mul *= 256)) this[offset + i] = value / mul & 255; 993 return offset + byteLength; 994 }; 995 Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { 996 value = +value; 997 offset = offset >>> 0; 998 byteLength = byteLength >>> 0; 999 if (!noAssert) { 1000 const maxBytes = Math.pow(2, 8 * byteLength) - 1; 1001 checkInt(this, value, offset, byteLength, maxBytes, 0); 1002 } 1003 let i = byteLength - 1; 1004 let mul = 1; 1005 this[offset + i] = value & 255; 1006 while (--i >= 0 && (mul *= 256)) this[offset + i] = value / mul & 255; 1007 return offset + byteLength; 1008 }; 1009 Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { 1010 value = +value; 1011 offset = offset >>> 0; 1012 if (!noAssert) checkInt(this, value, offset, 1, 255, 0); 1013 this[offset] = value & 255; 1014 return offset + 1; 1015 }; 1016 Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { 1017 value = +value; 1018 offset = offset >>> 0; 1019 if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); 1020 this[offset] = value & 255; 1021 this[offset + 1] = value >>> 8; 1022 return offset + 2; 1023 }; 1024 Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { 1025 value = +value; 1026 offset = offset >>> 0; 1027 if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); 1028 this[offset] = value >>> 8; 1029 this[offset + 1] = value & 255; 1030 return offset + 2; 1031 }; 1032 Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { 1033 value = +value; 1034 offset = offset >>> 0; 1035 if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); 1036 this[offset + 3] = value >>> 24; 1037 this[offset + 2] = value >>> 16; 1038 this[offset + 1] = value >>> 8; 1039 this[offset] = value & 255; 1040 return offset + 4; 1041 }; 1042 Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { 1043 value = +value; 1044 offset = offset >>> 0; 1045 if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); 1046 this[offset] = value >>> 24; 1047 this[offset + 1] = value >>> 16; 1048 this[offset + 2] = value >>> 8; 1049 this[offset + 3] = value & 255; 1050 return offset + 4; 1051 }; 1052 function wrtBigUInt64LE(buf, value, offset, min, max) { 1053 checkIntBI(value, min, max, buf, offset, 7); 1054 let lo = Number(value & BigInt(4294967295)); 1055 buf[offset++] = lo; 1056 lo = lo >> 8; 1057 buf[offset++] = lo; 1058 lo = lo >> 8; 1059 buf[offset++] = lo; 1060 lo = lo >> 8; 1061 buf[offset++] = lo; 1062 let hi = Number(value >> BigInt(32) & BigInt(4294967295)); 1063 buf[offset++] = hi; 1064 hi = hi >> 8; 1065 buf[offset++] = hi; 1066 hi = hi >> 8; 1067 buf[offset++] = hi; 1068 hi = hi >> 8; 1069 buf[offset++] = hi; 1070 return offset; 1071 } 1072 function wrtBigUInt64BE(buf, value, offset, min, max) { 1073 checkIntBI(value, min, max, buf, offset, 7); 1074 let lo = Number(value & BigInt(4294967295)); 1075 buf[offset + 7] = lo; 1076 lo = lo >> 8; 1077 buf[offset + 6] = lo; 1078 lo = lo >> 8; 1079 buf[offset + 5] = lo; 1080 lo = lo >> 8; 1081 buf[offset + 4] = lo; 1082 let hi = Number(value >> BigInt(32) & BigInt(4294967295)); 1083 buf[offset + 3] = hi; 1084 hi = hi >> 8; 1085 buf[offset + 2] = hi; 1086 hi = hi >> 8; 1087 buf[offset + 1] = hi; 1088 hi = hi >> 8; 1089 buf[offset] = hi; 1090 return offset + 8; 1091 } 1092 Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { 1093 return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); 1094 }); 1095 Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { 1096 return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); 1097 }); 1098 Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { 1099 value = +value; 1100 offset = offset >>> 0; 1101 if (!noAssert) { 1102 const limit = Math.pow(2, 8 * byteLength - 1); 1103 checkInt(this, value, offset, byteLength, limit - 1, -limit); 1104 } 1105 let i = 0; 1106 let mul = 1; 1107 let sub = 0; 1108 this[offset] = value & 255; 1109 while (++i < byteLength && (mul *= 256)) { 1110 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) sub = 1; 1111 this[offset + i] = (value / mul >> 0) - sub & 255; 1112 } 1113 return offset + byteLength; 1114 }; 1115 Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { 1116 value = +value; 1117 offset = offset >>> 0; 1118 if (!noAssert) { 1119 const limit = Math.pow(2, 8 * byteLength - 1); 1120 checkInt(this, value, offset, byteLength, limit - 1, -limit); 1121 } 1122 let i = byteLength - 1; 1123 let mul = 1; 1124 let sub = 0; 1125 this[offset + i] = value & 255; 1126 while (--i >= 0 && (mul *= 256)) { 1127 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) sub = 1; 1128 this[offset + i] = (value / mul >> 0) - sub & 255; 1129 } 1130 return offset + byteLength; 1131 }; 1132 Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { 1133 value = +value; 1134 offset = offset >>> 0; 1135 if (!noAssert) checkInt(this, value, offset, 1, 127, -128); 1136 if (value < 0) value = 255 + value + 1; 1137 this[offset] = value & 255; 1138 return offset + 1; 1139 }; 1140 Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { 1141 value = +value; 1142 offset = offset >>> 0; 1143 if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); 1144 this[offset] = value & 255; 1145 this[offset + 1] = value >>> 8; 1146 return offset + 2; 1147 }; 1148 Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { 1149 value = +value; 1150 offset = offset >>> 0; 1151 if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); 1152 this[offset] = value >>> 8; 1153 this[offset + 1] = value & 255; 1154 return offset + 2; 1155 }; 1156 Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { 1157 value = +value; 1158 offset = offset >>> 0; 1159 if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); 1160 this[offset] = value & 255; 1161 this[offset + 1] = value >>> 8; 1162 this[offset + 2] = value >>> 16; 1163 this[offset + 3] = value >>> 24; 1164 return offset + 4; 1165 }; 1166 Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { 1167 value = +value; 1168 offset = offset >>> 0; 1169 if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); 1170 if (value < 0) value = 4294967295 + value + 1; 1171 this[offset] = value >>> 24; 1172 this[offset + 1] = value >>> 16; 1173 this[offset + 2] = value >>> 8; 1174 this[offset + 3] = value & 255; 1175 return offset + 4; 1176 }; 1177 Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { 1178 return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); 1179 }); 1180 Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { 1181 return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); 1182 }); 1183 function checkIEEE754(buf, value, offset, ext, max, min) { 1184 if (offset + ext > buf.length) throw new RangeError("Index out of range"); 1185 if (offset < 0) throw new RangeError("Index out of range"); 1186 } 1187 function writeFloat(buf, value, offset, littleEndian, noAssert) { 1188 value = +value; 1189 offset = offset >>> 0; 1190 if (!noAssert) checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); 1191 ieee754.write(buf, value, offset, littleEndian, 23, 4); 1192 return offset + 4; 1193 } 1194 Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { 1195 return writeFloat(this, value, offset, true, noAssert); 1196 }; 1197 Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { 1198 return writeFloat(this, value, offset, false, noAssert); 1199 }; 1200 function writeDouble(buf, value, offset, littleEndian, noAssert) { 1201 value = +value; 1202 offset = offset >>> 0; 1203 if (!noAssert) checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); 1204 ieee754.write(buf, value, offset, littleEndian, 52, 8); 1205 return offset + 8; 1206 } 1207 Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { 1208 return writeDouble(this, value, offset, true, noAssert); 1209 }; 1210 Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { 1211 return writeDouble(this, value, offset, false, noAssert); 1212 }; 1213 Buffer.prototype.copy = function copy(target, targetStart, start, end) { 1214 if (!Buffer.isBuffer(target)) throw new TypeError("argument should be a Buffer"); 1215 if (!start) start = 0; 1216 if (!end && end !== 0) end = this.length; 1217 if (targetStart >= target.length) targetStart = target.length; 1218 if (!targetStart) targetStart = 0; 1219 if (end > 0 && end < start) end = start; 1220 if (end === start) return 0; 1221 if (target.length === 0 || this.length === 0) return 0; 1222 if (targetStart < 0) throw new RangeError("targetStart out of bounds"); 1223 if (start < 0 || start >= this.length) throw new RangeError("Index out of range"); 1224 if (end < 0) throw new RangeError("sourceEnd out of bounds"); 1225 if (end > this.length) end = this.length; 1226 if (target.length - targetStart < end - start) end = target.length - targetStart + start; 1227 const len = end - start; 1228 if (this === target && typeof Uint8Array.prototype.copyWithin === "function") this.copyWithin(targetStart, start, end); 1229 else Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); 1230 return len; 1231 }; 1232 Buffer.prototype.fill = function fill(val, start, end, encoding) { 1233 if (typeof val === "string") { 1234 if (typeof start === "string") { 1235 encoding = start; 1236 start = 0; 1237 end = this.length; 1238 } else if (typeof end === "string") { 1239 encoding = end; 1240 end = this.length; 1241 } 1242 if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string"); 1243 if (typeof encoding === "string" && !Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding); 1244 if (val.length === 1) { 1245 const code = val.charCodeAt(0); 1246 if (encoding === "utf8" && code < 128 || encoding === "latin1") val = code; 1247 } 1248 } else if (typeof val === "number") val = val & 255; 1249 else if (typeof val === "boolean") val = Number(val); 1250 if (start < 0 || this.length < start || this.length < end) throw new RangeError("Out of range index"); 1251 if (end <= start) return this; 1252 start = start >>> 0; 1253 end = end === void 0 ? this.length : end >>> 0; 1254 if (!val) val = 0; 1255 let i; 1256 if (typeof val === "number") for (i = start; i < end; ++i) this[i] = val; 1257 else { 1258 const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); 1259 const len = bytes.length; 1260 if (len === 0) throw new TypeError("The value \"" + val + "\" is invalid for argument \"value\""); 1261 for (i = 0; i < end - start; ++i) this[i + start] = bytes[i % len]; 1262 } 1263 return this; 1264 }; 1265 var errors = {}; 1266 function E(sym, getMessage, Base) { 1267 errors[sym] = class NodeError extends Base { 1268 constructor() { 1269 super(); 1270 Object.defineProperty(this, "message", { 1271 value: getMessage.apply(this, arguments), 1272 writable: true, 1273 configurable: true 1274 }); 1275 this.name = `${this.name} [${sym}]`; 1276 this.stack; 1277 delete this.name; 1278 } 1279 get code() { 1280 return sym; 1281 } 1282 set code(value) { 1283 Object.defineProperty(this, "code", { 1284 configurable: true, 1285 enumerable: true, 1286 value, 1287 writable: true 1288 }); 1289 } 1290 toString() { 1291 return `${this.name} [${sym}]: ${this.message}`; 1292 } 1293 }; 1294 } 1295 E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { 1296 if (name) return `${name} is outside of buffer bounds`; 1297 return "Attempt to access memory outside buffer bounds"; 1298 }, RangeError); 1299 E("ERR_INVALID_ARG_TYPE", function(name, actual) { 1300 return `The "${name}" argument must be of type number. Received type ${typeof actual}`; 1301 }, TypeError); 1302 E("ERR_OUT_OF_RANGE", function(str, range, input) { 1303 let msg = `The value of "${str}" is out of range.`; 1304 let received = input; 1305 if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) received = addNumericalSeparator(String(input)); 1306 else if (typeof input === "bigint") { 1307 received = String(input); 1308 if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) received = addNumericalSeparator(received); 1309 received += "n"; 1310 } 1311 msg += ` It must be ${range}. Received ${received}`; 1312 return msg; 1313 }, RangeError); 1314 function addNumericalSeparator(val) { 1315 let res = ""; 1316 let i = val.length; 1317 const start = val[0] === "-" ? 1 : 0; 1318 for (; i >= start + 4; i -= 3) res = `_${val.slice(i - 3, i)}${res}`; 1319 return `${val.slice(0, i)}${res}`; 1320 } 1321 function checkBounds(buf, offset, byteLength) { 1322 validateNumber(offset, "offset"); 1323 if (buf[offset] === void 0 || buf[offset + byteLength] === void 0) boundsError(offset, buf.length - (byteLength + 1)); 1324 } 1325 function checkIntBI(value, min, max, buf, offset, byteLength) { 1326 if (value > max || value < min) { 1327 const n = typeof min === "bigint" ? "n" : ""; 1328 let range; 1329 if (byteLength > 3) if (min === 0 || min === BigInt(0)) range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; 1330 else range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength + 1) * 8 - 1}${n}`; 1331 else range = `>= ${min}${n} and <= ${max}${n}`; 1332 throw new errors.ERR_OUT_OF_RANGE("value", range, value); 1333 } 1334 checkBounds(buf, offset, byteLength); 1335 } 1336 function validateNumber(value, name) { 1337 if (typeof value !== "number") throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); 1338 } 1339 function boundsError(value, length, type) { 1340 if (Math.floor(value) !== value) { 1341 validateNumber(value, type); 1342 throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); 1343 } 1344 if (length < 0) throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); 1345 throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length}`, value); 1346 } 1347 var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; 1348 function base64clean(str) { 1349 str = str.split("=")[0]; 1350 str = str.trim().replace(INVALID_BASE64_RE, ""); 1351 if (str.length < 2) return ""; 1352 while (str.length % 4 !== 0) str = str + "="; 1353 return str; 1354 } 1355 function utf8ToBytes(string, units) { 1356 units = units || Infinity; 1357 let codePoint; 1358 const length = string.length; 1359 let leadSurrogate = null; 1360 const bytes = []; 1361 for (let i = 0; i < length; ++i) { 1362 codePoint = string.charCodeAt(i); 1363 if (codePoint > 55295 && codePoint < 57344) { 1364 if (!leadSurrogate) { 1365 if (codePoint > 56319) { 1366 if ((units -= 3) > -1) bytes.push(239, 191, 189); 1367 continue; 1368 } else if (i + 1 === length) { 1369 if ((units -= 3) > -1) bytes.push(239, 191, 189); 1370 continue; 1371 } 1372 leadSurrogate = codePoint; 1373 continue; 1374 } 1375 if (codePoint < 56320) { 1376 if ((units -= 3) > -1) bytes.push(239, 191, 189); 1377 leadSurrogate = codePoint; 1378 continue; 1379 } 1380 codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; 1381 } else if (leadSurrogate) { 1382 if ((units -= 3) > -1) bytes.push(239, 191, 189); 1383 } 1384 leadSurrogate = null; 1385 if (codePoint < 128) { 1386 if ((units -= 1) < 0) break; 1387 bytes.push(codePoint); 1388 } else if (codePoint < 2048) { 1389 if ((units -= 2) < 0) break; 1390 bytes.push(codePoint >>
1390 6 | 192, codePoint & 63 | 128); 1391 } else if (codePoint < 65536) { 1392 if ((units -= 3) < 0) break; 1393 bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); 1394 } else if (codePoint < 1114112) { 1395 if ((units -= 4) < 0) break; 1396 bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); 1397 } else throw new Error("Invalid code point"); 1398 } 1399 return bytes; 1400 } 1401 function asciiToBytes(str) { 1402 const byteArray = []; 1403 for (let i = 0; i < str.length; ++i) byteArray.push(str.charCodeAt(i) & 255); 1404 return byteArray; 1405 } 1406 function utf16leToBytes(str, units) { 1407 let c, hi, lo; 1408 const byteArray = []; 1409 for (let i = 0; i < str.length; ++i) { 1410 if ((units -= 2) < 0) break; 1411 c = str.charCodeAt(i); 1412 hi = c >> 8; 1413 lo = c % 256; 1414 byteArray.push(lo); 1415 byteArray.push(hi); 1416 } 1417 return byteArray; 1418 } 1419 function base64ToBytes(str) { 1420 return base64.toByteArray(base64clean(str)); 1421 } 1422 function blitBuffer(src, dst, offset, length) { 1423 let i; 1424 for (i = 0; i < length; ++i) { 1425 if (i + offset >= dst.length || i >= src.length) break; 1426 dst[i + offset] = src[i]; 1427 } 1428 return i; 1429 } 1430 function isInstance(obj, type) { 1431 return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; 1432 } 1433 function numberIsNaN(obj) { 1434 return obj !== obj; 1435 } 1436 var hexSliceLookupTable = (function() { 1437 const alphabet = "0123456789abcdef"; 1438 const table = new Array(256); 1439 for (let i = 0; i < 16; ++i) { 1440 const i16 = i * 16; 1441 for (let j = 0; j < 16; ++j) table[i16 + j] = alphabet[i] + alphabet[j]; 1442 } 1443 return table; 1444 })(); 1445 function defineBigIntMethod(fn) { 1446 return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; 1447 } 1448 function BufferBigIntNotDefined() { 1449 throw new Error("BigInt not supported"); 1450 } 1451})); 1452//#endregion 1453//#region node_modules/warning/browser.js 1454var require_browser$14 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1455 var process = require_browser$15(); 1456 /** 1457 * Similar to invariant but only logs a warning if the condition is not met. 1458 * This can be used to log issues in development environments in critical 1459 * paths. Removing the logging code for production environments will keep the 1460 * same logic and follow the same code paths. 1461 */ 1462 var warning = function() {}; 1463 if (process.env.NODE_ENV !== "production") warning = function(condition, format, args) { 1464 var len = arguments.length; 1465 args = new Array(len > 2 ? len - 2 : 0); 1466 for (var key = 2; key < len; key++) args[key - 2] = arguments[key]; 1467 if (format === void 0) throw new Error("`warning(condition, format, ...args)` requires a warning message argument"); 1468 if (format.length < 10 || /^[s\W]*$/.test(format)) throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: " + format); 1469 if (!condition) { 1470 var argIndex = 0; 1471 var message = "Warning: " + format.replace(/%s/g, function() { 1472 return args[argIndex++]; 1473 }); 1474 if (typeof console !== "undefined") console.error(message); 1475 try { 1476 throw new Error(message); 1477 } catch (x) {} 1478 } 1479 }; 1480 module.exports = warning; 1481})); 1482//#endregion 1483//#region node_modules/invariant/browser.js 1484var require_browser$13 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1485 var process = require_browser$15(); 1486 /** 1487 * Use invariant() to assert state which your program assumes to be true. 1488 * 1489 * Provide sprintf-style format (only %s is supported) and arguments 1490 * to provide information about what broke and what you were 1491 * expecting. 1492 * 1493 * The invariant message will be stripped in production, but the invariant 1494 * will remain to ensure logic does not differ in production. 1495 */ 1496 var invariant = function(condition, format, a, b, c, d, e, f) { 1497 if (process.env.NODE_ENV !== "production") { 1498 if (format === void 0) throw new Error("invariant requires an error message argument"); 1499 } 1500 if (!condition) { 1501 var error; 1502 if (format === void 0) error = /* @__PURE__ */ new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); 1503 else { 1504 var args = [ 1505 a, 1506 b, 1507 c, 1508 d, 1509 e, 1510 f 1511 ]; 1512 var argIndex = 0; 1513 error = new Error(format.replace(/%s/g, function() { 1514 return args[argIndex++]; 1515 }));
1516 error.name = "Invariant Violation"; 1517 } 1518 error.framesToPop = 1; 1519 throw error; 1520 } 1521 }; 1522 module.exports = invariant; 1523})); 1524//#endregion 1525//#region node_modules/resolve-pathname/index.js 1526var resolve_pathname_exports = /* @__PURE__ */ __exportAll({ default: () => resolvePathname }); 1527function isAbsolute(pathname) { 1528 return pathname.charAt(0) === "/"; 1529} 1530function spliceOne(list, index) { 1531 for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) list[i] = list[k]; 1532 list.pop(); 1533} 1534function resolvePathname(to) { 1535 var from = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; 1536 var toParts = to && to.split("/") || []; 1537 var fromParts = from && from.split("/") || []; 1538 var isToAbs = to && isAbsolute(to); 1539 var isFromAbs = from && isAbsolute(from); 1540 var mustEndAbs = isToAbs || isFromAbs; 1541 if (to && isAbsolute(to)) fromParts = toParts; 1542 else if (toParts.length) { 1543 fromParts.pop(); 1544 fromParts = fromParts.concat(toParts); 1545 } 1546 if (!fromParts.length) return "/"; 1547 var hasTrailingSlash = void 0; 1548 if (fromParts.length) { 1549 var last = fromParts[fromParts.length - 1]; 1550 hasTrailingSlash = last === "." || last === ".." || last === ""; 1551 } else hasTrailingSlash = false; 1552 var up = 0; 1553 for (var i = fromParts.length; i >= 0; i--) { 1554 var part = fromParts[i]; 1555 if (part === ".") spliceOne(fromParts, i); 1556 else if (part === "..") { 1557 spliceOne(fromParts, i); 1558 up++; 1559 } else if (up) { 1560 spliceOne(fromParts, i); 1561 up--; 1562 } 1563 } 1564 if (!mustEndAbs) for (; up--;) fromParts.unshift(".."); 1565 if (mustEndAbs && fromParts[0] !== "" && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(""); 1566 var result = fromParts.join("/"); 1567 if (hasTrailingSlash && result.substr(-1) !== "/") result += "/"; 1568 return result; 1569} 1570var init_resolve_pathname = __esmMin((() => {})); 1571//#endregion 1572//#region node_modules/value-equal/index.js 1573var value_equal_exports = /* @__PURE__ */ __exportAll({ default: () => valueEqual }); 1574function valueEqual(a, b) { 1575 if (a === b) return true; 1576 if (a == null || b == null) return false; 1577 if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every(function(item, index) { 1578 return valueEqual(item, b[index]); 1579 }); 1580 var aType = typeof a === "undefined" ? "undefined" : _typeof$1(a); 1581 if (aType !== (typeof b === "undefined" ? "undefined" : _typeof$1(b))) return false; 1582 if (aType === "object") { 1583 var aValue = a.valueOf(); 1584 var bValue = b.valueOf(); 1585 if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); 1586 var aKeys = Object.keys(a); 1587 var bKeys = Object.keys(b); 1588 if (aKeys.length !== bKeys.length) return false; 1589 return aKeys.every(function(key) { 1590 return valueEqual(a[key], b[key]); 1591 }); 1592 } 1593 return false; 1594} 1595var _typeof$1; 1596var init_value_equal = __esmMin((() => { 1597 _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 1598 return typeof obj; 1599 } : function(obj) { 1600 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 1601 }; 1602})); 1603//#endregion 1604//#region node_modules/safe-buffer/index.js 1605var require_safe_buffer$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1606 /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ 1607 var buffer = require_buffer$1(); 1608 var Buffer = buffer.Buffer; 1609 function copyProps(src, dst) { 1610 for (var key in src) dst[key] = src[key]; 1611 } 1612 if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer; 1613 else { 1614 copyProps(buffer, exports); 1615 exports.Buffer = SafeBuffer; 1616 } 1617 function SafeBuffer(arg, encodingOrOffset, length) { 1618 return Buffer(arg, encodingOrOffset, length); 1619 } 1620 SafeBuffer.prototype = Object.create(Buffer.prototype); 1621 copyProps(Buffer, SafeBuffer); 1622 SafeBuffer.from = function(arg, encodingOrOffset, length) { 1623 if (typeof arg === "number") throw new TypeError("Argument must not be a number"); 1624 return Buffer(arg, encodingOrOffset, length); 1625 }; 1626 SafeBuffer.alloc = function(size, fill, encoding) { 1627 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 1628 var buf = Buffer(size); 1629 if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding); 1630 else buf.fill(fill); 1631 else buf.fill(0); 1632 return buf; 1633 }; 1634 SafeBuffer.allocUnsafe = function(size) {
1635 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 1636 return Buffer(size); 1637 }; 1638 SafeBuffer.allocUnsafeSlow = function(size) { 1639 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 1640 return buffer.SlowBuffer(size); 1641 }; 1642})); 1643//#endregion 1644//#region node_modules/randombytes/browser.js 1645var require_browser$12 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1646 var process = require_browser$15(); 1647 var MAX_BYTES = 65536; 1648 var MAX_UINT32 = 4294967295; 1649 function oldBrowser() { 1650 throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); 1651 } 1652 var Buffer = require_safe_buffer$2().Buffer; 1653 var crypto = globalThis.crypto || globalThis.msCrypto; 1654 if (crypto && crypto.getRandomValues) module.exports = randomBytes; 1655 else module.exports = oldBrowser; 1656 function randomBytes(size, cb) { 1657 if (size > MAX_UINT32) throw new RangeError("requested too many random bytes"); 1658 var bytes = Buffer.allocUnsafe(size); 1659 if (size > 0) if (size > MAX_BYTES) for (var generated = 0; generated < size; generated += MAX_BYTES) crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)); 1660 else crypto.getRandomValues(bytes); 1661 if (typeof cb === "function") return process.nextTick(function() { 1662 cb(null, bytes); 1663 }); 1664 return bytes; 1665 } 1666})); 1667//#endregion 1668//#region node_modules/inherits/inherits_browser.js 1669var require_inherits_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1670 if (typeof Object.create === "function") module.exports = function inherits(ctor, superCtor) { 1671 if (superCtor) { 1672 ctor.super_ = superCtor; 1673 ctor.prototype = Object.create(superCtor.prototype, { constructor: { 1674 value: ctor, 1675 enumerable: false, 1676 writable: true, 1677 configurable: true 1678 } }); 1679 } 1680 }; 1681 else module.exports = function inherits(ctor, superCtor) { 1682 if (superCtor) { 1683 ctor.super_ = superCtor; 1684 var TempCtor = function() {}; 1685 TempCtor.prototype = superCtor.prototype; 1686 ctor.prototype = new TempCtor(); 1687 ctor.prototype.constructor = ctor; 1688 } 1689 }; 1690})); 1691//#endregion 1692//#region node_modules/events/events.js 1693var require_events = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1694 function EventEmitter() { 1695 this._events = this._events || {}; 1696 this._maxListeners = this._maxListeners || void 0; 1697 } 1698 module.exports = EventEmitter; 1699 EventEmitter.EventEmitter = EventEmitter; 1700 EventEmitter.prototype._events = void 0; 1701 EventEmitter.prototype._maxListeners = void 0; 1702 EventEmitter.defaultMaxListeners = 10; 1703 EventEmitter.prototype.setMaxListeners = function(n) { 1704 if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError("n must be a positive number"); 1705 this._maxListeners = n; 1706 return this; 1707 }; 1708 EventEmitter.prototype.emit = function(type) { 1709 var er, handler, len, args, i, listeners; 1710 if (!this._events) this._events = {}; 1711 if (type === "error") { 1712 if (!this._events.error || isObject(this._events.error) && !this._events.error.length) { 1713 er = arguments[1]; 1714 if (er instanceof Error) throw er; 1715 else { 1716 var err = /* @__PURE__ */ new Error("Uncaught, unspecified \"error\" event. (" + er + ")"); 1717 err.context = er; 1718 throw err; 1719 } 1720 } 1721 } 1722 handler = this._events[type]; 1723 if (isUndefined(handler)) return false; 1724 if (isFunction(handler)) switch (arguments.length) { 1725 case 1: 1726 handler.call(this); 1727 break; 1728 case 2: 1729 handler.call(this, arguments[1]); 1730 break; 1731 case 3: 1732 handler.call(this, arguments[1], arguments[2]); 1733 break; 1734 default: 1735 args = Array.prototype.slice.call(arguments, 1); 1736 handler.apply(this, args); 1737 } 1738 else if (isObject(handler)) { 1739 args = Array.prototype.slice.call(arguments, 1); 1740 listeners = handler.slice(); 1741 len = listeners.length; 1742 for (i = 0; i < len; i++) listeners[i].apply(this, args); 1743 } 1744 return true; 1745 }; 1746 EventEmitter.prototype.addListener = function(type, listener) { 1747 var m; 1748 if (!isFunction(listener)) throw TypeError("listener must be a function"); 1749 if (!this._events) this._events = {}; 1750 if (this._events.newListener) this.emit("newListener", type, isFunction(listener.listener) ? listener.listener : listener); 1751 if (!this._events[type]) this._events[type] = listener; 1752 else if (isObject(this._events[type])) this._events[type].push(listener); 1753 else this._events[type] = [this._events[type], listener]; 1754 if (isObject(this._events[type]) && !this._events[type].warned) { 1755 if (!isUndefined(this._maxListeners)) m = this._maxListeners; 1756 else m = EventEmitter.defaultMaxListeners; 1757 if (m && m > 0 && this._events[type].length > m) { 1758 this._events[type].warned = true; 1759 console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[type].length); 1760 if (typeof console.trace === "function") console.trace(); 1761 } 1762 } 1763 return this; 1764 }; 1765 EventEmitter.prototype.on = EventEmitter.prototype.addListener; 1766 EventEmitter.prototype.once = function(type, listener) { 1767 if (!isFunction(listener)) throw TypeError("listener must be a function"); 1768 var fired = false;
1769 function g() { 1770 this.removeListener(type, g); 1771 if (!fired) { 1772 fired = true; 1773 listener.apply(this, arguments); 1774 } 1775 } 1776 g.listener = listener; 1777 this.on(type, g); 1778 return this; 1779 }; 1780 EventEmitter.prototype.removeListener = function(type, listener) { 1781 var list, position, length, i; 1782 if (!isFunction(listener)) throw TypeError("listener must be a function"); 1783 if (!this._events || !this._events[type]) return this; 1784 list = this._events[type]; 1785 length = list.length; 1786 position = -1; 1787 if (list === listener || isFunction(list.listener) && list.listener === listener) { 1788 delete this._events[type]; 1789 if (this._events.removeListener) this.emit("removeListener", type, listener); 1790 } else if (isObject(list)) { 1791 for (i = length; i-- > 0;) if (list[i] === listener || list[i].listener && list[i].listener === listener) { 1792 position = i; 1793 break; 1794 } 1795 if (position < 0) return this; 1796 if (list.length === 1) { 1797 list.length = 0; 1798 delete this._events[type]; 1799 } else list.splice(position, 1); 1800 if (this._events.removeListener) this.emit("removeListener", type, listener); 1801 } 1802 return this; 1803 }; 1804 EventEmitter.prototype.removeAllListeners = function(type) { 1805 var key, listeners; 1806 if (!this._events) return this; 1807 if (!this._events.removeListener) { 1808 if (arguments.length === 0) this._events = {}; 1809 else if (this._events[type]) delete this._events[type]; 1810 return this; 1811 } 1812 if (arguments.length === 0) { 1813 for (key in this._events) { 1814 if (key === "removeListener") continue; 1815 this.removeAllListeners(key); 1816 } 1817 this.removeAllListeners("removeListener"); 1818 this._events = {}; 1819 return this; 1820 } 1821 listeners = this._events[type]; 1822 if (isFunction(listeners)) this.removeListener(type, listeners); 1823 else if (listeners) while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); 1824 delete this._events[type]; 1825 return this; 1826 }; 1827 EventEmitter.prototype.listeners = function(type) { 1828 var ret; 1829 if (!this._events || !this._events[type]) ret = []; 1830 else if (isFunction(this._events[type])) ret = [this._events[type]]; 1831 else ret = this._events[type].slice(); 1832 return ret; 1833 }; 1834 EventEmitter.prototype.listenerCount = function(type) { 1835 if (this._events) { 1836 var evlistener = this._events[type]; 1837 if (isFunction(evlistener)) return 1; 1838 else if (evlistener) return evlistener.length; 1839 } 1840 return 0; 1841 }; 1842 EventEmitter.listenerCount = function(emitter, type) { 1843 return emitter.listenerCount(type); 1844 }; 1845 function isFunction(arg) { 1846 return typeof arg === "function"; 1847 } 1848 function isNumber(arg) { 1849 return typeof arg === "number"; 1850 } 1851 function isObject(arg) { 1852 return typeof arg === "object" && arg !== null; 1853 } 1854 function isUndefined(arg) { 1855 return arg === void 0; 1856 } 1857})); 1858//#endregion 1859//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js 1860var require_stream_browser$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1861 module.exports = require_events().EventEmitter; 1862})); 1863//#endregion 1864//#region __vite-browser-external 1865var require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1866 module.exports = {}; 1867})); 1868//#endregion 1869//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/buffer_list.js 1870var require_buffer_list$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 1871 function ownKeys(object, enumerableOnly) { 1872 var keys = Object.keys(object); 1873 if (Object.getOwnPropertySymbols) { 1874 var symbols = Object.getOwnPropertySymbols(object); 1875 if (enumerableOnly) symbols = symbols.filter(function(sym) { 1876 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 1877 }); 1878 keys.push.apply(keys, symbols); 1879 } 1880 return keys; 1881 } 1882 function _objectSpread(target) { 1883 for (var i = 1; i < arguments.length; i++) { 1884 var source = arguments[i] != null ? arguments[i] : {}; 1885 if (i % 2) ownKeys(Object(source), true).forEach(function(key) { 1886 _defineProperty(target, key, source[key]); 1887 }); 1888 else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
vendor: 13,617 bytes, lines 1889-2319
1889 else ownKeys(Object(source)).forEach(function(key) { 1890 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 1891 }); 1892 } 1893 return target; 1894 } 1895 function _defineProperty(obj, key, value) { 1896 if (key in obj) Object.defineProperty(obj, key, { 1897 value, 1898 enumerable: true, 1899 configurable: true, 1900 writable: true 1901 }); 1902 else obj[key] = value; 1903 return obj; 1904 } 1905 function _classCallCheck(instance, Constructor) { 1906 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 1907 } 1908 function _defineProperties(target, props) { 1909 for (var i = 0; i < props.length; i++) { 1910 var descriptor = props[i]; 1911 descriptor.enumerable = descriptor.enumerable || false; 1912 descriptor.configurable = true; 1913 if ("value" in descriptor) descriptor.writable = true; 1914 Object.defineProperty(target, descriptor.key, descriptor); 1915 } 1916 } 1917 function _createClass(Constructor, protoProps, staticProps) { 1918 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 1919 if (staticProps) _defineProperties(Constructor, staticProps); 1920 return Constructor; 1921 } 1922 var Buffer = require_buffer$1().Buffer; 1923 var inspect = require___vite_browser_external().inspect; 1924 var custom = inspect && inspect.custom || "inspect"; 1925 function copyBuffer(src, target, offset) { 1926 Buffer.prototype.copy.call(src, target, offset); 1927 } 1928 module.exports = /*#__PURE__*/ function() { 1929 function BufferList() { 1930 _classCallCheck(this, BufferList); 1931 this.head = null; 1932 this.tail = null; 1933 this.length = 0; 1934 } 1935 _createClass(BufferList, [ 1936 { 1937 key: "push", 1938 value: function push(v) { 1939 var entry = { 1940 data: v, 1941 next: null 1942 }; 1943 if (this.length > 0) this.tail.next = entry; 1944 else this.head = entry; 1945 this.tail = entry; 1946 ++this.length; 1947 } 1948 }, 1949 { 1950 key: "unshift", 1951 value: function unshift(v) { 1952 var entry = { 1953 data: v, 1954 next: this.head 1955 }; 1956 if (this.length === 0) this.tail = entry; 1957 this.head = entry; 1958 ++this.length; 1959 } 1960 }, 1961 { 1962 key: "shift", 1963 value: function shift() { 1964 if (this.length === 0) return; 1965 var ret = this.head.data; 1966 if (this.length === 1) this.head = this.tail = null; 1967 else this.head = this.head.next; 1968 --this.length; 1969 return ret; 1970 } 1971 }, 1972 { 1973 key: "clear", 1974 value: function clear() { 1975 this.head = this.tail = null; 1976 this.length = 0; 1977 } 1978 }, 1979 { 1980 key: "join", 1981 value: function join(s) { 1982 if (this.length === 0) return ""; 1983 var p = this.head; 1984 var ret = "" + p.data; 1985 while (p = p.next) ret += s + p.data; 1986 return ret; 1987 } 1988 }, 1989 { 1990 key: "concat", 1991 value: function concat(n) { 1992 if (this.length === 0) return Buffer.alloc(0); 1993 var ret = Buffer.allocUnsafe(n >>> 0); 1994 var p = this.head; 1995 var i = 0; 1996 while (p) { 1997 copyBuffer(p.data, ret, i); 1998 i += p.data.length; 1999 p = p.next; 2000 } 2001 return ret; 2002 } 2003 }, 2004 { 2005 key: "consume", 2006 value: function consume(n, hasStrings) { 2007 var ret; 2008 if (n < this.head.data.length) { 2009 ret = this.head.data.slice(0, n); 2010 this.head.data = this.head.data.slice(n); 2011 } else if (n === this.head.data.length) ret = this.shift(); 2012 else ret = hasStrings ? this._getString(n) : this._getBuffer(n); 2013 return ret; 2014 } 2015 }, 2016 { 2017 key: "first", 2018 value: function first() { 2019 return this.head.data; 2020 } 2021 }, 2022 { 2023 key: "_getString", 2024 value: function _getString(n) { 2025 var p = this.head; 2026 var c = 1; 2027 var ret = p.data; 2028 n -= ret.length; 2029 while (p = p.next) { 2030 var str = p.data; 2031 var nb = n > str.length ? str.length : n; 2032 if (nb === str.length) ret += str; 2033 else ret += str.slice(0, n); 2034 n -= nb; 2035 if (n === 0) { 2036 if (nb === str.length) { 2037 ++c; 2038 if (p.next) this.head = p.next; 2039 else this.head = this.tail = null; 2040 } else { 2041 this.head = p; 2042 p.data = str.slice(nb); 2043 } 2044 break; 2045 } 2046 ++c; 2047 } 2048 this.length -= c; 2049 return ret; 2050 } 2051 }, 2052 { 2053 key: "_getBuffer", 2054 value: function _getBuffer(n) { 2055 var ret = Buffer.allocUnsafe(n); 2056 var p = this.head; 2057 var c = 1; 2058 p.data.copy(ret); 2059 n -= p.data.length; 2060 while (p = p.next) { 2061 var buf = p.data; 2062 var nb = n > buf.length ? buf.length : n; 2063 buf.copy(ret, ret.length - n, 0, nb); 2064 n -= nb; 2065 if (n === 0) { 2066 if (nb === buf.length) { 2067 ++c; 2068 if (p.next) this.head = p.next; 2069 else this.head = this.tail = null; 2070 } else { 2071 this.head = p; 2072 p.data = buf.slice(nb); 2073 } 2074 break; 2075 } 2076 ++c; 2077 } 2078 this.length -= c; 2079 return ret; 2080 } 2081 }, 2082 { 2083 key: custom, 2084 value: function value(_, options) { 2085 return inspect(this, _objectSpread({}, options, { 2086 depth: 0, 2087 customInspect: false 2088 })); 2089 } 2090 } 2091 ]); 2092 return BufferList; 2093 }(); 2094})); 2095//#endregion 2096//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js 2097var require_destroy$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2098 var process = require_browser$15(); 2099 function destroy(err, cb) { 2100 var _this = this; 2101 var readableDestroyed = this._readableState && this._readableState.destroyed; 2102 var writableDestroyed = this._writableState && this._writableState.destroyed; 2103 if (readableDestroyed || writableDestroyed) { 2104 if (cb) cb(err); 2105 else if (err) { 2106 if (!this._writableState) process.nextTick(emitErrorNT, this, err); 2107 else if (!this._writableState.errorEmitted) { 2108 this._writableState.errorEmitted = true; 2109 process.nextTick(emitErrorNT, this, err); 2110 } 2111 } 2112 return this; 2113 } 2114 if (this._readableState) this._readableState.destroyed = true; 2115 if (this._writableState) this._writableState.destroyed = true; 2116 this._destroy(err || null, function(err) { 2117 if (!cb && err) if (!_this._writableState) process.nextTick(emitErrorAndCloseNT, _this, err); 2118 else if (!_this._writableState.errorEmitted) { 2119 _this._writableState.errorEmitted = true; 2120 process.nextTick(emitErrorAndCloseNT, _this, err); 2121 } else process.nextTick(emitCloseNT, _this); 2122 else if (cb) { 2123 process.nextTick(emitCloseNT, _this); 2124 cb(err); 2125 } else process.nextTick(emitCloseNT, _this); 2126 }); 2127 return this; 2128 } 2129 function emitErrorAndCloseNT(self, err) { 2130 emitErrorNT(self, err); 2131 emitCloseNT(self); 2132 } 2133 function emitCloseNT(self) { 2134 if (self._writableState && !self._writableState.emitClose) return; 2135 if (self._readableState && !self._readableState.emitClose) return; 2136 self.emit("close"); 2137 } 2138 function undestroy() { 2139 if (this._readableState) { 2140 this._readableState.destroyed = false; 2141 this._readableState.reading = false; 2142 this._readableState.ended = false; 2143 this._readableState.endEmitted = false; 2144 } 2145 if (this._writableState) { 2146 this._writableState.destroyed = false; 2147 this._writableState.ended = false; 2148 this._writableState.ending = false; 2149 this._writableState.finalCalled = false; 2150 this._writableState.prefinished = false; 2151 this._writableState.finished = false; 2152 this._writableState.errorEmitted = false; 2153 } 2154 } 2155 function emitErrorNT(self, err) { 2156 self.emit("error", err); 2157 } 2158 function errorOrDestroy(stream, err) { 2159 var rState = stream._readableState; 2160 var wState = stream._writableState; 2161 if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err); 2162 else stream.emit("error", err); 2163 } 2164 module.exports = { 2165 destroy, 2166 undestroy, 2167 errorOrDestroy 2168 }; 2169})); 2170//#endregion 2171//#region node_modules/hash-base/node_modules/readable-stream/errors-browser.js 2172var require_errors_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2173 function _inheritsLoose(subClass, superClass) { 2174 subClass.prototype = Object.create(superClass.prototype); 2175 subClass.prototype.constructor = subClass; 2176 subClass.__proto__ = superClass; 2177 } 2178 var codes = {}; 2179 function createErrorType(code, message, Base) { 2180 if (!Base) Base = Error; 2181 function getMessage(arg1, arg2, arg3) { 2182 if (typeof message === "string") return message; 2183 else return message(arg1, arg2, arg3); 2184 } 2185 var NodeError = /*#__PURE__*/ function(_Base) { 2186 _inheritsLoose(NodeError, _Base); 2187 function NodeError(arg1, arg2, arg3) { 2188 return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; 2189 } 2190 return NodeError; 2191 }(Base); 2192 NodeError.prototype.name = Base.name; 2193 NodeError.prototype.code = code; 2194 codes[code] = NodeError; 2195 } 2196 function oneOf(expected, thing) { 2197 if (Array.isArray(expected)) { 2198 var len = expected.length; 2199 expected = expected.map(function(i) { 2200 return String(i); 2201 }); 2202 if (len > 2) return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1]; 2203 else if (len === 2) return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); 2204 else return "of ".concat(thing, " ").concat(expected[0]); 2205 } else return "of ".concat(thing, " ").concat(String(expected)); 2206 } 2207 function startsWith(str, search, pos) { 2208 return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; 2209 } 2210 function endsWith(str, search, this_len) { 2211 if (this_len === void 0 || this_len > str.length) this_len = str.length; 2212 return str.substring(this_len - search.length, this_len) === search; 2213 } 2214 function includes(str, search, start) { 2215 if (typeof start !== "number") start = 0; 2216 if (start + search.length > str.length) return false; 2217 else return str.indexOf(search, start) !== -1; 2218 } 2219 createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { 2220 return "The value \"" + value + "\" is invalid for option \"" + name + "\""; 2221 }, TypeError); 2222 createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { 2223 var determiner; 2224 if (typeof expected === "string" && startsWith(expected, "not ")) { 2225 determiner = "must not be"; 2226 expected = expected.replace(/^not /, ""); 2227 } else determiner = "must be"; 2228 var msg; 2229 if (endsWith(name, " argument")) msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type")); 2230 else { 2231 var type = includes(name, ".") ? "property" : "argument"; 2232 msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type")); 2233 } 2234 msg += ". Received type ".concat(typeof actual); 2235 return msg; 2236 }, TypeError); 2237 createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); 2238 createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { 2239 return "The " + name + " method is not implemented"; 2240 }); 2241 createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); 2242 createErrorType("ERR_STREAM_DESTROYED", function(name) { 2243 return "Cannot call " + name + " after a stream was destroyed"; 2244 }); 2245 createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); 2246 createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); 2247 createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); 2248 createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); 2249 createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { 2250 return "Unknown encoding: " + arg; 2251 }, TypeError); 2252 createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); 2253 module.exports.codes = codes; 2254})); 2255//#endregion 2256//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/state.js 2257var require_state$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2258 var ERR_INVALID_OPT_VALUE = require_errors_browser$1().codes.ERR_INVALID_OPT_VALUE; 2259 function highWaterMarkFrom(options, isDuplex, duplexKey) { 2260 return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; 2261 } 2262 function getHighWaterMark(state, options, duplexKey, isDuplex) { 2263 var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); 2264 if (hwm != null) { 2265 if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) throw new ERR_INVALID_OPT_VALUE(isDuplex ? duplexKey : "highWaterMark", hwm); 2266 return Math.floor(hwm); 2267 } 2268 return state.objectMode ? 16 : 16 * 1024; 2269 } 2270 module.exports = { getHighWaterMark }; 2271})); 2272//#endregion 2273//#region node_modules/util-deprecate/browser.js 2274var require_browser$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2275 /** 2276 * Module exports. 2277 */ 2278 module.exports = deprecate; 2279 /** 2280 * Mark that a method should not be used. 2281 * Returns a modified function which warns once by default. 2282 * 2283 * If `localStorage.noDeprecation = true` is set, then it is a no-op. 2284 * 2285 * If `localStorage.throwDeprecation = true` is set, then deprecated functions 2286 * will throw an Error when invoked. 2287 * 2288 * If `localStorage.traceDeprecation = true` is set, then deprecated functions 2289 * will invoke `console.trace()` instead of `console.error()`. 2290 * 2291 * @param {Function} fn - the function to deprecate 2292 * @param {String} msg - the string to print to the console when `fn` is invoked 2293 * @returns {Function} a new "deprecated" version of `fn` 2294 * @api public 2295 */ 2296 function deprecate(fn, msg) { 2297 if (config("noDeprecation")) return fn; 2298 var warned = false; 2299 function deprecated() { 2300 if (!warned) { 2301 if (config("throwDeprecation")) throw new Error(msg); 2302 else if (config("traceDeprecation")) console.trace(msg); 2303 else console.warn(msg); 2304 warned = true; 2305 } 2306 return fn.apply(this, arguments); 2307 } 2308 return deprecated; 2309 } 2310 /** 2311 * Checks `localStorage` for boolean values for the given `name`. 2312 * 2313 * @param {String} name 2314 * @returns {Boolean} 2315 * @api private 2316 */ 2317 function config(name) { 2318 try { 2319 if (!globalThis.localStorage) return false;
vendor: 4,163 bytes, lines 2320-2429
2320 } catch (_) { 2321 return false; 2322 } 2323 var val = globalThis.localStorage[name]; 2324 if (null == val) return false; 2325 return String(val).toLowerCase() === "true"; 2326 } 2327})); 2328//#endregion 2329//#region node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js 2330var require__stream_writable$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2331 var process = require_browser$15(); 2332 module.exports = Writable; 2333 function CorkedRequest(state) { 2334 var _this = this; 2335 this.next = null; 2336 this.entry = null; 2337 this.finish = function() { 2338 onCorkedFinish(_this, state); 2339 }; 2340 } 2341 var Duplex; 2342 Writable.WritableState = WritableState; 2343 var internalUtil = { deprecate: require_browser$11() }; 2344 var Stream = require_stream_browser$2(); 2345 var Buffer = require_buffer$1().Buffer; 2346 var OurUint8Array = globalThis.Uint8Array || function() {}; 2347 function _uint8ArrayToBuffer(chunk) { 2348 return Buffer.from(chunk); 2349 } 2350 function _isUint8Array(obj) { 2351 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; 2352 } 2353 var destroyImpl = require_destroy$2(); 2354 var getHighWaterMark = require_state$1().getHighWaterMark; 2355 var _require$codes = require_errors_browser$1().codes; 2356 var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; 2357 var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; 2358 var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; 2359 var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; 2360 var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; 2361 var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; 2362 var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; 2363 var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; 2364 var errorOrDestroy = destroyImpl.errorOrDestroy; 2365 require_inherits_browser()(Writable, Stream); 2366 function nop() {} 2367 function WritableState(options, stream, isDuplex) { 2368 Duplex = Duplex || require__stream_duplex$2(); 2369 options = options || {}; 2370 if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; 2371 this.objectMode = !!options.objectMode; 2372 if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; 2373 this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); 2374 this.finalCalled = false; 2375 this.needDrain = false; 2376 this.ending = false; 2377 this.ended = false; 2378 this.finished = false; 2379 this.destroyed = false; 2380 var noDecode = options.decodeStrings === false; 2381 this.decodeStrings = !noDecode; 2382 this.defaultEncoding = options.defaultEncoding || "utf8"; 2383 this.length = 0; 2384 this.writing = false; 2385 this.corked = 0; 2386 this.sync = true; 2387 this.bufferProcessing = false; 2388 this.onwrite = function(er) { 2389 onwrite(stream, er); 2390 }; 2391 this.writecb = null; 2392 this.writelen = 0; 2393 this.bufferedRequest = null; 2394 this.lastBufferedRequest = null; 2395 this.pendingcb = 0; 2396 this.prefinished = false; 2397 this.errorEmitted = false; 2398 this.emitClose = options.emitClose !== false; 2399 this.autoDestroy = !!options.autoDestroy; 2400 this.bufferedRequestCount = 0; 2401 this.corkedRequestsFree = new CorkedRequest(this); 2402 } 2403 WritableState.prototype.getBuffer = function getBuffer() { 2404 var current = this.bufferedRequest; 2405 var out = []; 2406 while (current) { 2407 out.push(current); 2408 current = current.next; 2409 } 2410 return out; 2411 }; 2412 (function() { 2413 try { 2414 Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function writableStateBufferGetter() { 2415 return this.getBuffer(); 2416 }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); 2417 } catch (_) {} 2418 })(); 2419 var realHasInstance; 2420 if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { 2421 realHasInstance = Function.prototype[Symbol.hasInstance]; 2422 Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { 2423 if (realHasInstance.call(this, object)) return true; 2424 if (this !== Writable) return false; 2425 return object && object._writableState instanceof WritableState; 2426 } }); 2427 } else realHasInstance = function realHasInstance(object) { 2428 return object instanceof this; 2429 };
vendor: 5,801 bytes, lines 2430-2606
2430 function Writable(options) { 2431 Duplex = Duplex || require__stream_duplex$2(); 2432 var isDuplex = this instanceof Duplex; 2433 if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); 2434 this._writableState = new WritableState(options, this, isDuplex); 2435 this.writable = true; 2436 if (options) { 2437 if (typeof options.write === "function") this._write = options.write; 2438 if (typeof options.writev === "function") this._writev = options.writev; 2439 if (typeof options.destroy === "function") this._destroy = options.destroy; 2440 if (typeof options.final === "function") this._final = options.final; 2441 } 2442 Stream.call(this); 2443 } 2444 Writable.prototype.pipe = function() { 2445 errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); 2446 }; 2447 function writeAfterEnd(stream, cb) { 2448 var er = new ERR_STREAM_WRITE_AFTER_END(); 2449 errorOrDestroy(stream, er); 2450 process.nextTick(cb, er); 2451 } 2452 function validChunk(stream, state, chunk, cb) { 2453 var er; 2454 if (chunk === null) er = new ERR_STREAM_NULL_VALUES(); 2455 else if (typeof chunk !== "string" && !state.objectMode) er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); 2456 if (er) { 2457 errorOrDestroy(stream, er); 2458 process.nextTick(cb, er); 2459 return false; 2460 } 2461 return true; 2462 } 2463 Writable.prototype.write = function(chunk, encoding, cb) { 2464 var state = this._writableState; 2465 var ret = false; 2466 var isBuf = !state.objectMode && _isUint8Array(chunk); 2467 if (isBuf && !Buffer.isBuffer(chunk)) chunk = _uint8ArrayToBuffer(chunk); 2468 if (typeof encoding === "function") { 2469 cb = encoding; 2470 encoding = null; 2471 } 2472 if (isBuf) encoding = "buffer"; 2473 else if (!encoding) encoding = state.defaultEncoding; 2474 if (typeof cb !== "function") cb = nop; 2475 if (state.ending) writeAfterEnd(this, cb); 2476 else if (isBuf || validChunk(this, state, chunk, cb)) { 2477 state.pendingcb++; 2478 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); 2479 } 2480 return ret; 2481 }; 2482 Writable.prototype.cork = function() { 2483 this._writableState.corked++; 2484 }; 2485 Writable.prototype.uncork = function() { 2486 var state = this._writableState; 2487 if (state.corked) { 2488 state.corked--; 2489 if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); 2490 } 2491 }; 2492 Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { 2493 if (typeof encoding === "string") encoding = encoding.toLowerCase(); 2494 if (!([ 2495 "hex", 2496 "utf8", 2497 "utf-8", 2498 "ascii", 2499 "binary", 2500 "base64", 2501 "ucs2", 2502 "ucs-2", 2503 "utf16le", 2504 "utf-16le", 2505 "raw" 2506 ].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); 2507 this._writableState.defaultEncoding = encoding; 2508 return this; 2509 }; 2510 Object.defineProperty(Writable.prototype, "writableBuffer", { 2511 enumerable: false, 2512 get: function get() { 2513 return this._writableState && this._writableState.getBuffer(); 2514 } 2515 }); 2516 function decodeChunk(state, chunk, encoding) { 2517 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer.from(chunk, encoding); 2518 return chunk; 2519 } 2520 Object.defineProperty(Writable.prototype, "writableHighWaterMark", { 2521 enumerable: false, 2522 get: function get() { 2523 return this._writableState.highWaterMark; 2524 } 2525 }); 2526 function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { 2527 if (!isBuf) { 2528 var newChunk = decodeChunk(state, chunk, encoding); 2529 if (chunk !== newChunk) { 2530 isBuf = true; 2531 encoding = "buffer"; 2532 chunk = newChunk; 2533 } 2534 } 2535 var len = state.objectMode ? 1 : chunk.length; 2536 state.length += len; 2537 var ret = state.length < state.highWaterMark; 2538 if (!ret) state.needDrain = true; 2539 if (state.writing || state.corked) { 2540 var last = state.lastBufferedRequest; 2541 state.lastBufferedRequest = { 2542 chunk, 2543 encoding, 2544 isBuf, 2545 callback: cb, 2546 next: null 2547 }; 2548 if (last) last.next = state.lastBufferedRequest; 2549 else state.bufferedRequest = state.lastBufferedRequest; 2550 state.bufferedRequestCount += 1; 2551 } else doWrite(stream, state, false, len, chunk, encoding, cb); 2552 return ret; 2553 } 2554 function doWrite(stream, state, writev, len, chunk, encoding, cb) { 2555 state.writelen = len; 2556 state.writecb = cb; 2557 state.writing = true; 2558 state.sync = true; 2559 if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); 2560 else if (writev) stream._writev(chunk, state.onwrite); 2561 else stream._write(chunk, encoding, state.onwrite); 2562 state.sync = false; 2563 } 2564 function onwriteError(stream, state, sync, er, cb) { 2565 --state.pendingcb; 2566 if (sync) { 2567 process.nextTick(cb, er); 2568 process.nextTick(finishMaybe, stream, state); 2569 stream._writableState.errorEmitted = true; 2570 errorOrDestroy(stream, er); 2571 } else { 2572 cb(er); 2573 stream._writableState.errorEmitted = true; 2574 errorOrDestroy(stream, er); 2575 finishMaybe(stream, state); 2576 } 2577 } 2578 function onwriteStateUpdate(state) { 2579 state.writing = false; 2580 state.writecb = null; 2581 state.length -= state.writelen; 2582 state.writelen = 0; 2583 } 2584 function onwrite(stream, er) { 2585 var state = stream._writableState; 2586 var sync = state.sync; 2587 var cb = state.writecb; 2588 if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); 2589 onwriteStateUpdate(state); 2590 if (er) onwriteError(stream, state, sync, er, cb); 2591 else { 2592 var finished = needFinish(state) || stream.destroyed; 2593 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state); 2594 if (sync) process.nextTick(afterWrite, stream, state, finished, cb); 2595 else afterWrite(stream, state, finished, cb); 2596 } 2597 } 2598 function afterWrite(stream, state, finished, cb) { 2599 if (!finished) onwriteDrain(stream, state); 2600 state.pendingcb--; 2601 cb(); 2602 finishMaybe(stream, state); 2603 } 2604 function onwriteDrain(stream, state) { 2605 if (state.length === 0 && state.needDrain) { 2606 state.needDrain = false;
vendor: 5,113 bytes, lines 2607-2775
2607 stream.emit("drain"); 2608 } 2609 } 2610 function clearBuffer(stream, state) { 2611 state.bufferProcessing = true; 2612 var entry = state.bufferedRequest; 2613 if (stream._writev && entry && entry.next) { 2614 var l = state.bufferedRequestCount; 2615 var buffer = new Array(l); 2616 var holder = state.corkedRequestsFree; 2617 holder.entry = entry; 2618 var count = 0; 2619 var allBuffers = true; 2620 while (entry) { 2621 buffer[count] = entry; 2622 if (!entry.isBuf) allBuffers = false; 2623 entry = entry.next; 2624 count += 1; 2625 } 2626 buffer.allBuffers = allBuffers; 2627 doWrite(stream, state, true, state.length, buffer, "", holder.finish); 2628 state.pendingcb++; 2629 state.lastBufferedRequest = null; 2630 if (holder.next) { 2631 state.corkedRequestsFree = holder.next; 2632 holder.next = null; 2633 } else state.corkedRequestsFree = new CorkedRequest(state); 2634 state.bufferedRequestCount = 0; 2635 } else { 2636 while (entry) { 2637 var chunk = entry.chunk; 2638 var encoding = entry.encoding; 2639 var cb = entry.callback; 2640 doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb); 2641 entry = entry.next; 2642 state.bufferedRequestCount--; 2643 if (state.writing) break; 2644 } 2645 if (entry === null) state.lastBufferedRequest = null; 2646 } 2647 state.bufferedRequest = entry; 2648 state.bufferProcessing = false; 2649 } 2650 Writable.prototype._write = function(chunk, encoding, cb) { 2651 cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); 2652 }; 2653 Writable.prototype._writev = null; 2654 Writable.prototype.end = function(chunk, encoding, cb) { 2655 var state = this._writableState; 2656 if (typeof chunk === "function") { 2657 cb = chunk; 2658 chunk = null; 2659 encoding = null; 2660 } else if (typeof encoding === "function") { 2661 cb = encoding; 2662 encoding = null; 2663 } 2664 if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); 2665 if (state.corked) { 2666 state.corked = 1; 2667 this.uncork(); 2668 } 2669 if (!state.ending) endWritable(this, state, cb); 2670 return this; 2671 }; 2672 Object.defineProperty(Writable.prototype, "writableLength", { 2673 enumerable: false, 2674 get: function get() { 2675 return this._writableState.length; 2676 } 2677 }); 2678 function needFinish(state) { 2679 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; 2680 } 2681 function callFinal(stream, state) { 2682 stream._final(function(err) { 2683 state.pendingcb--; 2684 if (err) errorOrDestroy(stream, err); 2685 state.prefinished = true; 2686 stream.emit("prefinish"); 2687 finishMaybe(stream, state); 2688 }); 2689 } 2690 function prefinish(stream, state) { 2691 if (!state.prefinished && !state.finalCalled) if (typeof stream._final === "function" && !state.destroyed) { 2692 state.pendingcb++; 2693 state.finalCalled = true; 2694 process.nextTick(callFinal, stream, state); 2695 } else { 2696 state.prefinished = true; 2697 stream.emit("prefinish"); 2698 } 2699 } 2700 function finishMaybe(stream, state) { 2701 var need = needFinish(state); 2702 if (need) { 2703 prefinish(stream, state); 2704 if (state.pendingcb === 0) { 2705 state.finished = true; 2706 stream.emit("finish"); 2707 if (state.autoDestroy) { 2708 var rState = stream._readableState; 2709 if (!rState || rState.autoDestroy && rState.endEmitted) stream.destroy(); 2710 } 2711 } 2712 } 2713 return need; 2714 } 2715 function endWritable(stream, state, cb) { 2716 state.ending = true; 2717 finishMaybe(stream, state); 2718 if (cb) if (state.finished) process.nextTick(cb); 2719 else stream.once("finish", cb); 2720 state.ended = true; 2721 stream.writable = false; 2722 } 2723 function onCorkedFinish(corkReq, state, err) { 2724 var entry = corkReq.entry; 2725 corkReq.entry = null; 2726 while (entry) { 2727 var cb = entry.callback; 2728 state.pendingcb--; 2729 cb(err); 2730 entry = entry.next; 2731 } 2732 state.corkedRequestsFree.next = corkReq; 2733 } 2734 Object.defineProperty(Writable.prototype, "destroyed", { 2735 enumerable: false, 2736 get: function get() { 2737 if (this._writableState === void 0) return false; 2738 return this._writableState.destroyed; 2739 }, 2740 set: function set(value) { 2741 if (!this._writableState) return; 2742 this._writableState.destroyed = value; 2743 } 2744 }); 2745 Writable.prototype.destroy = destroyImpl.destroy; 2746 Writable.prototype._undestroy = destroyImpl.undestroy; 2747 Writable.prototype._destroy = function(err, cb) { 2748 cb(err); 2749 }; 2750})); 2751//#endregion 2752//#region node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js 2753var require__stream_duplex$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2754 var process = require_browser$15(); 2755 var objectKeys = Object.keys || function(obj) { 2756 var keys = []; 2757 for (var key in obj) keys.push(key); 2758 return keys; 2759 }; 2760 module.exports = Duplex; 2761 var Readable = require__stream_readable$2(); 2762 var Writable = require__stream_writable$2(); 2763 require_inherits_browser()(Duplex, Readable); 2764 var keys = objectKeys(Writable.prototype); 2765 for (var v = 0; v < keys.length; v++) { 2766 var method = keys[v]; 2767 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; 2768 } 2769 function Duplex(options) { 2770 if (!(this instanceof Duplex)) return new Duplex(options); 2771 Readable.call(this, options); 2772 Writable.call(this, options); 2773 this.allowHalfOpen = true; 2774 if (options) { 2775 if (options.readable === false) this.readable = false;
vendor: 15,386 bytes, lines 2776-3274
2776 if (options.writable === false) this.writable = false; 2777 if (options.allowHalfOpen === false) { 2778 this.allowHalfOpen = false; 2779 this.once("end", onend); 2780 } 2781 } 2782 } 2783 Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { 2784 enumerable: false, 2785 get: function get() { 2786 return this._writableState.highWaterMark; 2787 } 2788 }); 2789 Object.defineProperty(Duplex.prototype, "writableBuffer", { 2790 enumerable: false, 2791 get: function get() { 2792 return this._writableState && this._writableState.getBuffer(); 2793 } 2794 }); 2795 Object.defineProperty(Duplex.prototype, "writableLength", { 2796 enumerable: false, 2797 get: function get() { 2798 return this._writableState.length; 2799 } 2800 }); 2801 function onend() { 2802 if (this._writableState.ended) return; 2803 process.nextTick(onEndNT, this); 2804 } 2805 function onEndNT(self) { 2806 self.end(); 2807 } 2808 Object.defineProperty(Duplex.prototype, "destroyed", { 2809 enumerable: false, 2810 get: function get() { 2811 if (this._readableState === void 0 || this._writableState === void 0) return false; 2812 return this._readableState.destroyed && this._writableState.destroyed; 2813 }, 2814 set: function set(value) { 2815 if (this._readableState === void 0 || this._writableState === void 0) return; 2816 this._readableState.destroyed = value; 2817 this._writableState.destroyed = value; 2818 } 2819 }); 2820})); 2821//#endregion 2822//#region node_modules/string_decoder/node_modules/safe-buffer/index.js 2823var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 2824 var buffer = require_buffer$1(); 2825 var Buffer = buffer.Buffer; 2826 function copyProps(src, dst) { 2827 for (var key in src) dst[key] = src[key]; 2828 } 2829 if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer; 2830 else { 2831 copyProps(buffer, exports); 2832 exports.Buffer = SafeBuffer; 2833 } 2834 function SafeBuffer(arg, encodingOrOffset, length) { 2835 return Buffer(arg, encodingOrOffset, length); 2836 } 2837 copyProps(Buffer, SafeBuffer); 2838 SafeBuffer.from = function(arg, encodingOrOffset, length) { 2839 if (typeof arg === "number") throw new TypeError("Argument must not be a number"); 2840 return Buffer(arg, encodingOrOffset, length); 2841 }; 2842 SafeBuffer.alloc = function(size, fill, encoding) { 2843 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 2844 var buf = Buffer(size); 2845 if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding); 2846 else buf.fill(fill); 2847 else buf.fill(0); 2848 return buf; 2849 }; 2850 SafeBuffer.allocUnsafe = function(size) { 2851 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 2852 return Buffer(size); 2853 }; 2854 SafeBuffer.allocUnsafeSlow = function(size) { 2855 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 2856 return buffer.SlowBuffer(size); 2857 }; 2858})); 2859//#endregion 2860//#region node_modules/string_decoder/lib/string_decoder.js 2861var require_string_decoder = /* @__PURE__ */ __commonJSMin(((exports) => { 2862 var Buffer = require_safe_buffer$1().Buffer; 2863 var isEncoding = Buffer.isEncoding || function(encoding) { 2864 encoding = "" + encoding; 2865 switch (encoding && encoding.toLowerCase()) { 2866 case "hex": 2867 case "utf8": 2868 case "utf-8": 2869 case "ascii": 2870 case "binary": 2871 case "base64": 2872 case "ucs2": 2873 case "ucs-2": 2874 case "utf16le": 2875 case "utf-16le": 2876 case "raw": return true; 2877 default: return false; 2878 } 2879 }; 2880 function _normalizeEncoding(enc) { 2881 if (!enc) return "utf8"; 2882 var retried; 2883 while (true) switch (enc) { 2884 case "utf8": 2885 case "utf-8": return "utf8"; 2886 case "ucs2": 2887 case "ucs-2": 2888 case "utf16le": 2889 case "utf-16le": return "utf16le"; 2890 case "latin1": 2891 case "binary": return "latin1"; 2892 case "base64": 2893 case "ascii": 2894 case "hex": return enc; 2895 default: 2896 if (retried) return; 2897 enc = ("" + enc).toLowerCase(); 2898 retried = true; 2899 } 2900 } 2901 function normalizeEncoding(enc) { 2902 var nenc = _normalizeEncoding(enc); 2903 if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); 2904 return nenc || enc; 2905 } 2906 exports.StringDecoder = StringDecoder; 2907 function StringDecoder(encoding) { 2908 this.encoding = normalizeEncoding(encoding); 2909 var nb; 2910 switch (this.encoding) { 2911 case "utf16le": 2912 this.text = utf16Text; 2913 this.end = utf16End; 2914 nb = 4; 2915 break; 2916 case "utf8": 2917 this.fillLast = utf8FillLast; 2918 nb = 4; 2919 break; 2920 case "base64": 2921 this.text = base64Text; 2922 this.end = base64End; 2923 nb = 3; 2924 break; 2925 default: 2926 this.write = simpleWrite; 2927 this.end = simpleEnd; 2928 return; 2929 } 2930 this.lastNeed = 0; 2931 this.lastTotal = 0; 2932 this.lastChar = Buffer.allocUnsafe(nb); 2933 } 2934 StringDecoder.prototype.write = function(buf) { 2935 if (buf.length === 0) return ""; 2936 var r; 2937 var i; 2938 if (this.lastNeed) { 2939 r = this.fillLast(buf); 2940 if (r === void 0) return ""; 2941 i = this.lastNeed; 2942 this.lastNeed = 0; 2943 } else i = 0; 2944 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); 2945 return r || ""; 2946 }; 2947 StringDecoder.prototype.end = utf8End; 2948 StringDecoder.prototype.text = utf8Text; 2949 StringDecoder.prototype.fillLast = function(buf) { 2950 if (this.lastNeed <= buf.length) { 2951 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); 2952 return this.lastChar.toString(this.encoding, 0, this.lastTotal); 2953 } 2954 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); 2955 this.lastNeed -= buf.length; 2956 }; 2957 function utf8CheckByte(byte) { 2958 if (byte <= 127) return 0; 2959 else if (byte >> 5 === 6) return 2; 2960 else if (byte >> 4 === 14) return 3; 2961 else if (byte >> 3 === 30) return 4; 2962 return byte >> 6 === 2 ? -1 : -2; 2963 } 2964 function utf8CheckIncomplete(self, buf, i) { 2965 var j = buf.length - 1; 2966 if (j < i) return 0; 2967 var nb = utf8CheckByte(buf[j]); 2968 if (nb >= 0) { 2969 if (nb > 0) self.lastNeed = nb - 1; 2970 return nb; 2971 } 2972 if (--j < i || nb === -2) return 0; 2973 nb = utf8CheckByte(buf[j]); 2974 if (nb >= 0) { 2975 if (nb > 0) self.lastNeed = nb - 2; 2976 return nb; 2977 } 2978 if (--j < i || nb === -2) return 0; 2979 nb = utf8CheckByte(buf[j]); 2980 if (nb >= 0) { 2981 if (nb > 0) if (nb === 2) nb = 0; 2982 else self.lastNeed = nb - 3; 2983 return nb; 2984 } 2985 return 0; 2986 } 2987 function utf8CheckExtraBytes(self, buf, p) { 2988 if ((buf[0] & 192) !== 128) { 2989 self.lastNeed = 0; 2990 return "�"; 2991 } 2992 if (self.lastNeed > 1 && buf.length > 1) { 2993 if ((buf[1] & 192) !== 128) { 2994 self.lastNeed = 1; 2995 return "�"; 2996 } 2997 if (self.lastNeed > 2 && buf.length > 2) { 2998 if ((buf[2] & 192) !== 128) { 2999 self.lastNeed = 2; 3000 return "�"; 3001 } 3002 } 3003 } 3004 } 3005 function utf8FillLast(buf) { 3006 var p = this.lastTotal - this.lastNeed; 3007 var r = utf8CheckExtraBytes(this, buf, p); 3008 if (r !== void 0) return r; 3009 if (this.lastNeed <= buf.length) { 3010 buf.copy(this.lastChar, p, 0, this.lastNeed); 3011 return this.lastChar.toString(this.encoding, 0, this.lastTotal); 3012 } 3013 buf.copy(this.lastChar, p, 0, buf.length); 3014 this.lastNeed -= buf.length; 3015 } 3016 function utf8Text(buf, i) { 3017 var total = utf8CheckIncomplete(this, buf, i); 3018 if (!this.lastNeed) return buf.toString("utf8", i); 3019 this.lastTotal = total; 3020 var end = buf.length - (total - this.lastNeed); 3021 buf.copy(this.lastChar, 0, end); 3022 return buf.toString("utf8", i, end); 3023 } 3024 function utf8End(buf) { 3025 var r = buf && buf.length ? this.write(buf) : ""; 3026 if (this.lastNeed) return r + "�"; 3027 return r; 3028 } 3029 function utf16Text(buf, i) { 3030 if ((buf.length - i) % 2 === 0) { 3031 var r = buf.toString("utf16le", i); 3032 if (r) { 3033 var c = r.charCodeAt(r.length - 1); 3034 if (c >= 55296 && c <= 56319) { 3035 this.lastNeed = 2; 3036 this.lastTotal = 4; 3037 this.lastChar[0] = buf[buf.length - 2]; 3038 this.lastChar[1] = buf[buf.length - 1]; 3039 return r.slice(0, -1); 3040 } 3041 } 3042 return r; 3043 } 3044 this.lastNeed = 1; 3045 this.lastTotal = 2; 3046 this.lastChar[0] = buf[buf.length - 1]; 3047 return buf.toString("utf16le", i, buf.length - 1); 3048 } 3049 function utf16End(buf) { 3050 var r = buf && buf.length ? this.write(buf) : ""; 3051 if (this.lastNeed) { 3052 var end = this.lastTotal - this.lastNeed; 3053 return r + this.lastChar.toString("utf16le", 0, end); 3054 } 3055 return r; 3056 } 3057 function base64Text(buf, i) { 3058 var n = (buf.length - i) % 3; 3059 if (n === 0) return buf.toString("base64", i); 3060 this.lastNeed = 3 - n; 3061 this.lastTotal = 3; 3062 if (n === 1) this.lastChar[0] = buf[buf.length - 1]; 3063 else { 3064 this.lastChar[0] = buf[buf.length - 2]; 3065 this.lastChar[1] = buf[buf.length - 1]; 3066 } 3067 return buf.toString("base64", i, buf.length - n); 3068 } 3069 function base64End(buf) { 3070 var r = buf && buf.length ? this.write(buf) : ""; 3071 if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); 3072 return r; 3073 } 3074 function simpleWrite(buf) { 3075 return buf.toString(this.encoding); 3076 } 3077 function simpleEnd(buf) { 3078 return buf && buf.length ? this.write(buf) : ""; 3079 } 3080})); 3081//#endregion 3082//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/end-of-stream.js 3083var require_end_of_stream$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 3084 var ERR_STREAM_PREMATURE_CLOSE = require_errors_browser$1().codes.ERR_STREAM_PREMATURE_CLOSE; 3085 function once(callback) { 3086 var called = false; 3087 return function() { 3088 if (called) return; 3089 called = true; 3090 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; 3091 callback.apply(this, args); 3092 }; 3093 } 3094 function noop() {} 3095 function isRequest(stream) { 3096 return stream.setHeader && typeof stream.abort === "function"; 3097 } 3098 function eos(stream, opts, callback) { 3099 if (typeof opts === "function") return eos(stream, null, opts); 3100 if (!opts) opts = {}; 3101 callback = once(callback || noop); 3102 var readable = opts.readable || opts.readable !== false && stream.readable; 3103 var writable = opts.writable || opts.writable !== false && stream.writable; 3104 var onlegacyfinish = function onlegacyfinish() { 3105 if (!stream.writable) onfinish(); 3106 }; 3107 var writableEnded = stream._writableState && stream._writableState.finished; 3108 var onfinish = function onfinish() { 3109 writable = false; 3110 writableEnded = true; 3111 if (!readable) callback.call(stream); 3112 }; 3113 var readableEnded = stream._readableState && stream._readableState.endEmitted; 3114 var onend = function onend() { 3115 readable = false; 3116 readableEnded = true; 3117 if (!writable) callback.call(stream); 3118 }; 3119 var onerror = function onerror(err) { 3120 callback.call(stream, err); 3121 }; 3122 var onclose = function onclose() { 3123 var err; 3124 if (readable && !readableEnded) { 3125 if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); 3126 return callback.call(stream, err); 3127 } 3128 if (writable && !writableEnded) { 3129 if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); 3130 return callback.call(stream, err); 3131 } 3132 }; 3133 var onrequest = function onrequest() { 3134 stream.req.on("finish", onfinish); 3135 }; 3136 if (isRequest(stream)) { 3137 stream.on("complete", onfinish); 3138 stream.on("abort", onclose); 3139 if (stream.req) onrequest(); 3140 else stream.on("request", onrequest); 3141 } else if (writable && !stream._writableState) { 3142 stream.on("end", onlegacyfinish); 3143 stream.on("close", onlegacyfinish); 3144 } 3145 stream.on("end", onend); 3146 stream.on("finish", onfinish); 3147 if (opts.error !== false) stream.on("error", onerror); 3148 stream.on("close", onclose); 3149 return function() { 3150 stream.removeListener("complete", onfinish); 3151 stream.removeListener("abort", onclose); 3152 stream.removeListener("request", onrequest); 3153 if (stream.req) stream.req.removeListener("finish", onfinish); 3154 stream.removeListener("end", onlegacyfinish); 3155 stream.removeListener("close", onlegacyfinish); 3156 stream.removeListener("finish", onfinish); 3157 stream.removeListener("end", onend); 3158 stream.removeListener("error", onerror); 3159 stream.removeListener("close", onclose); 3160 }; 3161 } 3162 module.exports = eos; 3163})); 3164//#endregion 3165//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/async_iterator.js 3166var require_async_iterator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 3167 var process = require_browser$15(); 3168 var _Object$setPrototypeO; 3169 function _defineProperty(obj, key, value) { 3170 if (key in obj) Object.defineProperty(obj, key, { 3171 value, 3172 enumerable: true, 3173 configurable: true, 3174 writable: true 3175 }); 3176 else obj[key] = value; 3177 return obj; 3178 } 3179 var finished = require_end_of_stream$1(); 3180 var kLastResolve = Symbol("lastResolve"); 3181 var kLastReject = Symbol("lastReject"); 3182 var kError = Symbol("error"); 3183 var kEnded = Symbol("ended"); 3184 var kLastPromise = Symbol("lastPromise"); 3185 var kHandlePromise = Symbol("handlePromise"); 3186 var kStream = Symbol("stream"); 3187 function createIterResult(value, done) { 3188 return { 3189 value, 3190 done 3191 }; 3192 } 3193 function readAndResolve(iter) { 3194 var resolve = iter[kLastResolve]; 3195 if (resolve !== null) { 3196 var data = iter[kStream].read(); 3197 if (data !== null) { 3198 iter[kLastPromise] = null; 3199 iter[kLastResolve] = null; 3200 iter[kLastReject] = null; 3201 resolve(createIterResult(data, false)); 3202 } 3203 } 3204 } 3205 function onReadable(iter) { 3206 process.nextTick(readAndResolve, iter); 3207 } 3208 function wrapForNext(lastPromise, iter) { 3209 return function(resolve, reject) { 3210 lastPromise.then(function() { 3211 if (iter[kEnded]) { 3212 resolve(createIterResult(void 0, true)); 3213 return; 3214 } 3215 iter[kHandlePromise](resolve, reject); 3216 }, reject); 3217 }; 3218 } 3219 var AsyncIteratorPrototype = Object.getPrototypeOf(function() {}); 3220 var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { 3221 get stream() { 3222 return this[kStream]; 3223 }, 3224 next: function next() { 3225 var _this = this; 3226 var error = this[kError]; 3227 if (error !== null) return Promise.reject(error); 3228 if (this[kEnded]) return Promise.resolve(createIterResult(void 0, true)); 3229 if (this[kStream].destroyed) return new Promise(function(resolve, reject) { 3230 process.nextTick(function() { 3231 if (_this[kError]) reject(_this[kError]); 3232 else resolve(createIterResult(void 0, true)); 3233 }); 3234 }); 3235 var lastPromise = this[kLastPromise]; 3236 var promise; 3237 if (lastPromise) promise = new Promise(wrapForNext(lastPromise, this)); 3238 else { 3239 var data = this[kStream].read(); 3240 if (data !== null) return Promise.resolve(createIterResult(data, false)); 3241 promise = new Promise(this[kHandlePromise]); 3242 } 3243 this[kLastPromise] = promise; 3244 return promise; 3245 } 3246 }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { 3247 return this; 3248 }), _defineProperty(_Object$setPrototypeO, "return", function _return() { 3249 var _this2 = this; 3250 return new Promise(function(resolve, reject) { 3251 _this2[kStream].destroy(null, function(err) { 3252 if (err) { 3253 reject(err); 3254 return; 3255 } 3256 resolve(createIterResult(void 0, true)); 3257 }); 3258 }); 3259 }), _Object$setPrototypeO), AsyncIteratorPrototype); 3260 module.exports = function createReadableStreamAsyncIterator(stream) { 3261 var _Object$create; 3262 var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { 3263 value: stream, 3264 writable: true 3265 }), _defineProperty(_Object$create, kLastResolve, { 3266 value: null, 3267 writable: true 3268 }), _defineProperty(_Object$create, kLastReject, { 3269 value: null, 3270 writable: true 3271 }), _defineProperty(_Object$create, kError, { 3272 value: null, 3273 writable: true 3274 }), _defineProperty(_Object$create, kEnded, {
vendor: 4,153 bytes, lines 3275-3387
3275 value: stream._readableState.endEmitted, 3276 writable: true 3277 }), _defineProperty(_Object$create, kHandlePromise, { 3278 value: function value(resolve, reject) { 3279 var data = iterator[kStream].read(); 3280 if (data) { 3281 iterator[kLastPromise] = null; 3282 iterator[kLastResolve] = null; 3283 iterator[kLastReject] = null; 3284 resolve(createIterResult(data, false)); 3285 } else { 3286 iterator[kLastResolve] = resolve; 3287 iterator[kLastReject] = reject; 3288 } 3289 }, 3290 writable: true 3291 }), _Object$create)); 3292 iterator[kLastPromise] = null; 3293 finished(stream, function(err) { 3294 if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { 3295 var reject = iterator[kLastReject]; 3296 if (reject !== null) { 3297 iterator[kLastPromise] = null; 3298 iterator[kLastResolve] = null; 3299 iterator[kLastReject] = null; 3300 reject(err); 3301 } 3302 iterator[kError] = err; 3303 return; 3304 } 3305 var resolve = iterator[kLastResolve]; 3306 if (resolve !== null) { 3307 iterator[kLastPromise] = null; 3308 iterator[kLastResolve] = null; 3309 iterator[kLastReject] = null; 3310 resolve(createIterResult(void 0, true)); 3311 } 3312 iterator[kEnded] = true; 3313 }); 3314 stream.on("readable", onReadable.bind(null, iterator)); 3315 return iterator; 3316 }; 3317})); 3318//#endregion 3319//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/from-browser.js 3320var require_from_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 3321 module.exports = function() { 3322 throw new Error("Readable.from is not available in the browser"); 3323 }; 3324})); 3325//#endregion 3326//#region node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js 3327var require__stream_readable$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 3328 var process = require_browser$15(); 3329 module.exports = Readable; 3330 var Duplex; 3331 Readable.ReadableState = ReadableState; 3332 require_events().EventEmitter; 3333 var EElistenerCount = function EElistenerCount(emitter, type) { 3334 return emitter.listeners(type).length; 3335 }; 3336 var Stream = require_stream_browser$2(); 3337 var Buffer = require_buffer$1().Buffer; 3338 var OurUint8Array = globalThis.Uint8Array || function() {}; 3339 function _uint8ArrayToBuffer(chunk) { 3340 return Buffer.from(chunk); 3341 } 3342 function _isUint8Array(obj) { 3343 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; 3344 } 3345 var debugUtil = require___vite_browser_external(); 3346 var debug; 3347 if (debugUtil && debugUtil.debuglog) debug = debugUtil.debuglog("stream"); 3348 else debug = function debug() {}; 3349 var BufferList = require_buffer_list$1(); 3350 var destroyImpl = require_destroy$2(); 3351 var getHighWaterMark = require_state$1().getHighWaterMark; 3352 var _require$codes = require_errors_browser$1().codes; 3353 var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; 3354 var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; 3355 var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; 3356 var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; 3357 var StringDecoder; 3358 var createReadableStreamAsyncIterator; 3359 var from; 3360 require_inherits_browser()(Readable, Stream); 3361 var errorOrDestroy = destroyImpl.errorOrDestroy; 3362 var kProxyEvents = [ 3363 "error", 3364 "close", 3365 "destroy", 3366 "pause", 3367 "resume" 3368 ]; 3369 function prependListener(emitter, event, fn) { 3370 if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); 3371 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); 3372 else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn); 3373 else emitter._events[event] = [fn, emitter._events[event]]; 3374 } 3375 function ReadableState(options, stream, isDuplex) { 3376 Duplex = Duplex || require__stream_duplex$2(); 3377 options = options || {}; 3378 if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; 3379 this.objectMode = !!options.objectMode; 3380 if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; 3381 this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); 3382 this.buffer = new BufferList(); 3383 this.length = 0; 3384 this.pipes = null; 3385 this.pipesCount = 0; 3386 this.flowing = null; 3387 this.ended = false;
vendor: 19,251 bytes, lines 3388-3988
3388 this.endEmitted = false; 3389 this.reading = false; 3390 this.sync = true; 3391 this.needReadable = false; 3392 this.emittedReadable = false; 3393 this.readableListening = false; 3394 this.resumeScheduled = false; 3395 this.paused = true; 3396 this.emitClose = options.emitClose !== false; 3397 this.autoDestroy = !!options.autoDestroy; 3398 this.destroyed = false; 3399 this.defaultEncoding = options.defaultEncoding || "utf8"; 3400 this.awaitDrain = 0; 3401 this.readingMore = false; 3402 this.decoder = null; 3403 this.encoding = null; 3404 if (options.encoding) { 3405 if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; 3406 this.decoder = new StringDecoder(options.encoding); 3407 this.encoding = options.encoding; 3408 } 3409 } 3410 function Readable(options) { 3411 Duplex = Duplex || require__stream_duplex$2(); 3412 if (!(this instanceof Readable)) return new Readable(options); 3413 var isDuplex = this instanceof Duplex; 3414 this._readableState = new ReadableState(options, this, isDuplex); 3415 this.readable = true; 3416 if (options) { 3417 if (typeof options.read === "function") this._read = options.read; 3418 if (typeof options.destroy === "function") this._destroy = options.destroy; 3419 } 3420 Stream.call(this); 3421 } 3422 Object.defineProperty(Readable.prototype, "destroyed", { 3423 enumerable: false, 3424 get: function get() { 3425 if (this._readableState === void 0) return false; 3426 return this._readableState.destroyed; 3427 }, 3428 set: function set(value) { 3429 if (!this._readableState) return; 3430 this._readableState.destroyed = value; 3431 } 3432 }); 3433 Readable.prototype.destroy = destroyImpl.destroy; 3434 Readable.prototype._undestroy = destroyImpl.undestroy; 3435 Readable.prototype._destroy = function(err, cb) { 3436 cb(err); 3437 }; 3438 Readable.prototype.push = function(chunk, encoding) { 3439 var state = this._readableState; 3440 var skipChunkCheck; 3441 if (!state.objectMode) { 3442 if (typeof chunk === "string") { 3443 encoding = encoding || state.defaultEncoding; 3444 if (encoding !== state.encoding) { 3445 chunk = Buffer.from(chunk, encoding); 3446 encoding = ""; 3447 } 3448 skipChunkCheck = true; 3449 } 3450 } else skipChunkCheck = true; 3451 return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); 3452 }; 3453 Readable.prototype.unshift = function(chunk) { 3454 return readableAddChunk(this, chunk, null, true, false); 3455 }; 3456 function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { 3457 debug("readableAddChunk", chunk); 3458 var state = stream._readableState; 3459 if (chunk === null) { 3460 state.reading = false; 3461 onEofChunk(stream, state); 3462 } else { 3463 var er; 3464 if (!skipChunkCheck) er = chunkInvalid(state, chunk); 3465 if (er) errorOrDestroy(stream, er); 3466 else if (state.objectMode || chunk && chunk.length > 0) { 3467 if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) chunk = _uint8ArrayToBuffer(chunk); 3468 if (addToFront) if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); 3469 else addChunk(stream, state, chunk, true); 3470 else if (state.ended) errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); 3471 else if (state.destroyed) return false; 3472 else { 3473 state.reading = false; 3474 if (state.decoder && !encoding) { 3475 chunk = state.decoder.write(chunk); 3476 if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); 3477 else maybeReadMore(stream, state); 3478 } else addChunk(stream, state, chunk, false); 3479 } 3480 } else if (!addToFront) { 3481 state.reading = false; 3482 maybeReadMore(stream, state); 3483 } 3484 } 3485 return !state.ended && (state.length < state.highWaterMark || state.length === 0); 3486 } 3487 function addChunk(stream, state, chunk, addToFront) { 3488 if (state.flowing && state.length === 0 && !state.sync) { 3489 state.awaitDrain = 0; 3490 stream.emit("data", chunk); 3491 } else { 3492 state.length += state.objectMode ? 1 : chunk.length; 3493 if (addToFront) state.buffer.unshift(chunk); 3494 else state.buffer.push(chunk); 3495 if (state.needReadable) emitReadable(stream); 3496 } 3497 maybeReadMore(stream, state); 3498 } 3499 function chunkInvalid(state, chunk) { 3500 var er; 3501 if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = new ERR_INVALID_ARG_TYPE("chunk", [ 3502 "string", 3503 "Buffer", 3504 "Uint8Array" 3505 ], chunk); 3506 return er; 3507 } 3508 Readable.prototype.isPaused = function() { 3509 return this._readableState.flowing === false; 3510 }; 3511 Readable.prototype.setEncoding = function(enc) { 3512 if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; 3513 var decoder = new StringDecoder(enc); 3514 this._readableState.decoder = decoder; 3515 this._readableState.encoding = this._readableState.decoder.encoding; 3516 var p = this._readableState.buffer.head; 3517 var content = ""; 3518 while (p !== null) { 3519 content += decoder.write(p.data); 3520 p = p.next; 3521 } 3522 this._readableState.buffer.clear(); 3523 if (content !== "") this._readableState.buffer.push(content); 3524 this._readableState.length = content.length; 3525 return this; 3526 }; 3527 var MAX_HWM = 1073741824; 3528 function computeNewHighWaterMark(n) { 3529 if (n >= MAX_HWM) n = MAX_HWM; 3530 else { 3531 n--; 3532 n |= n >>> 1; 3533 n |= n >>> 2; 3534 n |= n >>> 4; 3535 n |= n >>> 8; 3536 n |= n >>> 16; 3537 n++; 3538 } 3539 return n; 3540 } 3541 function howMuchToRead(n, state) { 3542 if (n <= 0 || state.length === 0 && state.ended) return 0; 3543 if (state.objectMode) return 1; 3544 if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length; 3545 else return state.length; 3546 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); 3547 if (n <= state.length) return n; 3548 if (!state.ended) { 3549 state.needReadable = true; 3550 return 0; 3551 } 3552 return state.length; 3553 } 3554 Readable.prototype.read = function(n) { 3555 debug("read", n); 3556 n = parseInt(n, 10); 3557 var state = this._readableState; 3558 var nOrig = n; 3559 if (n !== 0) state.emittedReadable = false; 3560 if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { 3561 debug("read: emitReadable", state.length, state.ended); 3562 if (state.length === 0 && state.ended) endReadable(this); 3563 else emitReadable(this); 3564 return null; 3565 } 3566 n = howMuchToRead(n, state); 3567 if (n === 0 && state.ended) { 3568 if (state.length === 0) endReadable(this); 3569 return null; 3570 } 3571 var doRead = state.needReadable; 3572 debug("need readable", doRead); 3573 if (state.length === 0 || state.length - n < state.highWaterMark) { 3574 doRead = true; 3575 debug("length less than watermark", doRead); 3576 } 3577 if (state.ended || state.reading) { 3578 doRead = false; 3579 debug("reading or ended", doRead); 3580 } else if (doRead) { 3581 debug("do read"); 3582 state.reading = true; 3583 state.sync = true; 3584 if (state.length === 0) state.needReadable = true; 3585 this._read(state.highWaterMark); 3586 state.sync = false; 3587 if (!state.reading) n = howMuchToRead(nOrig, state); 3588 } 3589 var ret; 3590 if (n > 0) ret = fromList(n, state); 3591 else ret = null; 3592 if (ret === null) { 3593 state.needReadable = state.length <= state.highWaterMark; 3594 n = 0; 3595 } else { 3596 state.length -= n; 3597 state.awaitDrain = 0; 3598 } 3599 if (state.length === 0) { 3600 if (!state.ended) state.needReadable = true; 3601 if (nOrig !== n && state.ended) endReadable(this); 3602 } 3603 if (ret !== null) this.emit("data", ret); 3604 return ret; 3605 }; 3606 function onEofChunk(stream, state) { 3607 debug("onEofChunk"); 3608 if (state.ended) return; 3609 if (state.decoder) { 3610 var chunk = state.decoder.end(); 3611 if (chunk && chunk.length) { 3612 state.buffer.push(chunk); 3613 state.length += state.objectMode ? 1 : chunk.length; 3614 } 3615 } 3616 state.ended = true; 3617 if (state.sync) emitReadable(stream); 3618 else { 3619 state.needReadable = false; 3620 if (!state.emittedReadable) { 3621 state.emittedReadable = true; 3622 emitReadable_(stream); 3623 } 3624 } 3625 } 3626 function emitReadable(stream) { 3627 var state = stream._readableState; 3628 debug("emitReadable", state.needReadable, state.emittedReadable); 3629 state.needReadable = false; 3630 if (!state.emittedReadable) { 3631 debug("emitReadable", state.flowing); 3632 state.emittedReadable = true; 3633 process.nextTick(emitReadable_, stream); 3634 } 3635 } 3636 function emitReadable_(stream) { 3637 var state = stream._readableState; 3638 debug("emitReadable_", state.destroyed, state.length, state.ended); 3639 if (!state.destroyed && (state.length || state.ended)) { 3640 stream.emit("readable"); 3641 state.emittedReadable = false; 3642 } 3643 state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; 3644 flow(stream); 3645 } 3646 function maybeReadMore(stream, state) { 3647 if (!state.readingMore) { 3648 state.readingMore = true; 3649 process.nextTick(maybeReadMore_, stream, state); 3650 } 3651 } 3652 function maybeReadMore_(stream, state) { 3653 while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { 3654 var len = state.length; 3655 debug("maybeReadMore read 0"); 3656 stream.read(0); 3657 if (len === state.length) break; 3658 } 3659 state.readingMore = false; 3660 } 3661 Readable.prototype._read = function(n) { 3662 errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); 3663 }; 3664 Readable.prototype.pipe = function(dest, pipeOpts) { 3665 var src = this; 3666 var state = this._readableState; 3667 switch (state.pipesCount) { 3668 case 0: 3669 state.pipes = dest; 3670 break; 3671 case 1: 3672 state.pipes = [state.pipes, dest]; 3673 break; 3674 default: 3675 state.pipes.push(dest); 3676 break; 3677 } 3678 state.pipesCount += 1; 3679 debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); 3680 var endFn = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr ? onend : unpipe; 3681 if (state.endEmitted) process.nextTick(endFn); 3682 else src.once("end", endFn); 3683 dest.on("unpipe", onunpipe); 3684 function onunpipe(readable, unpipeInfo) { 3685 debug("onunpipe"); 3686 if (readable === src) { 3687 if (unpipeInfo && unpipeInfo.hasUnpiped === false) { 3688 unpipeInfo.hasUnpiped = true; 3689 cleanup(); 3690 } 3691 } 3692 } 3693 function onend() { 3694 debug("onend"); 3695 dest.end(); 3696 } 3697 var ondrain = pipeOnDrain(src); 3698 dest.on("drain", ondrain); 3699 var cleanedUp = false; 3700 function cleanup() { 3701 debug("cleanup"); 3702 dest.removeListener("close", onclose); 3703 dest.removeListener("finish", onfinish); 3704 dest.removeListener("drain", ondrain); 3705 dest.removeListener("error", onerror); 3706 dest.removeListener("unpipe", onunpipe); 3707 src.removeListener("end", onend); 3708 src.removeListener("end", unpipe); 3709 src.removeListener("data", ondata); 3710 cleanedUp = true; 3711 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); 3712 } 3713 src.on("data", ondata); 3714 function ondata(chunk) { 3715 debug("ondata"); 3716 var ret = dest.write(chunk); 3717 debug("dest.write", ret); 3718 if (ret === false) { 3719 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { 3720 debug("false write response, pause", state.awaitDrain); 3721 state.awaitDrain++; 3722 } 3723 src.pause(); 3724 } 3725 } 3726 function onerror(er) { 3727 debug("onerror", er); 3728 unpipe(); 3729 dest.removeListener("error", onerror); 3730 if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); 3731 } 3732 prependListener(dest, "error", onerror); 3733 function onclose() { 3734 dest.removeListener("finish", onfinish); 3735 unpipe(); 3736 } 3737 dest.once("close", onclose); 3738 function onfinish() { 3739 debug("onfinish"); 3740 dest.removeListener("close", onclose); 3741 unpipe(); 3742 } 3743 dest.once("finish", onfinish); 3744 function unpipe() { 3745 debug("unpipe"); 3746 src.unpipe(dest); 3747 } 3748 dest.emit("pipe", src); 3749 if (!state.flowing) { 3750 debug("pipe resume"); 3751 src.resume(); 3752 } 3753 return dest; 3754 }; 3755 function pipeOnDrain(src) { 3756 return function pipeOnDrainFunctionResult() { 3757 var state = src._readableState; 3758 debug("pipeOnDrain", state.awaitDrain); 3759 if (state.awaitDrain) state.awaitDrain--; 3760 if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { 3761 state.flowing = true; 3762 flow(src); 3763 } 3764 }; 3765 } 3766 Readable.prototype.unpipe = function(dest) { 3767 var state = this._readableState; 3768 var unpipeInfo = { hasUnpiped: false }; 3769 if (state.pipesCount === 0) return this; 3770 if (state.pipesCount === 1) { 3771 if (dest && dest !== state.pipes) return this; 3772 if (!dest) dest = state.pipes; 3773 state.pipes = null; 3774 state.pipesCount = 0; 3775 state.flowing = false; 3776 if (dest) dest.emit("unpipe", this, unpipeInfo); 3777 return this; 3778 } 3779 if (!dest) { 3780 var dests = state.pipes; 3781 var len = state.pipesCount; 3782 state.pipes = null; 3783 state.pipesCount = 0; 3784 state.flowing = false; 3785 for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false }); 3786 return this; 3787 } 3788 var index = indexOf(state.pipes, dest); 3789 if (index === -1) return this; 3790 state.pipes.splice(index, 1); 3791 state.pipesCount -= 1; 3792 if (state.pipesCount === 1) state.pipes = state.pipes[0]; 3793 dest.emit("unpipe", this, unpipeInfo); 3794 return this; 3795 }; 3796 Readable.prototype.on = function(ev, fn) { 3797 var res = Stream.prototype.on.call(this, ev, fn); 3798 var state = this._readableState; 3799 if (ev === "data") { 3800 state.readableListening = this.listenerCount("readable") > 0; 3801 if (state.flowing !== false) this.resume(); 3802 } else if (ev === "readable") { 3803 if (!state.endEmitted && !state.readableListening) { 3804 state.readableListening = state.needReadable = true; 3805 state.flowing = false; 3806 state.emittedReadable = false; 3807 debug("on readable", state.length, state.reading); 3808 if (state.length) emitReadable(this); 3809 else if (!state.reading) process.nextTick(nReadingNextTick, this); 3810 } 3811 } 3812 return res; 3813 }; 3814 Readable.prototype.addListener = Readable.prototype.on; 3815 Readable.prototype.removeListener = function(ev, fn) { 3816 var res = Stream.prototype.removeListener.call(this, ev, fn); 3817 if (ev === "readable") process.nextTick(updateReadableListening, this); 3818 return res; 3819 }; 3820 Readable.prototype.removeAllListeners = function(ev) { 3821 var res = Stream.prototype.removeAllListeners.apply(this, arguments); 3822 if (ev === "readable" || ev === void 0) process.nextTick(updateReadableListening, this); 3823 return res; 3824 }; 3825 function updateReadableListening(self) { 3826 var state = self._readableState; 3827 state.readableListening = self.listenerCount("readable") > 0; 3828 if (state.resumeScheduled && !state.paused) state.flowing = true; 3829 else if (self.listenerCount("data") > 0) self.resume(); 3830 } 3831 function nReadingNextTick(self) { 3832 debug("readable nexttick read 0"); 3833 self.read(0); 3834 } 3835 Readable.prototype.resume = function() { 3836 var state = this._readableState; 3837 if (!state.flowing) { 3838 debug("resume"); 3839 state.flowing = !state.readableListening; 3840 resume(this, state); 3841 } 3842 state.paused = false; 3843 return this; 3844 }; 3845 function resume(stream, state) { 3846 if (!state.resumeScheduled) { 3847 state.resumeScheduled = true; 3848 process.nextTick(resume_, stream, state); 3849 } 3850 } 3851 function resume_(stream, state) { 3852 debug("resume", state.reading); 3853 if (!state.reading) stream.read(0); 3854 state.resumeScheduled = false; 3855 stream.emit("resume"); 3856 flow(stream); 3857 if (state.flowing && !state.reading) stream.read(0); 3858 } 3859 Readable.prototype.pause = function() { 3860 debug("call pause flowing=%j", this._readableState.flowing); 3861 if (this._readableState.flowing !== false) { 3862 debug("pause"); 3863 this._readableState.flowing = false; 3864 this.emit("pause"); 3865 } 3866 this._readableState.paused = true; 3867 return this; 3868 }; 3869 function flow(stream) { 3870 var state = stream._readableState; 3871 debug("flow", state.flowing); 3872 while (state.flowing && stream.read() !== null); 3873 } 3874 Readable.prototype.wrap = function(stream) { 3875 var _this = this; 3876 var state = this._readableState; 3877 var paused = false; 3878 stream.on("end", function() { 3879 debug("wrapped end"); 3880 if (state.decoder && !state.ended) { 3881 var chunk = state.decoder.end(); 3882 if (chunk && chunk.length) _this.push(chunk); 3883 } 3884 _this.push(null); 3885 }); 3886 stream.on("data", function(chunk) { 3887 debug("wrapped data"); 3888 if (state.decoder) chunk = state.decoder.write(chunk); 3889 if (state.objectMode && (chunk === null || chunk === void 0)) return; 3890 else if (!state.objectMode && (!chunk || !chunk.length)) return; 3891 if (!_this.push(chunk)) { 3892 paused = true; 3893 stream.pause(); 3894 } 3895 }); 3896 for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function methodWrap(method) { 3897 return function methodWrapReturnFunction() { 3898 return stream[method].apply(stream, arguments); 3899 }; 3900 }(i); 3901 for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); 3902 this._read = function(n) { 3903 debug("wrapped _read", n); 3904 if (paused) { 3905 paused = false; 3906 stream.resume(); 3907 } 3908 }; 3909 return this; 3910 }; 3911 if (typeof Symbol === "function") Readable.prototype[Symbol.asyncIterator] = function() { 3912 if (createReadableStreamAsyncIterator === void 0) createReadableStreamAsyncIterator = require_async_iterator$1(); 3913 return createReadableStreamAsyncIterator(this); 3914 }; 3915 Object.defineProperty(Readable.prototype, "readableHighWaterMark", { 3916 enumerable: false, 3917 get: function get() { 3918 return this._readableState.highWaterMark; 3919 } 3920 }); 3921 Object.defineProperty(Readable.prototype, "readableBuffer", { 3922 enumerable: false, 3923 get: function get() { 3924 return this._readableState && this._readableState.buffer; 3925 } 3926 }); 3927 Object.defineProperty(Readable.prototype, "readableFlowing", { 3928 enumerable: false, 3929 get: function get() { 3930 return this._readableState.flowing; 3931 }, 3932 set: function set(state) { 3933 if (this._readableState) this._readableState.flowing = state; 3934 } 3935 }); 3936 Readable._fromList = fromList; 3937 Object.defineProperty(Readable.prototype, "readableLength", { 3938 enumerable: false, 3939 get: function get() { 3940 return this._readableState.length; 3941 } 3942 }); 3943 function fromList(n, state) { 3944 if (state.length === 0) return null; 3945 var ret; 3946 if (state.objectMode) ret = state.buffer.shift(); 3947 else if (!n || n >= state.length) { 3948 if (state.decoder) ret = state.buffer.join(""); 3949 else if (state.buffer.length === 1) ret = state.buffer.first(); 3950 else ret = state.buffer.concat(state.length); 3951 state.buffer.clear(); 3952 } else ret = state.buffer.consume(n, state.decoder); 3953 return ret; 3954 } 3955 function endReadable(stream) { 3956 var state = stream._readableState; 3957 debug("endReadable", state.endEmitted); 3958 if (!state.endEmitted) { 3959 state.ended = true; 3960 process.nextTick(endReadableNT, state, stream); 3961 } 3962 } 3963 function endReadableNT(state, stream) { 3964 debug("endReadableNT", state.endEmitted, state.length); 3965 if (!state.endEmitted && state.length === 0) { 3966 state.endEmitted = true; 3967 stream.readable = false; 3968 stream.emit("end"); 3969 if (state.autoDestroy) { 3970 var wState = stream._writableState; 3971 if (!wState || wState.autoDestroy && wState.finished) stream.destroy(); 3972 } 3973 } 3974 } 3975 if (typeof Symbol === "function") Readable.from = function(iterable, opts) { 3976 if (from === void 0) from = require_from_browser$1(); 3977 return from(Readable, iterable, opts); 3978 }; 3979 function indexOf(xs, x) { 3980 for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; 3981 return -1; 3982 } 3983})); 3984//#endregion 3985//#region node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js 3986var require__stream_transform$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 3987 module.exports = Transform; 3988 var _require$codes = require_errors_browser$1().codes;
vendor: 23,278 bytes, lines 3989-4962
3989 var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; 3990 var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; 3991 var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; 3992 var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; 3993 var Duplex = require__stream_duplex$2(); 3994 require_inherits_browser()(Transform, Duplex); 3995 function afterTransform(er, data) { 3996 var ts = this._transformState; 3997 ts.transforming = false; 3998 var cb = ts.writecb; 3999 if (cb === null) return this.emit("error", new ERR_MULTIPLE_CALLBACK()); 4000 ts.writechunk = null; 4001 ts.writecb = null; 4002 if (data != null) this.push(data); 4003 cb(er); 4004 var rs = this._readableState; 4005 rs.reading = false; 4006 if (rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); 4007 } 4008 function Transform(options) { 4009 if (!(this instanceof Transform)) return new Transform(options); 4010 Duplex.call(this, options); 4011 this._transformState = { 4012 afterTransform: afterTransform.bind(this), 4013 needTransform: false, 4014 transforming: false, 4015 writecb: null, 4016 writechunk: null, 4017 writeencoding: null 4018 }; 4019 this._readableState.needReadable = true; 4020 this._readableState.sync = false; 4021 if (options) { 4022 if (typeof options.transform === "function") this._transform = options.transform; 4023 if (typeof options.flush === "function") this._flush = options.flush; 4024 } 4025 this.on("prefinish", prefinish); 4026 } 4027 function prefinish() { 4028 var _this = this; 4029 if (typeof this._flush === "function" && !this._readableState.destroyed) this._flush(function(er, data) { 4030 done(_this, er, data); 4031 }); 4032 else done(this, null, null); 4033 } 4034 Transform.prototype.push = function(chunk, encoding) { 4035 this._transformState.needTransform = false; 4036 return Duplex.prototype.push.call(this, chunk, encoding); 4037 }; 4038 Transform.prototype._transform = function(chunk, encoding, cb) { 4039 cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); 4040 }; 4041 Transform.prototype._write = function(chunk, encoding, cb) { 4042 var ts = this._transformState; 4043 ts.writecb = cb; 4044 ts.writechunk = chunk; 4045 ts.writeencoding = encoding; 4046 if (!ts.transforming) { 4047 var rs = this._readableState; 4048 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); 4049 } 4050 }; 4051 Transform.prototype._read = function(n) { 4052 var ts = this._transformState; 4053 if (ts.writechunk !== null && !ts.transforming) { 4054 ts.transforming = true; 4055 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); 4056 } else ts.needTransform = true; 4057 }; 4058 Transform.prototype._destroy = function(err, cb) { 4059 Duplex.prototype._destroy.call(this, err, function(err2) { 4060 cb(err2); 4061 }); 4062 }; 4063 function done(stream, er, data) { 4064 if (er) return stream.emit("error", er); 4065 if (data != null) stream.push(data); 4066 if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); 4067 if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); 4068 return stream.push(null); 4069 } 4070})); 4071//#endregion 4072//#region node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js 4073var require__stream_passthrough$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4074 module.exports = PassThrough; 4075 var Transform = require__stream_transform$2(); 4076 require_inherits_browser()(PassThrough, Transform); 4077 function PassThrough(options) { 4078 if (!(this instanceof PassThrough)) return new PassThrough(options); 4079 Transform.call(this, options); 4080 } 4081 PassThrough.prototype._transform = function(chunk, encoding, cb) { 4082 cb(null, chunk); 4083 }; 4084})); 4085//#endregion 4086//#region node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/pipeline.js 4087var require_pipeline$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4088 var eos; 4089 function once(callback) { 4090 var called = false; 4091 return function() { 4092 if (called) return; 4093 called = true; 4094 callback.apply(void 0, arguments); 4095 }; 4096 } 4097 var _require$codes = require_errors_browser$1().codes; 4098 var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; 4099 var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; 4100 function noop(err) { 4101 if (err) throw err; 4102 } 4103 function isRequest(stream) { 4104 return stream.setHeader && typeof stream.abort === "function"; 4105 } 4106 function destroyer(stream, reading, writing, callback) { 4107 callback = once(callback); 4108 var closed = false; 4109 stream.on("close", function() { 4110 closed = true; 4111 }); 4112 if (eos === void 0) eos = require_end_of_stream$1(); 4113 eos(stream, { 4114 readable: reading, 4115 writable: writing 4116 }, function(err) { 4117 if (err) return callback(err); 4118 closed = true; 4119 callback(); 4120 }); 4121 var destroyed = false; 4122 return function(err) { 4123 if (closed) return; 4124 if (destroyed) return; 4125 destroyed = true; 4126 if (isRequest(stream)) return stream.abort(); 4127 if (typeof stream.destroy === "function") return stream.destroy(); 4128 callback(err || new ERR_STREAM_DESTROYED("pipe")); 4129 }; 4130 } 4131 function call(fn) { 4132 fn(); 4133 } 4134 function pipe(from, to) { 4135 return from.pipe(to); 4136 } 4137 function popCallback(streams) { 4138 if (!streams.length) return noop; 4139 if (typeof streams[streams.length - 1] !== "function") return noop; 4140 return streams.pop(); 4141 } 4142 function pipeline() { 4143 for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) streams[_key] = arguments[_key]; 4144 var callback = popCallback(streams); 4145 if (Array.isArray(streams[0])) streams = streams[0]; 4146 if (streams.length < 2) throw new ERR_MISSING_ARGS("streams"); 4147 var error; 4148 var destroys = streams.map(function(stream, i) { 4149 var reading = i < streams.length - 1; 4150 return destroyer(stream, reading, i > 0, function(err) { 4151 if (!error) error = err; 4152 if (err) destroys.forEach(call); 4153 if (reading) return; 4154 destroys.forEach(call); 4155 callback(error); 4156 }); 4157 }); 4158 return streams.reduce(pipe); 4159 } 4160 module.exports = pipeline; 4161})); 4162//#endregion 4163//#region node_modules/hash-base/node_modules/readable-stream/readable-browser.js 4164var require_readable_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4165 exports = module.exports = require__stream_readable$2(); 4166 exports.Stream = exports; 4167 exports.Readable = exports; 4168 exports.Writable = require__stream_writable$2(); 4169 exports.Duplex = require__stream_duplex$2(); 4170 exports.Transform = require__stream_transform$2(); 4171 exports.PassThrough = require__stream_passthrough$2(); 4172 exports.finished = require_end_of_stream$1(); 4173 exports.pipeline = require_pipeline$1(); 4174})); 4175//#endregion 4176//#region node_modules/hash-base/index.js 4177var require_hash_base$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4178 var Buffer = require_safe_buffer$2().Buffer; 4179 var Transform = require_readable_browser$1().Transform; 4180 var inherits = require_inherits_browser(); 4181 function throwIfNotStringOrBuffer(val, prefix) { 4182 if (!Buffer.isBuffer(val) && typeof val !== "string") throw new TypeError(prefix + " must be a string or a buffer"); 4183 } 4184 function HashBase(blockSize) { 4185 Transform.call(this); 4186 this._block = Buffer.allocUnsafe(blockSize); 4187 this._blockSize = blockSize; 4188 this._blockOffset = 0; 4189 this._length = [ 4190 0, 4191 0, 4192 0, 4193 0 4194 ]; 4195 this._finalized = false; 4196 } 4197 inherits(HashBase, Transform); 4198 HashBase.prototype._transform = function(chunk, encoding, callback) { 4199 var error = null; 4200 try { 4201 this.update(chunk, encoding); 4202 } catch (err) { 4203 error = err; 4204 } 4205 callback(error); 4206 }; 4207 HashBase.prototype._flush = function(callback) { 4208 var error = null; 4209 try { 4210 this.push(this.digest()); 4211 } catch (err) { 4212 error = err; 4213 } 4214 callback(error); 4215 }; 4216 HashBase.prototype.update = function(data, encoding) { 4217 throwIfNotStringOrBuffer(data, "Data"); 4218 if (this._finalized) throw new Error("Digest already called"); 4219 if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding); 4220 var block = this._block; 4221 var offset = 0; 4222 while (this._blockOffset + data.length - offset >= this._blockSize) { 4223 for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]; 4224 this._update(); 4225 this._blockOffset = 0; 4226 } 4227 while (offset < data.length) block[this._blockOffset++] = data[offset++]; 4228 for (var j = 0, carry = data.length * 8; carry > 0; ++j) { 4229 this._length[j] += carry; 4230 carry = this._length[j] / 4294967296 | 0; 4231 if (carry > 0) this._length[j] -= 4294967296 * carry; 4232 } 4233 return this; 4234 }; 4235 HashBase.prototype._update = function() { 4236 throw new Error("_update is not implemented"); 4237 }; 4238 HashBase.prototype.digest = function(encoding) { 4239 if (this._finalized) throw new Error("Digest already called"); 4240 this._finalized = true; 4241 var digest = this._digest(); 4242 if (encoding !== void 0) digest = digest.toString(encoding); 4243 this._block.fill(0); 4244 this._blockOffset = 0; 4245 for (var i = 0; i < 4; ++i) this._length[i] = 0; 4246 return digest; 4247 }; 4248 HashBase.prototype._digest = function() { 4249 throw new Error("_digest is not implemented"); 4250 }; 4251 module.exports = HashBase; 4252})); 4253//#endregion 4254//#region node_modules/md5.js/index.js 4255var require_md5_js = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4256 var inherits = require_inherits_browser(); 4257 var HashBase = require_hash_base$1(); 4258 var Buffer = require_safe_buffer$2().Buffer; 4259 var ARRAY16 = new Array(16); 4260 function MD5() { 4261 HashBase.call(this, 64); 4262 this._a = 1732584193; 4263 this._b = 4023233417; 4264 this._c = 2562383102; 4265 this._d = 271733878; 4266 } 4267 inherits(MD5, HashBase); 4268 MD5.prototype._update = function() { 4269 var M = ARRAY16; 4270 for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4); 4271 var a = this._a; 4272 var b = this._b; 4273 var c = this._c; 4274 var d = this._d; 4275 a = fnF(a, b, c, d, M[0], 3614090360, 7); 4276 d = fnF(d, a, b, c, M[1], 3905402710, 12); 4277 c = fnF(c, d, a, b, M[2], 606105819, 17); 4278 b = fnF(b, c, d, a, M[3], 3250441966, 22); 4279 a = fnF(a, b, c, d, M[4], 4118548399, 7); 4280 d = fnF(d, a, b, c, M[5], 1200080426, 12); 4281 c = fnF(c, d, a, b, M[6], 2821735955, 17); 4282 b = fnF(b, c, d, a, M[7], 4249261313, 22); 4283 a = fnF(a, b, c, d, M[8], 1770035416, 7); 4284 d = fnF(d, a, b, c, M[9], 2336552879, 12); 4285 c = fnF(c, d, a, b, M[10], 4294925233, 17); 4286 b = fnF(b, c, d, a, M[11], 2304563134, 22); 4287 a = fnF(a, b, c, d, M[12], 1804603682, 7); 4288 d = fnF(d, a, b, c, M[13], 4254626195, 12); 4289 c = fnF(c, d, a, b, M[14], 2792965006, 17); 4290 b = fnF(b, c, d, a, M[15], 1236535329, 22); 4291 a = fnG(a, b, c, d, M[1], 4129170786, 5); 4292 d = fnG(d, a, b, c, M[6], 3225465664, 9); 4293 c = fnG(c, d, a, b, M[11], 643717713, 14); 4294 b = fnG(b, c, d, a, M[0], 3921069994, 20); 4295 a = fnG(a, b, c, d, M[5], 3593408605, 5); 4296 d = fnG(d, a, b, c, M[10], 38016083, 9); 4297 c = fnG(c, d, a, b, M[15], 3634488961, 14); 4298 b = fnG(b, c, d, a, M[4], 3889429448, 20); 4299 a = fnG(a, b, c, d, M[9], 568446438, 5); 4300 d = fnG(d, a, b, c, M[14], 3275163606, 9); 4301 c = fnG(c, d, a, b, M[3], 4107603335, 14); 4302 b = fnG(b, c, d, a, M[8], 1163531501, 20); 4303 a = fnG(a, b, c, d, M[13], 2850285829, 5); 4304 d = fnG(d, a, b, c, M[2], 4243563512, 9); 4305 c = fnG(c, d, a, b, M[7], 1735328473, 14); 4306 b = fnG(b, c, d, a, M[12], 2368359562, 20); 4307 a = fnH(a, b, c, d, M[5], 4294588738, 4); 4308 d = fnH(d, a, b, c, M[8], 2272392833, 11); 4309 c = fnH(c, d, a, b, M[11], 1839030562, 16); 4310 b = fnH(b, c, d, a, M[14], 4259657740, 23); 4311 a = fnH(a, b, c, d, M[1], 2763975236, 4); 4312 d = fnH(d, a, b, c, M[4], 1272893353, 11); 4313 c = fnH(c, d, a, b, M[7], 4139469664, 16); 4314 b = fnH(b, c, d, a, M[10], 3200236656, 23); 4315 a = fnH(a, b, c, d, M[13], 681279174, 4); 4316 d = fnH(d, a, b, c, M[0], 3936430074, 11); 4317 c = fnH(c, d, a, b, M[3], 3572445317, 16); 4318 b = fnH(b, c, d, a, M[6], 76029189, 23); 4319 a = fnH(a, b, c, d, M[9], 3654602809, 4); 4320 d = fnH(d, a, b, c, M[12], 3873151461, 11); 4321 c = fnH(c, d, a, b, M[15], 530742520, 16); 4322 b = fnH(b, c, d, a, M[2], 3299628645, 23); 4323 a = fnI(a, b, c, d, M[0], 4096336452, 6); 4324 d = fnI(d, a, b, c, M[7], 1126891415, 10); 4325 c = fnI(c, d, a, b, M[14], 2878612391, 15); 4326 b = fnI(b, c, d, a, M[5], 4237533241, 21); 4327 a = fnI(a, b, c, d, M[12], 1700485571, 6); 4328 d = fnI(d, a, b, c, M[3], 2399980690, 10); 4329 c = fnI(c, d, a, b, M[10], 4293915773, 15); 4330 b = fnI(b, c, d, a, M[1], 2240044497, 21); 4331 a = fnI(a, b, c, d, M[8], 1873313359, 6); 4332 d = fnI(d, a, b, c, M[15], 4264355552, 10); 4333 c = fnI(c, d, a, b, M[6], 2734768916, 15); 4334 b = fnI(b, c, d, a, M[13], 1309151649, 21); 4335 a = fnI(a, b, c, d, M[4], 4149444226, 6); 4336 d = fnI(d, a, b, c, M[11], 3174756917, 10); 4337 c = fnI(c, d, a, b, M[2], 718787259, 15); 4338 b = fnI(b, c, d, a, M[9], 3951481745, 21); 4339 this._a = this._a + a | 0; 4340 this._b = this._b + b | 0; 4341 this._c = this._c + c | 0; 4342 this._d = this._d + d | 0; 4343 }; 4344 MD5.prototype._digest = function() { 4345 this._block[this._blockOffset++] = 128; 4346 if (this._blockOffset > 56) { 4347 this._block.fill(0, this._blockOffset, 64); 4348 this._update(); 4349 this._blockOffset = 0; 4350 } 4351 this._block.fill(0, this._blockOffset, 56); 4352 this._block.writeUInt32LE(this._length[0], 56); 4353 this._block.writeUInt32LE(this._length[1], 60); 4354 this._update(); 4355 var buffer = Buffer.allocUnsafe(16); 4356 buffer.writeInt32LE(this._a, 0); 4357 buffer.writeInt32LE(this._b, 4); 4358 buffer.writeInt32LE(this._c, 8); 4359 buffer.writeInt32LE(this._d, 12); 4360 return buffer; 4361 }; 4362 function rotl(x, n) { 4363 return x << n | x >>> 32 - n; 4364 } 4365 function fnF(a, b, c, d, m, k, s) { 4366 return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0; 4367 } 4368 function fnG(a, b, c, d, m, k, s) { 4369 return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0; 4370 } 4371 function fnH(a, b, c, d, m, k, s) { 4372 return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0; 4373 } 4374 function fnI(a, b, c, d, m, k, s) { 4375 return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0; 4376 } 4377 module.exports = MD5; 4378})); 4379//#endregion 4380//#region node_modules/ripemd160/index.js 4381var require_ripemd160$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4382 var Buffer = require_buffer$1().Buffer; 4383 var inherits = require_inherits_browser(); 4384 var HashBase = require_hash_base$1(); 4385 var ARRAY16 = new Array(16); 4386 var zl = [ 4387 0, 4388 1, 4389 2, 4390 3, 4391 4, 4392 5, 4393 6, 4394 7, 4395 8, 4396 9, 4397 10, 4398 11, 4399 12, 4400 13, 4401 14, 4402 15, 4403 7, 4404 4, 4405 13, 4406 1, 4407 10, 4408 6, 4409 15, 4410 3, 4411 12, 4412 0, 4413 9, 4414 5, 4415 2, 4416 14, 4417 11, 4418 8, 4419 3, 4420 10, 4421 14, 4422 4, 4423 9, 4424 15, 4425 8, 4426 1, 4427 2, 4428 7, 4429 0, 4430 6, 4431 13, 4432 11, 4433 5, 4434 12, 4435 1, 4436 9, 4437 11, 4438 10, 4439 0, 4440 8, 4441 12, 4442 4, 4443 13, 4444 3, 4445 7, 4446 15, 4447 14, 4448 5, 4449 6, 4450 2, 4451 4, 4452 0, 4453 5, 4454 9, 4455 7, 4456 12, 4457 2, 4458 10, 4459 14, 4460 1, 4461 3, 4462 8, 4463 11, 4464 6, 4465 15, 4466 13 4467 ]; 4468 var zr = [ 4469 5, 4470 14, 4471 7, 4472 0, 4473 9, 4474 2, 4475 11, 4476 4, 4477 13, 4478 6, 4479 15, 4480 8, 4481 1, 4482 10, 4483 3, 4484 12, 4485 6, 4486 11, 4487 3, 4488 7, 4489 0, 4490 13, 4491 5, 4492 10, 4493 14, 4494 15, 4495 8, 4496 12, 4497 4, 4498 9, 4499 1, 4500 2, 4501 15, 4502 5, 4503 1, 4504 3, 4505 7, 4506 14, 4507 6, 4508 9, 4509 11, 4510 8, 4511 12, 4512 2, 4513 10, 4514 0, 4515 4, 4516 13, 4517 8, 4518 6, 4519 4, 4520 1, 4521 3, 4522 11, 4523 15, 4524 0, 4525 5, 4526 12, 4527 2, 4528 13, 4529 9, 4530 7, 4531 10, 4532 14, 4533 12, 4534 15, 4535 10, 4536 4, 4537 1, 4538 5, 4539 8, 4540 7, 4541 6, 4542 2, 4543 13, 4544 14, 4545 0, 4546 3, 4547 9, 4548 11 4549 ]; 4550 var sl = [ 4551 11, 4552 14, 4553 15, 4554 12, 4555 5, 4556 8, 4557 7, 4558 9, 4559 11, 4560 13, 4561 14, 4562 15, 4563 6, 4564 7, 4565 9, 4566 8, 4567 7, 4568 6, 4569 8, 4570 13, 4571 11, 4572 9, 4573 7, 4574 15, 4575 7, 4576 12, 4577 15, 4578 9, 4579 11, 4580 7, 4581 13, 4582 12, 4583 11, 4584 13, 4585 6, 4586 7, 4587 14, 4588 9, 4589 13, 4590 15, 4591 14, 4592 8, 4593 13, 4594 6, 4595 5, 4596 12, 4597 7, 4598 5, 4599 11, 4600 12, 4601 14, 4602 15, 4603 14, 4604 15, 4605 9, 4606 8, 4607 9, 4608 14, 4609 5, 4610 6, 4611 8, 4612 6, 4613 5, 4614 12, 4615 9, 4616 15, 4617 5, 4618 11, 4619 6, 4620 8, 4621 13, 4622 12, 4623 5, 4624 12, 4625 13, 4626 14, 4627 11, 4628 8, 4629 5, 4630 6 4631 ]; 4632 var sr = [ 4633 8, 4634 9, 4635 9, 4636 11, 4637 13, 4638 15, 4639 15, 4640 5, 4641 7, 4642 7, 4643 8, 4644 11, 4645 14, 4646 14, 4647 12, 4648 6, 4649 9, 4650 13, 4651 15, 4652 7, 4653 12, 4654 8, 4655 9, 4656 11, 4657 7, 4658 7, 4659 12, 4660 7, 4661 6, 4662 15, 4663 13, 4664 11, 4665 9, 4666 7, 4667 15, 4668 11, 4669 8, 4670 6, 4671 6, 4672 14, 4673 12, 4674 13, 4675 5, 4676 14, 4677 13, 4678 13, 4679 7, 4680 5, 4681 15, 4682 5, 4683 8, 4684 11, 4685 14, 4686 14, 4687 6, 4688 14, 4689 6, 4690 9, 4691 12, 4692 9, 4693 12, 4694 5, 4695 15, 4696 8, 4697 8, 4698 5, 4699 12, 4700 9, 4701 12, 4702 5, 4703 14, 4704 6, 4705 8, 4706 13, 4707 6, 4708 5, 4709 15, 4710 13, 4711 11, 4712 11 4713 ]; 4714 var hl = [ 4715 0, 4716 1518500249, 4717 1859775393, 4718 2400959708, 4719 2840853838 4720 ]; 4721 var hr = [ 4722 1352829926, 4723 1548603684, 4724 1836072691, 4725 2053994217, 4726 0 4727 ]; 4728 function RIPEMD160() { 4729 HashBase.call(this, 64); 4730 this._a = 1732584193; 4731 this._b = 4023233417; 4732 this._c = 2562383102; 4733 this._d = 271733878; 4734 this._e = 3285377520; 4735 } 4736 inherits(RIPEMD160, HashBase); 4737 RIPEMD160.prototype._update = function() { 4738 var words = ARRAY16; 4739 for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4); 4740 var al = this._a | 0; 4741 var bl = this._b | 0; 4742 var cl = this._c | 0; 4743 var dl = this._d | 0; 4744 var el = this._e | 0; 4745 var ar = this._a | 0; 4746 var br = this._b | 0; 4747 var cr = this._c | 0; 4748 var dr = this._d | 0; 4749 var er = this._e | 0; 4750 for (var i = 0; i < 80; i += 1) { 4751 var tl; 4752 var tr; 4753 if (i < 16) { 4754 tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]); 4755 tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i]); 4756 } else if (i < 32) { 4757 tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]); 4758 tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i]); 4759 } else if (i < 48) { 4760 tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]); 4761 tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i]); 4762 } else if (i < 64) { 4763 tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]); 4764 tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i]); 4765 } else { 4766 tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]); 4767 tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i]); 4768 } 4769 al = el; 4770 el = dl; 4771 dl = rotl(cl, 10); 4772 cl = bl; 4773 bl = tl; 4774 ar = er; 4775 er = dr; 4776 dr = rotl(cr, 10); 4777 cr = br; 4778 br = tr; 4779 } 4780 var t = this._b + cl + dr | 0; 4781 this._b = this._c + dl + er | 0; 4782 this._c = this._d + el + ar | 0; 4783 this._d = this._e + al + br | 0; 4784 this._e = this._a + bl + cr | 0; 4785 this._a = t; 4786 }; 4787 RIPEMD160.prototype._digest = function() { 4788 this._block[this._blockOffset++] = 128; 4789 if (this._blockOffset > 56) { 4790 this._block.fill(0, this._blockOffset, 64); 4791 this._update(); 4792 this._blockOffset = 0; 4793 } 4794 this._block.fill(0, this._blockOffset, 56); 4795 this._block.writeUInt32LE(this._length[0], 56); 4796 this._block.writeUInt32LE(this._length[1], 60); 4797 this._update(); 4798 var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20); 4799 buffer.writeInt32LE(this._a, 0); 4800 buffer.writeInt32LE(this._b, 4); 4801 buffer.writeInt32LE(this._c, 8); 4802 buffer.writeInt32LE(this._d, 12); 4803 buffer.writeInt32LE(this._e, 16); 4804 return buffer; 4805 }; 4806 function rotl(x, n) { 4807 return x << n | x >>> 32 - n; 4808 } 4809 function fn1(a, b, c, d, e, m, k, s) { 4810 return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0; 4811 } 4812 function fn2(a, b, c, d, e, m, k, s) { 4813 return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0; 4814 } 4815 function fn3(a, b, c, d, e, m, k, s) { 4816 return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0; 4817 } 4818 function fn4(a, b, c, d, e, m, k, s) { 4819 return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0; 4820 } 4821 function fn5(a, b, c, d, e, m, k, s) { 4822 return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0; 4823 } 4824 module.exports = RIPEMD160; 4825})); 4826//#endregion 4827//#region node_modules/to-buffer/node_modules/isarray/index.js 4828var require_isarray$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4829 var toString = {}.toString; 4830 module.exports = Array.isArray || function(arr) { 4831 return toString.call(arr) == "[object Array]"; 4832 }; 4833})); 4834//#endregion 4835//#region node_modules/es-errors/type.js 4836var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4837 /** @type {import('./type')} */ 4838 module.exports = TypeError; 4839})); 4840//#endregion 4841//#region node_modules/es-object-atoms/index.js 4842var require_es_object_atoms = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4843 /** @type {import('.')} */ 4844 module.exports = Object; 4845})); 4846//#endregion 4847//#region node_modules/es-errors/index.js 4848var require_es_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4849 /** @type {import('.')} */ 4850 module.exports = Error; 4851})); 4852//#endregion 4853//#region node_modules/es-errors/eval.js 4854var require_eval = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4855 /** @type {import('./eval')} */ 4856 module.exports = EvalError; 4857})); 4858//#endregion 4859//#region node_modules/es-errors/range.js 4860var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4861 /** @type {import('./range')} */ 4862 module.exports = RangeError; 4863})); 4864//#endregion 4865//#region node_modules/es-errors/ref.js 4866var require_ref = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4867 /** @type {import('./ref')} */ 4868 module.exports = ReferenceError; 4869})); 4870//#endregion 4871//#region node_modules/es-errors/syntax.js 4872var require_syntax = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4873 /** @type {import('./syntax')} */ 4874 module.exports = SyntaxError; 4875})); 4876//#endregion 4877//#region node_modules/es-errors/uri.js 4878var require_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4879 /** @type {import('./uri')} */ 4880 module.exports = URIError; 4881})); 4882//#endregion 4883//#region node_modules/math-intrinsics/abs.js 4884var require_abs = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4885 /** @type {import('./abs')} */ 4886 module.exports = Math.abs; 4887})); 4888//#endregion 4889//#region node_modules/math-intrinsics/floor.js 4890var require_floor = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4891 /** @type {import('./floor')} */ 4892 module.exports = Math.floor; 4893})); 4894//#endregion 4895//#region node_modules/math-intrinsics/max.js 4896var require_max = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4897 /** @type {import('./max')} */ 4898 module.exports = Math.max; 4899})); 4900//#endregion 4901//#region node_modules/math-intrinsics/min.js 4902var require_min = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4903 /** @type {import('./min')} */ 4904 module.exports = Math.min; 4905})); 4906//#endregion 4907//#region node_modules/math-intrinsics/pow.js 4908var require_pow = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4909 /** @type {import('./pow')} */ 4910 module.exports = Math.pow; 4911})); 4912//#endregion 4913//#region node_modules/math-intrinsics/round.js 4914var require_round = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4915 /** @type {import('./round')} */ 4916 module.exports = Math.round; 4917})); 4918//#endregion 4919//#region node_modules/math-intrinsics/isNaN.js 4920var require_isNaN = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4921 /** @type {import('./isNaN')} */ 4922 module.exports = Number.isNaN || function isNaN(a) { 4923 return a !== a; 4924 }; 4925})); 4926//#endregion 4927//#region node_modules/math-intrinsics/sign.js 4928var require_sign$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4929 var $isNaN = require_isNaN(); 4930 /** @type {import('./sign')} */ 4931 module.exports = function sign(number) { 4932 if ($isNaN(number) || number === 0) return number; 4933 return number < 0 ? -1 : 1; 4934 }; 4935})); 4936//#endregion 4937//#region node_modules/gopd/gOPD.js 4938var require_gOPD = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4939 /** @type {import('./gOPD')} */ 4940 module.exports = Object.getOwnPropertyDescriptor; 4941})); 4942//#endregion 4943//#region node_modules/gopd/index.js 4944var require_gopd = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4945 /** @type {import('.')} */ 4946 var $gOPD = require_gOPD(); 4947 if ($gOPD) try { 4948 $gOPD([], "length"); 4949 } catch (e) { 4950 $gOPD = null; 4951 } 4952 module.exports = $gOPD; 4953})); 4954//#endregion 4955//#region node_modules/es-define-property/index.js 4956var require_es_define_property = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4957 /** @type {import('.')} */ 4958 var $defineProperty = Object.defineProperty || false; 4959 if ($defineProperty) try { 4960 $defineProperty({}, "a", { value: 1 }); 4961 } catch (e) { 4962 $defineProperty = false;
vendor: 8,901 bytes, lines 4963-5180
4963 } 4964 module.exports = $defineProperty; 4965})); 4966//#endregion 4967//#region node_modules/has-symbols/shams.js 4968var require_shams$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4969 /** @type {import('./shams')} */ 4970 module.exports = function hasSymbols() { 4971 if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") return false; 4972 if (typeof Symbol.iterator === "symbol") return true; 4973 /** @type {{ [k in symbol]?: unknown }} */ 4974 var obj = {}; 4975 var sym = Symbol("test"); 4976 var symObj = Object(sym); 4977 if (typeof sym === "string") return false; 4978 if (Object.prototype.toString.call(sym) !== "[object Symbol]") return false; 4979 if (Object.prototype.toString.call(symObj) !== "[object Symbol]") return false; 4980 var symVal = 42; 4981 obj[sym] = symVal; 4982 for (var _ in obj) return false; 4983 if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) return false; 4984 if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) return false; 4985 var syms = Object.getOwnPropertySymbols(obj); 4986 if (syms.length !== 1 || syms[0] !== sym) return false; 4987 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false; 4988 if (typeof Object.getOwnPropertyDescriptor === "function") { 4989 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 4990 if (descriptor.value !== symVal || descriptor.enumerable !== true) return false; 4991 } 4992 return true; 4993 }; 4994})); 4995//#endregion 4996//#region node_modules/has-symbols/index.js 4997var require_has_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => { 4998 var origSymbol = typeof Symbol !== "undefined" && Symbol; 4999 var hasSymbolSham = require_shams$1(); 5000 /** @type {import('.')} */ 5001 module.exports = function hasNativeSymbols() { 5002 if (typeof origSymbol !== "function") return false; 5003 if (typeof Symbol !== "function") return false; 5004 if (typeof origSymbol("foo") !== "symbol") return false; 5005 if (typeof Symbol("bar") !== "symbol") return false; 5006 return hasSymbolSham(); 5007 }; 5008})); 5009//#endregion 5010//#region node_modules/get-proto/Reflect.getPrototypeOf.js 5011var require_Reflect_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5012 /** @type {import('./Reflect.getPrototypeOf')} */ 5013 module.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; 5014})); 5015//#endregion 5016//#region node_modules/get-proto/Object.getPrototypeOf.js 5017var require_Object_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5018 /** @type {import('./Object.getPrototypeOf')} */ 5019 module.exports = require_es_object_atoms().getPrototypeOf || null; 5020})); 5021//#endregion 5022//#region node_modules/function-bind/implementation.js 5023var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5024 var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; 5025 var toStr = Object.prototype.toString; 5026 var max = Math.max; 5027 var funcType = "[object Function]"; 5028 var concatty = function concatty(a, b) { 5029 var arr = []; 5030 for (var i = 0; i < a.length; i += 1) arr[i] = a[i]; 5031 for (var j = 0; j < b.length; j += 1) arr[j + a.length] = b[j]; 5032 return arr; 5033 }; 5034 var slicy = function slicy(arrLike, offset) { 5035 var arr = []; 5036 for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) arr[j] = arrLike[i]; 5037 return arr; 5038 }; 5039 var joiny = function(arr, joiner) { 5040 var str = ""; 5041 for (var i = 0; i < arr.length; i += 1) { 5042 str += arr[i]; 5043 if (i + 1 < arr.length) str += joiner; 5044 } 5045 return str; 5046 }; 5047 module.exports = function bind(that) { 5048 var target = this; 5049 if (typeof target !== "function" || toStr.apply(target) !== funcType) throw new TypeError(ERROR_MESSAGE + target); 5050 var args = slicy(arguments, 1); 5051 var bound; 5052 var binder = function() { 5053 if (this instanceof bound) { 5054 var result = target.apply(this, concatty(args, arguments)); 5055 if (Object(result) === result) return result; 5056 return this; 5057 } 5058 return target.apply(that, concatty(args, arguments)); 5059 }; 5060 var boundLength = max(0, target.length - args.length); 5061 var boundArgs = []; 5062 for (var i = 0; i < boundLength; i++) boundArgs[i] = "$" + i; 5063 bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); 5064 if (target.prototype) { 5065 var Empty = function Empty() {}; 5066 Empty.prototype = target.prototype; 5067 bound.prototype = new Empty(); 5068 Empty.prototype = null; 5069 } 5070 return bound; 5071 }; 5072})); 5073//#endregion 5074//#region node_modules/function-bind/index.js 5075var require_function_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5076 var implementation = require_implementation(); 5077 module.exports = Function.prototype.bind || implementation; 5078})); 5079//#endregion 5080//#region node_modules/call-bind-apply-helpers/functionCall.js 5081var require_functionCall = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5082 /** @type {import('./functionCall')} */ 5083 module.exports = Function.prototype.call; 5084})); 5085//#endregion 5086//#region node_modules/call-bind-apply-helpers/functionApply.js 5087var require_functionApply = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5088 /** @type {import('./functionApply')} */ 5089 module.exports = Function.prototype.apply; 5090})); 5091//#endregion 5092//#region node_modules/call-bind-apply-helpers/reflectApply.js 5093var require_reflectApply = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5094 /** @type {import('./reflectApply')} */ 5095 module.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; 5096})); 5097//#endregion 5098//#region node_modules/call-bind-apply-helpers/actualApply.js 5099var require_actualApply = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5100 var bind = require_function_bind(); 5101 var $apply = require_functionApply(); 5102 var $call = require_functionCall(); 5103 /** @type {import('./actualApply')} */ 5104 module.exports = require_reflectApply() || bind.call($call, $apply); 5105})); 5106//#endregion 5107//#region node_modules/call-bind-apply-helpers/index.js 5108var require_call_bind_apply_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5109 var bind = require_function_bind(); 5110 var $TypeError = require_type(); 5111 var $call = require_functionCall(); 5112 var $actualApply = require_actualApply(); 5113 /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ 5114 module.exports = function callBindBasic(args) { 5115 if (args.length < 1 || typeof args[0] !== "function") throw new $TypeError("a function is required"); 5116 return $actualApply(bind, $call, args); 5117 }; 5118})); 5119//#endregion 5120//#region node_modules/dunder-proto/get.js 5121var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5122 var callBind = require_call_bind_apply_helpers(); 5123 var gOPD = require_gopd(); 5124 var hasProtoAccessor; 5125 try { 5126 hasProtoAccessor = [].__proto__ === Array.prototype; 5127 } catch (e) { 5128 if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") throw e; 5129 } 5130 var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, "__proto__"); 5131 var $Object = Object; 5132 var $getPrototypeOf = $Object.getPrototypeOf; 5133 /** @type {import('./get')} */ 5134 module.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? function getDunder(value) { 5135 return $getPrototypeOf(value == null ? value : $Object(value)); 5136 } : false; 5137})); 5138//#endregion 5139//#region node_modules/get-proto/index.js 5140var require_get_proto = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5141 var reflectGetProto = require_Reflect_getPrototypeOf(); 5142 var originalGetProto = require_Object_getPrototypeOf(); 5143 var getDunderProto = require_get(); 5144 /** @type {import('.')} */ 5145 module.exports = reflectGetProto ? function getProto(O) { 5146 return reflectGetProto(O); 5147 } : originalGetProto ? function getProto(O) { 5148 if (!O || typeof O !== "object" && typeof O !== "function") throw new TypeError("getProto: not an object"); 5149 return originalGetProto(O); 5150 } : getDunderProto ? function getProto(O) { 5151 return getDunderProto(O); 5152 } : null; 5153})); 5154//#endregion 5155//#region node_modules/hasown/index.js 5156var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5157 var call = Function.prototype.call; 5158 var $hasOwn = Object.prototype.hasOwnProperty; 5159 /** @type {import('.')} */ 5160 module.exports = require_function_bind().call(call, $hasOwn); 5161})); 5162//#endregion 5163//#region node_modules/get-intrinsic/index.js 5164var require_get_intrinsic = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5165 var undefined; 5166 var $Object = require_es_object_atoms(); 5167 var $Error = require_es_errors(); 5168 var $EvalError = require_eval(); 5169 var $RangeError = require_range(); 5170 var $ReferenceError = require_ref(); 5171 var $SyntaxError = require_syntax(); 5172 var $TypeError = require_type(); 5173 var $URIError = require_uri(); 5174 var abs = require_abs(); 5175 var floor = require_floor(); 5176 var max = require_max(); 5177 var min = require_min(); 5178 var pow = require_pow(); 5179 var round = require_round(); 5180 var sign = require_sign$1
vendor: 13,556 bytes, lines 5180-5503
5180(); 5181 var $Function = Function; 5182 var getEvalledConstructor = function(expressionSyntax) { 5183 try { 5184 return $Function("\"use strict\"; return (" + expressionSyntax + ").constructor;")(); 5185 } catch (e) {} 5186 }; 5187 var $gOPD = require_gopd(); 5188 var $defineProperty = require_es_define_property(); 5189 var throwTypeError = function() { 5190 throw new $TypeError(); 5191 }; 5192 var ThrowTypeError = $gOPD ? function() { 5193 try { 5194 arguments.callee; 5195 return throwTypeError; 5196 } catch (calleeThrows) { 5197 try { 5198 return $gOPD(arguments, "callee").get; 5199 } catch (gOPDthrows) { 5200 return throwTypeError; 5201 } 5202 } 5203 }() : throwTypeError; 5204 var hasSymbols = require_has_symbols()(); 5205 var getProto = require_get_proto(); 5206 var $ObjectGPO = require_Object_getPrototypeOf(); 5207 var $ReflectGPO = require_Reflect_getPrototypeOf(); 5208 var $apply = require_functionApply(); 5209 var $call = require_functionCall(); 5210 var needsEval = {}; 5211 var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined : getProto(Uint8Array); 5212 var INTRINSICS = { 5213 __proto__: null, 5214 "%AggregateError%": typeof AggregateError === "undefined" ? undefined : AggregateError, 5215 "%Array%": Array, 5216 "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined : ArrayBuffer, 5217 "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, 5218 "%AsyncFromSyncIteratorPrototype%": undefined, 5219 "%AsyncFunction%": needsEval, 5220 "%AsyncGenerator%": needsEval, 5221 "%AsyncGeneratorFunction%": needsEval, 5222 "%AsyncIteratorPrototype%": needsEval, 5223 "%Atomics%": typeof Atomics === "undefined" ? undefined : Atomics, 5224 "%BigInt%": typeof BigInt === "undefined" ? undefined : BigInt, 5225 "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined : BigInt64Array, 5226 "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined : BigUint64Array, 5227 "%Boolean%": Boolean, 5228 "%DataView%": typeof DataView === "undefined" ? undefined : DataView, 5229 "%Date%": Date, 5230 "%decodeURI%": decodeURI, 5231 "%decodeURIComponent%": decodeURIComponent, 5232 "%encodeURI%": encodeURI, 5233 "%encodeURIComponent%": encodeURIComponent, 5234 "%Error%": $Error, 5235 "%eval%": eval, 5236 "%EvalError%": $EvalError, 5237 "%Float16Array%": typeof Float16Array === "undefined" ? undefined : Float16Array, 5238 "%Float32Array%": typeof Float32Array === "undefined" ? undefined : Float32Array, 5239 "%Float64Array%": typeof Float64Array === "undefined" ? undefined : Float64Array, 5240 "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined : FinalizationRegistry, 5241 "%Function%": $Function, 5242 "%GeneratorFunction%": needsEval, 5243 "%Int8Array%": typeof Int8Array === "undefined" ? undefined : Int8Array, 5244 "%Int16Array%": typeof Int16Array === "undefined" ? undefined : Int16Array, 5245 "%Int32Array%": typeof Int32Array === "undefined" ? undefined : Int32Array, 5246 "%isFinite%": isFinite, 5247 "%isNaN%": isNaN, 5248 "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, 5249 "%JSON%": typeof JSON === "object" ? JSON : undefined, 5250 "%Map%": typeof Map === "undefined" ? undefined : Map, 5251 "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), 5252 "%Math%": Math, 5253 "%Number%": Number, 5254 "%Object%": $Object, 5255 "%Object.getOwnPropertyDescriptor%": $gOPD, 5256 "%parseFloat%": parseFloat, 5257 "%parseInt%": parseInt, 5258 "%Promise%": typeof Promise === "undefined" ? undefined : Promise, 5259 "%Proxy%": typeof Proxy === "undefined" ? undefined : Proxy, 5260 "%RangeError%": $RangeError, 5261 "%ReferenceError%": $ReferenceError, 5262 "%Reflect%": typeof Reflect === "undefined" ? undefined : Reflect, 5263 "%RegExp%": RegExp, 5264 "%Set%": typeof Set === "undefined" ? undefined : Set, 5265 "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), 5266 "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined : SharedArrayBuffer, 5267 "%String%": String, 5268 "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined, 5269 "%Symbol%": hasSymbols ? Symbol : undefined, 5270 "%SyntaxError%": $SyntaxError, 5271 "%ThrowTypeError%": ThrowTypeError, 5272 "%TypedArray%": TypedArray, 5273 "%TypeError%": $TypeError, 5274 "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined : Uint8Array, 5275 "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined : Uint8ClampedArray, 5276 "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined : Uint16Array, 5277 "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined : Uint32Array, 5278 "%URIError%": $URIError, 5279 "%WeakMap%": typeof WeakMap === "undefined" ? undefined : WeakMap, 5280 "%WeakRef%": typeof WeakRef === "undefined" ? undefined : WeakRef, 5281 "%WeakSet%": typeof WeakSet === "undefined" ? undefined : WeakSet, 5282 "%Function.prototype.call%": $call, 5283 "%Function.prototype.apply%": $apply, 5284 "%Object.defineProperty%": $defineProperty, 5285 "%Object.getPrototypeOf%": $ObjectGPO, 5286 "%Math.abs%": abs, 5287 "%Math.floor%": floor, 5288 "%Math.max%": max, 5289 "%Math.min%": min, 5290 "%Math.pow%": pow, 5291 "%Math.round%": round, 5292 "%Math.sign%": sign, 5293 "%Reflect.getPrototypeOf%": $ReflectGPO 5294 }; 5295 if (getProto) try { 5296 null.error; 5297 } catch (e) { 5298 INTRINSICS["%Error.prototype%"] = getProto(getProto(e)); 5299 } 5300 var doEval = function doEval(name) { 5301 var value; 5302 if (name === "%AsyncFunction%") value = getEvalledConstructor("async function () {}"); 5303 else if (name === "%GeneratorFunction%") value = getEvalledConstructor("function* () {}"); 5304 else if (name === "%AsyncGeneratorFunction%") value = getEvalledConstructor("async function* () {}"); 5305 else if (name === "%AsyncGenerator%") { 5306 var fn = doEval("%AsyncGeneratorFunction%"); 5307 if (fn) value = fn.prototype; 5308 } else if (name === "%AsyncIteratorPrototype%") { 5309 var gen = doEval("%AsyncGenerator%"); 5310 if (gen && getProto) value = getProto(gen.prototype); 5311 } 5312 INTRINSICS[name] = value; 5313 return value; 5314 }; 5315 var LEGACY_ALIASES = { 5316 __proto__: null, 5317 "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], 5318 "%ArrayPrototype%": ["Array", "prototype"], 5319 "%ArrayProto_entries%": [ 5320 "Array", 5321 "prototype", 5322 "entries" 5323 ], 5324 "%ArrayProto_forEach%": [ 5325 "Array", 5326 "prototype", 5327 "forEach" 5328 ], 5329 "%ArrayProto_keys%": [ 5330 "Array", 5331 "prototype", 5332 "keys" 5333 ], 5334 "%ArrayProto_values%": [ 5335 "Array", 5336 "prototype", 5337 "values" 5338 ], 5339 "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], 5340 "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], 5341 "%AsyncGeneratorPrototype%": [ 5342 "AsyncGeneratorFunction", 5343 "prototype", 5344 "prototype" 5345 ], 5346 "%BooleanPrototype%": ["Boolean", "prototype"], 5347 "%DataViewPrototype%": ["DataView", "prototype"], 5348 "%DatePrototype%": ["Date", "prototype"], 5349 "%ErrorPrototype%": ["Error", "prototype"], 5350 "%EvalErrorPrototype%": ["EvalError", "prototype"], 5351 "%Float32ArrayPrototype%": ["Float32Array", "prototype"], 5352 "%Float64ArrayPrototype%": ["Float64Array", "prototype"], 5353 "%FunctionPrototype%": ["Function", "prototype"], 5354 "%Generator%": ["GeneratorFunction", "prototype"], 5355 "%GeneratorPrototype%": [ 5356 "GeneratorFunction", 5357 "prototype", 5358 "prototype" 5359 ], 5360 "%Int8ArrayPrototype%": ["Int8Array", "prototype"], 5361 "%Int16ArrayPrototype%": ["Int16Array", "prototype"], 5362 "%Int32ArrayPrototype%": ["Int32Array", "prototype"], 5363 "%JSONParse%": ["JSON", "parse"], 5364 "%JSONStringify%": ["JSON", "stringify"], 5365 "%MapPrototype%": ["Map", "prototype"], 5366 "%NumberPrototype%": ["Number", "prototype"], 5367 "%ObjectPrototype%": ["Object", "prototype"], 5368 "%ObjProto_toString%": [ 5369 "Object", 5370 "prototype", 5371 "toString" 5372 ], 5373 "%ObjProto_valueOf%": [ 5374 "Object", 5375 "prototype", 5376 "valueOf" 5377 ], 5378 "%PromisePrototype%": ["Promise", "prototype"], 5379 "%PromiseProto_then%": [ 5380 "Promise", 5381 "prototype", 5382 "then" 5383 ], 5384 "%Promise_all%": ["Promise", "all"], 5385 "%Promise_reject%": ["Promise", "reject"], 5386 "%Promise_resolve%": ["Promise", "resolve"], 5387 "%RangeErrorPrototype%": ["RangeError", "prototype"], 5388 "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], 5389 "%RegExpPrototype%": ["RegExp", "prototype"], 5390 "%SetPrototype%": ["Set", "prototype"], 5391 "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], 5392 "%StringPrototype%": ["String", "prototype"], 5393 "%SymbolPrototype%": ["Symbol", "prototype"], 5394 "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], 5395 "%TypedArrayPrototype%": ["TypedArray", "prototype"], 5396 "%TypeErrorPrototype%": ["TypeError", "prototype"], 5397 "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], 5398 "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], 5399 "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], 5400 "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], 5401 "%URIErrorPrototype%": ["URIError", "prototype"], 5402 "%WeakMapPrototype%": ["WeakMap", "prototype"], 5403 "%WeakSetPrototype%": ["WeakSet", "prototype"] 5404 }; 5405 var bind = require_function_bind(); 5406 var hasOwn = require_hasown(); 5407 var $concat = bind.call($call, Array.prototype.concat); 5408 var $spliceApply = bind.call($apply, Array.prototype.splice); 5409 var $replace = bind.call($call, String.prototype.replace); 5410 var $strSlice = bind.call($call, String.prototype.slice); 5411 var $exec = bind.call($call, RegExp.prototype.exec); 5412 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 5413 var reEscapeChar = /\\(\\)?/g; 5414 var stringToPath = function stringToPath(string) { 5415 var first = $strSlice(string, 0, 1); 5416 var last = $strSlice(string, -1); 5417 if (first === "%" && last !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); 5418 else if (last === "%" && first !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); 5419 var result = []; 5420 $replace(string, rePropName, function(match, number, quote, subString) { 5421 result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; 5422 }); 5423 return result; 5424 }; 5425 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 5426 var intrinsicName = name; 5427 var alias; 5428 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 5429 alias = LEGACY_ALIASES[intrinsicName]; 5430 intrinsicName = "%" + alias[0] + "%"; 5431 } 5432 if (hasOwn(INTRINSICS, intrinsicName)) { 5433 var value = INTRINSICS[intrinsicName]; 5434 if (value === needsEval) value = doEval(intrinsicName); 5435 if (typeof value === "undefined" && !allowMissing) throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); 5436 return { 5437 alias, 5438 name: intrinsicName, 5439 value 5440 }; 5441 } 5442 throw new $SyntaxError("intrinsic " + name + " does not exist!"); 5443 }; 5444 module.exports = function GetIntrinsic(name, allowMissing) { 5445 if (typeof name !== "string" || name.length === 0) throw new $TypeError("intrinsic name must be a non-empty string"); 5446 if (arguments.length > 1 && typeof allowMissing !== "boolean") throw new $TypeError("\"allowMissing\" argument must be a boolean"); 5447 if ($exec(/^%?[^%]*%?$/, name) === null) throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); 5448 var parts = stringToPath(name); 5449 var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; 5450 var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); 5451 var intrinsicRealName = intrinsic.name; 5452 var value = intrinsic.value; 5453 var skipFurtherCaching = false; 5454 var alias = intrinsic.alias; 5455 if (alias) { 5456 intrinsicBaseName = alias[0]; 5457 $spliceApply(parts, $concat([0, 1], alias)); 5458 } 5459 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 5460 var part = parts[i]; 5461 var first = $strSlice(part, 0, 1); 5462 var last = $strSlice(part, -1); 5463 if ((first === "\"" || first === "'" || first === "`" || last === "\"" || last === "'" || last === "`") && first !== last) throw new $SyntaxError("property names with quotes must have matching quotes"); 5464 if (part === "constructor" || !isOwn) skipFurtherCaching = true; 5465 intrinsicBaseName += "." + part; 5466 intrinsicRealName = "%" + intrinsicBaseName + "%"; 5467 if (hasOwn(INTRINSICS, intrinsicRealName)) value = INTRINSICS[intrinsicRealName]; 5468 else if (value != null) { 5469 if (!(part in value)) { 5470 if (!allowMissing) throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); 5471 return; 5472 } 5473 if ($gOPD && i + 1 >= parts.length) { 5474 var desc = $gOPD(value, part); 5475 isOwn = !!desc; 5476 if (isOwn && "get" in desc && !("originalValue" in desc.get)) value = desc.get; 5477 else value = value[part]; 5478 } else { 5479 isOwn = hasOwn(value, part); 5480 value = value[part]; 5481 } 5482 if (isOwn && !skipFurtherCaching) INTRINSICS[intrinsicRealName] = value; 5483 } 5484 } 5485 return value; 5486 }; 5487})); 5488//#endregion 5489//#region node_modules/call-bound/index.js 5490var require_call_bound = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5491 var GetIntrinsic = require_get_intrinsic(); 5492 var callBindBasic = require_call_bind_apply_helpers(); 5493 /** @type {(thisArg: string, searchString: string, position?: number) => number} */ 5494 var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]); 5495 /** @type {import('.')} */ 5496 module.exports = function callBoundIntrinsic(name, allowMissing) { 5497 var intrinsic = GetIntrinsic(name, !!allowMissing); 5498 if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) return callBindBasic([intrinsic]); 5499 return intrinsic; 5500 }; 5501})); 5502//#endregion 5503//#region node_modules/is-
5503callable/index.js 5504var require_is_callable = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5505 var fnToStr = Function.prototype.toString; 5506 var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; 5507 var badArrayLike; 5508 var isCallableMarker; 5509 if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") try { 5510 badArrayLike = Object.defineProperty({}, "length", { get: function() { 5511 throw isCallableMarker; 5512 } }); 5513 isCallableMarker = {};
vendor: 12,707 bytes, lines 5514-5794
5514 reflectApply(function() { 5515 throw 42; 5516 }, null, badArrayLike); 5517 } catch (_) { 5518 if (_ !== isCallableMarker) reflectApply = null; 5519 } 5520 else reflectApply = null; 5521 var constructorRegex = /^\s*class\b/; 5522 var isES6ClassFn = function isES6ClassFunction(value) { 5523 try { 5524 var fnStr = fnToStr.call(value); 5525 return constructorRegex.test(fnStr); 5526 } catch (e) { 5527 return false; 5528 } 5529 }; 5530 var tryFunctionObject = function tryFunctionToStr(value) { 5531 try { 5532 if (isES6ClassFn(value)) return false; 5533 fnToStr.call(value); 5534 return true; 5535 } catch (e) { 5536 return false; 5537 } 5538 }; 5539 var toStr = Object.prototype.toString; 5540 var objectClass = "[object Object]"; 5541 var fnClass = "[object Function]"; 5542 var genClass = "[object GeneratorFunction]"; 5543 var ddaClass = "[object HTMLAllCollection]"; 5544 var ddaClass2 = "[object HTML document.all class]"; 5545 var ddaClass3 = "[object HTMLCollection]"; 5546 var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; 5547 var isIE68 = !(0 in [,]); 5548 var isDDA = function isDocumentDotAll() { 5549 return false; 5550 }; 5551 if (typeof document === "object") { 5552 var all = document.all; 5553 if (toStr.call(all) === toStr.call(document.all)) isDDA = function isDocumentDotAll(value) { 5554 if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) try { 5555 var str = toStr.call(value); 5556 return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null; 5557 } catch (e) {} 5558 return false; 5559 }; 5560 } 5561 module.exports = reflectApply ? function isCallable(value) { 5562 if (isDDA(value)) return true; 5563 if (!value) return false; 5564 if (typeof value !== "function" && typeof value !== "object") return false; 5565 try { 5566 reflectApply(value, null, badArrayLike); 5567 } catch (e) { 5568 if (e !== isCallableMarker) return false; 5569 } 5570 return !isES6ClassFn(value) && tryFunctionObject(value); 5571 } : function isCallable(value) { 5572 if (isDDA(value)) return true; 5573 if (!value) return false; 5574 if (typeof value !== "function" && typeof value !== "object") return false; 5575 if (hasToStringTag) return tryFunctionObject(value); 5576 if (isES6ClassFn(value)) return false; 5577 var strClass = toStr.call(value); 5578 if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) return false; 5579 return tryFunctionObject(value); 5580 }; 5581})); 5582//#endregion 5583//#region node_modules/for-each/index.js 5584var require_for_each = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5585 var isCallable = require_is_callable(); 5586 var toStr = Object.prototype.toString; 5587 var hasOwnProperty = Object.prototype.hasOwnProperty; 5588 /** @type {<This, A extends readonly unknown[]>(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */ 5589 var forEachArray = function forEachArray(array, iterator, receiver) { 5590 for (var i = 0, len = array.length; i < len; i++) if (hasOwnProperty.call(array, i)) if (receiver == null) iterator(array[i], i, array); 5591 else iterator.call(receiver, array[i], i, array); 5592 }; 5593 /** @type {<This, S extends string>(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */ 5594 var forEachString = function forEachString(string, iterator, receiver) { 5595 for (var i = 0, len = string.length; i < len; i++) if (receiver == null) iterator(string.charAt(i), i, string); 5596 else iterator.call(receiver, string.charAt(i), i, string); 5597 }; 5598 /** @type {<This, O>(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */ 5599 var forEachObject = function forEachObject(object, iterator, receiver) { 5600 for (var k in object) if (hasOwnProperty.call(object, k)) if (receiver == null) iterator(object[k], k, object); 5601 else iterator.call(receiver, object[k], k, object); 5602 }; 5603 /** @type {(x: unknown) => x is readonly unknown[]} */ 5604 function isArray(x) { 5605 return toStr.call(x) === "[object Array]"; 5606 } 5607 /** @type {import('.')._internal} */ 5608 module.exports = function forEach(list, iterator, thisArg) { 5609 if (!isCallable(iterator)) throw new TypeError("iterator must be a function"); 5610 var receiver; 5611 if (arguments.length >= 3) receiver = thisArg; 5612 if (isArray(list)) forEachArray(list, iterator, receiver); 5613 else if (typeof list === "string") forEachString(list, iterator, receiver); 5614 else forEachObject(list, iterator, receiver); 5615 }; 5616})); 5617//#endregion 5618//#region node_modules/possible-typed-array-names/index.js 5619var require_possible_typed_array_names = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5620 /** @type {import('.')} */ 5621 module.exports = [ 5622 "Float16Array", 5623 "Float32Array", 5624 "Float64Array", 5625 "Int8Array", 5626 "Int16Array", 5627 "Int32Array", 5628 "Uint8Array", 5629 "Uint8ClampedArray", 5630 "Uint16Array", 5631 "Uint32Array", 5632 "BigInt64Array", 5633 "BigUint64Array" 5634 ]; 5635})); 5636//#endregion 5637//#region node_modules/available-typed-arrays/index.js 5638var require_available_typed_arrays = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5639 var possibleNames = require_possible_typed_array_names(); 5640 var g = typeof globalThis === "undefined" ? globalThis : globalThis; 5641 /** @type {import('.')} */ 5642 module.exports = function availableTypedArrays() { 5643 var out = []; 5644 for (var i = 0; i < possibleNames.length; i++) if (typeof g[possibleNames[i]] === "function") out[out.length] = possibleNames[i]; 5645 return out; 5646 }; 5647})); 5648//#endregion 5649//#region node_modules/define-data-property/index.js 5650var require_define_data_property = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5651 var $defineProperty = require_es_define_property(); 5652 var $SyntaxError = require_syntax(); 5653 var $TypeError = require_type(); 5654 var gopd = require_gopd(); 5655 /** @type {import('.')} */ 5656 module.exports = function defineDataProperty(obj, property, value) { 5657 if (!obj || typeof obj !== "object" && typeof obj !== "function") throw new $TypeError("`obj` must be an object or a function`"); 5658 if (typeof property !== "string" && typeof property !== "symbol") throw new $TypeError("`property` must be a string or a symbol`"); 5659 if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); 5660 if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); 5661 if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); 5662 if (arguments.length > 6 && typeof arguments[6] !== "boolean") throw new $TypeError("`loose`, if provided, must be a boolean"); 5663 var nonEnumerable = arguments.length > 3 ? arguments[3] : null; 5664 var nonWritable = arguments.length > 4 ? arguments[4] : null; 5665 var nonConfigurable = arguments.length > 5 ? arguments[5] : null; 5666 var loose = arguments.length > 6 ? arguments[6] : false; 5667 var desc = !!gopd && gopd(obj, property); 5668 if ($defineProperty) $defineProperty(obj, property, { 5669 configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, 5670 enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, 5671 value, 5672 writable: nonWritable === null && desc ? desc.writable : !nonWritable 5673 }); 5674 else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) obj[property] = value; 5675 else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); 5676 }; 5677})); 5678//#endregion 5679//#region node_modules/has-property-descriptors/index.js 5680var require_has_property_descriptors = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5681 var $defineProperty = require_es_define_property(); 5682 var hasPropertyDescriptors = function hasPropertyDescriptors() { 5683 return !!$defineProperty; 5684 }; 5685 hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { 5686 if (!$defineProperty) return null; 5687 try { 5688 return $defineProperty([], "length", { value: 1 }).length !== 1; 5689 } catch (e) { 5690 return true; 5691 } 5692 }; 5693 module.exports = hasPropertyDescriptors; 5694})); 5695//#endregion 5696//#region node_modules/set-function-length/index.js 5697var require_set_function_length = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5698 var GetIntrinsic = require_get_intrinsic(); 5699 var define = require_define_data_property(); 5700 var hasDescriptors = require_has_property_descriptors()(); 5701 var gOPD = require_gopd(); 5702 var $TypeError = require_type(); 5703 var $floor = GetIntrinsic("%Math.floor%"); 5704 /** @type {import('.')} */ 5705 module.exports = function setFunctionLength(fn, length) { 5706 if (typeof fn !== "function") throw new $TypeError("`fn` is not a function"); 5707 if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) throw new $TypeError("`length` must be a positive 32-bit integer"); 5708 var loose = arguments.length > 2 && !!arguments[2]; 5709 var functionLengthIsConfigurable = true; 5710 var functionLengthIsWritable = true; 5711 if ("length" in fn && gOPD) { 5712 var desc = gOPD(fn, "length"); 5713 if (desc && !desc.configurable) functionLengthIsConfigurable = false; 5714 if (desc && !desc.writable) functionLengthIsWritable = false; 5715 } 5716 if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) if (hasDescriptors) define(fn, "length", length, true, true); 5717 else define(fn, "length", length); 5718 return fn; 5719 }; 5720})); 5721//#endregion 5722//#region node_modules/call-bind-apply-helpers/applyBind.js 5723var require_applyBind = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5724 var bind = require_function_bind(); 5725 var $apply = require_functionApply(); 5726 var actualApply = require_actualApply(); 5727 /** @type {import('./applyBind')} */ 5728 module.exports = function applyBind() { 5729 return actualApply(bind, $apply, arguments); 5730 }; 5731})); 5732//#endregion 5733//#region node_modules/call-bind/index.js 5734var require_call_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5735 var setFunctionLength = require_set_function_length(); 5736 var $defineProperty = require_es_define_property(); 5737 var callBindBasic = require_call_bind_apply_helpers(); 5738 var applyBind = require_applyBind(); 5739 module.exports = function callBind(originalFunction) { 5740 var func = callBindBasic(arguments); 5741 var adjustedLength = originalFunction.length - (arguments.length - 1); 5742 return setFunctionLength(func, 1 + (adjustedLength > 0 ? adjustedLength : 0), true); 5743 }; 5744 if ($defineProperty) $defineProperty(module.exports, "apply", { value: applyBind }); 5745 else module.exports.apply = applyBind; 5746})); 5747//#endregion 5748//#region node_modules/has-tostringtag/shams.js 5749var require_shams = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5750 var hasSymbols = require_shams$1(); 5751 /** @type {import('.')} */ 5752 module.exports = function hasToStringTagShams() { 5753 return hasSymbols() && !!Symbol.toStringTag; 5754 }; 5755})); 5756//#endregion 5757//#region node_modules/which-typed-array/index.js 5758var require_which_typed_array = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5759 var forEach = require_for_each(); 5760 var availableTypedArrays = require_available_typed_arrays(); 5761 var callBind = require_call_bind(); 5762 var callBound = require_call_bound(); 5763 var gOPD = require_gopd(); 5764 var getProto = require_get_proto(); 5765 var $toString = callBound("Object.prototype.toString"); 5766 var hasToStringTag = require_shams()(); 5767 var g = typeof globalThis === "undefined" ? globalThis : globalThis; 5768 var typedArrays = availableTypedArrays(); 5769 var $slice = callBound("String.prototype.slice"); 5770 /** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */ 5771 var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) { 5772 for (var i = 0; i < array.length; i += 1) if (array[i] === value) return i; 5773 return -1; 5774 }; 5775 /** @typedef {import('./types').Getter} Getter */ 5776 /** @type {import('./types').Cache} */ 5777 var cache = { __proto__: null }; 5778 if (hasToStringTag && gOPD && getProto) forEach(typedArrays, function(typedArray) { 5779 var arr = new g[typedArray](); 5780 if (Symbol.toStringTag in arr && getProto) { 5781 var proto = getProto(arr); 5782 var descriptor = gOPD(proto, Symbol.toStringTag); 5783 if (!descriptor && proto) descriptor = gOPD(getProto(proto), Symbol.toStringTag); 5784 cache["$" + typedArray] = callBind(descriptor.get); 5785 } 5786 }); 5787 else forEach(typedArrays, function(typedArray) { 5788 var arr = new g[typedArray](); 5789 var fn = arr.slice || arr.set; 5790 if (fn) cache["$" + typedArray] = callBind(fn); 5791 }); 5792 /** @type {(value: object) => false | import('.').TypedArrayName} */ 5793 var tryTypedArrays = function tryAllTypedArrays(value) { 5794 /** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;
vendor: 23,607 bytes, lines 5795-6715
5795 forEach( 5796 cache, 5797 /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ 5798 function(getter, typedArray) { 5799 if (!found) try { 5800 if ("$" + getter(value) === typedArray) found = $slice(typedArray, 1); 5801 } catch (e) {} 5802 } 5803 ); 5804 return found; 5805 }; 5806 /** @type {(value: object) => false | import('.').TypedArrayName} */ 5807 var trySlices = function tryAllSlices(value) { 5808 /** @type {ReturnType<typeof tryAllSlices>} */ var found = false; 5809 forEach( 5810 cache, 5811 /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ 5812 function(getter, name) { 5813 if (!found) try { 5814 getter(value); 5815 found = $slice(name, 1); 5816 } catch (e) {} 5817 } 5818 ); 5819 return found; 5820 }; 5821 /** @type {import('.')} */ 5822 module.exports = function whichTypedArray(value) { 5823 if (!value || typeof value !== "object") return false; 5824 if (!hasToStringTag) { 5825 /** @type {string} */ 5826 var tag = $slice($toString(value), 8, -1); 5827 if ($indexOf(typedArrays, tag) > -1) return tag; 5828 if (tag !== "Object") return false; 5829 return trySlices(value); 5830 } 5831 if (!gOPD) return null; 5832 return tryTypedArrays(value); 5833 }; 5834})); 5835//#endregion 5836//#region node_modules/is-typed-array/index.js 5837var require_is_typed_array = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5838 var whichTypedArray = require_which_typed_array(); 5839 /** @type {import('.')} */ 5840 module.exports = function isTypedArray(value) { 5841 return !!whichTypedArray(value); 5842 }; 5843})); 5844//#endregion 5845//#region node_modules/typed-array-buffer/index.js 5846var require_typed_array_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5847 var $TypeError = require_type(); 5848 /** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */ 5849 var $typedArrayBuffer = require_call_bound()("TypedArray.prototype.buffer", true); 5850 var isTypedArray = require_is_typed_array(); 5851 /** @type {import('.')} */ 5852 module.exports = $typedArrayBuffer || function typedArrayBuffer(x) { 5853 if (!isTypedArray(x)) throw new $TypeError("Not a Typed Array"); 5854 return x.buffer; 5855 }; 5856})); 5857//#endregion 5858//#region node_modules/to-buffer/index.js 5859var require_to_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5860 var Buffer = require_safe_buffer$2().Buffer; 5861 var isArray = require_isarray$1(); 5862 var typedArrayBuffer = require_typed_array_buffer(); 5863 var isView = ArrayBuffer.isView || function isView(obj) { 5864 try { 5865 typedArrayBuffer(obj); 5866 return true; 5867 } catch (e) { 5868 return false; 5869 } 5870 }; 5871 var useUint8Array = typeof Uint8Array !== "undefined"; 5872 var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined"; 5873 var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT); 5874 module.exports = function toBuffer(data, encoding) { 5875 if (Buffer.isBuffer(data)) { 5876 if (data.constructor && !("isBuffer" in data)) return Buffer.from(data); 5877 return data; 5878 } 5879 if (typeof data === "string") return Buffer.from(data, encoding); 5880 if (useArrayBuffer && isView(data)) { 5881 if (data.byteLength === 0) return Buffer.alloc(0); 5882 if (useFromArrayBuffer) { 5883 var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength); 5884 if (res.byteLength === data.byteLength) return res; 5885 } 5886 var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength); 5887 var result = Buffer.from(uint8); 5888 if (result.length === data.byteLength) return result; 5889 } 5890 if (useUint8Array && data instanceof Uint8Array) return Buffer.from(data); 5891 var isArr = isArray(data); 5892 if (isArr) for (var i = 0; i < data.length; i += 1) { 5893 var x = data[i]; 5894 if (typeof x !== "number" || x < 0 || x > 255 || ~~x !== x) throw new RangeError("Array items must be numbers in the range 0-255."); 5895 } 5896 if (isArr || Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) return Buffer.from(data); 5897 throw new TypeError("The \"data\" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView."); 5898 }; 5899})); 5900//#endregion 5901//#region node_modules/sha.js/hash.js 5902var require_hash$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5903 var Buffer = require_safe_buffer$2().Buffer; 5904 var toBuffer = require_to_buffer$1(); 5905 function Hash(blockSize, finalSize) { 5906 this._block = Buffer.alloc(blockSize); 5907 this._finalSize = finalSize; 5908 this._blockSize = blockSize; 5909 this._len = 0; 5910 } 5911 Hash.prototype.update = function(data, enc) { 5912 data = toBuffer(data, enc || "utf8"); 5913 var block = this._block; 5914 var blockSize = this._blockSize; 5915 var length = data.length; 5916 var accum = this._len; 5917 for (var offset = 0; offset < length;) { 5918 var assigned = accum % blockSize; 5919 var remainder = Math.min(length - offset, blockSize - assigned); 5920 for (var i = 0; i < remainder; i++) block[assigned + i] = data[offset + i]; 5921 accum += remainder; 5922 offset += remainder; 5923 if (accum % blockSize === 0) this._update(block); 5924 } 5925 this._len += length; 5926 return this; 5927 }; 5928 Hash.prototype.digest = function(enc) { 5929 var rem = this._len % this._blockSize; 5930 this._block[rem] = 128; 5931 this._block.fill(0, rem + 1); 5932 if (rem >= this._finalSize) { 5933 this._update(this._block); 5934 this._block.fill(0); 5935 } 5936 var bits = this._len * 8; 5937 if (bits <= 4294967295) this._block.writeUInt32BE(bits, this._blockSize - 4); 5938 else { 5939 var lowBits = (bits & 4294967295) >>> 0; 5940 var highBits = (bits - lowBits) / 4294967296; 5941 this._block.writeUInt32BE(highBits, this._blockSize - 8); 5942 this._block.writeUInt32BE(lowBits, this._blockSize - 4); 5943 } 5944 this._update(this._block); 5945 var hash = this._hash(); 5946 return enc ? hash.toString(enc) : hash; 5947 }; 5948 Hash.prototype._update = function() { 5949 throw new Error("_update must be implemented by subclass"); 5950 }; 5951 module.exports = Hash; 5952})); 5953//#endregion 5954//#region node_modules/sha.js/sha.js 5955var require_sha$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 5956 var inherits = require_inherits_browser(); 5957 var Hash = require_hash$1(); 5958 var Buffer = require_safe_buffer$2().Buffer; 5959 var K = [ 5960 1518500249, 5961 1859775393, 5962 -1894007588, 5963 -899497514 5964 ]; 5965 var W = new Array(80); 5966 function Sha() { 5967 this.init(); 5968 this._w = W; 5969 Hash.call(this, 64, 56); 5970 } 5971 inherits(Sha, Hash); 5972 Sha.prototype.init = function() { 5973 this._a = 1732584193; 5974 this._b = 4023233417; 5975 this._c = 2562383102; 5976 this._d = 271733878; 5977 this._e = 3285377520; 5978 return this; 5979 }; 5980 function rotl5(num) { 5981 return num << 5 | num >>> 27; 5982 } 5983 function rotl30(num) { 5984 return num << 30 | num >>> 2; 5985 } 5986 function ft(s, b, c, d) { 5987 if (s === 0) return b & c | ~b & d; 5988 if (s === 2) return b & c | b & d | c & d; 5989 return b ^ c ^ d; 5990 } 5991 Sha.prototype._update = function(M) { 5992 var w = this._w; 5993 var a = this._a | 0; 5994 var b = this._b | 0; 5995 var c = this._c | 0; 5996 var d = this._d | 0; 5997 var e = this._e | 0; 5998 for (var i = 0; i < 16; ++i) w[i] = M.readInt32BE(i * 4); 5999 for (; i < 80; ++i) w[i] = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]; 6000 for (var j = 0; j < 80; ++j) { 6001 var s = ~~(j / 20); 6002 var t = rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s] | 0; 6003 e = d; 6004 d = c; 6005 c = rotl30(b); 6006 b = a; 6007 a = t; 6008 } 6009 this._a = a + this._a | 0; 6010 this._b = b + this._b | 0; 6011 this._c = c + this._c | 0; 6012 this._d = d + this._d | 0; 6013 this._e = e + this._e | 0; 6014 }; 6015 Sha.prototype._hash = function() { 6016 var H = Buffer.allocUnsafe(20); 6017 H.writeInt32BE(this._a | 0, 0); 6018 H.writeInt32BE(this._b | 0, 4); 6019 H.writeInt32BE(this._c | 0, 8); 6020 H.writeInt32BE(this._d | 0, 12); 6021 H.writeInt32BE(this._e | 0, 16); 6022 return H; 6023 }; 6024 module.exports = Sha; 6025})); 6026//#endregion 6027//#region node_modules/sha.js/sha1.js 6028var require_sha1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6029 var inherits = require_inherits_browser(); 6030 var Hash = require_hash$1(); 6031 var Buffer = require_safe_buffer$2().Buffer; 6032 var K = [ 6033 1518500249, 6034 1859775393, 6035 -1894007588, 6036 -899497514 6037 ]; 6038 var W = new Array(80); 6039 function Sha1() { 6040 this.init(); 6041 this._w = W; 6042 Hash.call(this, 64, 56); 6043 } 6044 inherits(Sha1, Hash); 6045 Sha1.prototype.init = function() { 6046 this._a = 1732584193; 6047 this._b = 4023233417; 6048 this._c = 2562383102; 6049 this._d = 271733878; 6050 this._e = 3285377520; 6051 return this; 6052 }; 6053 function rotl1(num) { 6054 return num << 1 | num >>> 31; 6055 } 6056 function rotl5(num) { 6057 return num << 5 | num >>> 27; 6058 } 6059 function rotl30(num) { 6060 return num << 30 | num >>> 2; 6061 } 6062 function ft(s, b, c, d) { 6063 if (s === 0) return b & c | ~b & d; 6064 if (s === 2) return b & c | b & d | c & d; 6065 return b ^ c ^ d; 6066 } 6067 Sha1.prototype._update = function(M) { 6068 var w = this._w; 6069 var a = this._a | 0; 6070 var b = this._b | 0; 6071 var c = this._c | 0; 6072 var d = this._d | 0; 6073 var e = this._e | 0; 6074 for (var i = 0; i < 16; ++i) w[i] = M.readInt32BE(i * 4); 6075 for (; i < 80; ++i) w[i] = rotl1(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); 6076 for (var j = 0; j < 80; ++j) { 6077 var s = ~~(j / 20); 6078 var t = rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s] | 0; 6079 e = d; 6080 d = c; 6081 c = rotl30(b); 6082 b = a; 6083 a = t; 6084 } 6085 this._a = a + this._a | 0; 6086 this._b = b + this._b | 0; 6087 this._c = c + this._c | 0; 6088 this._d = d + this._d | 0; 6089 this._e = e + this._e | 0; 6090 }; 6091 Sha1.prototype._hash = function() { 6092 var H = Buffer.allocUnsafe(20); 6093 H.writeInt32BE(this._a | 0, 0); 6094 H.writeInt32BE(this._b | 0, 4); 6095 H.writeInt32BE(this._c | 0, 8); 6096 H.writeInt32BE(this._d | 0, 12); 6097 H.writeInt32BE(this._e | 0, 16); 6098 return H; 6099 }; 6100 module.exports = Sha1; 6101})); 6102//#endregion 6103//#region node_modules/sha.js/sha256.js 6104var require_sha256$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6105 /** 6106 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined 6107 * in FIPS 180-2 6108 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. 6109 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet 6110 * 6111 */ 6112 var inherits = require_inherits_browser(); 6113 var Hash = require_hash$1(); 6114 var Buffer = require_safe_buffer$2().Buffer; 6115 var K = [ 6116 1116352408, 6117 1899447441, 6118 3049323471, 6119 3921009573, 6120 961987163, 6121 1508970993, 6122 2453635748, 6123 2870763221, 6124 3624381080, 6125 310598401, 6126 607225278, 6127 1426881987, 6128 1925078388, 6129 2162078206, 6130 2614888103, 6131 3248222580, 6132 3835390401, 6133 4022224774, 6134 264347078, 6135 604807628, 6136 770255983, 6137 1249150122, 6138 1555081692, 6139 1996064986, 6140 2554220882, 6141 2821834349, 6142 2952996808, 6143 3210313671, 6144 3336571891, 6145 3584528711, 6146 113926993, 6147 338241895, 6148 666307205, 6149 773529912, 6150 1294757372, 6151 1396182291, 6152 1695183700, 6153 1986661051, 6154 2177026350, 6155 2456956037, 6156 2730485921, 6157 2820302411, 6158 3259730800, 6159 3345764771, 6160 3516065817, 6161 3600352804, 6162 4094571909, 6163 275423344, 6164 430227734, 6165 506948616, 6166 659060556, 6167 883997877, 6168 958139571, 6169 1322822218, 6170 1537002063, 6171 1747873779, 6172 1955562222, 6173 2024104815, 6174 2227730452, 6175 2361852424, 6176 2428436474, 6177 2756734187, 6178 3204031479, 6179 3329325298 6180 ]; 6181 var W = new Array(64); 6182 function Sha256() { 6183 this.init(); 6184 this._w = W; 6185 Hash.call(this, 64, 56); 6186 } 6187 inherits(Sha256, Hash); 6188 Sha256.prototype.init = function() { 6189 this._a = 1779033703; 6190 this._b = 3144134277; 6191 this._c = 1013904242; 6192 this._d = 2773480762; 6193 this._e = 1359893119; 6194 this._f = 2600822924; 6195 this._g = 528734635; 6196 this._h = 1541459225; 6197 return this; 6198 }; 6199 function ch(x, y, z) { 6200 return z ^ x & (y ^ z); 6201 } 6202 function maj(x, y, z) { 6203 return x & y | z & (x | y); 6204 } 6205 function sigma0(x) { 6206 return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10); 6207 } 6208 function sigma1(x) { 6209 return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7); 6210 } 6211 function gamma0(x) { 6212 return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3; 6213 } 6214 function gamma1(x) { 6215 return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10; 6216 } 6217 Sha256.prototype._update = function(M) { 6218 var w = this._w; 6219 var a = this._a | 0; 6220 var b = this._b | 0; 6221 var c = this._c | 0; 6222 var d = this._d | 0; 6223 var e = this._e | 0; 6224 var f = this._f | 0; 6225 var g = this._g | 0; 6226 var h = this._h | 0; 6227 for (var i = 0; i < 16; ++i) w[i] = M.readInt32BE(i * 4); 6228 for (; i < 64; ++i) w[i] = gamma1(w[i - 2]) + w[i - 7] + gamma0(w[i - 15]) + w[i - 16] | 0; 6229 for (var j = 0; j < 64; ++j) { 6230 var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + w[j] | 0; 6231 var T2 = sigma0(a) + maj(a, b, c) | 0; 6232 h = g; 6233 g = f; 6234 f = e; 6235 e = d + T1 | 0; 6236 d = c; 6237 c = b; 6238 b = a; 6239 a = T1 + T2 | 0; 6240 } 6241 this._a = a + this._a | 0; 6242 this._b = b + this._b | 0; 6243 this._c = c + this._c | 0; 6244 this._d = d + this._d | 0; 6245 this._e = e + this._e | 0; 6246 this._f = f + this._f | 0; 6247 this._g = g + this._g | 0; 6248 this._h = h + this._h | 0; 6249 }; 6250 Sha256.prototype._hash = function() { 6251 var H = Buffer.allocUnsafe(32); 6252 H.writeInt32BE(this._a, 0); 6253 H.writeInt32BE(this._b, 4); 6254 H.writeInt32BE(this._c, 8); 6255 H.writeInt32BE(this._d, 12); 6256 H.writeInt32BE(this._e, 16); 6257 H.writeInt32BE(this._f, 20); 6258 H.writeInt32BE(this._g, 24); 6259 H.writeInt32BE(this._h, 28); 6260 return H; 6261 }; 6262 module.exports = Sha256; 6263})); 6264//#endregion 6265//#region node_modules/sha.js/sha224.js 6266var require_sha224 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6267 /** 6268 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined 6269 * in FIPS 180-2 6270 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. 6271 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet 6272 * 6273 */ 6274 var inherits = require_inherits_browser(); 6275 var Sha256 = require_sha256$1(); 6276 var Hash = require_hash$1(); 6277 var Buffer = require_safe_buffer$2().Buffer; 6278 var W = new Array(64); 6279 function Sha224() { 6280 this.init(); 6281 this._w = W; 6282 Hash.call(this, 64, 56); 6283 } 6284 inherits(Sha224, Sha256); 6285 Sha224.prototype.init = function() { 6286 this._a = 3238371032; 6287 this._b = 914150663; 6288 this._c = 812702999; 6289 this._d = 4144912697; 6290 this._e = 4290775857; 6291 this._f = 1750603025; 6292 this._g = 1694076839; 6293 this._h = 3204075428; 6294 return this; 6295 }; 6296 Sha224.prototype._hash = function() { 6297 var H = Buffer.allocUnsafe(28); 6298 H.writeInt32BE(this._a, 0); 6299 H.writeInt32BE(this._b, 4); 6300 H.writeInt32BE(this._c, 8); 6301 H.writeInt32BE(this._d, 12); 6302 H.writeInt32BE(this._e, 16); 6303 H.writeInt32BE(this._f, 20); 6304 H.writeInt32BE(this._g, 24); 6305 return H; 6306 }; 6307 module.exports = Sha224; 6308})); 6309//#endregion 6310//#region node_modules/sha.js/sha512.js 6311var require_sha512 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6312 var inherits = require_inherits_browser(); 6313 var Hash = require_hash$1(); 6314 var Buffer = require_safe_buffer$2().Buffer; 6315 var K = [ 6316 1116352408, 6317 3609767458, 6318 1899447441, 6319 602891725, 6320 3049323471, 6321 3964484399, 6322 3921009573, 6323 2173295548, 6324 961987163, 6325 4081628472, 6326 1508970993, 6327 3053834265, 6328 2453635748, 6329 2937671579, 6330 2870763221, 6331 3664609560, 6332 3624381080, 6333 2734883394, 6334 310598401, 6335 1164996542, 6336 607225278, 6337 1323610764, 6338 1426881987, 6339 3590304994, 6340 1925078388, 6341 4068182383, 6342 2162078206, 6343 991336113, 6344 2614888103, 6345 633803317, 6346 3248222580, 6347 3479774868, 6348 3835390401, 6349 2666613458, 6350 4022224774, 6351 944711139, 6352 264347078, 6353 2341262773, 6354 604807628, 6355 2007800933, 6356 770255983, 6357 1495990901, 6358 1249150122, 6359 1856431235, 6360 1555081692, 6361 3175218132, 6362 1996064986, 6363 2198950837, 6364 2554220882, 6365 3999719339, 6366 2821834349, 6367 766784016, 6368 2952996808, 6369 2566594879, 6370 3210313671, 6371 3203337956, 6372 3336571891, 6373 1034457026, 6374 3584528711, 6375 2466948901, 6376 113926993, 6377 3758326383, 6378 338241895, 6379 168717936, 6380 666307205, 6381 1188179964, 6382 773529912, 6383 1546045734, 6384 1294757372, 6385 1522805485, 6386 1396182291, 6387 2643833823, 6388 1695183700, 6389 2343527390, 6390 1986661051, 6391 1014477480, 6392 2177026350, 6393 1206759142, 6394 2456956037, 6395 344077627, 6396 2730485921, 6397 1290863460, 6398 2820302411, 6399 3158454273, 6400 3259730800, 6401 3505952657, 6402 3345764771, 6403 106217008, 6404 3516065817, 6405 3606008344, 6406 3600352804, 6407 1432725776, 6408 4094571909, 6409 1467031594, 6410 275423344, 6411 851169720, 6412 430227734, 6413 3100823752, 6414 506948616, 6415 1363258195, 6416 659060556, 6417 3750685593, 6418 883997877, 6419 3785050280, 6420 958139571, 6421 3318307427, 6422 1322822218, 6423 3812723403, 6424 1537002063, 6425 2003034995, 6426 1747873779, 6427 3602036899, 6428 1955562222, 6429 1575990012, 6430 2024104815, 6431 1125592928, 6432 2227730452, 6433 2716904306, 6434 2361852424, 6435 442776044, 6436 2428436474, 6437 593698344, 6438 2756734187, 6439 3733110249, 6440 3204031479, 6441 2999351573, 6442 3329325298, 6443 3815920427, 6444 3391569614, 6445 3928383900, 6446 3515267271, 6447 566280711, 6448 3940187606, 6449 3454069534, 6450 4118630271, 6451 4000239992, 6452 116418474, 6453 1914138554, 6454 174292421, 6455 2731055270, 6456 289380356, 6457 3203993006, 6458 460393269, 6459 320620315, 6460 685471733, 6461 587496836, 6462 852142971, 6463 1086792851, 6464 1017036298, 6465 365543100, 6466 1126000580, 6467 2618297676, 6468 1288033470, 6469 3409855158, 6470 1501505948, 6471 4234509866, 6472 1607167915, 6473 987167468, 6474 1816402316, 6475 1246189591 6476 ]; 6477 var W = new Array(160); 6478 function Sha512() { 6479 this.init(); 6480 this._w = W; 6481 Hash.call(this, 128, 112); 6482 } 6483 inherits(Sha512, Hash); 6484 Sha512.prototype.init = function() { 6485 this._ah = 1779033703; 6486 this._bh = 3144134277; 6487 this._ch = 1013904242; 6488 this._dh = 2773480762; 6489 this._eh = 1359893119; 6490 this._fh = 2600822924; 6491 this._gh = 528734635; 6492 this._hh = 1541459225; 6493 this._al = 4089235720; 6494 this._bl = 2227873595; 6495 this._cl = 4271175723; 6496 this._dl = 1595750129; 6497 this._el = 2917565137; 6498 this._fl = 725511199; 6499 this._gl = 4215389547; 6500 this._hl = 327033209; 6501 return this; 6502 }; 6503 function Ch(x, y, z) { 6504 return z ^ x & (y ^ z); 6505 } 6506 function maj(x, y, z) { 6507 return x & y | z & (x | y); 6508 } 6509 function sigma0(x, xl) { 6510 return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25); 6511 } 6512 function sigma1(x, xl) { 6513 return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23); 6514 } 6515 function Gamma0(x, xl) { 6516 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7; 6517 } 6518 function Gamma0l(x, xl) { 6519 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25); 6520 } 6521 function Gamma1(x, xl) { 6522 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6; 6523 } 6524 function Gamma1l(x, xl) { 6525 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26); 6526 } 6527 function getCarry(a, b) { 6528 return a >>> 0 < b >>> 0 ? 1 : 0; 6529 } 6530 Sha512.prototype._update = function(M) { 6531 var w = this._w; 6532 var ah = this._ah | 0; 6533 var bh = this._bh | 0; 6534 var ch = this._ch | 0; 6535 var dh = this._dh | 0; 6536 var eh = this._eh | 0; 6537 var fh = this._fh | 0; 6538 var gh = this._gh | 0; 6539 var hh = this._hh | 0; 6540 var al = this._al | 0; 6541 var bl = this._bl | 0; 6542 var cl = this._cl | 0; 6543 var dl = this._dl | 0; 6544 var el = this._el | 0; 6545 var fl = this._fl | 0; 6546 var gl = this._gl | 0; 6547 var hl = this._hl | 0; 6548 for (var i = 0; i < 32; i += 2) { 6549 w[i] = M.readInt32BE(i * 4); 6550 w[i + 1] = M.readInt32BE(i * 4 + 4); 6551 } 6552 for (; i < 160; i += 2) { 6553 var xh = w[i - 30]; 6554 var xl = w[i - 30 + 1]; 6555 var gamma0 = Gamma0(xh, xl); 6556 var gamma0l = Gamma0l(xl, xh); 6557 xh = w[i - 4]; 6558 xl = w[i - 4 + 1]; 6559 var gamma1 = Gamma1(xh, xl); 6560 var gamma1l = Gamma1l(xl, xh); 6561 var Wi7h = w[i - 14]; 6562 var Wi7l = w[i - 14 + 1]; 6563 var Wi16h = w[i - 32]; 6564 var Wi16l = w[i - 32 + 1]; 6565 var Wil = gamma0l + Wi7l | 0; 6566 var Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0; 6567 Wil = Wil + gamma1l | 0; 6568 Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0; 6569 Wil = Wil + Wi16l | 0; 6570 Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0; 6571 w[i] = Wih; 6572 w[i + 1] = Wil; 6573 } 6574 for (var j = 0; j < 160; j += 2) { 6575 Wih = w[j]; 6576 Wil = w[j + 1]; 6577 var majh = maj(ah, bh, ch); 6578 var majl = maj(al, bl, cl); 6579 var sigma0h = sigma0(ah, al); 6580 var sigma0l = sigma0(al, ah); 6581 var sigma1h = sigma1(eh, el); 6582 var sigma1l = sigma1(el, eh); 6583 var Kih = K[j]; 6584 var Kil = K[j + 1]; 6585 var chh = Ch(eh, fh, gh); 6586 var chl = Ch(el, fl, gl); 6587 var t1l = hl + sigma1l | 0; 6588 var t1h = hh + sigma1h + getCarry(t1l, hl) | 0; 6589 t1l = t1l + chl | 0; 6590 t1h = t1h + chh + getCarry(t1l, chl) | 0; 6591 t1l = t1l + Kil | 0; 6592 t1h = t1h + Kih + getCarry(t1l, Kil) | 0; 6593 t1l = t1l + Wil | 0; 6594 t1h = t1h + Wih + getCarry(t1l, Wil) | 0; 6595 var t2l = sigma0l + majl | 0; 6596 var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0; 6597 hh = gh; 6598 hl = gl; 6599 gh = fh; 6600 gl = fl; 6601 fh = eh; 6602 fl = el; 6603 el = dl + t1l | 0; 6604 eh = dh + t1h + getCarry(el, dl) | 0; 6605 dh = ch; 6606 dl = cl; 6607 ch = bh; 6608 cl = bl; 6609 bh = ah; 6610 bl = al; 6611 al = t1l + t2l | 0; 6612 ah = t1h + t2h + getCarry(al, t1l) | 0; 6613 } 6614 this._al = this._al + al | 0; 6615 this._bl = this._bl + bl | 0; 6616 this._cl = this._cl + cl | 0; 6617 this._dl = this._dl + dl | 0; 6618 this._el = this._el + el | 0; 6619 this._fl = this._fl + fl | 0; 6620 this._gl = this._gl + gl | 0; 6621 this._hl = this._hl + hl | 0; 6622 this._ah = this._ah + ah + getCarry(this._al, al) | 0; 6623 this._bh = this._bh + bh + getCarry(this._bl, bl) | 0; 6624 this._ch = this._ch + ch + getCarry(this._cl, cl) | 0; 6625 this._dh = this._dh + dh + getCarry(this._dl, dl) | 0; 6626 this._eh = this._eh + eh + getCarry(this._el, el) | 0; 6627 this._fh = this._fh + fh + getCarry(this._fl, fl) | 0; 6628 this._gh = this._gh + gh + getCarry(this._gl, gl) | 0; 6629 this._hh = this._hh + hh + getCarry(this._hl, hl) | 0; 6630 }; 6631 Sha512.prototype._hash = function() { 6632 var H = Buffer.allocUnsafe(64); 6633 function writeInt64BE(h, l, offset) { 6634 H.writeInt32BE(h, offset); 6635 H.writeInt32BE(l, offset + 4); 6636 } 6637 writeInt64BE(this._ah, this._al, 0); 6638 writeInt64BE(this._bh, this._bl, 8); 6639 writeInt64BE(this._ch, this._cl, 16); 6640 writeInt64BE(this._dh, this._dl, 24); 6641 writeInt64BE(this._eh, this._el, 32); 6642 writeInt64BE(this._fh, this._fl, 40); 6643 writeInt64BE(this._gh, this._gl, 48); 6644 writeInt64BE(this._hh, this._hl, 56); 6645 return H; 6646 }; 6647 module.exports = Sha512; 6648})); 6649//#endregion 6650//#region node_modules/sha.js/sha384.js 6651var require_sha384 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6652 var inherits = require_inherits_browser(); 6653 var SHA512 = require_sha512(); 6654 var Hash = require_hash$1(); 6655 var Buffer = require_safe_buffer$2().Buffer; 6656 var W = new Array(160); 6657 function Sha384() { 6658 this.init(); 6659 this._w = W; 6660 Hash.call(this, 128, 112); 6661 } 6662 inherits(Sha384, SHA512); 6663 Sha384.prototype.init = function() { 6664 this._ah = 3418070365; 6665 this._bh = 1654270250; 6666 this._ch = 2438529370; 6667 this._dh = 355462360; 6668 this._eh = 1731405415; 6669 this._fh = 2394180231; 6670 this._gh = 3675008525; 6671 this._hh = 1203062813; 6672 this._al = 3238371032; 6673 this._bl = 914150663; 6674 this._cl = 812702999; 6675 this._dl = 4144912697; 6676 this._el = 4290775857; 6677 this._fl = 1750603025; 6678 this._gl = 1694076839; 6679 this._hl = 3204075428; 6680 return this; 6681 }; 6682 Sha384.prototype._hash = function() { 6683 var H = Buffer.allocUnsafe(48); 6684 function writeInt64BE(h, l, offset) { 6685 H.writeInt32BE(h, offset); 6686 H.writeInt32BE(l, offset + 4); 6687 } 6688 writeInt64BE(this._ah, this._al, 0); 6689 writeInt64BE(this._bh, this._bl, 8); 6690 writeInt64BE(this._ch, this._cl, 16); 6691 writeInt64BE(this._dh, this._dl, 24); 6692 writeInt64BE(this._eh, this._el, 32); 6693 writeInt64BE(this._fh, this._fl, 40); 6694 return H; 6695 }; 6696 module.exports = Sha384; 6697})); 6698//#endregion 6699//#region node_modules/sha.js/index.js 6700var require_sha_js = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6701 module.exports = function SHA(algorithm) { 6702 var alg = algorithm.toLowerCase(); 6703 var Algorithm = module.exports[alg]; 6704 if (!Algorithm) throw new Error(alg + " is not supported (we accept pull requests)"); 6705 return new Algorithm(); 6706 }; 6707 module.exports.sha = require_sha$1(); 6708 module.exports.sha1 = require_sha1(); 6709 module.exports.sha224 = require_sha224(); 6710 module.exports.sha256 = require_sha256$1(); 6711 module.exports.sha384 = require_sha384(); 6712 module.exports.sha512 = require_sha512(); 6713})); 6714//#endregion 6715//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/stream
vendor: 11,250 bytes, lines 6715-7080
6715s/stream-browser.js 6716var require_stream_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6717 module.exports = require_events().EventEmitter; 6718})); 6719//#endregion 6720//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js 6721var require_buffer_list = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6722 function ownKeys(object, enumerableOnly) { 6723 var keys = Object.keys(object); 6724 if (Object.getOwnPropertySymbols) { 6725 var symbols = Object.getOwnPropertySymbols(object); 6726 enumerableOnly && (symbols = symbols.filter(function(sym) { 6727 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 6728 })), keys.push.apply(keys, symbols); 6729 } 6730 return keys; 6731 } 6732 function _objectSpread(target) { 6733 for (var i = 1; i < arguments.length; i++) { 6734 var source = null != arguments[i] ? arguments[i] : {}; 6735 i % 2 ? ownKeys(Object(source), !0).forEach(function(key) { 6736 _defineProperty(target, key, source[key]); 6737 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { 6738 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 6739 }); 6740 } 6741 return target; 6742 } 6743 function _defineProperty(obj, key, value) { 6744 key = _toPropertyKey(key); 6745 if (key in obj) Object.defineProperty(obj, key, { 6746 value, 6747 enumerable: true, 6748 configurable: true, 6749 writable: true 6750 }); 6751 else obj[key] = value; 6752 return obj; 6753 } 6754 function _classCallCheck(instance, Constructor) { 6755 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 6756 } 6757 function _defineProperties(target, props) { 6758 for (var i = 0; i < props.length; i++) { 6759 var descriptor = props[i]; 6760 descriptor.enumerable = descriptor.enumerable || false; 6761 descriptor.configurable = true; 6762 if ("value" in descriptor) descriptor.writable = true; 6763 Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); 6764 } 6765 } 6766 function _createClass(Constructor, protoProps, staticProps) { 6767 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 6768 if (staticProps) _defineProperties(Constructor, staticProps); 6769 Object.defineProperty(Constructor, "prototype", { writable: false }); 6770 return Constructor; 6771 } 6772 function _toPropertyKey(arg) { 6773 var key = _toPrimitive(arg, "string"); 6774 return typeof key === "symbol" ? key : String(key); 6775 } 6776 function _toPrimitive(input, hint) { 6777 if (typeof input !== "object" || input === null) return input; 6778 var prim = input[Symbol.toPrimitive]; 6779 if (prim !== void 0) { 6780 var res = prim.call(input, hint || "default"); 6781 if (typeof res !== "object") return res; 6782 throw new TypeError("@@toPrimitive must return a primitive value."); 6783 } 6784 return (hint === "string" ? String : Number)(input); 6785 } 6786 var Buffer = require_buffer$1().Buffer; 6787 var inspect = require___vite_browser_external().inspect; 6788 var custom = inspect && inspect.custom || "inspect"; 6789 function copyBuffer(src, target, offset) { 6790 Buffer.prototype.copy.call(src, target, offset); 6791 } 6792 module.exports = /*#__PURE__*/ function() { 6793 function BufferList() { 6794 _classCallCheck(this, BufferList); 6795 this.head = null; 6796 this.tail = null; 6797 this.length = 0; 6798 } 6799 _createClass(BufferList, [ 6800 { 6801 key: "push", 6802 value: function push(v) { 6803 var entry = { 6804 data: v, 6805 next: null 6806 }; 6807 if (this.length > 0) this.tail.next = entry; 6808 else this.head = entry; 6809 this.tail = entry; 6810 ++this.length; 6811 } 6812 }, 6813 { 6814 key: "unshift", 6815 value: function unshift(v) { 6816 var entry = { 6817 data: v, 6818 next: this.head 6819 }; 6820 if (this.length === 0) this.tail = entry; 6821 this.head = entry; 6822 ++this.length; 6823 } 6824 }, 6825 { 6826 key: "shift", 6827 value: function shift() { 6828 if (this.length === 0) return; 6829 var ret = this.head.data; 6830 if (this.length === 1) this.head = this.tail = null; 6831 else this.head = this.head.next; 6832 --this.length; 6833 return ret; 6834 } 6835 }, 6836 { 6837 key: "clear", 6838 value: function clear() { 6839 this.head = this.tail = null; 6840 this.length = 0; 6841 } 6842 }, 6843 { 6844 key: "join", 6845 value: function join(s) { 6846 if (this.length === 0) return ""; 6847 var p = this.head; 6848 var ret = "" + p.data; 6849 while (p = p.next) ret += s + p.data; 6850 return ret; 6851 } 6852 }, 6853 { 6854 key: "concat", 6855 value: function concat(n) { 6856 if (this.length === 0) return Buffer.alloc(0); 6857 var ret = Buffer.allocUnsafe(n >>> 0); 6858 var p = this.head; 6859 var i = 0; 6860 while (p) { 6861 copyBuffer(p.data, ret, i); 6862 i += p.data.length; 6863 p = p.next; 6864 } 6865 return ret; 6866 } 6867 }, 6868 { 6869 key: "consume", 6870 value: function consume(n, hasStrings) { 6871 var ret; 6872 if (n < this.head.data.length) { 6873 ret = this.head.data.slice(0, n); 6874 this.head.data = this.head.data.slice(n); 6875 } else if (n === this.head.data.length) ret = this.shift(); 6876 else ret = hasStrings ? this._getString(n) : this._getBuffer(n); 6877 return ret; 6878 } 6879 }, 6880 { 6881 key: "first", 6882 value: function first() { 6883 return this.head.data; 6884 } 6885 }, 6886 { 6887 key: "_getString", 6888 value: function _getString(n) { 6889 var p = this.head; 6890 var c = 1; 6891 var ret = p.data; 6892 n -= ret.length; 6893 while (p = p.next) { 6894 var str = p.data; 6895 var nb = n > str.length ? str.length : n; 6896 if (nb === str.length) ret += str; 6897 else ret += str.slice(0, n); 6898 n -= nb; 6899 if (n === 0) { 6900 if (nb === str.length) { 6901 ++c; 6902 if (p.next) this.head = p.next; 6903 else this.head = this.tail = null; 6904 } else { 6905 this.head = p; 6906 p.data = str.slice(nb); 6907 } 6908 break; 6909 } 6910 ++c; 6911 } 6912 this.length -= c; 6913 return ret; 6914 } 6915 }, 6916 { 6917 key: "_getBuffer", 6918 value: function _getBuffer(n) { 6919 var ret = Buffer.allocUnsafe(n); 6920 var p = this.head; 6921 var c = 1; 6922 p.data.copy(ret); 6923 n -= p.data.length; 6924 while (p = p.next) { 6925 var buf = p.data; 6926 var nb = n > buf.length ? buf.length : n; 6927 buf.copy(ret, ret.length - n, 0, nb); 6928 n -= nb; 6929 if (n === 0) { 6930 if (nb === buf.length) { 6931 ++c; 6932 if (p.next) this.head = p.next; 6933 else this.head = this.tail = null; 6934 } else { 6935 this.head = p; 6936 p.data = buf.slice(nb); 6937 } 6938 break; 6939 } 6940 ++c; 6941 } 6942 this.length -= c; 6943 return ret; 6944 } 6945 }, 6946 { 6947 key: custom, 6948 value: function value(_, options) { 6949 return inspect(this, _objectSpread(_objectSpread({}, options), {}, { 6950 depth: 0, 6951 customInspect: false 6952 })); 6953 } 6954 } 6955 ]); 6956 return BufferList; 6957 }(); 6958})); 6959//#endregion 6960//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js 6961var require_destroy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 6962 var process = require_browser$15(); 6963 function destroy(err, cb) { 6964 var _this = this; 6965 var readableDestroyed = this._readableState && this._readableState.destroyed; 6966 var writableDestroyed = this._writableState && this._writableState.destroyed; 6967 if (readableDestroyed || writableDestroyed) { 6968 if (cb) cb(err); 6969 else if (err) { 6970 if (!this._writableState) process.nextTick(emitErrorNT, this, err); 6971 else if (!this._writableState.errorEmitted) { 6972 this._writableState.errorEmitted = true; 6973 process.nextTick(emitErrorNT, this, err); 6974 } 6975 } 6976 return this; 6977 } 6978 if (this._readableState) this._readableState.destroyed = true; 6979 if (this._writableState) this._writableState.destroyed = true; 6980 this._destroy(err || null, function(err) { 6981 if (!cb && err) if (!_this._writableState) process.nextTick(emitErrorAndCloseNT, _this, err); 6982 else if (!_this._writableState.errorEmitted) { 6983 _this._writableState.errorEmitted = true; 6984 process.nextTick(emitErrorAndCloseNT, _this, err); 6985 } else process.nextTick(emitCloseNT, _this); 6986 else if (cb) { 6987 process.nextTick(emitCloseNT, _this); 6988 cb(err); 6989 } else process.nextTick(emitCloseNT, _this); 6990 }); 6991 return this; 6992 } 6993 function emitErrorAndCloseNT(self, err) { 6994 emitErrorNT(self, err); 6995 emitCloseNT(self); 6996 } 6997 function emitCloseNT(self) { 6998 if (self._writableState && !self._writableState.emitClose) return; 6999 if (self._readableState && !self._readableState.emitClose) return; 7000 self.emit("close"); 7001 } 7002 function undestroy() { 7003 if (this._readableState) { 7004 this._readableState.destroyed = false; 7005 this._readableState.reading = false; 7006 this._readableState.ended = false; 7007 this._readableState.endEmitted = false; 7008 } 7009 if (this._writableState) { 7010 this._writableState.destroyed = false; 7011 this._writableState.ended = false; 7012 this._writableState.ending = false; 7013 this._writableState.finalCalled = false; 7014 this._writableState.prefinished = false; 7015 this._writableState.finished = false; 7016 this._writableState.errorEmitted = false; 7017 } 7018 } 7019 function emitErrorNT(self, err) { 7020 self.emit("error", err); 7021 } 7022 function errorOrDestroy(stream, err) { 7023 var rState = stream._readableState; 7024 var wState = stream._writableState; 7025 if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err); 7026 else stream.emit("error", err); 7027 } 7028 module.exports = { 7029 destroy, 7030 undestroy, 7031 errorOrDestroy 7032 }; 7033})); 7034//#endregion 7035//#region node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js 7036var require_errors_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7037 function _inheritsLoose(subClass, superClass) { 7038 subClass.prototype = Object.create(superClass.prototype); 7039 subClass.prototype.constructor = subClass; 7040 subClass.__proto__ = superClass; 7041 } 7042 var codes = {}; 7043 function createErrorType(code, message, Base) { 7044 if (!Base) Base = Error; 7045 function getMessage(arg1, arg2, arg3) { 7046 if (typeof message === "string") return message; 7047 else return message(arg1, arg2, arg3); 7048 } 7049 var NodeError = /*#__PURE__*/ function(_Base) { 7050 _inheritsLoose(NodeError, _Base); 7051 function NodeError(arg1, arg2, arg3) { 7052 return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; 7053 } 7054 return NodeError; 7055 }(Base); 7056 NodeError.prototype.name = Base.name; 7057 NodeError.prototype.code = code; 7058 codes[code] = NodeError; 7059 } 7060 function oneOf(expected, thing) { 7061 if (Array.isArray(expected)) { 7062 var len = expected.length; 7063 expected = expected.map(function(i) { 7064 return String(i); 7065 }); 7066 if (len > 2) return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1]; 7067 else if (len === 2) return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); 7068 else return "of ".concat(thing, " ").concat(expected[0]); 7069 } else return "of ".concat(thing, " ").concat(String(expected)); 7070 } 7071 function startsWith(str, search, pos) { 7072 return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; 7073 } 7074 function endsWith(str, search, this_len) { 7075 if (this_len === void 0 || this_len > str.length) this_len = str.length; 7076 return str.substring(this_len - search.length, this_len) === search; 7077 } 7078 function includes(str, search, start) { 7079 if (typeof start !== "number") start = 0; 7080 if (start + search.length > str.length) return false;
vendor: 4,287 bytes, lines 7081-7170
7081 else return str.indexOf(search, start) !== -1; 7082 } 7083 createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { 7084 return "The value \"" + value + "\" is invalid for option \"" + name + "\""; 7085 }, TypeError); 7086 createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { 7087 var determiner; 7088 if (typeof expected === "string" && startsWith(expected, "not ")) { 7089 determiner = "must not be"; 7090 expected = expected.replace(/^not /, ""); 7091 } else determiner = "must be"; 7092 var msg; 7093 if (endsWith(name, " argument")) msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type")); 7094 else { 7095 var type = includes(name, ".") ? "property" : "argument"; 7096 msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type")); 7097 } 7098 msg += ". Received type ".concat(typeof actual); 7099 return msg; 7100 }, TypeError); 7101 createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); 7102 createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { 7103 return "The " + name + " method is not implemented"; 7104 }); 7105 createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); 7106 createErrorType("ERR_STREAM_DESTROYED", function(name) { 7107 return "Cannot call " + name + " after a stream was destroyed"; 7108 }); 7109 createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); 7110 createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); 7111 createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); 7112 createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); 7113 createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { 7114 return "Unknown encoding: " + arg; 7115 }, TypeError); 7116 createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); 7117 module.exports.codes = codes; 7118})); 7119//#endregion 7120//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js 7121var require_state = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7122 var ERR_INVALID_OPT_VALUE = require_errors_browser().codes.ERR_INVALID_OPT_VALUE; 7123 function highWaterMarkFrom(options, isDuplex, duplexKey) { 7124 return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; 7125 } 7126 function getHighWaterMark(state, options, duplexKey, isDuplex) { 7127 var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); 7128 if (hwm != null) { 7129 if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) throw new ERR_INVALID_OPT_VALUE(isDuplex ? duplexKey : "highWaterMark", hwm); 7130 return Math.floor(hwm); 7131 } 7132 return state.objectMode ? 16 : 16 * 1024; 7133 } 7134 module.exports = { getHighWaterMark }; 7135})); 7136//#endregion 7137//#region node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js 7138var require__stream_writable$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7139 var process = require_browser$15(); 7140 module.exports = Writable; 7141 function CorkedRequest(state) { 7142 var _this = this; 7143 this.next = null; 7144 this.entry = null; 7145 this.finish = function() { 7146 onCorkedFinish(_this, state); 7147 }; 7148 } 7149 var Duplex; 7150 Writable.WritableState = WritableState; 7151 var internalUtil = { deprecate: require_browser$11() }; 7152 var Stream = require_stream_browser$1(); 7153 var Buffer = require_buffer$1().Buffer; 7154 var OurUint8Array = (typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {}; 7155 function _uint8ArrayToBuffer(chunk) { 7156 return Buffer.from(chunk); 7157 } 7158 function _isUint8Array(obj) { 7159 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; 7160 } 7161 var destroyImpl = require_destroy$1(); 7162 var getHighWaterMark = require_state().getHighWaterMark; 7163 var _require$codes = require_errors_browser().codes; 7164 var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; 7165 var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; 7166 var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; 7167 var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; 7168 var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; 7169 var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; 7170 var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
vendor: 8,313 bytes, lines 7171-7414
7171 var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; 7172 var errorOrDestroy = destroyImpl.errorOrDestroy; 7173 require_inherits_browser()(Writable, Stream); 7174 function nop() {} 7175 function WritableState(options, stream, isDuplex) { 7176 Duplex = Duplex || require__stream_duplex$1(); 7177 options = options || {}; 7178 if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; 7179 this.objectMode = !!options.objectMode; 7180 if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; 7181 this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); 7182 this.finalCalled = false; 7183 this.needDrain = false; 7184 this.ending = false; 7185 this.ended = false; 7186 this.finished = false; 7187 this.destroyed = false; 7188 var noDecode = options.decodeStrings === false; 7189 this.decodeStrings = !noDecode; 7190 this.defaultEncoding = options.defaultEncoding || "utf8"; 7191 this.length = 0; 7192 this.writing = false; 7193 this.corked = 0; 7194 this.sync = true; 7195 this.bufferProcessing = false; 7196 this.onwrite = function(er) { 7197 onwrite(stream, er); 7198 }; 7199 this.writecb = null; 7200 this.writelen = 0; 7201 this.bufferedRequest = null; 7202 this.lastBufferedRequest = null; 7203 this.pendingcb = 0; 7204 this.prefinished = false; 7205 this.errorEmitted = false; 7206 this.emitClose = options.emitClose !== false; 7207 this.autoDestroy = !!options.autoDestroy; 7208 this.bufferedRequestCount = 0; 7209 this.corkedRequestsFree = new CorkedRequest(this); 7210 } 7211 WritableState.prototype.getBuffer = function getBuffer() { 7212 var current = this.bufferedRequest; 7213 var out = []; 7214 while (current) { 7215 out.push(current); 7216 current = current.next; 7217 } 7218 return out; 7219 }; 7220 (function() { 7221 try { 7222 Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function writableStateBufferGetter() { 7223 return this.getBuffer(); 7224 }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); 7225 } catch (_) {} 7226 })(); 7227 var realHasInstance; 7228 if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { 7229 realHasInstance = Function.prototype[Symbol.hasInstance]; 7230 Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { 7231 if (realHasInstance.call(this, object)) return true; 7232 if (this !== Writable) return false; 7233 return object && object._writableState instanceof WritableState; 7234 } }); 7235 } else realHasInstance = function realHasInstance(object) { 7236 return object instanceof this; 7237 }; 7238 function Writable(options) { 7239 Duplex = Duplex || require__stream_duplex$1(); 7240 var isDuplex = this instanceof Duplex; 7241 if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); 7242 this._writableState = new WritableState(options, this, isDuplex); 7243 this.writable = true; 7244 if (options) { 7245 if (typeof options.write === "function") this._write = options.write; 7246 if (typeof options.writev === "function") this._writev = options.writev; 7247 if (typeof options.destroy === "function") this._destroy = options.destroy; 7248 if (typeof options.final === "function") this._final = options.final; 7249 } 7250 Stream.call(this); 7251 } 7252 Writable.prototype.pipe = function() { 7253 errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); 7254 }; 7255 function writeAfterEnd(stream, cb) { 7256 var er = new ERR_STREAM_WRITE_AFTER_END(); 7257 errorOrDestroy(stream, er); 7258 process.nextTick(cb, er); 7259 } 7260 function validChunk(stream, state, chunk, cb) { 7261 var er; 7262 if (chunk === null) er = new ERR_STREAM_NULL_VALUES(); 7263 else if (typeof chunk !== "string" && !state.objectMode) er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); 7264 if (er) { 7265 errorOrDestroy(stream, er); 7266 process.nextTick(cb, er); 7267 return false; 7268 } 7269 return true; 7270 } 7271 Writable.prototype.write = function(chunk, encoding, cb) { 7272 var state = this._writableState; 7273 var ret = false; 7274 var isBuf = !state.objectMode && _isUint8Array(chunk); 7275 if (isBuf && !Buffer.isBuffer(chunk)) chunk = _uint8ArrayToBuffer(chunk); 7276 if (typeof encoding === "function") { 7277 cb = encoding; 7278 encoding = null; 7279 } 7280 if (isBuf) encoding = "buffer"; 7281 else if (!encoding) encoding = state.defaultEncoding; 7282 if (typeof cb !== "function") cb = nop; 7283 if (state.ending) writeAfterEnd(this, cb); 7284 else if (isBuf || validChunk(this, state, chunk, cb)) { 7285 state.pendingcb++; 7286 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); 7287 } 7288 return ret; 7289 }; 7290 Writable.prototype.cork = function() { 7291 this._writableState.corked++; 7292 }; 7293 Writable.prototype.uncork = function() { 7294 var state = this._writableState; 7295 if (state.corked) { 7296 state.corked--; 7297 if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); 7298 } 7299 }; 7300 Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { 7301 if (typeof encoding === "string") encoding = encoding.toLowerCase(); 7302 if (!([ 7303 "hex", 7304 "utf8", 7305 "utf-8", 7306 "ascii", 7307 "binary", 7308 "base64", 7309 "ucs2", 7310 "ucs-2", 7311 "utf16le", 7312 "utf-16le", 7313 "raw" 7314 ].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); 7315 this._writableState.defaultEncoding = encoding; 7316 return this; 7317 }; 7318 Object.defineProperty(Writable.prototype, "writableBuffer", { 7319 enumerable: false, 7320 get: function get() { 7321 return this._writableState && this._writableState.getBuffer(); 7322 } 7323 }); 7324 function decodeChunk(state, chunk, encoding) { 7325 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer.from(chunk, encoding); 7326 return chunk; 7327 } 7328 Object.defineProperty(Writable.prototype, "writableHighWaterMark", { 7329 enumerable: false, 7330 get: function get() { 7331 return this._writableState.highWaterMark; 7332 } 7333 }); 7334 function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { 7335 if (!isBuf) { 7336 var newChunk = decodeChunk(state, chunk, encoding); 7337 if (chunk !== newChunk) { 7338 isBuf = true; 7339 encoding = "buffer"; 7340 chunk = newChunk; 7341 } 7342 } 7343 var len = state.objectMode ? 1 : chunk.length; 7344 state.length += len; 7345 var ret = state.length < state.highWaterMark; 7346 if (!ret) state.needDrain = true; 7347 if (state.writing || state.corked) { 7348 var last = state.lastBufferedRequest; 7349 state.lastBufferedRequest = { 7350 chunk, 7351 encoding, 7352 isBuf, 7353 callback: cb, 7354 next: null 7355 }; 7356 if (last) last.next = state.lastBufferedRequest; 7357 else state.bufferedRequest = state.lastBufferedRequest; 7358 state.bufferedRequestCount += 1; 7359 } else doWrite(stream, state, false, len, chunk, encoding, cb); 7360 return ret; 7361 } 7362 function doWrite(stream, state, writev, len, chunk, encoding, cb) { 7363 state.writelen = len; 7364 state.writecb = cb; 7365 state.writing = true; 7366 state.sync = true; 7367 if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); 7368 else if (writev) stream._writev(chunk, state.onwrite); 7369 else stream._write(chunk, encoding, state.onwrite); 7370 state.sync = false; 7371 } 7372 function onwriteError(stream, state, sync, er, cb) { 7373 --state.pendingcb; 7374 if (sync) { 7375 process.nextTick(cb, er); 7376 process.nextTick(finishMaybe, stream, state); 7377 stream._writableState.errorEmitted = true; 7378 errorOrDestroy(stream, er); 7379 } else { 7380 cb(er); 7381 stream._writableState.errorEmitted = true; 7382 errorOrDestroy(stream, er); 7383 finishMaybe(stream, state); 7384 } 7385 } 7386 function onwriteStateUpdate(state) { 7387 state.writing = false; 7388 state.writecb = null; 7389 state.length -= state.writelen; 7390 state.writelen = 0; 7391 } 7392 function onwrite(stream, er) { 7393 var state = stream._writableState; 7394 var sync = state.sync; 7395 var cb = state.writecb; 7396 if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); 7397 onwriteStateUpdate(state); 7398 if (er) onwriteError(stream, state, sync, er, cb); 7399 else { 7400 var finished = needFinish(state) || stream.destroyed; 7401 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state); 7402 if (sync) process.nextTick(afterWrite, stream, state, finished, cb); 7403 else afterWrite(stream, state, finished, cb); 7404 } 7405 } 7406 function afterWrite(stream, state, finished, cb) { 7407 if (!finished) onwriteDrain(stream, state); 7408 state.pendingcb--; 7409 cb(); 7410 finishMaybe(stream, state); 7411 } 7412 function onwriteDrain(stream, state) { 7413 if (state.length === 0 && state.needDrain) { 7414 state.needDrain = false;
vendor: 5,121 bytes, lines 7415-7583
7415 stream.emit("drain"); 7416 } 7417 } 7418 function clearBuffer(stream, state) { 7419 state.bufferProcessing = true; 7420 var entry = state.bufferedRequest; 7421 if (stream._writev && entry && entry.next) { 7422 var l = state.bufferedRequestCount; 7423 var buffer = new Array(l); 7424 var holder = state.corkedRequestsFree; 7425 holder.entry = entry; 7426 var count = 0; 7427 var allBuffers = true; 7428 while (entry) { 7429 buffer[count] = entry; 7430 if (!entry.isBuf) allBuffers = false; 7431 entry = entry.next; 7432 count += 1; 7433 } 7434 buffer.allBuffers = allBuffers; 7435 doWrite(stream, state, true, state.length, buffer, "", holder.finish); 7436 state.pendingcb++; 7437 state.lastBufferedRequest = null; 7438 if (holder.next) { 7439 state.corkedRequestsFree = holder.next; 7440 holder.next = null; 7441 } else state.corkedRequestsFree = new CorkedRequest(state); 7442 state.bufferedRequestCount = 0; 7443 } else { 7444 while (entry) { 7445 var chunk = entry.chunk; 7446 var encoding = entry.encoding; 7447 var cb = entry.callback; 7448 doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb); 7449 entry = entry.next; 7450 state.bufferedRequestCount--; 7451 if (state.writing) break; 7452 } 7453 if (entry === null) state.lastBufferedRequest = null; 7454 } 7455 state.bufferedRequest = entry; 7456 state.bufferProcessing = false; 7457 } 7458 Writable.prototype._write = function(chunk, encoding, cb) { 7459 cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); 7460 }; 7461 Writable.prototype._writev = null; 7462 Writable.prototype.end = function(chunk, encoding, cb) { 7463 var state = this._writableState; 7464 if (typeof chunk === "function") { 7465 cb = chunk; 7466 chunk = null; 7467 encoding = null; 7468 } else if (typeof encoding === "function") { 7469 cb = encoding; 7470 encoding = null; 7471 } 7472 if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); 7473 if (state.corked) { 7474 state.corked = 1; 7475 this.uncork(); 7476 } 7477 if (!state.ending) endWritable(this, state, cb); 7478 return this; 7479 }; 7480 Object.defineProperty(Writable.prototype, "writableLength", { 7481 enumerable: false, 7482 get: function get() { 7483 return this._writableState.length; 7484 } 7485 }); 7486 function needFinish(state) { 7487 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; 7488 } 7489 function callFinal(stream, state) { 7490 stream._final(function(err) { 7491 state.pendingcb--; 7492 if (err) errorOrDestroy(stream, err); 7493 state.prefinished = true; 7494 stream.emit("prefinish"); 7495 finishMaybe(stream, state); 7496 }); 7497 } 7498 function prefinish(stream, state) { 7499 if (!state.prefinished && !state.finalCalled) if (typeof stream._final === "function" && !state.destroyed) { 7500 state.pendingcb++; 7501 state.finalCalled = true; 7502 process.nextTick(callFinal, stream, state); 7503 } else { 7504 state.prefinished = true; 7505 stream.emit("prefinish"); 7506 } 7507 } 7508 function finishMaybe(stream, state) { 7509 var need = needFinish(state); 7510 if (need) { 7511 prefinish(stream, state); 7512 if (state.pendingcb === 0) { 7513 state.finished = true; 7514 stream.emit("finish"); 7515 if (state.autoDestroy) { 7516 var rState = stream._readableState; 7517 if (!rState || rState.autoDestroy && rState.endEmitted) stream.destroy(); 7518 } 7519 } 7520 } 7521 return need; 7522 } 7523 function endWritable(stream, state, cb) { 7524 state.ending = true; 7525 finishMaybe(stream, state); 7526 if (cb) if (state.finished) process.nextTick(cb); 7527 else stream.once("finish", cb); 7528 state.ended = true; 7529 stream.writable = false; 7530 } 7531 function onCorkedFinish(corkReq, state, err) { 7532 var entry = corkReq.entry; 7533 corkReq.entry = null; 7534 while (entry) { 7535 var cb = entry.callback; 7536 state.pendingcb--; 7537 cb(err); 7538 entry = entry.next; 7539 } 7540 state.corkedRequestsFree.next = corkReq; 7541 } 7542 Object.defineProperty(Writable.prototype, "destroyed", { 7543 enumerable: false, 7544 get: function get() { 7545 if (this._writableState === void 0) return false; 7546 return this._writableState.destroyed; 7547 }, 7548 set: function set(value) { 7549 if (!this._writableState) return; 7550 this._writableState.destroyed = value; 7551 } 7552 }); 7553 Writable.prototype.destroy = destroyImpl.destroy; 7554 Writable.prototype._undestroy = destroyImpl.undestroy; 7555 Writable.prototype._destroy = function(err, cb) { 7556 cb(err); 7557 }; 7558})); 7559//#endregion 7560//#region node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js 7561var require__stream_duplex$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7562 var process = require_browser$15(); 7563 var objectKeys = Object.keys || function(obj) { 7564 var keys = []; 7565 for (var key in obj) keys.push(key); 7566 return keys; 7567 }; 7568 module.exports = Duplex; 7569 var Readable = require__stream_readable$1(); 7570 var Writable = require__stream_writable$1(); 7571 require_inherits_browser()(Duplex, Readable); 7572 var keys = objectKeys(Writable.prototype); 7573 for (var v = 0; v < keys.length; v++) { 7574 var method = keys[v]; 7575 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; 7576 } 7577 function Duplex(options) { 7578 if (!(this instanceof Duplex)) return new Duplex(options); 7579 Readable.call(this, options); 7580 Writable.call(this, options); 7581 this.allowHalfOpen = true; 7582 if (options) { 7583 if (options.readable === false) this.readable = false;
vendor: 9,809 bytes, lines 7584-7882
7584 if (options.writable === false) this.writable = false; 7585 if (options.allowHalfOpen === false) { 7586 this.allowHalfOpen = false; 7587 this.once("end", onend); 7588 } 7589 } 7590 } 7591 Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { 7592 enumerable: false, 7593 get: function get() { 7594 return this._writableState.highWaterMark; 7595 } 7596 }); 7597 Object.defineProperty(Duplex.prototype, "writableBuffer", { 7598 enumerable: false, 7599 get: function get() { 7600 return this._writableState && this._writableState.getBuffer(); 7601 } 7602 }); 7603 Object.defineProperty(Duplex.prototype, "writableLength", { 7604 enumerable: false, 7605 get: function get() { 7606 return this._writableState.length; 7607 } 7608 }); 7609 function onend() { 7610 if (this._writableState.ended) return; 7611 process.nextTick(onEndNT, this); 7612 } 7613 function onEndNT(self) { 7614 self.end(); 7615 } 7616 Object.defineProperty(Duplex.prototype, "destroyed", { 7617 enumerable: false, 7618 get: function get() { 7619 if (this._readableState === void 0 || this._writableState === void 0) return false; 7620 return this._readableState.destroyed && this._writableState.destroyed; 7621 }, 7622 set: function set(value) { 7623 if (this._readableState === void 0 || this._writableState === void 0) return; 7624 this._readableState.destroyed = value; 7625 this._writableState.destroyed = value; 7626 } 7627 }); 7628})); 7629//#endregion 7630//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js 7631var require_end_of_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7632 var ERR_STREAM_PREMATURE_CLOSE = require_errors_browser().codes.ERR_STREAM_PREMATURE_CLOSE; 7633 function once(callback) { 7634 var called = false; 7635 return function() { 7636 if (called) return; 7637 called = true; 7638 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; 7639 callback.apply(this, args); 7640 }; 7641 } 7642 function noop() {} 7643 function isRequest(stream) { 7644 return stream.setHeader && typeof stream.abort === "function"; 7645 } 7646 function eos(stream, opts, callback) { 7647 if (typeof opts === "function") return eos(stream, null, opts); 7648 if (!opts) opts = {}; 7649 callback = once(callback || noop); 7650 var readable = opts.readable || opts.readable !== false && stream.readable; 7651 var writable = opts.writable || opts.writable !== false && stream.writable; 7652 var onlegacyfinish = function onlegacyfinish() { 7653 if (!stream.writable) onfinish(); 7654 }; 7655 var writableEnded = stream._writableState && stream._writableState.finished; 7656 var onfinish = function onfinish() { 7657 writable = false; 7658 writableEnded = true; 7659 if (!readable) callback.call(stream); 7660 }; 7661 var readableEnded = stream._readableState && stream._readableState.endEmitted; 7662 var onend = function onend() { 7663 readable = false; 7664 readableEnded = true; 7665 if (!writable) callback.call(stream); 7666 }; 7667 var onerror = function onerror(err) { 7668 callback.call(stream, err); 7669 }; 7670 var onclose = function onclose() { 7671 var err; 7672 if (readable && !readableEnded) { 7673 if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); 7674 return callback.call(stream, err); 7675 } 7676 if (writable && !writableEnded) { 7677 if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); 7678 return callback.call(stream, err); 7679 } 7680 }; 7681 var onrequest = function onrequest() { 7682 stream.req.on("finish", onfinish); 7683 }; 7684 if (isRequest(stream)) { 7685 stream.on("complete", onfinish); 7686 stream.on("abort", onclose); 7687 if (stream.req) onrequest(); 7688 else stream.on("request", onrequest); 7689 } else if (writable && !stream._writableState) { 7690 stream.on("end", onlegacyfinish); 7691 stream.on("close", onlegacyfinish); 7692 } 7693 stream.on("end", onend); 7694 stream.on("finish", onfinish); 7695 if (opts.error !== false) stream.on("error", onerror); 7696 stream.on("close", onclose); 7697 return function() { 7698 stream.removeListener("complete", onfinish); 7699 stream.removeListener("abort", onclose); 7700 stream.removeListener("request", onrequest); 7701 if (stream.req) stream.req.removeListener("finish", onfinish); 7702 stream.removeListener("end", onlegacyfinish); 7703 stream.removeListener("close", onlegacyfinish); 7704 stream.removeListener("finish", onfinish); 7705 stream.removeListener("end", onend); 7706 stream.removeListener("error", onerror); 7707 stream.removeListener("close", onclose); 7708 }; 7709 } 7710 module.exports = eos; 7711})); 7712//#endregion 7713//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js 7714var require_async_iterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7715 var process = require_browser$15(); 7716 var _Object$setPrototypeO; 7717 function _defineProperty(obj, key, value) { 7718 key = _toPropertyKey(key); 7719 if (key in obj) Object.defineProperty(obj, key, { 7720 value, 7721 enumerable: true, 7722 configurable: true, 7723 writable: true 7724 }); 7725 else obj[key] = value; 7726 return obj; 7727 } 7728 function _toPropertyKey(arg) { 7729 var key = _toPrimitive(arg, "string"); 7730 return typeof key === "symbol" ? key : String(key); 7731 } 7732 function _toPrimitive(input, hint) { 7733 if (typeof input !== "object" || input === null) return input; 7734 var prim = input[Symbol.toPrimitive]; 7735 if (prim !== void 0) { 7736 var res = prim.call(input, hint || "default"); 7737 if (typeof res !== "object") return res; 7738 throw new TypeError("@@toPrimitive must return a primitive value."); 7739 } 7740 return (hint === "string" ? String : Number)(input); 7741 } 7742 var finished = require_end_of_stream(); 7743 var kLastResolve = Symbol("lastResolve"); 7744 var kLastReject = Symbol("lastReject"); 7745 var kError = Symbol("error"); 7746 var kEnded = Symbol("ended"); 7747 var kLastPromise = Symbol("lastPromise"); 7748 var kHandlePromise = Symbol("handlePromise"); 7749 var kStream = Symbol("stream"); 7750 function createIterResult(value, done) { 7751 return { 7752 value, 7753 done 7754 }; 7755 } 7756 function readAndResolve(iter) { 7757 var resolve = iter[kLastResolve]; 7758 if (resolve !== null) { 7759 var data = iter[kStream].read(); 7760 if (data !== null) { 7761 iter[kLastPromise] = null; 7762 iter[kLastResolve] = null; 7763 iter[kLastReject] = null; 7764 resolve(createIterResult(data, false)); 7765 } 7766 } 7767 } 7768 function onReadable(iter) { 7769 process.nextTick(readAndResolve, iter); 7770 } 7771 function wrapForNext(lastPromise, iter) { 7772 return function(resolve, reject) { 7773 lastPromise.then(function() { 7774 if (iter[kEnded]) { 7775 resolve(createIterResult(void 0, true)); 7776 return; 7777 } 7778 iter[kHandlePromise](resolve, reject); 7779 }, reject); 7780 }; 7781 } 7782 var AsyncIteratorPrototype = Object.getPrototypeOf(function() {}); 7783 var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { 7784 get stream() { 7785 return this[kStream]; 7786 }, 7787 next: function next() { 7788 var _this = this; 7789 var error = this[kError]; 7790 if (error !== null) return Promise.reject(error); 7791 if (this[kEnded]) return Promise.resolve(createIterResult(void 0, true)); 7792 if (this[kStream].destroyed) return new Promise(function(resolve, reject) { 7793 process.nextTick(function() { 7794 if (_this[kError]) reject(_this[kError]); 7795 else resolve(createIterResult(void 0, true)); 7796 }); 7797 }); 7798 var lastPromise = this[kLastPromise]; 7799 var promise; 7800 if (lastPromise) promise = new Promise(wrapForNext(lastPromise, this)); 7801 else { 7802 var data = this[kStream].read(); 7803 if (data !== null) return Promise.resolve(createIterResult(data, false)); 7804 promise = new Promise(this[kHandlePromise]); 7805 } 7806 this[kLastPromise] = promise; 7807 return promise; 7808 } 7809 }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { 7810 return this; 7811 }), _defineProperty(_Object$setPrototypeO, "return", function _return() { 7812 var _this2 = this; 7813 return new Promise(function(resolve, reject) { 7814 _this2[kStream].destroy(null, function(err) { 7815 if (err) { 7816 reject(err); 7817 return; 7818 } 7819 resolve(createIterResult(void 0, true)); 7820 }); 7821 }); 7822 }), _Object$setPrototypeO), AsyncIteratorPrototype); 7823 module.exports = function createReadableStreamAsyncIterator(stream) { 7824 var _Object$create; 7825 var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { 7826 value: stream, 7827 writable: true 7828 }), _defineProperty(_Object$create, kLastResolve, { 7829 value: null, 7830 writable: true 7831 }), _defineProperty(_Object$create, kLastReject, { 7832 value: null, 7833 writable: true 7834 }), _defineProperty(_Object$create, kError, { 7835 value: null, 7836 writable: true 7837 }), _defineProperty(_Object$create, kEnded, { 7838 value: stream._readableState.endEmitted, 7839 writable: true 7840 }), _defineProperty(_Object$create, kHandlePromise, { 7841 value: function value(resolve, reject) { 7842 var data = iterator[kStream].read(); 7843 if (data) { 7844 iterator[kLastPromise] = null; 7845 iterator[kLastResolve] = null; 7846 iterator[kLastReject] = null; 7847 resolve(createIterResult(data, false)); 7848 } else { 7849 iterator[kLastResolve] = resolve; 7850 iterator[kLastReject] = reject; 7851 } 7852 }, 7853 writable: true 7854 }), _Object$create)); 7855 iterator[kLastPromise] = null; 7856 finished(stream, function(err) { 7857 if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { 7858 var reject = iterator[kLastReject]; 7859 if (reject !== null) { 7860 iterator[kLastPromise] = null; 7861 iterator[kLastResolve] = null; 7862 iterator[kLastReject] = null; 7863 reject(err); 7864 } 7865 iterator[kError] = err; 7866 return; 7867 } 7868 var resolve = iterator[kLastResolve]; 7869 if (resolve !== null) { 7870 iterator[kLastPromise] = null; 7871 iterator[kLastResolve] = null; 7872 iterator[kLastReject] = null; 7873 resolve(createIterResult(void 0, true)); 7874 } 7875 iterator[kEnded] = true; 7876 }); 7877 stream.on("readable", onReadable.bind(null, iterator)); 7878 return iterator; 7879 }; 7880})); 7881//#endregion 7882//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/stream
vendor: 4,281 bytes, lines 7882-7988
7882s/from-browser.js 7883var require_from_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7884 module.exports = function() { 7885 throw new Error("Readable.from is not available in the browser"); 7886 }; 7887})); 7888//#endregion 7889//#region node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js 7890var require__stream_readable$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 7891 var process = require_browser$15(); 7892 module.exports = Readable; 7893 var Duplex; 7894 Readable.ReadableState = ReadableState; 7895 require_events().EventEmitter; 7896 var EElistenerCount = function EElistenerCount(emitter, type) { 7897 return emitter.listeners(type).length; 7898 }; 7899 var Stream = require_stream_browser$1(); 7900 var Buffer = require_buffer$1().Buffer; 7901 var OurUint8Array = (typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {}; 7902 function _uint8ArrayToBuffer(chunk) { 7903 return Buffer.from(chunk); 7904 } 7905 function _isUint8Array(obj) { 7906 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; 7907 } 7908 var debugUtil = require___vite_browser_external(); 7909 var debug; 7910 if (debugUtil && debugUtil.debuglog) debug = debugUtil.debuglog("stream"); 7911 else debug = function debug() {}; 7912 var BufferList = require_buffer_list(); 7913 var destroyImpl = require_destroy$1(); 7914 var getHighWaterMark = require_state().getHighWaterMark; 7915 var _require$codes = require_errors_browser().codes; 7916 var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; 7917 var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; 7918 var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; 7919 var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; 7920 var StringDecoder; 7921 var createReadableStreamAsyncIterator; 7922 var from; 7923 require_inherits_browser()(Readable, Stream); 7924 var errorOrDestroy = destroyImpl.errorOrDestroy; 7925 var kProxyEvents = [ 7926 "error", 7927 "close", 7928 "destroy", 7929 "pause", 7930 "resume" 7931 ]; 7932 function prependListener(emitter, event, fn) { 7933 if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); 7934 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); 7935 else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn); 7936 else emitter._events[event] = [fn, emitter._events[event]]; 7937 } 7938 function ReadableState(options, stream, isDuplex) { 7939 Duplex = Duplex || require__stream_duplex$1(); 7940 options = options || {}; 7941 if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; 7942 this.objectMode = !!options.objectMode; 7943 if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; 7944 this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); 7945 this.buffer = new BufferList(); 7946 this.length = 0; 7947 this.pipes = null; 7948 this.pipesCount = 0; 7949 this.flowing = null; 7950 this.ended = false; 7951 this.endEmitted = false; 7952 this.reading = false; 7953 this.sync = true; 7954 this.needReadable = false; 7955 this.emittedReadable = false; 7956 this.readableListening = false; 7957 this.resumeScheduled = false; 7958 this.paused = true; 7959 this.emitClose = options.emitClose !== false; 7960 this.autoDestroy = !!options.autoDestroy; 7961 this.destroyed = false; 7962 this.defaultEncoding = options.defaultEncoding || "utf8"; 7963 this.awaitDrain = 0; 7964 this.readingMore = false; 7965 this.decoder = null; 7966 this.encoding = null; 7967 if (options.encoding) { 7968 if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; 7969 this.decoder = new StringDecoder(options.encoding); 7970 this.encoding = options.encoding; 7971 } 7972 } 7973 function Readable(options) { 7974 Duplex = Duplex || require__stream_duplex$1(); 7975 if (!(this instanceof Readable)) return new Readable(options); 7976 var isDuplex = this instanceof Duplex; 7977 this._readableState = new ReadableState(options, this, isDuplex); 7978 this.readable = true; 7979 if (options) { 7980 if (typeof options.read === "function") this._read = options.read; 7981 if (typeof options.destroy === "function") this._destroy = options.destroy; 7982 } 7983 Stream.call(this); 7984 } 7985 Object.defineProperty(Readable.prototype, "destroyed", { 7986 enumerable: false, 7987 get: function get() { 7988 if (this._readableState === void 0) return false;
vendor: 17,926 bytes, lines 7989-8551
7989 return this._readableState.destroyed; 7990 }, 7991 set: function set(value) { 7992 if (!this._readableState) return; 7993 this._readableState.destroyed = value; 7994 } 7995 }); 7996 Readable.prototype.destroy = destroyImpl.destroy; 7997 Readable.prototype._undestroy = destroyImpl.undestroy; 7998 Readable.prototype._destroy = function(err, cb) { 7999 cb(err); 8000 }; 8001 Readable.prototype.push = function(chunk, encoding) { 8002 var state = this._readableState; 8003 var skipChunkCheck; 8004 if (!state.objectMode) { 8005 if (typeof chunk === "string") { 8006 encoding = encoding || state.defaultEncoding; 8007 if (encoding !== state.encoding) { 8008 chunk = Buffer.from(chunk, encoding); 8009 encoding = ""; 8010 } 8011 skipChunkCheck = true; 8012 } 8013 } else skipChunkCheck = true; 8014 return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); 8015 }; 8016 Readable.prototype.unshift = function(chunk) { 8017 return readableAddChunk(this, chunk, null, true, false); 8018 }; 8019 function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { 8020 debug("readableAddChunk", chunk); 8021 var state = stream._readableState; 8022 if (chunk === null) { 8023 state.reading = false; 8024 onEofChunk(stream, state); 8025 } else { 8026 var er; 8027 if (!skipChunkCheck) er = chunkInvalid(state, chunk); 8028 if (er) errorOrDestroy(stream, er); 8029 else if (state.objectMode || chunk && chunk.length > 0) { 8030 if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) chunk = _uint8ArrayToBuffer(chunk); 8031 if (addToFront) if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); 8032 else addChunk(stream, state, chunk, true); 8033 else if (state.ended) errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); 8034 else if (state.destroyed) return false; 8035 else { 8036 state.reading = false; 8037 if (state.decoder && !encoding) { 8038 chunk = state.decoder.write(chunk); 8039 if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); 8040 else maybeReadMore(stream, state); 8041 } else addChunk(stream, state, chunk, false); 8042 } 8043 } else if (!addToFront) { 8044 state.reading = false; 8045 maybeReadMore(stream, state); 8046 } 8047 } 8048 return !state.ended && (state.length < state.highWaterMark || state.length === 0); 8049 } 8050 function addChunk(stream, state, chunk, addToFront) { 8051 if (state.flowing && state.length === 0 && !state.sync) { 8052 state.awaitDrain = 0; 8053 stream.emit("data", chunk); 8054 } else { 8055 state.length += state.objectMode ? 1 : chunk.length; 8056 if (addToFront) state.buffer.unshift(chunk); 8057 else state.buffer.push(chunk); 8058 if (state.needReadable) emitReadable(stream); 8059 } 8060 maybeReadMore(stream, state); 8061 } 8062 function chunkInvalid(state, chunk) { 8063 var er; 8064 if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = new ERR_INVALID_ARG_TYPE("chunk", [ 8065 "string", 8066 "Buffer", 8067 "Uint8Array" 8068 ], chunk); 8069 return er; 8070 } 8071 Readable.prototype.isPaused = function() { 8072 return this._readableState.flowing === false; 8073 }; 8074 Readable.prototype.setEncoding = function(enc) { 8075 if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; 8076 var decoder = new StringDecoder(enc); 8077 this._readableState.decoder = decoder; 8078 this._readableState.encoding = this._readableState.decoder.encoding; 8079 var p = this._readableState.buffer.head; 8080 var content = ""; 8081 while (p !== null) { 8082 content += decoder.write(p.data); 8083 p = p.next; 8084 } 8085 this._readableState.buffer.clear(); 8086 if (content !== "") this._readableState.buffer.push(content); 8087 this._readableState.length = content.length; 8088 return this; 8089 }; 8090 var MAX_HWM = 1073741824; 8091 function computeNewHighWaterMark(n) { 8092 if (n >= MAX_HWM) n = MAX_HWM; 8093 else { 8094 n--; 8095 n |= n >>> 1; 8096 n |= n >>> 2; 8097 n |= n >>> 4; 8098 n |= n >>> 8; 8099 n |= n >>> 16; 8100 n++; 8101 } 8102 return n; 8103 } 8104 function howMuchToRead(n, state) { 8105 if (n <= 0 || state.length === 0 && state.ended) return 0; 8106 if (state.objectMode) return 1; 8107 if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length; 8108 else return state.length; 8109 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); 8110 if (n <= state.length) return n; 8111 if (!state.ended) { 8112 state.needReadable = true; 8113 return 0; 8114 } 8115 return state.length; 8116 } 8117 Readable.prototype.read = function(n) { 8118 debug("read", n); 8119 n = parseInt(n, 10); 8120 var state = this._readableState; 8121 var nOrig = n; 8122 if (n !== 0) state.emittedReadable = false; 8123 if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { 8124 debug("read: emitReadable", state.length, state.ended); 8125 if (state.length === 0 && state.ended) endReadable(this); 8126 else emitReadable(this); 8127 return null; 8128 } 8129 n = howMuchToRead(n, state); 8130 if (n === 0 && state.ended) { 8131 if (state.length === 0) endReadable(this); 8132 return null; 8133 } 8134 var doRead = state.needReadable; 8135 debug("need readable", doRead); 8136 if (state.length === 0 || state.length - n < state.highWaterMark) { 8137 doRead = true; 8138 debug("length less than watermark", doRead); 8139 } 8140 if (state.ended || state.reading) { 8141 doRead = false; 8142 debug("reading or ended", doRead); 8143 } else if (doRead) { 8144 debug("do read"); 8145 state.reading = true; 8146 state.sync = true; 8147 if (state.length === 0) state.needReadable = true; 8148 this._read(state.highWaterMark); 8149 state.sync = false; 8150 if (!state.reading) n = howMuchToRead(nOrig, state); 8151 } 8152 var ret; 8153 if (n > 0) ret = fromList(n, state); 8154 else ret = null; 8155 if (ret === null) { 8156 state.needReadable = state.length <= state.highWaterMark; 8157 n = 0; 8158 } else { 8159 state.length -= n; 8160 state.awaitDrain = 0; 8161 } 8162 if (state.length === 0) { 8163 if (!state.ended) state.needReadable = true; 8164 if (nOrig !== n && state.ended) endReadable(this); 8165 } 8166 if (ret !== null) this.emit("data", ret); 8167 return ret; 8168 }; 8169 function onEofChunk(stream, state) { 8170 debug("onEofChunk"); 8171 if (state.ended) return; 8172 if (state.decoder) { 8173 var chunk = state.decoder.end(); 8174 if (chunk && chunk.length) { 8175 state.buffer.push(chunk); 8176 state.length += state.objectMode ? 1 : chunk.length; 8177 } 8178 } 8179 state.ended = true; 8180 if (state.sync) emitReadable(stream); 8181 else { 8182 state.needReadable = false; 8183 if (!state.emittedReadable) { 8184 state.emittedReadable = true; 8185 emitReadable_(stream); 8186 } 8187 } 8188 } 8189 function emitReadable(stream) { 8190 var state = stream._readableState; 8191 debug("emitReadable", state.needReadable, state.emittedReadable); 8192 state.needReadable = false; 8193 if (!state.emittedReadable) { 8194 debug("emitReadable", state.flowing); 8195 state.emittedReadable = true; 8196 process.nextTick(emitReadable_, stream); 8197 } 8198 } 8199 function emitReadable_(stream) { 8200 var state = stream._readableState; 8201 debug("emitReadable_", state.destroyed, state.length, state.ended); 8202 if (!state.destroyed && (state.length || state.ended)) { 8203 stream.emit("readable"); 8204 state.emittedReadable = false; 8205 } 8206 state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; 8207 flow(stream); 8208 } 8209 function maybeReadMore(stream, state) { 8210 if (!state.readingMore) { 8211 state.readingMore = true; 8212 process.nextTick(maybeReadMore_, stream, state); 8213 } 8214 } 8215 function maybeReadMore_(stream, state) { 8216 while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { 8217 var len = state.length; 8218 debug("maybeReadMore read 0"); 8219 stream.read(0); 8220 if (len === state.length) break; 8221 } 8222 state.readingMore = false; 8223 } 8224 Readable.prototype._read = function(n) { 8225 errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); 8226 }; 8227 Readable.prototype.pipe = function(dest, pipeOpts) { 8228 var src = this; 8229 var state = this._readableState; 8230 switch (state.pipesCount) { 8231 case 0: 8232 state.pipes = dest; 8233 break; 8234 case 1: 8235 state.pipes = [state.pipes, dest]; 8236 break; 8237 default: 8238 state.pipes.push(dest); 8239 break; 8240 } 8241 state.pipesCount += 1; 8242 debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); 8243 var endFn = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr ? onend : unpipe; 8244 if (state.endEmitted) process.nextTick(endFn); 8245 else src.once("end", endFn); 8246 dest.on("unpipe", onunpipe); 8247 function onunpipe(readable, unpipeInfo) { 8248 debug("onunpipe"); 8249 if (readable === src) { 8250 if (unpipeInfo && unpipeInfo.hasUnpiped === false) { 8251 unpipeInfo.hasUnpiped = true; 8252 cleanup(); 8253 } 8254 } 8255 } 8256 function onend() { 8257 debug("onend"); 8258 dest.end(); 8259 } 8260 var ondrain = pipeOnDrain(src); 8261 dest.on("drain", ondrain); 8262 var cleanedUp = false; 8263 function cleanup() { 8264 debug("cleanup"); 8265 dest.removeListener("close", onclose); 8266 dest.removeListener("finish", onfinish); 8267 dest.removeListener("drain", ondrain); 8268 dest.removeListener("error", onerror); 8269 dest.removeListener("unpipe", onunpipe); 8270 src.removeListener("end", onend); 8271 src.removeListener("end", unpipe); 8272 src.removeListener("data", ondata); 8273 cleanedUp = true; 8274 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); 8275 } 8276 src.on("data", ondata); 8277 function ondata(chunk) { 8278 debug("ondata"); 8279 var ret = dest.write(chunk); 8280 debug("dest.write", ret); 8281 if (ret === false) { 8282 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { 8283 debug("false write response, pause", state.awaitDrain); 8284 state.awaitDrain++; 8285 } 8286 src.pause(); 8287 } 8288 } 8289 function onerror(er) { 8290 debug("onerror", er); 8291 unpipe(); 8292 dest.removeListener("error", onerror); 8293 if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); 8294 } 8295 prependListener(dest, "error", onerror); 8296 function onclose() { 8297 dest.removeListener("finish", onfinish); 8298 unpipe(); 8299 } 8300 dest.once("close", onclose); 8301 function onfinish() { 8302 debug("onfinish"); 8303 dest.removeListener("close", onclose); 8304 unpipe(); 8305 } 8306 dest.once("finish", onfinish); 8307 function unpipe() { 8308 debug("unpipe"); 8309 src.unpipe(dest); 8310 } 8311 dest.emit("pipe", src); 8312 if (!state.flowing) { 8313 debug("pipe resume"); 8314 src.resume(); 8315 } 8316 return dest; 8317 }; 8318 function pipeOnDrain(src) { 8319 return function pipeOnDrainFunctionResult() { 8320 var state = src._readableState; 8321 debug("pipeOnDrain", state.awaitDrain); 8322 if (state.awaitDrain) state.awaitDrain--; 8323 if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { 8324 state.flowing = true; 8325 flow(src); 8326 } 8327 }; 8328 } 8329 Readable.prototype.unpipe = function(dest) { 8330 var state = this._readableState; 8331 var unpipeInfo = { hasUnpiped: false }; 8332 if (state.pipesCount === 0) return this; 8333 if (state.pipesCount === 1) { 8334 if (dest && dest !== state.pipes) return this; 8335 if (!dest) dest = state.pipes; 8336 state.pipes = null; 8337 state.pipesCount = 0; 8338 state.flowing = false; 8339 if (dest) dest.emit("unpipe", this, unpipeInfo); 8340 return this; 8341 } 8342 if (!dest) { 8343 var dests = state.pipes; 8344 var len = state.pipesCount; 8345 state.pipes = null; 8346 state.pipesCount = 0; 8347 state.flowing = false; 8348 for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false }); 8349 return this; 8350 } 8351 var index = indexOf(state.pipes, dest); 8352 if (index === -1) return this; 8353 state.pipes.splice(index, 1); 8354 state.pipesCount -= 1; 8355 if (state.pipesCount === 1) state.pipes = state.pipes[0]; 8356 dest.emit("unpipe", this, unpipeInfo); 8357 return this; 8358 }; 8359 Readable.prototype.on = function(ev, fn) { 8360 var res = Stream.prototype.on.call(this, ev, fn); 8361 var state = this._readableState; 8362 if (ev === "data") { 8363 state.readableListening = this.listenerCount("readable") > 0; 8364 if (state.flowing !== false) this.resume(); 8365 } else if (ev === "readable") { 8366 if (!state.endEmitted && !state.readableListening) { 8367 state.readableListening = state.needReadable = true; 8368 state.flowing = false; 8369 state.emittedReadable = false; 8370 debug("on readable", state.length, state.reading); 8371 if (state.length) emitReadable(this); 8372 else if (!state.reading) process.nextTick(nReadingNextTick, this); 8373 } 8374 } 8375 return res; 8376 }; 8377 Readable.prototype.addListener = Readable.prototype.on; 8378 Readable.prototype.removeListener = function(ev, fn) { 8379 var res = Stream.prototype.removeListener.call(this, ev, fn); 8380 if (ev === "readable") process.nextTick(updateReadableListening, this); 8381 return res; 8382 }; 8383 Readable.prototype.removeAllListeners = function(ev) { 8384 var res = Stream.prototype.removeAllListeners.apply(this, arguments); 8385 if (ev === "readable" || ev === void 0) process.nextTick(updateReadableListening, this); 8386 return res; 8387 }; 8388 function updateReadableListening(self) { 8389 var state = self._readableState; 8390 state.readableListening = self.listenerCount("readable") > 0; 8391 if (state.resumeScheduled && !state.paused) state.flowing = true; 8392 else if (self.listenerCount("data") > 0) self.resume(); 8393 } 8394 function nReadingNextTick(self) { 8395 debug("readable nexttick read 0"); 8396 self.read(0); 8397 } 8398 Readable.prototype.resume = function() { 8399 var state = this._readableState; 8400 if (!state.flowing) { 8401 debug("resume"); 8402 state.flowing = !state.readableListening; 8403 resume(this, state); 8404 } 8405 state.paused = false; 8406 return this; 8407 }; 8408 function resume(stream, state) { 8409 if (!state.resumeScheduled) { 8410 state.resumeScheduled = true; 8411 process.nextTick(resume_, stream, state); 8412 } 8413 } 8414 function resume_(stream, state) { 8415 debug("resume", state.reading); 8416 if (!state.reading) stream.read(0); 8417 state.resumeScheduled = false; 8418 stream.emit("resume"); 8419 flow(stream); 8420 if (state.flowing && !state.reading) stream.read(0); 8421 } 8422 Readable.prototype.pause = function() { 8423 debug("call pause flowing=%j", this._readableState.flowing); 8424 if (this._readableState.flowing !== false) { 8425 debug("pause"); 8426 this._readableState.flowing = false; 8427 this.emit("pause"); 8428 } 8429 this._readableState.paused = true; 8430 return this; 8431 }; 8432 function flow(stream) { 8433 var state = stream._readableState; 8434 debug("flow", state.flowing); 8435 while (state.flowing && stream.read() !== null); 8436 } 8437 Readable.prototype.wrap = function(stream) { 8438 var _this = this; 8439 var state = this._readableState; 8440 var paused = false; 8441 stream.on("end", function() { 8442 debug("wrapped end"); 8443 if (state.decoder && !state.ended) { 8444 var chunk = state.decoder.end(); 8445 if (chunk && chunk.length) _this.push(chunk); 8446 } 8447 _this.push(null); 8448 }); 8449 stream.on("data", function(chunk) { 8450 debug("wrapped data"); 8451 if (state.decoder) chunk = state.decoder.write(chunk); 8452 if (state.objectMode && (chunk === null || chunk === void 0)) return; 8453 else if (!state.objectMode && (!chunk || !chunk.length)) return; 8454 if (!_this.push(chunk)) { 8455 paused = true; 8456 stream.pause(); 8457 } 8458 }); 8459 for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function methodWrap(method) { 8460 return function methodWrapReturnFunction() { 8461 return stream[method].apply(stream, arguments); 8462 }; 8463 }(i); 8464 for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); 8465 this._read = function(n) { 8466 debug("wrapped _read", n); 8467 if (paused) { 8468 paused = false; 8469 stream.resume(); 8470 } 8471 }; 8472 return this; 8473 }; 8474 if (typeof Symbol === "function") Readable.prototype[Symbol.asyncIterator] = function() { 8475 if (createReadableStreamAsyncIterator === void 0) createReadableStreamAsyncIterator = require_async_iterator(); 8476 return createReadableStreamAsyncIterator(this); 8477 }; 8478 Object.defineProperty(Readable.prototype, "readableHighWaterMark", { 8479 enumerable: false, 8480 get: function get() { 8481 return this._readableState.highWaterMark; 8482 } 8483 }); 8484 Object.defineProperty(Readable.prototype, "readableBuffer", { 8485 enumerable: false, 8486 get: function get() { 8487 return this._readableState && this._readableState.buffer; 8488 } 8489 }); 8490 Object.defineProperty(Readable.prototype, "readableFlowing", { 8491 enumerable: false, 8492 get: function get() { 8493 return this._readableState.flowing; 8494 }, 8495 set: function set(state) { 8496 if (this._readableState) this._readableState.flowing = state; 8497 } 8498 }); 8499 Readable._fromList = fromList; 8500 Object.defineProperty(Readable.prototype, "readableLength", { 8501 enumerable: false, 8502 get: function get() { 8503 return this._readableState.length; 8504 } 8505 }); 8506 function fromList(n, state) { 8507 if (state.length === 0) return null; 8508 var ret; 8509 if (state.objectMode) ret = state.buffer.shift(); 8510 else if (!n || n >= state.length) { 8511 if (state.decoder) ret = state.buffer.join(""); 8512 else if (state.buffer.length === 1) ret = state.buffer.first(); 8513 else ret = state.buffer.concat(state.length); 8514 state.buffer.clear(); 8515 } else ret = state.buffer.consume(n, state.decoder); 8516 return ret; 8517 } 8518 function endReadable(stream) { 8519 var state = stream._readableState; 8520 debug("endReadable", state.endEmitted); 8521 if (!state.endEmitted) { 8522 state.ended = true; 8523 process.nextTick(endReadableNT, state, stream); 8524 } 8525 } 8526 function endReadableNT(state, stream) { 8527 debug("endReadableNT", state.endEmitted, state.length); 8528 if (!state.endEmitted && state.length === 0) { 8529 state.endEmitted = true; 8530 stream.readable = false; 8531 stream.emit("end"); 8532 if (state.autoDestroy) { 8533 var wState = stream._writableState; 8534 if (!wState || wState.autoDestroy && wState.finished) stream.destroy(); 8535 } 8536 } 8537 } 8538 if (typeof Symbol === "function") Readable.from = function(iterable, opts) { 8539 if (from === void 0) from = require_from_browser(); 8540 return from(Readable, iterable, opts); 8541 }; 8542 function indexOf(xs, x) { 8543 for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; 8544 return -1; 8545 } 8546})); 8547//#endregion 8548//#region node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js 8549var require__stream_transform$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8550 module.exports = Transform; 8551 var _require$codes = require_errors_browser().codes;
vendor: 124,462 bytes, lines 8552-13167
8552 var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; 8553 var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; 8554 var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; 8555 var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; 8556 var Duplex = require__stream_duplex$1(); 8557 require_inherits_browser()(Transform, Duplex); 8558 function afterTransform(er, data) { 8559 var ts = this._transformState; 8560 ts.transforming = false; 8561 var cb = ts.writecb; 8562 if (cb === null) return this.emit("error", new ERR_MULTIPLE_CALLBACK()); 8563 ts.writechunk = null; 8564 ts.writecb = null; 8565 if (data != null) this.push(data); 8566 cb(er); 8567 var rs = this._readableState; 8568 rs.reading = false; 8569 if (rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); 8570 } 8571 function Transform(options) { 8572 if (!(this instanceof Transform)) return new Transform(options); 8573 Duplex.call(this, options); 8574 this._transformState = { 8575 afterTransform: afterTransform.bind(this), 8576 needTransform: false, 8577 transforming: false, 8578 writecb: null, 8579 writechunk: null, 8580 writeencoding: null 8581 }; 8582 this._readableState.needReadable = true; 8583 this._readableState.sync = false; 8584 if (options) { 8585 if (typeof options.transform === "function") this._transform = options.transform; 8586 if (typeof options.flush === "function") this._flush = options.flush; 8587 } 8588 this.on("prefinish", prefinish); 8589 } 8590 function prefinish() { 8591 var _this = this; 8592 if (typeof this._flush === "function" && !this._readableState.destroyed) this._flush(function(er, data) { 8593 done(_this, er, data); 8594 }); 8595 else done(this, null, null); 8596 } 8597 Transform.prototype.push = function(chunk, encoding) { 8598 this._transformState.needTransform = false; 8599 return Duplex.prototype.push.call(this, chunk, encoding); 8600 }; 8601 Transform.prototype._transform = function(chunk, encoding, cb) { 8602 cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); 8603 }; 8604 Transform.prototype._write = function(chunk, encoding, cb) { 8605 var ts = this._transformState; 8606 ts.writecb = cb; 8607 ts.writechunk = chunk; 8608 ts.writeencoding = encoding; 8609 if (!ts.transforming) { 8610 var rs = this._readableState; 8611 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); 8612 } 8613 }; 8614 Transform.prototype._read = function(n) { 8615 var ts = this._transformState; 8616 if (ts.writechunk !== null && !ts.transforming) { 8617 ts.transforming = true; 8618 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); 8619 } else ts.needTransform = true; 8620 }; 8621 Transform.prototype._destroy = function(err, cb) { 8622 Duplex.prototype._destroy.call(this, err, function(err2) { 8623 cb(err2); 8624 }); 8625 }; 8626 function done(stream, er, data) { 8627 if (er) return stream.emit("error", er); 8628 if (data != null) stream.push(data); 8629 if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); 8630 if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); 8631 return stream.push(null); 8632 } 8633})); 8634//#endregion 8635//#region node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js 8636var require__stream_passthrough$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8637 module.exports = PassThrough; 8638 var Transform = require__stream_transform$1(); 8639 require_inherits_browser()(PassThrough, Transform); 8640 function PassThrough(options) { 8641 if (!(this instanceof PassThrough)) return new PassThrough(options); 8642 Transform.call(this, options); 8643 } 8644 PassThrough.prototype._transform = function(chunk, encoding, cb) { 8645 cb(null, chunk); 8646 }; 8647})); 8648//#endregion 8649//#region node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js 8650var require_pipeline = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8651 var eos; 8652 function once(callback) { 8653 var called = false; 8654 return function() { 8655 if (called) return; 8656 called = true; 8657 callback.apply(void 0, arguments); 8658 }; 8659 } 8660 var _require$codes = require_errors_browser().codes; 8661 var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; 8662 var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; 8663 function noop(err) { 8664 if (err) throw err; 8665 } 8666 function isRequest(stream) { 8667 return stream.setHeader && typeof stream.abort === "function"; 8668 } 8669 function destroyer(stream, reading, writing, callback) { 8670 callback = once(callback); 8671 var closed = false; 8672 stream.on("close", function() { 8673 closed = true; 8674 }); 8675 if (eos === void 0) eos = require_end_of_stream(); 8676 eos(stream, { 8677 readable: reading, 8678 writable: writing 8679 }, function(err) { 8680 if (err) return callback(err); 8681 closed = true; 8682 callback(); 8683 }); 8684 var destroyed = false; 8685 return function(err) { 8686 if (closed) return; 8687 if (destroyed) return; 8688 destroyed = true; 8689 if (isRequest(stream)) return stream.abort(); 8690 if (typeof stream.destroy === "function") return stream.destroy(); 8691 callback(err || new ERR_STREAM_DESTROYED("pipe")); 8692 }; 8693 } 8694 function call(fn) { 8695 fn(); 8696 } 8697 function pipe(from, to) { 8698 return from.pipe(to); 8699 } 8700 function popCallback(streams) { 8701 if (!streams.length) return noop; 8702 if (typeof streams[streams.length - 1] !== "function") return noop; 8703 return streams.pop(); 8704 } 8705 function pipeline() { 8706 for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) streams[_key] = arguments[_key]; 8707 var callback = popCallback(streams); 8708 if (Array.isArray(streams[0])) streams = streams[0]; 8709 if (streams.length < 2) throw new ERR_MISSING_ARGS("streams"); 8710 var error; 8711 var destroys = streams.map(function(stream, i) { 8712 var reading = i < streams.length - 1; 8713 return destroyer(stream, reading, i > 0, function(err) { 8714 if (!error) error = err; 8715 if (err) destroys.forEach(call); 8716 if (reading) return; 8717 destroys.forEach(call); 8718 callback(error); 8719 }); 8720 }); 8721 return streams.reduce(pipe); 8722 } 8723 module.exports = pipeline; 8724})); 8725//#endregion 8726//#region node_modules/stream-browserify/index.js 8727var require_stream_browserify = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8728 module.exports = Stream; 8729 var EE = require_events().EventEmitter; 8730 require_inherits_browser()(Stream, EE); 8731 Stream.Readable = require__stream_readable$1(); 8732 Stream.Writable = require__stream_writable$1(); 8733 Stream.Duplex = require__stream_duplex$1(); 8734 Stream.Transform = require__stream_transform$1(); 8735 Stream.PassThrough = require__stream_passthrough$1(); 8736 Stream.finished = require_end_of_stream(); 8737 Stream.pipeline = require_pipeline(); 8738 Stream.Stream = Stream; 8739 function Stream() { 8740 EE.call(this); 8741 } 8742 Stream.prototype.pipe = function(dest, options) { 8743 var source = this; 8744 function ondata(chunk) { 8745 if (dest.writable) { 8746 if (false === dest.write(chunk) && source.pause) source.pause(); 8747 } 8748 } 8749 source.on("data", ondata); 8750 function ondrain() { 8751 if (source.readable && source.resume) source.resume(); 8752 } 8753 dest.on("drain", ondrain); 8754 if (!dest._isStdio && (!options || options.end !== false)) { 8755 source.on("end", onend); 8756 source.on("close", onclose); 8757 } 8758 var didOnEnd = false; 8759 function onend() { 8760 if (didOnEnd) return; 8761 didOnEnd = true; 8762 dest.end(); 8763 } 8764 function onclose() { 8765 if (didOnEnd) return; 8766 didOnEnd = true; 8767 if (typeof dest.destroy === "function") dest.destroy(); 8768 } 8769 function onerror(er) { 8770 cleanup(); 8771 if (EE.listenerCount(this, "error") === 0) throw er; 8772 } 8773 source.on("error", onerror); 8774 dest.on("error", onerror); 8775 function cleanup() { 8776 source.removeListener("data", ondata); 8777 dest.removeListener("drain", ondrain); 8778 source.removeListener("end", onend); 8779 source.removeListener("close", onclose); 8780 source.removeListener("error", onerror); 8781 dest.removeListener("error", onerror); 8782 source.removeListener("end", cleanup); 8783 source.removeListener("close", cleanup); 8784 dest.removeListener("close", cleanup); 8785 } 8786 source.on("end", cleanup); 8787 source.on("close", cleanup); 8788 dest.on("close", cleanup); 8789 dest.emit("pipe", source); 8790 return dest; 8791 }; 8792})); 8793//#endregion 8794//#region node_modules/cipher-base/index.js 8795var require_cipher_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8796 var Buffer = require_safe_buffer$2().Buffer; 8797 var Transform = require_stream_browserify().Transform; 8798 var StringDecoder = require_string_decoder().StringDecoder; 8799 var inherits = require_inherits_browser(); 8800 function CipherBase(hashMode) { 8801 Transform.call(this); 8802 this.hashMode = typeof hashMode === "string"; 8803 if (this.hashMode) this[hashMode] = this._finalOrDigest; 8804 else this["final"] = this._finalOrDigest; 8805 if (this._final) { 8806 this.__final = this._final; 8807 this._final = null; 8808 } 8809 this._decoder = null; 8810 this._encoding = null; 8811 } 8812 inherits(CipherBase, Transform); 8813 var useUint8Array = typeof Uint8Array !== "undefined"; 8814 var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && ArrayBuffer.isView && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT); 8815 function toBuffer(data, encoding) { 8816 if (data instanceof Buffer) return data; 8817 if (typeof data === "string") return Buffer.from(data, encoding); 8818 if (useArrayBuffer && ArrayBuffer.isView(data)) { 8819 if (data.byteLength === 0) return Buffer.alloc(0); 8820 var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength); 8821 if (res.byteLength === data.byteLength) return res; 8822 } 8823 if (useUint8Array && data instanceof Uint8Array) return Buffer.from(data); 8824 if (Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) return Buffer.from(data); 8825 throw new TypeError("The \"data\" argument must be of type string or an instance of Buffer, TypedArray, or DataView."); 8826 } 8827 CipherBase.prototype.update = function(data, inputEnc, outputEnc) { 8828 var bufferData = toBuffer(data, inputEnc); 8829 var outData = this._update(bufferData); 8830 if (this.hashMode) return this; 8831 if (outputEnc) outData = this._toString(outData, outputEnc); 8832 return outData; 8833 }; 8834 CipherBase.prototype.setAutoPadding = function() {}; 8835 CipherBase.prototype.getAuthTag = function() { 8836 throw new Error("trying to get auth tag in unsupported state"); 8837 }; 8838 CipherBase.prototype.setAuthTag = function() { 8839 throw new Error("trying to set auth tag in unsupported state"); 8840 }; 8841 CipherBase.prototype.setAAD = function() { 8842 throw new Error("trying to set aad in unsupported state"); 8843 }; 8844 CipherBase.prototype._transform = function(data, _, next) { 8845 var err; 8846 try { 8847 if (this.hashMode) this._update(data); 8848 else this.push(this._update(data)); 8849 } catch (e) { 8850 err = e; 8851 } finally { 8852 next(err); 8853 } 8854 }; 8855 CipherBase.prototype._flush = function(done) { 8856 var err; 8857 try { 8858 this.push(this.__final()); 8859 } catch (e) { 8860 err = e; 8861 } 8862 done(err); 8863 }; 8864 CipherBase.prototype._finalOrDigest = function(outputEnc) { 8865 var outData = this.__final() || Buffer.alloc(0); 8866 if (outputEnc) outData = this._toString(outData, outputEnc, true); 8867 return outData; 8868 }; 8869 CipherBase.prototype._toString = function(value, enc, fin) { 8870 if (!this._decoder) { 8871 this._decoder = new StringDecoder(enc); 8872 this._encoding = enc; 8873 } 8874 if (this._encoding !== enc) throw new Error("can’t switch encodings"); 8875 var out = this._decoder.write(value); 8876 if (fin) out += this._decoder.end(); 8877 return out; 8878 }; 8879 module.exports = CipherBase; 8880})); 8881//#endregion 8882//#region node_modules/create-hash/browser.js 8883var require_browser$10 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8884 var inherits = require_inherits_browser(); 8885 var MD5 = require_md5_js(); 8886 var RIPEMD160 = require_ripemd160$1(); 8887 var sha = require_sha_js(); 8888 var Base = require_cipher_base(); 8889 function Hash(hash) { 8890 Base.call(this, "digest"); 8891 this._hash = hash; 8892 } 8893 inherits(Hash, Base); 8894 Hash.prototype._update = function(data) { 8895 this._hash.update(data); 8896 }; 8897 Hash.prototype._final = function() { 8898 return this._hash.digest(); 8899 }; 8900 module.exports = function createHash(alg) { 8901 alg = alg.toLowerCase(); 8902 if (alg === "md5") return new MD5(); 8903 if (alg === "rmd160" || alg === "ripemd160") return new RIPEMD160(); 8904 return new Hash(sha(alg)); 8905 }; 8906})); 8907//#endregion 8908//#region node_modules/create-hmac/legacy.js 8909var require_legacy = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8910 var inherits = require_inherits_browser(); 8911 var Buffer = require_safe_buffer$2().Buffer; 8912 var Base = require_cipher_base(); 8913 var ZEROS = Buffer.alloc(128); 8914 var blocksize = 64; 8915 function Hmac(alg, key) { 8916 Base.call(this, "digest"); 8917 if (typeof key === "string") key = Buffer.from(key); 8918 this._alg = alg; 8919 this._key = key; 8920 if (key.length > blocksize) key = alg(key); 8921 else if (key.length < blocksize) key = Buffer.concat([key, ZEROS], blocksize); 8922 var ipad = this._ipad = Buffer.allocUnsafe(blocksize); 8923 var opad = this._opad = Buffer.allocUnsafe(blocksize); 8924 for (var i = 0; i < blocksize; i++) { 8925 ipad[i] = key[i] ^ 54; 8926 opad[i] = key[i] ^ 92; 8927 } 8928 this._hash = [ipad]; 8929 } 8930 inherits(Hmac, Base); 8931 Hmac.prototype._update = function(data) { 8932 this._hash.push(data); 8933 }; 8934 Hmac.prototype._final = function() { 8935 var h = this._alg(Buffer.concat(this._hash)); 8936 return this._alg(Buffer.concat([this._opad, h])); 8937 }; 8938 module.exports = Hmac; 8939})); 8940//#endregion 8941//#region node_modules/create-hash/md5.js 8942var require_md5$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8943 var MD5 = require_md5_js(); 8944 module.exports = function(buffer) { 8945 return new MD5().update(buffer).digest(); 8946 }; 8947})); 8948//#endregion 8949//#region node_modules/create-hmac/browser.js 8950var require_browser$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 8951 var inherits = require_inherits_browser(); 8952 var Legacy = require_legacy(); 8953 var Base = require_cipher_base(); 8954 var Buffer = require_safe_buffer$2().Buffer; 8955 var md5 = require_md5$1(); 8956 var RIPEMD160 = require_ripemd160$1(); 8957 var sha = require_sha_js(); 8958 var ZEROS = Buffer.alloc(128); 8959 function Hmac(alg, key) { 8960 Base.call(this, "digest"); 8961 if (typeof key === "string") key = Buffer.from(key); 8962 var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; 8963 this._alg = alg; 8964 this._key = key; 8965 if (key.length > blocksize) key = (alg === "rmd160" ? new RIPEMD160() : sha(alg)).update(key).digest(); 8966 else if (key.length < blocksize) key = Buffer.concat([key, ZEROS], blocksize); 8967 var ipad = this._ipad = Buffer.allocUnsafe(blocksize); 8968 var opad = this._opad = Buffer.allocUnsafe(blocksize); 8969 for (var i = 0; i < blocksize; i++) { 8970 ipad[i] = key[i] ^ 54; 8971 opad[i] = key[i] ^ 92; 8972 } 8973 this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); 8974 this._hash.update(ipad); 8975 } 8976 inherits(Hmac, Base); 8977 Hmac.prototype._update = function(data) { 8978 this._hash.update(data); 8979 }; 8980 Hmac.prototype._final = function() { 8981 var h = this._hash.digest(); 8982 return (this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg)).update(this._opad).update(h).digest(); 8983 }; 8984 module.exports = function createHmac(alg, key) { 8985 alg = alg.toLowerCase(); 8986 if (alg === "rmd160" || alg === "ripemd160") return new Hmac("rmd160", key); 8987 if (alg === "md5") return new Legacy(md5, key); 8988 return new Hmac(alg, key); 8989 }; 8990})); 8991//#endregion 8992//#region node_modules/browserify-sign/browser/algorithms.json 8993var algorithms_exports = /* @__PURE__ */ __exportAll({ 8994 DSA: () => DSA, 8995 default: () => algorithms_default, 8996 md5WithRSAEncryption: () => md5WithRSAEncryption, 8997 ripemd160WithRSA: () => ripemd160WithRSA, 8998 sha224: () => sha224, 8999 sha224WithRSAEncryption: () => sha224WithRSAEncryption, 9000 sha256: () => sha256, 9001 sha256WithRSAEncryption: () => sha256WithRSAEncryption, 9002 sha384: () => sha384, 9003 sha384WithRSAEncryption: () => sha384WithRSAEncryption, 9004 sha512: () => sha512, 9005 sha512WithRSAEncryption: () => sha512WithRSAEncryption 9006}); 9007var sha224WithRSAEncryption, sha256WithRSAEncryption, sha384WithRSAEncryption, sha512WithRSAEncryption, sha256, sha224, sha384, sha512, DSA, ripemd160WithRSA, md5WithRSAEncryption, algorithms_default; 9008var init_algorithms = __esmMin((() => { 9009 sha224WithRSAEncryption = { 9010 "sign": "rsa", 9011 "hash": "sha224", 9012 "id": "302d300d06096086480165030402040500041c" 9013 }; 9014 sha256WithRSAEncryption = { 9015 "sign": "rsa", 9016 "hash": "sha256", 9017 "id": "3031300d060960864801650304020105000420" 9018 }; 9019 sha384WithRSAEncryption = { 9020 "sign": "rsa", 9021 "hash": "sha384", 9022 "id": "3041300d060960864801650304020205000430" 9023 }; 9024 sha512WithRSAEncryption = { 9025 "sign": "rsa", 9026 "hash": "sha512", 9027 "id": "3051300d060960864801650304020305000440" 9028 }; 9029 sha256 = { 9030 "sign": "ecdsa", 9031 "hash": "sha256", 9032 "id": "" 9033 }; 9034 sha224 = { 9035 "sign": "ecdsa", 9036 "hash": "sha224", 9037 "id": "" 9038 }; 9039 sha384 = { 9040 "sign": "ecdsa", 9041 "hash": "sha384", 9042 "id": "" 9043 }; 9044 sha512 = { 9045 "sign": "ecdsa", 9046 "hash": "sha512", 9047 "id": "" 9048 }; 9049 DSA = { 9050 "sign": "dsa", 9051 "hash": "sha1", 9052 "id": "" 9053 }; 9054 ripemd160WithRSA = { 9055 "sign": "rsa", 9056 "hash": "rmd160", 9057 "id": "3021300906052b2403020105000414" 9058 }; 9059 md5WithRSAEncryption = { 9060 "sign": "rsa", 9061 "hash": "md5", 9062 "id": "3020300c06082a864886f70d020505000410" 9063 }; 9064 algorithms_default = { 9065 sha224WithRSAEncryption, 9066 "RSA-SHA224": { 9067 "sign": "ecdsa/rsa", 9068 "hash": "sha224", 9069 "id": "302d300d06096086480165030402040500041c" 9070 }, 9071 sha256WithRSAEncryption, 9072 "RSA-SHA256": { 9073 "sign": "ecdsa/rsa", 9074 "hash": "sha256", 9075 "id": "3031300d060960864801650304020105000420" 9076 }, 9077 sha384WithRSAEncryption, 9078 "RSA-SHA384": { 9079 "sign": "ecdsa/rsa", 9080 "hash": "sha384", 9081 "id": "3041300d060960864801650304020205000430" 9082 }, 9083 sha512WithRSAEncryption, 9084 "RSA-SHA512": { 9085 "sign": "ecdsa/rsa", 9086 "hash": "sha512", 9087 "id": "3051300d060960864801650304020305000440" 9088 }, 9089 "RSA-SHA1": { 9090 "sign": "rsa", 9091 "hash": "sha1", 9092 "id": "3021300906052b0e03021a05000414" 9093 }, 9094 "ecdsa-with-SHA1": { 9095 "sign": "ecdsa", 9096 "hash": "sha1", 9097 "id": "" 9098 }, 9099 sha256, 9100 sha224, 9101 sha384, 9102 sha512, 9103 "DSA-SHA": { 9104 "sign": "dsa", 9105 "hash": "sha1", 9106 "id": "" 9107 }, 9108 "DSA-SHA1": { 9109 "sign": "dsa", 9110 "hash": "sha1", 9111 "id": "" 9112 }, 9113 DSA, 9114 "DSA-WITH-SHA224": { 9115 "sign": "dsa", 9116 "hash": "sha224", 9117 "id": "" 9118 }, 9119 "DSA-SHA224": { 9120 "sign": "dsa", 9121 "hash": "sha224", 9122 "id": "" 9123 }, 9124 "DSA-WITH-SHA256": { 9125 "sign": "dsa", 9126 "hash": "sha256", 9127 "id": "" 9128 }, 9129 "DSA-SHA256": { 9130 "sign": "dsa", 9131 "hash": "sha256", 9132 "id": "" 9133 }, 9134 "DSA-WITH-SHA384": { 9135 "sign": "dsa", 9136 "hash": "sha384", 9137 "id": "" 9138 }, 9139 "DSA-SHA384": { 9140 "sign": "dsa", 9141 "hash": "sha384", 9142 "id": "" 9143 }, 9144 "DSA-WITH-SHA512": { 9145 "sign": "dsa", 9146 "hash": "sha512", 9147 "id": "" 9148 }, 9149 "DSA-SHA512": { 9150 "sign": "dsa", 9151 "hash": "sha512", 9152 "id": "" 9153 }, 9154 "DSA-RIPEMD160": { 9155 "sign": "dsa", 9156 "hash": "rmd160", 9157 "id": "" 9158 }, 9159 ripemd160WithRSA, 9160 "RSA-RIPEMD160": { 9161 "sign": "rsa", 9162 "hash": "rmd160", 9163 "id": "3021300906052b2403020105000414" 9164 }, 9165 md5WithRSAEncryption, 9166 "RSA-MD5": { 9167 "sign": "rsa", 9168 "hash": "md5", 9169 "id": "3020300c06082a864886f70d020505000410" 9170 } 9171 }; 9172})); 9173//#endregion 9174//#region node_modules/browserify-sign/algos.js 9175var require_algos = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9176 module.exports = (init_algorithms(), __toCommonJS(algorithms_exports).default); 9177})); 9178//#endregion 9179//#region node_modules/pbkdf2/lib/precondition.js 9180var require_precondition = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9181 var MAX_ALLOC = Math.pow(2, 30) - 1; 9182 module.exports = function(iterations, keylen) { 9183 if (typeof iterations !== "number") throw new TypeError("Iterations not a number"); 9184 if (iterations < 0) throw new TypeError("Bad iterations"); 9185 if (typeof keylen !== "number") throw new TypeError("Key length not a number"); 9186 if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) throw new TypeError("Bad key length"); 9187 }; 9188})); 9189//#endregion 9190//#region node_modules/pbkdf2/lib/default-encoding.js 9191var require_default_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9192 var process = require_browser$15(); 9193 var defaultEncoding; 9194 /* istanbul ignore next */ 9195 if (globalThis.process && globalThis.process.browser) defaultEncoding = "utf-8"; 9196 else if (globalThis.process && globalThis.process.version) defaultEncoding = parseInt(process.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary"; 9197 else defaultEncoding = "utf-8"; 9198 module.exports = defaultEncoding; 9199})); 9200//#endregion 9201//#region node_modules/pbkdf2/node_modules/create-hash/make-hash.js 9202var require_make_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9203 var Buffer = require_buffer$1().Buffer; 9204 var intSize = 4; 9205 var zeroBuffer = new Buffer(intSize); 9206 zeroBuffer.fill(0); 9207 var charSize = 8; 9208 var hashSize = 16; 9209 function toArray(buf) { 9210 if (buf.length % intSize !== 0) { 9211 var len = buf.length + (intSize - buf.length % intSize); 9212 buf = Buffer.concat([buf, zeroBuffer], len); 9213 } 9214 var arr = new Array(buf.length >>> 2); 9215 for (var i = 0, j = 0; i < buf.length; i += intSize, j++) arr[j] = buf.readInt32LE(i); 9216 return arr; 9217 } 9218 module.exports = function hash(buf, fn) { 9219 var arr = fn(toArray(buf), buf.length * charSize); 9220 buf = new Buffer(hashSize); 9221 for (var i = 0; i < arr.length; i++) buf.writeInt32LE(arr[i], i << 2, true); 9222 return buf; 9223 }; 9224})); 9225//#endregion 9226//#region node_modules/pbkdf2/node_modules/create-hash/md5.js 9227var require_md5 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9228 var makeHash = require_make_hash(); 9229 function core_md5(x, len) { 9230 x[len >> 5] |= 128 << len % 32; 9231 x[(len + 64 >>> 9 << 4) + 14] = len; 9232 var a = 1732584193; 9233 var b = -271733879; 9234 var c = -1732584194; 9235 var d = 271733878; 9236 for (var i = 0; i < x.length; i += 16) { 9237 var olda = a; 9238 var oldb = b; 9239 var oldc = c; 9240 var oldd = d; 9241 a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936); 9242 d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); 9243 c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); 9244 b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); 9245 a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); 9246 d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); 9247 c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); 9248 b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); 9249 a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); 9250 d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); 9251 c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); 9252 b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); 9253 a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); 9254 d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); 9255 c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); 9256 b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); 9257 a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); 9258 d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); 9259 c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); 9260 b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302); 9261 a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); 9262 d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); 9263 c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); 9264 b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); 9265 a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); 9266 d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); 9267 c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); 9268 b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); 9269 a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); 9270 d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); 9271 c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); 9272 b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); 9273 a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); 9274 d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); 9275 c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); 9276 b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); 9277 a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); 9278 d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); 9279 c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); 9280 b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); 9281 a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); 9282 d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222); 9283 c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); 9284 b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); 9285 a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); 9286 d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); 9287 c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); 9288 b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); 9289 a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844); 9290 d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); 9291 c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); 9292 b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); 9293 a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); 9294 d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); 9295 c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); 9296 b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); 9297 a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); 9298 d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); 9299 c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); 9300 b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); 9301 a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); 9302 d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); 9303 c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); 9304 b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); 9305 a = safe_add(a, olda); 9306 b = safe_add(b, oldb); 9307 c = safe_add(c, oldc); 9308 d = safe_add(d, oldd); 9309 } 9310 return [ 9311 a, 9312 b, 9313 c, 9314 d 9315 ]; 9316 } 9317 function md5_cmn(q, a, b, x, s, t) { 9318 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); 9319 } 9320 function md5_ff(a, b, c, d, x, s, t) { 9321 return md5_cmn(b & c | ~b & d, a, b, x, s, t); 9322 } 9323 function md5_gg(a, b, c, d, x, s, t) { 9324 return md5_cmn(b & d | c & ~d, a, b, x, s, t); 9325 } 9326 function md5_hh(a, b, c, d, x, s, t) { 9327 return md5_cmn(b ^ c ^ d, a, b, x, s, t); 9328 } 9329 function md5_ii(a, b, c, d, x, s, t) { 9330 return md5_cmn(c ^ (b | ~d), a, b, x, s, t); 9331 } 9332 function safe_add(x, y) { 9333 var lsw = (x & 65535) + (y & 65535); 9334 return (x >> 16) + (y >> 16) + (lsw >> 16) << 16 | lsw & 65535; 9335 } 9336 function bit_rol(num, cnt) { 9337 return num << cnt | num >>> 32 - cnt; 9338 } 9339 module.exports = function md5(buf) { 9340 return makeHash(buf, core_md5); 9341 }; 9342})); 9343//#endregion 9344//#region node_modules/pbkdf2/node_modules/hash-base/index.js 9345var require_hash_base = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9346 var Buffer = require_buffer$1().Buffer; 9347 var Transform = require_stream_browserify().Transform; 9348 var inherits = require_inherits_browser(); 9349 function HashBase(blockSize) { 9350 Transform.call(this); 9351 this._block = new Buffer(blockSize); 9352 this._blockSize = blockSize; 9353 this._blockOffset = 0; 9354 this._length = [ 9355 0, 9356 0, 9357 0, 9358 0 9359 ]; 9360 this._finalized = false; 9361 } 9362 inherits(HashBase, Transform); 9363 HashBase.prototype._transform = function(chunk, encoding, callback) { 9364 var error = null; 9365 try { 9366 if (encoding !== "buffer") chunk = new Buffer(chunk, encoding); 9367 this.update(chunk); 9368 } catch (err) { 9369 error = err; 9370 } 9371 callback(error); 9372 }; 9373 HashBase.prototype._flush = function(callback) { 9374 var error = null; 9375 try { 9376 this.push(this._digest()); 9377 } catch (err) { 9378 error = err; 9379 } 9380 callback(error); 9381 }; 9382 HashBase.prototype.update = function(data, encoding) { 9383 if (!Buffer.isBuffer(data) && typeof data !== "string") throw new TypeError("Data must be a string or a buffer"); 9384 if (this._finalized) throw new Error("Digest already called"); 9385 if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || "binary"); 9386 var block = this._block; 9387 var offset = 0; 9388 while (this._blockOffset + data.length - offset >= this._blockSize) { 9389 for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]; 9390 this._update(); 9391 this._blockOffset = 0; 9392 } 9393 while (offset < data.length) block[this._blockOffset++] = data[offset++]; 9394 for (var j = 0, carry = data.length * 8; carry > 0; ++j) { 9395 this._length[j] += carry; 9396 carry = this._length[j] / 4294967296 | 0; 9397 if (carry > 0) this._length[j] -= 4294967296 * carry; 9398 } 9399 return this; 9400 }; 9401 HashBase.prototype._update = function(data) { 9402 throw new Error("_update is not implemented"); 9403 }; 9404 HashBase.prototype.digest = function(encoding) { 9405 if (this._finalized) throw new Error("Digest already called"); 9406 this._finalized = true; 9407 var digest = this._digest(); 9408 if (encoding !== void 0) digest = digest.toString(encoding); 9409 return digest; 9410 }; 9411 HashBase.prototype._digest = function() { 9412 throw new Error("_digest is not implemented"); 9413 }; 9414 module.exports = HashBase; 9415})); 9416//#endregion 9417//#region node_modules/pbkdf2/node_modules/ripemd160/index.js 9418var require_ripemd160 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9419 var Buffer = require_buffer$1().Buffer; 9420 var inherits = require_inherits_browser(); 9421 var HashBase = require_hash_base(); 9422 function RIPEMD160() { 9423 HashBase.call(this, 64); 9424 this._a = 1732584193; 9425 this._b = 4023233417; 9426 this._c = 2562383102; 9427 this._d = 271733878; 9428 this._e = 3285377520; 9429 } 9430 inherits(RIPEMD160, HashBase); 9431 RIPEMD160.prototype._update = function() { 9432 var m = new Array(16); 9433 for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4); 9434 var al = this._a; 9435 var bl = this._b; 9436 var cl = this._c; 9437 var dl = this._d; 9438 var el = this._e; 9439 al = fn1(al, bl, cl, dl, el, m[0], 0, 11); 9440 cl = rotl(cl, 10); 9441 el = fn1(el, al, bl, cl, dl, m[1], 0, 14); 9442 bl = rotl(bl, 10); 9443 dl = fn1(dl, el, al, bl, cl, m[2], 0, 15); 9444 al = rotl(al, 10); 9445 cl = fn1(cl, dl, el, al, bl, m[3], 0, 12); 9446 el = rotl(el, 10); 9447 bl = fn1(bl, cl, dl, el, al, m[4], 0, 5); 9448 dl = rotl(dl, 10); 9449 al = fn1(al, bl, cl, dl, el, m[5], 0, 8); 9450 cl = rotl(cl, 10); 9451 el = fn1(el, al, bl, cl, dl, m[6], 0, 7); 9452 bl = rotl(bl, 10); 9453 dl = fn1(dl, el, al, bl, cl, m[7], 0, 9); 9454 al = rotl(al, 10); 9455 cl = fn1(cl, dl, el, al, bl, m[8], 0, 11); 9456 el = rotl(el, 10); 9457 bl = fn1(bl, cl, dl, el, al, m[9], 0, 13); 9458 dl = rotl(dl, 10); 9459 al = fn1(al, bl, cl, dl, el, m[10], 0, 14); 9460 cl = rotl(cl, 10); 9461 el = fn1(el, al, bl, cl, dl, m[11], 0, 15); 9462 bl = rotl(bl, 10); 9463 dl = fn1(dl, el, al, bl, cl, m[12], 0, 6); 9464 al = rotl(al, 10); 9465 cl = fn1(cl, dl, el, al, bl, m[13], 0, 7); 9466 el = rotl(el, 10); 9467 bl = fn1(bl, cl, dl, el, al, m[14], 0, 9); 9468 dl = rotl(dl, 10); 9469 al = fn1(al, bl, cl, dl, el, m[15], 0, 8); 9470 cl = rotl(cl, 10); 9471 el = fn2(el, al, bl, cl, dl, m[7], 1518500249, 7); 9472 bl = rotl(bl, 10); 9473 dl = fn2(dl, el, al, bl, cl, m[4], 1518500249, 6); 9474 al = rotl(al, 10); 9475 cl = fn2(cl, dl, el, al, bl, m[13], 1518500249, 8); 9476 el = rotl(el, 10); 9477 bl = fn2(bl, cl, dl, el, al, m[1], 1518500249, 13); 9478 dl = rotl(dl, 10); 9479 al = fn2(al, bl, cl, dl, el, m[10], 1518500249, 11); 9480 cl = rotl(cl, 10); 9481 el = fn2(el, al, bl, cl, dl, m[6], 1518500249, 9); 9482 bl = rotl(bl, 10); 9483 dl = fn2(dl, el, al, bl, cl, m[15], 1518500249, 7); 9484 al = rotl(al, 10); 9485 cl = fn2(cl, dl, el, al, bl, m[3], 1518500249, 15); 9486 el = rotl(el, 10); 9487 bl = fn2(bl, cl, dl, el, al, m[12], 1518500249, 7); 9488 dl = rotl(dl, 10); 9489 al = fn2(al, bl, cl, dl, el, m[0], 1518500249, 12); 9490 cl = rotl(cl, 10); 9491 el = fn2(el, al, bl, cl, dl, m[9], 1518500249, 15); 9492 bl = rotl(bl, 10); 9493 dl = fn2(dl, el, al, bl, cl, m[5], 1518500249, 9); 9494 al = rotl(al, 10); 9495 cl = fn2(cl, dl, el, al, bl, m[2], 1518500249, 11); 9496 el = rotl(el, 10); 9497 bl = fn2(bl, cl, dl, el, al, m[14], 1518500249, 7); 9498 dl = rotl(dl, 10); 9499 al = fn2(al, bl, cl, dl, el, m[11], 1518500249, 13); 9500 cl = rotl(cl, 10); 9501 el = fn2(el, al, bl, cl, dl, m[8], 1518500249, 12); 9502 bl = rotl(bl, 10); 9503 dl = fn3(dl, el, al, bl, cl, m[3], 1859775393, 11); 9504 al = rotl(al, 10); 9505 cl = fn3(cl, dl, el, al, bl, m[10], 1859775393, 13); 9506 el = rotl(el, 10); 9507 bl = fn3(bl, cl, dl, el, al, m[14], 1859775393, 6); 9508 dl = rotl(dl, 10); 9509 al = fn3(al, bl, cl, dl, el, m[4], 1859775393, 7); 9510 cl = rotl(cl, 10); 9511 el = fn3(el, al, bl, cl, dl, m[9], 1859775393, 14); 9512 bl = rotl(bl, 10); 9513 dl = fn3(dl, el, al, bl, cl, m[15], 1859775393, 9); 9514 al = rotl(al, 10); 9515 cl = fn3(cl, dl, el, al, bl, m[8], 1859775393, 13); 9516 el = rotl(el, 10); 9517 bl = fn3(bl, cl, dl, el, al, m[1], 1859775393, 15); 9518 dl = rotl(dl, 10); 9519 al = fn3(al, bl, cl, dl, el, m[2], 1859775393, 14); 9520 cl = rotl(cl, 10); 9521 el = fn3(el, al, bl, cl, dl, m[7], 1859775393, 8); 9522 bl = rotl(bl, 10); 9523 dl = fn3(dl, el, al, bl, cl, m[0], 1859775393, 13); 9524 al = rotl(al, 10); 9525 cl = fn3(cl, dl, el, al, bl, m[6], 1859775393, 6); 9526 el = rotl(el, 10); 9527 bl = fn3(bl, cl, dl, el, al, m[13], 1859775393, 5); 9528 dl = rotl(dl, 10); 9529 al = fn3(al, bl, cl, dl, el, m[11], 1859775393, 12); 9530 cl = rotl(cl, 10); 9531 el = fn3(el, al, bl, cl, dl, m[5], 1859775393, 7); 9532 bl = rotl(bl, 10); 9533 dl = fn3(dl, el, al, bl, cl, m[12], 1859775393, 5); 9534 al = rotl(al, 10); 9535 cl = fn4(cl, dl, el, al, bl, m[1], 2400959708, 11); 9536 el = rotl(el, 10); 9537 bl = fn4(bl, cl, dl, el, al, m[9], 2400959708, 12); 9538 dl = rotl(dl, 10); 9539 al = fn4(al, bl, cl, dl, el, m[11], 2400959708, 14); 9540 cl = rotl(cl, 10); 9541 el = fn4(el, al, bl, cl, dl, m[10], 2400959708, 15); 9542 bl = rotl(bl, 10); 9543 dl = fn4(dl, el, al, bl, cl, m[0], 2400959708, 14); 9544 al = rotl(al, 10); 9545 cl = fn4(cl, dl, el, al, bl, m[8], 2400959708, 15); 9546 el = rotl(el, 10); 9547 bl = fn4(bl, cl, dl, el, al, m[12], 2400959708, 9); 9548 dl = rotl(dl, 10); 9549 al = fn4(al, bl, cl, dl, el, m[4], 2400959708, 8); 9550 cl = rotl(cl, 10); 9551 el = fn4(el, al, bl, cl, dl, m[13], 2400959708, 9); 9552 bl = rotl(bl, 10); 9553 dl = fn4(dl, el, al, bl, cl, m[3], 2400959708, 14); 9554 al = rotl(al, 10); 9555 cl = fn4(cl, dl, el, al, bl, m[7], 2400959708, 5); 9556 el = rotl(el, 10); 9557 bl = fn4(bl, cl, dl, el, al, m[15], 2400959708, 6); 9558 dl = rotl(dl, 10); 9559 al = fn4(al, bl, cl, dl, el, m[14], 2400959708, 8); 9560 cl = rotl(cl, 10); 9561 el = fn4(el, al, bl, cl, dl, m[5], 2400959708, 6); 9562 bl = rotl(bl, 10); 9563 dl = fn4(dl, el, al, bl, cl, m[6], 2400959708, 5); 9564 al = rotl(al, 10); 9565 cl = fn4(cl, dl, el, al, bl, m[2], 2400959708, 12); 9566 el = rotl(el, 10); 9567 bl = fn5(bl, cl, dl, el, al, m[4], 2840853838, 9); 9568 dl = rotl(dl, 10); 9569 al = fn5(al, bl, cl, dl, el, m[0], 2840853838, 15); 9570 cl = rotl(cl, 10); 9571 el = fn5(el, al, bl, cl, dl, m[5], 2840853838, 5); 9572 bl = rotl(bl, 10); 9573 dl = fn5(dl, el, al, bl, cl, m[9], 2840853838, 11); 9574 al = rotl(al, 10); 9575 cl = fn5(cl, dl, el, al, bl, m[7], 2840853838, 6); 9576 el = rotl(el, 10); 9577 bl = fn5(bl, cl, dl, el, al, m[12], 2840853838, 8); 9578 dl = rotl(dl, 10); 9579 al = fn5(al, bl, cl, dl, el, m[2], 2840853838, 13); 9580 cl = rotl(cl, 10); 9581 el = fn5(el, al, bl, cl, dl, m[10], 2840853838, 12); 9582 bl = rotl(bl, 10); 9583 dl = fn5(dl, el, al, bl, cl, m[14], 2840853838, 5); 9584 al = rotl(al, 10); 9585 cl = fn5(cl, dl, el, al, bl, m[1], 2840853838, 12); 9586 el = rotl(el, 10); 9587 bl = fn5(bl, cl, dl, el, al, m[3], 2840853838, 13); 9588 dl = rotl(dl, 10); 9589 al = fn5(al, bl, cl, dl, el, m[8], 2840853838, 14); 9590 cl = rotl(cl, 10); 9591 el = fn5(el, al, bl, cl, dl, m[11], 2840853838, 11); 9592 bl = rotl(bl, 10); 9593 dl = fn5(dl, el, al, bl, cl, m[6], 2840853838, 8); 9594 al = rotl(al, 10); 9595 cl = fn5(cl, dl, el, al, bl, m[15], 2840853838, 5); 9596 el = rotl(el, 10); 9597 bl = fn5(bl, cl, dl, el, al, m[13], 2840853838, 6); 9598 dl = rotl(dl, 10); 9599 var ar = this._a; 9600 var br = this._b; 9601 var cr = this._c; 9602 var dr = this._d; 9603 var er = this._e; 9604 ar = fn5(ar, br, cr, dr, er, m[5], 1352829926, 8); 9605 cr = rotl(cr, 10); 9606 er = fn5(er, ar, br, cr, dr, m[14], 1352829926, 9); 9607 br = rotl(br, 10); 9608 dr = fn5(dr, er, ar, br, cr, m[7], 1352829926, 9); 9609 ar = rotl(ar, 10); 9610 cr = fn5(cr, dr, er, ar, br, m[0], 1352829926, 11); 9611 er = rotl(er, 10); 9612 br = fn5(br, cr, dr, er, ar, m[9], 1352829926, 13); 9613 dr = rotl(dr, 10); 9614 ar = fn5(ar, br, cr, dr, er, m[2], 1352829926, 15); 9615 cr = rotl(cr, 10); 9616 er = fn5(er, ar, br, cr, dr, m[11], 1352829926, 15); 9617 br = rotl(br, 10); 9618 dr = fn5(dr, er, ar, br, cr, m[4], 1352829926, 5); 9619 ar = rotl(ar, 10); 9620 cr = fn5(cr, dr, er, ar, br, m[13], 1352829926, 7); 9621 er = rotl(er, 10); 9622 br = fn5(br, cr, dr, er, ar, m[6], 1352829926, 7); 9623 dr = rotl(dr, 10); 9624 ar = fn5(ar, br, cr, dr, er, m[15], 1352829926, 8); 9625 cr = rotl(cr, 10); 9626 er = fn5(er, ar, br, cr, dr, m[8], 1352829926, 11); 9627 br = rotl(br, 10); 9628 dr = fn5(dr, er, ar, br, cr, m[1], 1352829926, 14); 9629 ar = rotl(ar, 10); 9630 cr = fn5(cr, dr, er, ar, br, m[10], 1352829926, 14); 9631 er = rotl(er, 10); 9632 br = fn5(br, cr, dr, er, ar, m[3], 1352829926, 12); 9633 dr = rotl(dr, 10); 9634 ar = fn5(ar, br, cr, dr, er, m[12], 1352829926, 6); 9635 cr = rotl(cr, 10); 9636 er = fn4(er, ar, br, cr, dr, m[6], 1548603684, 9); 9637 br = rotl(br, 10); 9638 dr = fn4(dr, er, ar, br, cr, m[11], 1548603684, 13); 9639 ar = rotl(ar, 10); 9640 cr = fn4(cr, dr, er, ar, br, m[3], 1548603684, 15); 9641 er = rotl(er, 10); 9642 br = fn4(br, cr, dr, er, ar, m[7], 1548603684, 7); 9643 dr = rotl(dr, 10); 9644 ar = fn4(ar, br, cr, dr, er, m[0], 1548603684, 12); 9645 cr = rotl(cr, 10); 9646 er = fn4(er, ar, br, cr, dr, m[13], 1548603684, 8); 9647 br = rotl(br, 10); 9648 dr = fn4(dr, er, ar, br, cr, m[5], 1548603684, 9); 9649 ar = rotl(ar, 10); 9650 cr = fn4(cr, dr, er, ar, br, m[10], 1548603684, 11); 9651 er = rotl(er, 10); 9652 br = fn4(br, cr, dr, er, ar, m[14], 1548603684, 7); 9653 dr = rotl(dr, 10); 9654 ar = fn4(ar, br, cr, dr, er, m[15], 1548603684, 7); 9655 cr = rotl(cr, 10); 9656 er = fn4(er, ar, br, cr, dr, m[8], 1548603684, 12); 9657 br = rotl(br, 10); 9658 dr = fn4(dr, er, ar, br, cr, m[12], 1548603684, 7); 9659 ar = rotl(ar, 10); 9660 cr = fn4(cr, dr, er, ar, br, m[4], 1548603684, 6); 9661 er = rotl(er, 10); 9662 br = fn4(br, cr, dr, er, ar, m[9], 1548603684, 15); 9663 dr = rotl(dr, 10); 9664 ar = fn4(ar, br, cr, dr, er, m[1], 1548603684, 13); 9665 cr = rotl(cr, 10); 9666 er = fn4(er, ar, br, cr, dr, m[2], 1548603684, 11); 9667 br = rotl(br, 10); 9668 dr = fn3(dr, er, ar, br, cr, m[15], 1836072691, 9); 9669 ar = rotl(ar, 10); 9670 cr = fn3(cr, dr, er, ar, br, m[5], 1836072691, 7); 9671 er = rotl(er, 10); 9672 br = fn3(br, cr, dr, er, ar, m[1], 1836072691, 15); 9673 dr = rotl(dr, 10); 9674 ar = fn3(ar, br, cr, dr, er, m[3], 1836072691, 11); 9675 cr = rotl(cr, 10); 9676 er = fn3(er, ar, br, cr, dr, m[7], 1836072691, 8); 9677 br = rotl(br, 10); 9678 dr = fn3(dr, er, ar, br, cr, m[14], 1836072691, 6); 9679 ar = rotl(ar, 10); 9680 cr = fn3(cr, dr, er, ar, br, m[6], 1836072691, 6); 9681 er = rotl(er, 10); 9682 br = fn3(br, cr, dr, er, ar, m[9], 1836072691, 14); 9683 dr = rotl(dr, 10); 9684 ar = fn3(ar, br, cr, dr, er, m[11], 1836072691, 12); 9685 cr = rotl(cr, 10); 9686 er = fn3(er, ar, br, cr, dr, m[8], 1836072691, 13); 9687 br = rotl(br, 10); 9688 dr = fn3(dr, er, ar, br, cr, m[12], 1836072691, 5); 9689 ar = rotl(ar, 10); 9690 cr = fn3(cr, dr, er, ar, br, m[2], 1836072691, 14); 9691 er = rotl(er, 10); 9692 br = fn3(br, cr, dr, er, ar, m[10], 1836072691, 13); 9693 dr = rotl(dr, 10); 9694 ar = fn3(ar, br, cr, dr, er, m[0], 1836072691, 13); 9695 cr = rotl(cr, 10); 9696 er = fn3(er, ar, br, cr, dr, m[4], 1836072691, 7); 9697 br = rotl(br, 10); 9698 dr = fn3(dr, er, ar, br, cr, m[13], 1836072691, 5); 9699 ar = rotl(ar, 10); 9700 cr = fn2(cr, dr, er, ar, br, m[8], 2053994217, 15); 9701 er = rotl(er, 10); 9702 br = fn2(br, cr, dr, er, ar, m[6], 2053994217, 5); 9703 dr = rotl(dr, 10); 9704 ar = fn2(ar, br, cr, dr, er, m[4], 2053994217, 8); 9705 cr = rotl(cr, 10); 9706 er = fn2(er, ar, br, cr, dr, m[1], 2053994217, 11); 9707 br = rotl(br, 10); 9708 dr = fn2(dr, er, ar, br, cr, m[3], 2053994217, 14); 9709 ar = rotl(ar, 10); 9710 cr = fn2(cr, dr, er, ar, br, m[11], 2053994217, 14); 9711 er = rotl(er, 10); 9712 br = fn2(br, cr, dr, er, ar, m[15], 2053994217, 6); 9713 dr = rotl(dr, 10); 9714 ar = fn2(ar, br, cr, dr, er, m[0], 2053994217, 14); 9715 cr = rotl(cr, 10); 9716 er = fn2(er, ar, br, cr, dr, m[5], 2053994217, 6); 9717 br = rotl(br, 10); 9718 dr = fn2(dr, er, ar, br, cr, m[12], 2053994217, 9); 9719 ar = rotl(ar, 10); 9720 cr = fn2(cr, dr, er, ar, br, m[2], 2053994217, 12); 9721 er = rotl(er, 10); 9722 br = fn2(br, cr, dr, er, ar, m[13], 2053994217, 9); 9723 dr = rotl(dr, 10); 9724 ar = fn2(ar, br, cr, dr, er, m[9], 2053994217, 12); 9725 cr = rotl(cr, 10); 9726 er = fn2(er, ar, br, cr, dr, m[7], 2053994217, 5); 9727 br = rotl(br, 10); 9728 dr = fn2(dr, er, ar, br, cr, m[10], 2053994217, 15); 9729 ar = rotl(ar, 10); 9730 cr = fn2(cr, dr, er, ar, br, m[14], 2053994217, 8); 9731 er = rotl(er, 10); 9732 br = fn1(br, cr, dr, er, ar, m[12], 0, 8); 9733 dr = rotl(dr, 10); 9734 ar = fn1(ar, br, cr, dr, er, m[15], 0, 5); 9735 cr = rotl(cr, 10); 9736 er = fn1(er, ar, br, cr, dr, m[10], 0, 12); 9737 br = rotl(br, 10); 9738 dr = fn1(dr, er, ar, br, cr, m[4], 0, 9); 9739 ar = rotl(ar, 10); 9740 cr = fn1(cr, dr, er, ar, br, m[1], 0, 12); 9741 er = rotl(er, 10); 9742 br = fn1(br, cr, dr, er, ar, m[5], 0, 5); 9743 dr = rotl(dr, 10); 9744 ar = fn1(ar, br, cr, dr, er, m[8], 0, 14); 9745 cr = rotl(cr, 10); 9746 er = fn1(er, ar, br, cr, dr, m[7], 0, 6); 9747 br = rotl(br, 10); 9748 dr = fn1(dr, er, ar, br, cr, m[6], 0, 8); 9749 ar = rotl(ar, 10); 9750 cr = fn1(cr, dr, er, ar, br, m[2], 0, 13); 9751 er = rotl(er, 10); 9752 br = fn1(br, cr, dr, er, ar, m[13], 0, 6); 9753 dr = rotl(dr, 10); 9754 ar = fn1(ar, br, cr, dr, er, m[14], 0, 5); 9755 cr = rotl(cr, 10); 9756 er = fn1(er, ar, br, cr, dr, m[0], 0, 15); 9757 br = rotl(br, 10); 9758 dr = fn1(dr, er, ar, br, cr, m[3], 0, 13); 9759 ar = rotl(ar, 10); 9760 cr = fn1(cr, dr, er, ar, br, m[9], 0, 11); 9761 er = rotl(er, 10); 9762 br = fn1(br, cr, dr, er, ar, m[11], 0, 11); 9763 dr = rotl(dr, 10); 9764 var t = this._b + cl + dr | 0; 9765 this._b = this._c + dl + er | 0; 9766 this._c = this._d + el + ar | 0; 9767 this._d = this._e + al + br | 0; 9768 this._e = this._a + bl + cr | 0; 9769 this._a = t; 9770 }; 9771 RIPEMD160.prototype._digest = function() { 9772 this._block[this._blockOffset++] = 128; 9773 if (this._blockOffset > 56) { 9774 this._block.fill(0, this._blockOffset, 64); 9775 this._update(); 9776 this._blockOffset = 0; 9777 } 9778 this._block.fill(0, this._blockOffset, 56); 9779 this._block.writeUInt32LE(this._length[0], 56); 9780 this._block.writeUInt32LE(this._length[1], 60); 9781 this._update(); 9782 var buffer = new Buffer(20); 9783 buffer.writeInt32LE(this._a, 0); 9784 buffer.writeInt32LE(this._b, 4); 9785 buffer.writeInt32LE(this._c, 8); 9786 buffer.writeInt32LE(this._d, 12); 9787 buffer.writeInt32LE(this._e, 16); 9788 return buffer; 9789 }; 9790 function rotl(x, n) { 9791 return x << n | x >>> 32 - n; 9792 } 9793 function fn1(a, b, c, d, e, m, k, s) { 9794 return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0; 9795 } 9796 function fn2(a, b, c, d, e, m, k, s) { 9797 return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0; 9798 } 9799 function fn3(a, b, c, d, e, m, k, s) { 9800 return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0; 9801 } 9802 function fn4(a, b, c, d, e, m, k, s) { 9803 return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0; 9804 } 9805 function fn5(a, b, c, d, e, m, k, s) { 9806 return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0; 9807 } 9808 module.exports = RIPEMD160; 9809})); 9810//#endregion 9811//#region node_modules/pbkdf2/lib/to-buffer.js 9812var require_to_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9813 var Buffer = require_safe_buffer$2().Buffer; 9814 var toBuffer = require_to_buffer$1(); 9815 var useUint8Array = typeof Uint8Array !== "undefined"; 9816 var isView = useUint8Array && typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView; 9817 module.exports = function(thing, encoding, name) { 9818 if (typeof thing === "string" || Buffer.isBuffer(thing) || useUint8Array && thing instanceof Uint8Array || isView && isView(thing)) return toBuffer(thing, encoding); 9819 throw new TypeError(name + " must be a string, a Buffer, a Uint8Array, or a DataView"); 9820 }; 9821})); 9822//#endregion 9823//#region node_modules/pbkdf2/lib/sync-browser.js 9824var require_sync_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9825 var md5 = require_md5(); 9826 var RIPEMD160 = require_ripemd160(); 9827 var sha = require_sha_js(); 9828 var Buffer = require_safe_buffer$2().Buffer; 9829 var checkParameters = require_precondition(); 9830 var defaultEncoding = require_default_encoding(); 9831 var toBuffer = require_to_buffer(); 9832 var ZEROS = Buffer.alloc(128); 9833 var sizes = { 9834 __proto__: null, 9835 md5: 16, 9836 sha1: 20, 9837 sha224: 28, 9838 sha256: 32, 9839 sha384: 48, 9840 sha512: 64, 9841 "sha512-256": 32, 9842 ripemd160: 20, 9843 rmd160: 20 9844 }; 9845 var mapping = { 9846 __proto__: null, 9847 "sha-1": "sha1", 9848 "sha-224": "sha224", 9849 "sha-256": "sha256", 9850 "sha-384": "sha384", 9851 "sha-512": "sha512", 9852 "ripemd-160": "ripemd160" 9853 }; 9854 function rmd160Func(data) { 9855 return new RIPEMD160().update(data).digest(); 9856 } 9857 function getDigest(alg) { 9858 function shaFunc(data) { 9859 return sha(alg).update(data).digest(); 9860 } 9861 if (alg === "rmd160" || alg === "ripemd160") return rmd160Func; 9862 if (alg === "md5") return md5; 9863 return shaFunc; 9864 } 9865 function Hmac(alg, key, saltLen) { 9866 var hash = getDigest(alg); 9867 var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; 9868 if (key.length > blocksize) key = hash(key); 9869 else if (key.length < blocksize) key = Buffer.concat([key, ZEROS], blocksize); 9870 var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]); 9871 var opad = Buffer.allocUnsafe(blocksize + sizes[alg]); 9872 for (var i = 0; i < blocksize; i++) { 9873 ipad[i] = key[i] ^ 54; 9874 opad[i] = key[i] ^ 92; 9875 } 9876 var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4); 9877 ipad.copy(ipad1, 0, 0, blocksize); 9878 this.ipad1 = ipad1; 9879 this.ipad2 = ipad; 9880 this.opad = opad; 9881 this.alg = alg; 9882 this.blocksize = blocksize; 9883 this.hash = hash; 9884 this.size = sizes[alg]; 9885 } 9886 Hmac.prototype.run = function(data, ipad) { 9887 data.copy(ipad, this.blocksize); 9888 this.hash(ipad).copy(this.opad, this.blocksize); 9889 return this.hash(this.opad); 9890 }; 9891 function pbkdf2(password, salt, iterations, keylen, digest) { 9892 checkParameters(iterations, keylen); 9893 password = toBuffer(password, defaultEncoding, "Password"); 9894 salt = toBuffer(salt, defaultEncoding, "Salt"); 9895 var lowerDigest = (digest || "sha1").toLowerCase(); 9896 var mappedDigest = mapping[lowerDigest] || lowerDigest; 9897 var size = sizes[mappedDigest]; 9898 if (typeof size !== "number" || !size) throw new TypeError("Digest algorithm not supported: " + digest); 9899 var hmac = new Hmac(mappedDigest, password, salt.length); 9900 var DK = Buffer.allocUnsafe(keylen); 9901 var block1 = Buffer.allocUnsafe(salt.length + 4); 9902 salt.copy(block1, 0, 0, salt.length); 9903 var destPos = 0; 9904 var hLen = size; 9905 var l = Math.ceil(keylen / hLen); 9906 for (var i = 1; i <= l; i++) { 9907 block1.writeUInt32BE(i, salt.length); 9908 var T = hmac.run(block1, hmac.ipad1); 9909 var U = T; 9910 for (var j = 1; j < iterations; j++) { 9911 U = hmac.run(U, hmac.ipad2); 9912 for (var k = 0; k < hLen; k++) T[k] ^= U[k]; 9913 } 9914 T.copy(DK, destPos); 9915 destPos += hLen; 9916 } 9917 return DK; 9918 } 9919 module.exports = pbkdf2; 9920})); 9921//#endregion 9922//#region node_modules/pbkdf2/lib/async.js 9923var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => { 9924 var Buffer = require_safe_buffer$2().Buffer; 9925 var checkParameters = require_precondition(); 9926 var defaultEncoding = require_default_encoding(); 9927 var sync = require_sync_browser(); 9928 var toBuffer = require_to_buffer(); 9929 var ZERO_BUF; 9930 var subtle = globalThis.crypto && globalThis.crypto.subtle; 9931 var toBrowser = { 9932 sha: "SHA-1", 9933 "sha-1": "SHA-1", 9934 sha1: "SHA-1", 9935 sha256: "SHA-256", 9936 "sha-256": "SHA-256", 9937 sha384: "SHA-384", 9938 "sha-384": "SHA-384", 9939 "sha-512": "SHA-512", 9940 sha512: "SHA-512" 9941 }; 9942 var checks = []; 9943 var nextTick; 9944 function getNextTick() { 9945 if (nextTick) return nextTick; 9946 if (globalThis.process && globalThis.process.nextTick) nextTick = globalThis.process.nextTick; 9947 else if (globalThis.queueMicrotask) nextTick = globalThis.queueMicrotask; 9948 else if (globalThis.setImmediate) nextTick = globalThis.setImmediate; 9949 else nextTick = globalThis.setTimeout; 9950 return nextTick; 9951 } 9952 function browserPbkdf2(password, salt, iterations, length, algo) { 9953 return subtle.importKey("raw", password, { name: "PBKDF2" }, false, ["deriveBits"]).then(function(key) { 9954 return subtle.deriveBits({ 9955 name: "PBKDF2", 9956 salt, 9957 iterations, 9958 hash: { name: algo } 9959 }, key, length << 3); 9960 }).then(function(res) { 9961 return Buffer.from(res); 9962 }); 9963 } 9964 function checkNative(algo) { 9965 if (globalThis.process && !globalThis.process.browser) return Promise.resolve(false); 9966 if (!subtle || !subtle.importKey || !subtle.deriveBits) return Promise.resolve(false); 9967 if (checks[algo] !== void 0) return checks[algo]; 9968 ZERO_BUF = ZERO_BUF || Buffer.alloc(8); 9969 var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() { 9970 return true; 9971 }, function() { 9972 return false; 9973 }); 9974 checks[algo] = prom; 9975 return prom; 9976 } 9977 function resolvePromise(promise, callback) { 9978 promise.then(function(out) { 9979 getNextTick()(function() { 9980 callback(null, out); 9981 }); 9982 }, function(e) { 9983 getNextTick()(function() { 9984 callback(e); 9985 }); 9986 }); 9987 } 9988 module.exports = function(password, salt, iterations, keylen, digest, callback) { 9989 if (typeof digest === "function") { 9990 callback = digest; 9991 digest = void 0; 9992 } 9993 digest = digest || "sha1"; 9994 var algo = toBrowser[digest.toLowerCase()]; 9995 if (!algo || typeof globalThis.Promise !== "function") { 9996 getNextTick()(function() { 9997 var out; 9998 try { 9999 out = sync(password, salt, iterations, keylen, digest); 10000 } catch (e) { 10001 callback(e); 10002 return; 10003 } 10004 callback(null, out); 10005 }); 10006 return; 10007 } 10008 checkParameters(iterations, keylen); 10009 password = toBuffer(password, defaultEncoding, "Password"); 10010 salt = toBuffer(salt, defaultEncoding, "Salt"); 10011 if (typeof callback !== "function") throw new Error("No callback provided to pbkdf2"); 10012 resolvePromise(checkNative(algo).then(function(resp) { 10013 if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo); 10014 return sync(password, salt, iterations, keylen, digest); 10015 }), callback); 10016 }; 10017})); 10018//#endregion 10019//#region node_modules/pbkdf2/browser.js 10020var require_browser$8 = /* @__PURE__ */ __commonJSMin(((exports) => { 10021 exports.pbkdf2 = require_async(); 10022 exports.pbkdf2Sync = require_sync_browser(); 10023})); 10024//#endregion 10025//#region node_modules/des.js/lib/des/utils.js 10026var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => { 10027 exports.readUInt32BE = function readUInt32BE(bytes, off) { 10028 return (bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off]) >>> 0; 10029 }; 10030 exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { 10031 bytes[0 + off] = value >>> 24; 10032 bytes[1 + off] = value >>> 16 & 255; 10033 bytes[2 + off] = value >>> 8 & 255; 10034 bytes[3 + off] = value & 255; 10035 }; 10036 exports.ip = function ip(inL, inR, out, off) { 10037 var outL = 0; 10038 var outR = 0; 10039 for (var i = 6; i >= 0; i -= 2) { 10040 for (var j = 0; j <= 24; j += 8) { 10041 outL <<= 1; 10042 outL |= inR >>> j + i & 1; 10043 } 10044 for (var j = 0; j <= 24; j += 8) { 10045 outL <<= 1; 10046 outL |= inL >>> j + i & 1; 10047 } 10048 } 10049 for (var i = 6; i >= 0; i -= 2) { 10050 for (var j = 1; j <= 25; j += 8) { 10051 outR <<= 1; 10052 outR |= inR >>> j + i & 1; 10053 } 10054 for (var j = 1; j <= 25; j += 8) { 10055 outR <<= 1; 10056 outR |= inL >>> j + i & 1; 10057 } 10058 } 10059 out[off + 0] = outL >>> 0; 10060 out[off + 1] = outR >>> 0; 10061 }; 10062 exports.rip = function rip(inL, inR, out, off) { 10063 var outL = 0; 10064 var outR = 0; 10065 for (var i = 0; i < 4; i++) for (var j = 24; j >= 0; j -= 8) { 10066 outL <<= 1; 10067 outL |= inR >>> j + i & 1; 10068 outL <<= 1; 10069 outL |= inL >>> j + i & 1; 10070 } 10071 for (var i = 4; i < 8; i++) for (var j = 24; j >= 0; j -= 8) { 10072 outR <<= 1; 10073 outR |= inR >>> j + i & 1; 10074 outR <<= 1; 10075 outR |= inL >>> j + i & 1; 10076 } 10077 out[off + 0] = outL >>> 0; 10078 out[off + 1] = outR >>> 0; 10079 }; 10080 exports.pc1 = function pc1(inL, inR, out, off) { 10081 var outL = 0; 10082 var outR = 0; 10083 for (var i = 7; i >= 5; i--) { 10084 for (var j = 0; j <= 24; j += 8) { 10085 outL <<= 1; 10086 outL |= inR >> j + i & 1; 10087 } 10088 for (var j = 0; j <= 24; j += 8) { 10089 outL <<= 1; 10090 outL |= inL >> j + i & 1; 10091 } 10092 } 10093 for (var j = 0; j <= 24; j += 8) { 10094 outL <<= 1; 10095 outL |= inR >> j + i & 1; 10096 } 10097 for (var i = 1; i <= 3; i++) { 10098 for (var j = 0; j <= 24; j += 8) { 10099 outR <<= 1; 10100 outR |= inR >> j + i & 1; 10101 } 10102 for (var j = 0; j <= 24; j += 8) { 10103 outR <<= 1; 10104 outR |= inL >> j + i & 1; 10105 } 10106 } 10107 for (var j = 0; j <= 24; j += 8) { 10108 outR <<= 1; 10109 outR |= inL >> j + i & 1; 10110 } 10111 out[off + 0] = outL >>> 0; 10112 out[off + 1] = outR >>> 0; 10113 }; 10114 exports.r28shl = function r28shl(num, shift) { 10115 return num << shift & 268435455 | num >>> 28 - shift; 10116 }; 10117 var pc2table = [ 10118 14, 10119 11, 10120 17, 10121 4, 10122 27, 10123 23, 10124 25, 10125 0, 10126 13, 10127 22, 10128 7, 10129 18, 10130 5, 10131 9, 10132 16, 10133 24, 10134 2, 10135 20, 10136 12, 10137 21, 10138 1, 10139 8, 10140 15, 10141 26, 10142 15, 10143 4, 10144 25, 10145 19, 10146 9, 10147 1, 10148 26, 10149 16, 10150 5, 10151 11, 10152 23, 10153 8, 10154 12, 10155 7, 10156 17, 10157 0, 10158 22, 10159 3, 10160 10, 10161 14, 10162 6, 10163 20, 10164 27, 10165 24 10166 ]; 10167 exports.pc2 = function pc2(inL, inR, out, off) { 10168 var outL = 0; 10169 var outR = 0; 10170 var len = pc2table.length >>> 1; 10171 for (var i = 0; i < len; i++) { 10172 outL <<= 1; 10173 outL |= inL >>> pc2table[i] & 1; 10174 } 10175 for (var i = len; i < pc2table.length; i++) { 10176 outR <<= 1; 10177 outR |= inR >>> pc2table[i] & 1; 10178 } 10179 out[off + 0] = outL >>> 0; 10180 out[off + 1] = outR >>> 0; 10181 }; 10182 exports.expand = function expand(r, out, off) { 10183 var outL = 0; 10184 var outR = 0; 10185 outL = (r & 1) << 5 | r >>> 27; 10186 for (var i = 23; i >= 15; i -= 4) { 10187 outL <<= 6; 10188 outL |= r >>> i & 63; 10189 } 10190 for (var i = 11; i >= 3; i -= 4) { 10191 outR |= r >>> i & 63; 10192 outR <<= 6; 10193 } 10194 outR |= (r & 31) << 1 | r >>> 31; 10195 out[off + 0] = outL >>> 0; 10196 out[off + 1] = outR >>> 0; 10197 }; 10198 var sTable = [ 10199 14, 10200 0, 10201 4, 10202 15, 10203 13, 10204 7, 10205 1, 10206 4, 10207 2, 10208 14, 10209 15, 10210 2, 10211 11, 10212 13, 10213 8, 10214 1, 10215 3, 10216 10, 10217 10, 10218 6, 10219 6, 10220 12, 10221 12, 10222 11, 10223 5, 10224 9, 10225 9, 10226 5, 10227 0, 10228 3, 10229 7, 10230 8, 10231 4, 10232 15, 10233 1, 10234 12, 10235 14, 10236 8, 10237 8, 10238 2, 10239 13, 10240 4, 10241 6, 10242 9, 10243 2, 10244 1, 10245 11, 10246 7, 10247 15, 10248 5, 10249 12, 10250 11, 10251 9, 10252 3, 10253 7, 10254 14, 10255 3, 10256 10, 10257 10, 10258 0, 10259 5, 10260 6, 10261 0, 10262 13, 10263 15, 10264 3, 10265 1, 10266 13, 10267 8, 10268 4, 10269 14, 10270 7, 10271 6, 10272 15, 10273 11, 10274 2, 10275 3, 10276 8, 10277 4, 10278 14, 10279 9, 10280 12, 10281 7, 10282 0, 10283 2, 10284 1, 10285 13, 10286 10, 10287 12, 10288 6, 10289 0, 10290 9, 10291 5, 10292 11, 10293 10, 10294 5, 10295 0, 10296 13, 10297 14, 10298 8, 10299 7, 10300 10, 10301 11, 10302 1, 10303 10, 10304 3, 10305 4, 10306 15, 10307 13, 10308 4, 10309 1, 10310 2, 10311 5, 10312 11, 10313 8, 10314 6, 10315 12, 10316 7, 10317 6, 10318 12, 10319 9, 10320 0, 10321 3, 10322 5, 10323 2, 10324 14, 10325 15, 10326 9, 10327 10, 10328 13, 10329 0, 10330 7, 10331 9, 10332 0, 10333 14, 10334 9, 10335 6, 10336 3, 10337 3, 10338 4, 10339 15, 10340 6, 10341 5, 10342 10, 10343 1, 10344 2, 10345 13, 10346 8, 10347 12, 10348 5, 10349 7, 10350 14, 10351 11, 10352 12, 10353 4, 10354 11, 10355 2, 10356 15, 10357 8, 10358 1, 10359 13, 10360 1, 10361 6, 10362 10, 10363 4, 10364 13, 10365 9, 10366 0, 10367 8, 10368 6, 10369 15, 10370 9, 10371 3, 10372 8, 10373 0, 10374 7, 10375 11, 10376 4, 10377 1, 10378 15, 10379 2, 10380 14, 10381 12, 10382 3, 10383 5, 10384 11, 10385 10, 10386 5, 10387 14, 10388 2, 10389 7, 10390 12, 10391 7, 10392 13, 10393 13, 10394 8, 10395 14, 10396 11, 10397 3, 10398 5, 10399 0, 10400 6, 10401 6, 10402 15, 10403 9, 10404 0, 10405 10, 10406 3, 10407 1, 10408 4, 10409 2, 10410 7, 10411 8, 10412 2, 10413 5, 10414 12, 10415 11, 10416 1, 10417 12, 10418 10, 10419 4, 10420 14, 10421 15, 10422 9, 10423 10, 10424 3, 10425 6, 10426 15, 10427 9, 10428 0, 10429 0, 10430 6, 10431 12, 10432 10, 10433 11, 10434 1, 10435 7, 10436 13, 10437 13, 10438 8, 10439 15, 10440 9, 10441 1, 10442 4, 10443 3, 10444 5, 10445 14, 10446 11, 10447 5, 10448 12, 10449 2, 10450 7, 10451 8, 10452 2, 10453 4, 10454 14, 10455 2, 10456 14, 10457 12, 10458 11, 10459 4, 10460 2, 10461 1, 10462 12, 10463 7, 10464 4, 10465 10, 10466 7, 10467 11, 10468 13, 10469 6, 10470 1, 10471 8, 10472 5, 10473 5, 10474 0, 10475 3, 10476 15, 10477 15, 10478 10, 10479 13, 10480 3, 10481 0, 10482 9, 10483 14, 10484 8, 10485 9, 10486 6, 10487 4, 10488 11, 10489 2, 10490 8, 10491 1, 10492 12, 10493 11, 10494 7, 10495 10, 10496 1, 10497 13, 10498 14, 10499 7, 10500 2, 10501 8, 10502 13, 10503 15, 10504 6, 10505 9, 10506 15, 10507 12, 10508 0, 10509 5, 10510 9, 10511 6, 10512 10, 10513 3, 10514 4, 10515 0, 10516 5, 10517 14, 10518 3, 10519 12, 10520 10, 10521 1, 10522 15, 10523 10, 10524 4, 10525 15, 10526 2, 10527 9, 10528 7, 10529 2, 10530 12, 10531 6, 10532 9, 10533 8, 10534 5, 10535 0, 10536 6, 10537 13, 10538 1, 10539 3, 10540 13, 10541 4, 10542 14, 10543 14, 10544 0, 10545 7, 10546 11, 10547 5, 10548 3, 10549 11, 10550 8, 10551 9, 10552 4, 10553 14, 10554 3, 10555 15, 10556 2, 10557 5, 10558 12, 10559 2, 10560 9, 10561 8, 10562 5, 10563 12, 10564 15, 10565 3, 10566 10, 10567 7, 10568 11, 10569 0, 10570 14, 10571 4, 10572 1, 10573 10, 10574 7, 10575 1, 10576 6, 10577 13, 10578 0, 10579 11, 10580 8, 10581 6, 10582 13, 10583 4, 10584 13, 10585 11, 10586 0, 10587 2, 10588 11, 10589 14, 10590 7, 10591 15, 10592 4, 10593 0, 10594 9, 10595 8, 10596 1, 10597 13, 10598 10, 10599 3, 10600 14, 10601 12, 10602 3, 10603 9, 10604 5, 10605 7, 10606 12, 10607 5, 10608 2, 10609 10, 10610 15, 10611 6, 10612 8, 10613 1, 10614 6, 10615 1, 10616 6, 10617 4, 10618 11, 10619 11, 10620 13, 10621 13, 10622 8, 10623 12, 10624 1, 10625 3, 10626 4, 10627 7, 10628 10, 10629 14, 10630 7, 10631 10, 10632 9, 10633 15, 10634 5, 10635 6, 10636 0, 10637 8, 10638 15, 10639 0, 10640 14, 10641 5, 10642 2, 10643 9, 10644 3, 10645 2, 10646 12, 10647 13, 10648 1, 10649 2, 10650 15, 10651 8, 10652 13, 10653 4, 10654 8, 10655 6, 10656 10, 10657 15, 10658 3, 10659 11, 10660 7, 10661 1, 10662 4, 10663 10, 10664 12, 10665 9, 10666 5, 10667 3, 10668 6, 10669 14, 10670 11, 10671 5, 10672 0, 10673 0, 10674 14, 10675 12, 10676 9, 10677 7, 10678 2, 10679 7, 10680 2, 10681 11, 10682 1, 10683 4, 10684 14, 10685 1, 10686 7, 10687 9, 10688 4, 10689 12, 10690 10, 10691 14, 10692 8, 10693 2, 10694 13, 10695 0, 10696 15, 10697 6, 10698 12, 10699 10, 10700 9, 10701 13, 10702 0, 10703 15, 10704 3, 10705 3, 10706 5, 10707 5, 10708 6, 10709 8, 10710 11 10711 ]; 10712 exports.substitute = function substitute(inL, inR) { 10713 var out = 0; 10714 for (var i = 0; i < 4; i++) { 10715 var b = inL >>> 18 - i * 6 & 63; 10716 var sb = sTable[i * 64 + b]; 10717 out <<= 4; 10718 out |= sb; 10719 } 10720 for (var i = 0; i < 4; i++) { 10721 var b = inR >>> 18 - i * 6 & 63; 10722 var sb = sTable[256 + i * 64 + b]; 10723 out <<= 4; 10724 out |= sb; 10725 } 10726 return out >>> 0; 10727 }; 10728 var permuteTable = [ 10729 16, 10730 25, 10731 12, 10732 11, 10733 3, 10734 20, 10735 4, 10736 15, 10737 31, 10738 17, 10739 9, 10740 6, 10741 27, 10742 14, 10743 1, 10744 22, 10745 30, 10746 24, 10747 8, 10748 18, 10749 0, 10750 5, 10751 29, 10752 23, 10753 13, 10754 19, 10755 2, 10756 26, 10757 10, 10758 21, 10759 28, 10760 7 10761 ]; 10762 exports.permute = function permute(num) { 10763 var out = 0; 10764 for (var i = 0; i < permuteTable.length; i++) { 10765 out <<= 1; 10766 out |= num >>> permuteTable[i] & 1; 10767 } 10768 return out >>> 0; 10769 }; 10770 exports.padSplit = function padSplit(num, size, group) { 10771 var str = num.toString(2); 10772 while (str.length < size) str = "0" + str; 10773 var out = []; 10774 for (var i = 0; i < size; i += group) out.push(str.slice(i, i + group)); 10775 return out.join(" "); 10776 }; 10777})); 10778//#endregion 10779//#region node_modules/minimalistic-assert/index.js 10780var require_minimalistic_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => { 10781 module.exports = assert; 10782 function assert(val, msg) { 10783 if (!val) throw new Error(msg || "Assertion failed"); 10784 } 10785 assert.equal = function assertEqual(l, r, msg) { 10786 if (l != r) throw new Error(msg || "Assertion failed: " + l + " != " + r); 10787 }; 10788})); 10789//#endregion 10790//#region node_modules/des.js/lib/des/cipher.js 10791var require_cipher = /* @__PURE__ */ __commonJSMin(((exports, module) => { 10792 require_buffer$1().Buffer; 10793 var assert = require_minimalistic_assert(); 10794 function Cipher(options) { 10795 this.options = options; 10796 this.type = this.options.type; 10797 this.blockSize = 8; 10798 this._init(); 10799 this.buffer = new Array(this.blockSize); 10800 this.bufferOff = 0; 10801 } 10802 module.exports = Cipher; 10803 Cipher.prototype._init = function _init() {}; 10804 Cipher.prototype.update = function update(data) { 10805 if (data.length === 0) return []; 10806 if (this.type === "decrypt") return this._updateDecrypt(data); 10807 else return this._updateEncrypt(data); 10808 }; 10809 Cipher.prototype._buffer = function _buffer(data, off) { 10810 var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); 10811 for (var i = 0; i < min; i++) this.buffer[this.bufferOff + i] = data[off + i]; 10812 this.bufferOff += min; 10813 return min; 10814 }; 10815 Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { 10816 this._update(this.buffer, 0, out, off); 10817 this.bufferOff = 0; 10818 return this.blockSize; 10819 }; 10820 Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { 10821 var inputOff = 0; 10822 var outputOff = 0; 10823 var count = (this.bufferOff + data.length) / this.blockSize | 0; 10824 var out = new Array(count * this.blockSize); 10825 if (this.bufferOff !== 0) { 10826 inputOff += this._buffer(data, inputOff); 10827 if (this.bufferOff === this.buffer.length) outputOff += this._flushBuffer(out, outputOff); 10828 } 10829 var max = data.length - (data.length - inputOff) % this.blockSize; 10830 for (; inputOff < max; inputOff += this.blockSize) { 10831 this._update(data, inputOff, out, outputOff); 10832 outputOff += this.blockSize; 10833 } 10834 for (; inputOff < data.length; inputOff++, this.bufferOff++) this.buffer[this.bufferOff] = data[inputOff]; 10835 return out; 10836 }; 10837 Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { 10838 var inputOff = 0; 10839 var outputOff = 0; 10840 var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; 10841 var out = new Array(count * this.blockSize); 10842 for (; count > 0; count--) { 10843 inputOff += this._buffer(data, inputOff); 10844 outputOff += this._flushBuffer(out, outputOff); 10845 } 10846 inputOff += this._buffer(data, inputOff); 10847 return out; 10848 }; 10849 Cipher.prototype.final = function final(buffer) { 10850 var first; 10851 if (buffer) first = this.update(buffer); 10852 var last; 10853 if (this.type === "encrypt") last = this._finalEncrypt(); 10854 else last = this._finalDecrypt(); 10855 if (first) return first.concat(last); 10856 else return last; 10857 }; 10858 Cipher.prototype._pad = function _pad(buffer, off) { 10859 if (off === 0) return false; 10860 while (off < buffer.length) buffer[off++] = 0; 10861 return true; 10862 }; 10863 Cipher.prototype._finalEncrypt = function _finalEncrypt() { 10864 if (!this._pad(this.buffer, this.bufferOff)) return []; 10865 var out = new Array(this.blockSize); 10866 this._update(this.buffer, 0, out, 0); 10867 return out; 10868 }; 10869 Cipher.prototype._unpad = function _unpad(buffer) { 10870 return buffer; 10871 }; 10872 Cipher.prototype._finalDecrypt = function _finalDecrypt() { 10873 assert.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); 10874 var out = new Array(this.blockSize); 10875 this._flushBuffer(out, 0); 10876 return this._unpad(out); 10877 }; 10878})); 10879//#endregion 10880//#region node_modules/des.js/lib/des/des.js 10881var require_des$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 10882 var assert = require_minimalistic_assert(); 10883 var inherits = require_inherits_browser(); 10884 var utils = require_utils$4(); 10885 var Cipher = require_cipher(); 10886 function DESState() { 10887 this.tmp = new Array(2); 10888 this.keys = null; 10889 } 10890 function DES(options) { 10891 Cipher.call(this, options); 10892 var state = new DESState(); 10893 this._desState = state; 10894 this.deriveKeys(state, options.key); 10895 } 10896 inherits(DES, Cipher); 10897 module.exports = DES; 10898 DES.create = function create(options) { 10899 return new DES(options); 10900 }; 10901 var shiftTable = [ 10902 1, 10903 1, 10904 2, 10905 2, 10906 2, 10907 2, 10908 2, 10909 2, 10910 1, 10911 2, 10912 2, 10913 2, 10914 2, 10915 2, 10916 2, 10917 1 10918 ]; 10919 DES.prototype.deriveKeys = function deriveKeys(state, key) { 10920 state.keys = new Array(32); 10921 assert.equal(key.length, this.blockSize, "Invalid key length"); 10922 var kL = utils.readUInt32BE(key, 0); 10923 var kR = utils.readUInt32BE(key, 4); 10924 utils.pc1(kL, kR, state.tmp, 0); 10925 kL = state.tmp[0]; 10926 kR = state.tmp[1]; 10927 for (var i = 0; i < state.keys.length; i += 2) { 10928 var shift = shiftTable[i >>> 1]; 10929 kL = utils.r28shl(kL, shift); 10930 kR = utils.r28shl(kR, shift); 10931 utils.pc2(kL, kR, state.keys, i); 10932 } 10933 }; 10934 DES.prototype._update = function _update(inp, inOff, out, outOff) { 10935 var state = this._desState; 10936 var l = utils.readUInt32BE(inp, inOff); 10937 var r = utils.readUInt32BE(inp, inOff + 4); 10938 utils.ip(l, r, state.tmp, 0); 10939 l = state.tmp[0]; 10940 r = state.tmp[1]; 10941 if (this.type === "encrypt") this._encrypt(state, l, r, state.tmp, 0); 10942 else this._decrypt(state, l, r, state.tmp, 0); 10943 l = state.tmp[0]; 10944 r = state.tmp[1]; 10945 utils.writeUInt32BE(out, l, outOff); 10946 utils.writeUInt32BE(out, r, outOff + 4); 10947 }; 10948 DES.prototype._pad = function _pad(buffer, off) { 10949 var value = buffer.length - off; 10950 for (var i = off; i < buffer.length; i++) buffer[i] = value; 10951 return true; 10952 }; 10953 DES.prototype._unpad = function _unpad(buffer) { 10954 var pad = buffer[buffer.length - 1]; 10955 for (var i = buffer.length - pad; i < buffer.length; i++) assert.equal(buffer[i], pad); 10956 return buffer.slice(0, buffer.length - pad); 10957 }; 10958 DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { 10959 var l = lStart; 10960 var r = rStart; 10961 for (var i = 0; i < state.keys.length; i += 2) { 10962 var keyL = state.keys[i]; 10963 var keyR = state.keys[i + 1]; 10964 utils.expand(r, state.tmp, 0); 10965 keyL ^= state.tmp[0]; 10966 keyR ^= state.tmp[1]; 10967 var s = utils.substitute(keyL, keyR); 10968 var f = utils.permute(s); 10969 var t = r; 10970 r = (l ^ f) >>> 0; 10971 l = t; 10972 } 10973 utils.rip(r, l, out, off); 10974 }; 10975 DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { 10976 var l = rStart; 10977 var r = lStart; 10978 for (var i = state.keys.length - 2; i >= 0; i -= 2) { 10979 var keyL = state.keys[i]; 10980 var keyR = state.keys[i + 1]; 10981 utils.expand(l, state.tmp, 0); 10982 keyL ^= state.tmp[0]; 10983 keyR ^= state.tmp[1]; 10984 var s = utils.substitute(keyL, keyR); 10985 var f = utils.permute(s); 10986 var t = l; 10987 l = (r ^ f) >>> 0; 10988 r = t; 10989 } 10990 utils.rip(l, r, out, off); 10991 }; 10992})); 10993//#endregion 10994//#region node_modules/des.js/lib/des/cbc.js 10995var require_cbc$1 = /* @__PURE__ */ __commonJSMin(((exports) => { 10996 var assert = require_minimalistic_assert(); 10997 var inherits = require_inherits_browser(); 10998 var proto = {}; 10999 function CBCState(iv) { 11000 assert.equal(iv.length, 8, "Invalid IV length"); 11001 this.iv = new Array(8); 11002 for (var i = 0; i < this.iv.length; i++) this.iv[i] = iv[i]; 11003 } 11004 function instantiate(Base) { 11005 function CBC(options) { 11006 Base.call(this, options); 11007 this._cbcInit(); 11008 } 11009 inherits(CBC, Base); 11010 var keys = Object.keys(proto); 11011 for (var i = 0; i < keys.length; i++) { 11012 var key = keys[i]; 11013 CBC.prototype[key] = proto[key]; 11014 } 11015 CBC.create = function create(options) { 11016 return new CBC(options); 11017 }; 11018 return CBC; 11019 } 11020 exports.instantiate = instantiate; 11021 proto._cbcInit = function _cbcInit() { 11022 var state = new CBCState(this.options.iv); 11023 this._cbcState = state; 11024 }; 11025 proto._update = function _update(inp, inOff, out, outOff) { 11026 var state = this._cbcState; 11027 var superProto = this.constructor.super_.prototype; 11028 var iv = state.iv; 11029 if (this.type === "encrypt") { 11030 for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i]; 11031 superProto._update.call(this, iv, 0, out, outOff); 11032 for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i]; 11033 } else { 11034 superProto._update.call(this, inp, inOff, out, outOff); 11035 for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i]; 11036 for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i]; 11037 } 11038 }; 11039})); 11040//#endregion 11041//#region node_modules/des.js/lib/des/ede.js 11042var require_ede = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11043 var assert = require_minimalistic_assert(); 11044 var inherits = require_inherits_browser(); 11045 var Cipher = require_cipher(); 11046 var DES = require_des$1(); 11047 function EDEState(type, key) { 11048 assert.equal(key.length, 24, "Invalid key length"); 11049 var k1 = key.slice(0, 8); 11050 var k2 = key.slice(8, 16); 11051 var k3 = key.slice(16, 24); 11052 if (type === "encrypt") this.ciphers = [ 11053 DES.create({ 11054 type: "encrypt", 11055 key: k1 11056 }), 11057 DES.create({ 11058 type: "decrypt", 11059 key: k2 11060 }), 11061 DES.create({ 11062 type: "encrypt", 11063 key: k3 11064 }) 11065 ]; 11066 else this.ciphers = [ 11067 DES.create({ 11068 type: "decrypt", 11069 key: k3 11070 }), 11071 DES.create({ 11072 type: "encrypt", 11073 key: k2 11074 }), 11075 DES.create({ 11076 type: "decrypt", 11077 key: k1 11078 }) 11079 ]; 11080 } 11081 function EDE(options) { 11082 Cipher.call(this, options); 11083 var state = new EDEState(this.type, this.options.key); 11084 this._edeState = state; 11085 } 11086 inherits(EDE, Cipher); 11087 module.exports = EDE; 11088 EDE.create = function create(options) { 11089 return new EDE(options); 11090 }; 11091 EDE.prototype._update = function _update(inp, inOff, out, outOff) { 11092 var state = this._edeState; 11093 state.ciphers[0]._update(inp, inOff, out, outOff); 11094 state.ciphers[1]._update(out, outOff, out, outOff); 11095 state.ciphers[2]._update(out, outOff, out, outOff); 11096 }; 11097 EDE.prototype._pad = DES.prototype._pad; 11098 EDE.prototype._unpad = DES.prototype._unpad; 11099})); 11100//#endregion 11101//#region node_modules/des.js/lib/des.js 11102var require_des = /* @__PURE__ */ __commonJSMin(((exports) => { 11103 exports.utils = require_utils$4(); 11104 exports.Cipher = require_cipher(); 11105 exports.DES = require_des$1(); 11106 exports.CBC = require_cbc$1(); 11107 exports.EDE = require_ede(); 11108})); 11109//#endregion 11110//#region node_modules/browserify-des/index.js 11111var require_browserify_des = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11112 var CipherBase = require_cipher_base(); 11113 var des = require_des(); 11114 var inherits = require_inherits_browser(); 11115 var Buffer = require_safe_buffer$2().Buffer; 11116 var modes = { 11117 "des-ede3-cbc": des.CBC.instantiate(des.EDE), 11118 "des-ede3": des.EDE, 11119 "des-ede-cbc": des.CBC.instantiate(des.EDE), 11120 "des-ede": des.EDE, 11121 "des-cbc": des.CBC.instantiate(des.DES), 11122 "des-ecb": des.DES 11123 }; 11124 modes.des = modes["des-cbc"]; 11125 modes.des3 = modes["des-ede3-cbc"]; 11126 module.exports = DES; 11127 inherits(DES, CipherBase); 11128 function DES(opts) { 11129 CipherBase.call(this); 11130 var modeName = opts.mode.toLowerCase(); 11131 var mode = modes[modeName]; 11132 var type; 11133 if (opts.decrypt) type = "decrypt"; 11134 else type = "encrypt"; 11135 var key = opts.key; 11136 if (!Buffer.isBuffer(key)) key = Buffer.from(key); 11137 if (modeName === "des-ede" || modeName === "des-ede-cbc") key = Buffer.concat([key, key.slice(0, 8)]); 11138 var iv = opts.iv; 11139 if (!Buffer.isBuffer(iv)) iv = Buffer.from(iv); 11140 this._des = mode.create({ 11141 key, 11142 iv, 11143 type 11144 }); 11145 } 11146 DES.prototype._update = function(data) { 11147 return Buffer.from(this._des.update(data)); 11148 }; 11149 DES.prototype._final = function() { 11150 return Buffer.from(this._des.final()); 11151 }; 11152})); 11153//#endregion 11154//#region node_modules/browserify-aes/modes/ecb.js 11155var require_ecb = /* @__PURE__ */ __commonJSMin(((exports) => { 11156 exports.encrypt = function(self, block) { 11157 return self._cipher.encryptBlock(block); 11158 }; 11159 exports.decrypt = function(self, block) { 11160 return self._cipher.decryptBlock(block); 11161 }; 11162})); 11163//#endregion 11164//#region node_modules/buffer-xor/index.js 11165var require_buffer_xor = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11166 var Buffer = require_buffer$1().Buffer; 11167 module.exports = function xor(a, b) { 11168 var length = Math.min(a.length, b.length); 11169 var buffer = new Buffer(length); 11170 for (var i = 0; i < length; ++i) buffer[i] = a[i] ^ b[i]; 11171 return buffer; 11172 }; 11173})); 11174//#endregion 11175//#region node_modules/browserify-aes/modes/cbc.js 11176var require_cbc = /* @__PURE__ */ __commonJSMin(((exports) => { 11177 var xor = require_buffer_xor(); 11178 exports.encrypt = function(self, block) { 11179 var data = xor(block, self._prev); 11180 self._prev = self._cipher.encryptBlock(data); 11181 return self._prev; 11182 }; 11183 exports.decrypt = function(self, block) { 11184 var pad = self._prev; 11185 self._prev = block; 11186 return xor(self._cipher.decryptBlock(block), pad); 11187 }; 11188})); 11189//#endregion 11190//#region node_modules/browserify-aes/modes/cfb.js 11191var require_cfb = /* @__PURE__ */ __commonJSMin(((exports) => { 11192 var Buffer = require_safe_buffer$2().Buffer; 11193 var xor = require_buffer_xor(); 11194 function encryptStart(self, data, decrypt) { 11195 var len = data.length; 11196 var out = xor(data, self._cache); 11197 self._cache = self._cache.slice(len); 11198 self._prev = Buffer.concat([self._prev, decrypt ? data : out]); 11199 return out; 11200 } 11201 exports.encrypt = function(self, data, decrypt) { 11202 var out = Buffer.allocUnsafe(0); 11203 var len; 11204 while (data.length) { 11205 if (self._cache.length === 0) { 11206 self._cache = self._cipher.encryptBlock(self._prev); 11207 self._prev = Buffer.allocUnsafe(0); 11208 } 11209 if (self._cache.length <= data.length) { 11210 len = self._cache.length; 11211 out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)]); 11212 data = data.slice(len); 11213 } else { 11214 out = Buffer.concat([out, encryptStart(self, data, decrypt)]); 11215 break; 11216 } 11217 } 11218 return out; 11219 }; 11220})); 11221//#endregion 11222//#region node_modules/browserify-aes/modes/cfb8.js 11223var require_cfb8 = /* @__PURE__ */ __commonJSMin(((exports) => { 11224 var Buffer = require_safe_buffer$2().Buffer; 11225 function encryptByte(self, byteParam, decrypt) { 11226 var out = self._cipher.encryptBlock(self._prev)[0] ^ byteParam; 11227 self._prev = Buffer.concat([self._prev.slice(1), Buffer.from([decrypt ? byteParam : out])]); 11228 return out; 11229 } 11230 exports.encrypt = function(self, chunk, decrypt) { 11231 var len = chunk.length; 11232 var out = Buffer.allocUnsafe(len); 11233 var i = -1; 11234 while (++i < len) out[i] = encryptByte(self, chunk[i], decrypt); 11235 return out; 11236 }; 11237})); 11238//#endregion 11239//#region node_modules/browserify-aes/modes/cfb1.js 11240var require_cfb1 = /* @__PURE__ */ __commonJSMin(((exports) => { 11241 var Buffer = require_safe_buffer$2().Buffer; 11242 function encryptByte(self, byteParam, decrypt) { 11243 var pad; 11244 var i = -1; 11245 var len = 8; 11246 var out = 0; 11247 var bit, value; 11248 while (++i < len) { 11249 pad = self._cipher.encryptBlock(self._prev); 11250 bit = byteParam & 1 << 7 - i ? 128 : 0; 11251 value = pad[0] ^ bit; 11252 out += (value & 128) >> i % 8; 11253 self._prev = shiftIn(self._prev, decrypt ? bit : value); 11254 } 11255 return out; 11256 } 11257 function shiftIn(buffer, value) { 11258 var len = buffer.length; 11259 var i = -1; 11260 var out = Buffer.allocUnsafe(buffer.length); 11261 buffer = Buffer.concat([buffer, Buffer.from([value])]); 11262 while (++i < len) out[i] = buffer[i] << 1 | buffer[i + 1] >> 7; 11263 return out; 11264 } 11265 exports.encrypt = function(self, chunk, decrypt) { 11266 var len = chunk.length; 11267 var out = Buffer.allocUnsafe(len); 11268 var i = -1; 11269 while (++i < len) out[i] = encryptByte(self, chunk[i], decrypt); 11270 return out; 11271 }; 11272})); 11273//#endregion 11274//#region node_modules/browserify-aes/modes/ofb.js 11275var require_ofb = /* @__PURE__ */ __commonJSMin(((exports) => { 11276 var Buffer = require_buffer$1().Buffer; 11277 var xor = require_buffer_xor(); 11278 function getBlock(self) { 11279 self._prev = self._cipher.encryptBlock(self._prev); 11280 return self._prev; 11281 } 11282 exports.encrypt = function(self, chunk) { 11283 while (self._cache.length < chunk.length) self._cache = Buffer.concat([self._cache, getBlock(self)]); 11284 var pad = self._cache.slice(0, chunk.length); 11285 self._cache = self._cache.slice(chunk.length); 11286 return xor(chunk, pad); 11287 }; 11288})); 11289//#endregion 11290//#region node_modules/browserify-aes/incr32.js 11291var require_incr32 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11292 function incr32(iv) { 11293 var len = iv.length; 11294 var item; 11295 while (len--) { 11296 item = iv.readUInt8(len); 11297 if (item === 255) iv.writeUInt8(0, len); 11298 else { 11299 item++; 11300 iv.writeUInt8(item, len); 11301 break; 11302 } 11303 } 11304 } 11305 module.exports = incr32; 11306})); 11307//#endregion 11308//#region node_modules/browserify-aes/modes/ctr.js 11309var require_ctr = /* @__PURE__ */ __commonJSMin(((exports) => { 11310 var xor = require_buffer_xor(); 11311 var Buffer = require_safe_buffer$2().Buffer; 11312 var incr32 = require_incr32(); 11313 function getBlock(self) { 11314 var out = self._cipher.encryptBlockRaw(self._prev); 11315 incr32(self._prev); 11316 return out; 11317 } 11318 var blockSize = 16; 11319 exports.encrypt = function(self, chunk) { 11320 var chunkNum = Math.ceil(chunk.length / blockSize); 11321 var start = self._cache.length; 11322 self._cache = Buffer.concat([self._cache, Buffer.allocUnsafe(chunkNum * blockSize)]); 11323 for (var i = 0; i < chunkNum; i++) { 11324 var out = getBlock(self); 11325 var offset = start + i * blockSize; 11326 self._cache.writeUInt32BE(out[0], offset + 0); 11327 self._cache.writeUInt32BE(out[1], offset + 4); 11328 self._cache.writeUInt32BE(out[2], offset + 8); 11329 self._cache.writeUInt32BE(out[3], offset + 12); 11330 } 11331 var pad = self._cache.slice(0, chunk.length); 11332 self._cache = self._cache.slice(chunk.length); 11333 return xor(chunk, pad); 11334 }; 11335})); 11336//#endregion 11337//#region node_modules/browserify-aes/modes/list.json 11338var list_exports = /* @__PURE__ */ __exportAll({ 11339 aes128: () => aes128, 11340 aes192: () => aes192, 11341 aes256: () => aes256, 11342 default: () => list_default 11343}); 11344var aes128, aes192, aes256, list_default; 11345var init_list = __esmMin((() => { 11346 aes128 = { 11347 "cipher": "AES", 11348 "key": 128, 11349 "iv": 16, 11350 "mode": "CBC", 11351 "type": "block" 11352 }; 11353 aes192 = { 11354 "cipher": "AES", 11355 "key": 192, 11356 "iv": 16, 11357 "mode": "CBC", 11358 "type": "block" 11359 }; 11360 aes256 = { 11361 "cipher": "AES", 11362 "key": 256, 11363 "iv": 16, 11364 "mode": "CBC", 11365 "type": "block" 11366 }; 11367 list_default = { 11368 "aes-128-ecb": { 11369 "cipher": "AES", 11370 "key": 128, 11371 "iv": 0, 11372 "mode": "ECB", 11373 "type": "block" 11374 }, 11375 "aes-192-ecb": { 11376 "cipher": "AES", 11377 "key": 192, 11378 "iv": 0, 11379 "mode": "ECB", 11380 "type": "block" 11381 }, 11382 "aes-256-ecb": { 11383 "cipher": "AES", 11384 "key": 256, 11385 "iv": 0, 11386 "mode": "ECB", 11387 "type": "block" 11388 }, 11389 "aes-128-cbc": { 11390 "cipher": "AES", 11391 "key": 128, 11392 "iv": 16, 11393 "mode": "CBC", 11394 "type": "block" 11395 }, 11396 "aes-192-cbc": { 11397 "cipher": "AES", 11398 "key": 192, 11399 "iv": 16, 11400 "mode": "CBC", 11401 "type": "block" 11402 }, 11403 "aes-256-cbc": { 11404 "cipher": "AES", 11405 "key": 256, 11406 "iv": 16, 11407 "mode": "CBC", 11408 "type": "block" 11409 }, 11410 aes128, 11411 aes192, 11412 aes256, 11413 "aes-128-cfb": { 11414 "cipher": "AES", 11415 "key": 128, 11416 "iv": 16, 11417 "mode": "CFB", 11418 "type": "stream" 11419 }, 11420 "aes-192-cfb": { 11421 "cipher": "AES", 11422 "key": 192, 11423 "iv": 16, 11424 "mode": "CFB", 11425 "type": "stream" 11426 }, 11427 "aes-256-cfb": { 11428 "cipher": "AES", 11429 "key": 256, 11430 "iv": 16, 11431 "mode": "CFB", 11432 "type": "stream" 11433 }, 11434 "aes-128-cfb8": { 11435 "cipher": "AES", 11436 "key": 128, 11437 "iv": 16, 11438 "mode": "CFB8", 11439 "type": "stream" 11440 }, 11441 "aes-192-cfb8": { 11442 "cipher": "AES", 11443 "key": 192, 11444 "iv": 16, 11445 "mode": "CFB8", 11446 "type": "stream" 11447 }, 11448 "aes-256-cfb8": { 11449 "cipher": "AES", 11450 "key": 256, 11451 "iv": 16, 11452 "mode": "CFB8", 11453 "type": "stream" 11454 }, 11455 "aes-128-cfb1": { 11456 "cipher": "AES", 11457 "key": 128, 11458 "iv": 16, 11459 "mode": "CFB1", 11460 "type": "stream" 11461 }, 11462 "aes-192-cfb1": { 11463 "cipher": "AES", 11464 "key": 192, 11465 "iv": 16, 11466 "mode": "CFB1", 11467 "type": "stream" 11468 }, 11469 "aes-256-cfb1": { 11470 "cipher": "AES", 11471 "key": 256, 11472 "iv": 16, 11473 "mode": "CFB1", 11474 "type": "stream" 11475 }, 11476 "aes-128-ofb": { 11477 "cipher": "AES", 11478 "key": 128, 11479 "iv": 16, 11480 "mode": "OFB", 11481 "type": "stream" 11482 }, 11483 "aes-192-ofb": { 11484 "cipher": "AES", 11485 "key": 192, 11486 "iv": 16, 11487 "mode": "OFB", 11488 "type": "stream" 11489 }, 11490 "aes-256-ofb": { 11491 "cipher": "AES", 11492 "key": 256, 11493 "iv": 16, 11494 "mode": "OFB", 11495 "type": "stream" 11496 }, 11497 "aes-128-ctr": { 11498 "cipher": "AES", 11499 "key": 128, 11500 "iv": 16, 11501 "mode": "CTR", 11502 "type": "stream" 11503 }, 11504 "aes-192-ctr": { 11505 "cipher": "AES", 11506 "key": 192, 11507 "iv": 16, 11508 "mode": "CTR", 11509 "type": "stream" 11510 }, 11511 "aes-256-ctr": { 11512 "cipher": "AES", 11513 "key": 256, 11514 "iv": 16, 11515 "mode": "CTR", 11516 "type": "stream" 11517 }, 11518 "aes-128-gcm": { 11519 "cipher": "AES", 11520 "key": 128, 11521 "iv": 12, 11522 "mode": "GCM", 11523 "type": "auth" 11524 }, 11525 "aes-192-gcm": { 11526 "cipher": "AES", 11527 "key": 192, 11528 "iv": 12, 11529 "mode": "GCM", 11530 "type": "auth" 11531 }, 11532 "aes-256-gcm": { 11533 "cipher": "AES", 11534 "key": 256, 11535 "iv": 12, 11536 "mode": "GCM", 11537 "type": "auth" 11538 } 11539 }; 11540})); 11541//#endregion 11542//#region node_modules/browserify-aes/modes/index.js 11543var require_modes$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11544 var modeModules = { 11545 ECB: require_ecb(), 11546 CBC: require_cbc(), 11547 CFB: require_cfb(), 11548 CFB8: require_cfb8(), 11549 CFB1: require_cfb1(), 11550 OFB: require_ofb(), 11551 CTR: require_ctr(), 11552 GCM: require_ctr() 11553 }; 11554 var modes = (init_list(), __toCommonJS(list_exports).default); 11555 for (var key in modes) modes[key].module = modeModules[modes[key].mode]; 11556 module.exports = modes; 11557})); 11558//#endregion 11559//#region node_modules/browserify-aes/aes.js 11560var require_aes = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11561 var Buffer = require_safe_buffer$2().Buffer; 11562 function asUInt32Array(buf) { 11563 if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); 11564 var len = buf.length / 4 | 0; 11565 var out = new Array(len); 11566 for (var i = 0; i < len; i++) out[i] = buf.readUInt32BE(i * 4); 11567 return out; 11568 } 11569 function scrubVec(v) { 11570 for (var i = 0; i < v.length; v++) v[i] = 0; 11571 } 11572 function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) { 11573 var SUB_MIX0 = SUB_MIX[0]; 11574 var SUB_MIX1 = SUB_MIX[1]; 11575 var SUB_MIX2 = SUB_MIX[2]; 11576 var SUB_MIX3 = SUB_MIX[3]; 11577 var s0 = M[0] ^ keySchedule[0]; 11578 var s1 = M[1] ^ keySchedule[1]; 11579 var s2 = M[2] ^ keySchedule[2]; 11580 var s3 = M[3] ^ keySchedule[3]; 11581 var t0, t1, t2, t3; 11582 var ksRow = 4; 11583 for (var round = 1; round < nRounds; round++) { 11584 t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++]; 11585 t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++]; 11586 t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++]; 11587 t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++]; 11588 s0 = t0; 11589 s1 = t1; 11590 s2 = t2; 11591 s3 = t3; 11592 } 11593 t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++]; 11594 t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++]; 11595 t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++]; 11596 t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++]; 11597 t0 = t0 >>> 0; 11598 t1 = t1 >>> 0; 11599 t2 = t2 >>> 0; 11600 t3 = t3 >>> 0; 11601 return [ 11602 t0, 11603 t1, 11604 t2, 11605 t3 11606 ]; 11607 } 11608 var RCON = [ 11609 0, 11610 1, 11611 2, 11612 4, 11613 8, 11614 16, 11615 32, 11616 64, 11617 128, 11618 27, 11619 54 11620 ]; 11621 var G = (function() { 11622 var d = new Array(256); 11623 for (var j = 0; j < 256; j++) if (j < 128) d[j] = j << 1; 11624 else d[j] = j << 1 ^ 283; 11625 var SBOX = []; 11626 var INV_SBOX = []; 11627 var SUB_MIX = [ 11628 [], 11629 [], 11630 [], 11631 [] 11632 ]; 11633 var INV_SUB_MIX = [ 11634 [], 11635 [], 11636 [], 11637 [] 11638 ]; 11639 var x = 0; 11640 var xi = 0; 11641 for (var i = 0; i < 256; ++i) { 11642 var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4; 11643 sx = sx >>> 8 ^ sx & 255 ^ 99; 11644 SBOX[x] = sx; 11645 INV_SBOX[sx] = x; 11646 var x2 = d[x]; 11647 var x4 = d[x2]; 11648 var x8 = d[x4]; 11649 var t = d[sx] * 257 ^ sx * 16843008; 11650 SUB_MIX[0][x] = t << 24 | t >>> 8; 11651 SUB_MIX[1][x] = t << 16 | t >>> 16; 11652 SUB_MIX[2][x] = t << 8 | t >>> 24; 11653 SUB_MIX[3][x] = t; 11654 t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008; 11655 INV_SUB_MIX[0][sx] = t << 24 | t >>> 8; 11656 INV_SUB_MIX[1][sx] = t << 16 | t >>> 16; 11657 INV_SUB_MIX[2][sx] = t << 8 | t >>> 24; 11658 INV_SUB_MIX[3][sx] = t; 11659 if (x === 0) x = xi = 1; 11660 else { 11661 x = x2 ^ d[d[d[x8 ^ x2]]]; 11662 xi ^= d[d[xi]]; 11663 } 11664 } 11665 return { 11666 SBOX, 11667 INV_SBOX, 11668 SUB_MIX, 11669 INV_SUB_MIX 11670 }; 11671 })(); 11672 function AES(key) { 11673 this._key = asUInt32Array(key); 11674 this._reset(); 11675 } 11676 AES.blockSize = 16; 11677 AES.keySize = 256 / 8; 11678 AES.prototype.blockSize = AES.blockSize; 11679 AES.prototype.keySize = AES.keySize; 11680 AES.prototype._reset = function() { 11681 var keyWords = this._key; 11682 var keySize = keyWords.length; 11683 var nRounds = keySize + 6; 11684 var ksRows = (nRounds + 1) * 4; 11685 var keySchedule = []; 11686 for (var k = 0; k < keySize; k++) keySchedule[k] = keyWords[k]; 11687 for (k = keySize; k < ksRows; k++) { 11688 var t = keySchedule[k - 1]; 11689 if (k % keySize === 0) { 11690 t = t << 8 | t >>> 24; 11691 t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]; 11692 t ^= RCON[k / keySize | 0] << 24; 11693 } else if (keySize > 6 && k % keySize === 4) t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255]; 11694 keySchedule[k] = keySchedule[k - keySize] ^ t; 11695 } 11696 var invKeySchedule = []; 11697 for (var ik = 0; ik < ksRows; ik++) { 11698 var ksR = ksRows - ik; 11699 var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]; 11700 if (ik < 4 || ksR <= 4) invKeySchedule[ik] = tt; 11701 else invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]]; 11702 } 11703 this._nRounds = nRounds; 11704 this._keySchedule = keySchedule; 11705 this._invKeySchedule = invKeySchedule; 11706 }; 11707 AES.prototype.encryptBlockRaw = function(M) { 11708 M = asUInt32Array(M); 11709 return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds); 11710 }; 11711 AES.prototype.encryptBlock = function(M) { 11712 var out = this.encryptBlockRaw(M); 11713 var buf = Buffer.allocUnsafe(16); 11714 buf.writeUInt32BE(out[0], 0); 11715 buf.writeUInt32BE(out[1], 4); 11716 buf.writeUInt32BE(out[2], 8); 11717 buf.writeUInt32BE(out[3], 12); 11718 return buf; 11719 }; 11720 AES.prototype.decryptBlock = function(M) { 11721 M = asUInt32Array(M); 11722 var m1 = M[1]; 11723 M[1] = M[3]; 11724 M[3] = m1; 11725 var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds); 11726 var buf = Buffer.allocUnsafe(16); 11727 buf.writeUInt32BE(out[0], 0); 11728 buf.writeUInt32BE(out[3], 4); 11729 buf.writeUInt32BE(out[2], 8); 11730 buf.writeUInt32BE(out[1], 12); 11731 return buf; 11732 }; 11733 AES.prototype.scrub = function() { 11734 scrubVec(this._keySchedule); 11735 scrubVec(this._invKeySchedule); 11736 scrubVec(this._key); 11737 }; 11738 module.exports.AES = AES; 11739})); 11740//#endregion 11741//#region node_modules/browserify-aes/ghash.js 11742var require_ghash = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11743 var Buffer = require_safe_buffer$2().Buffer; 11744 var ZEROES = Buffer.alloc(16, 0); 11745 function toArray(buf) { 11746 return [ 11747 buf.readUInt32BE(0), 11748 buf.readUInt32BE(4), 11749 buf.readUInt32BE(8), 11750 buf.readUInt32BE(12) 11751 ]; 11752 } 11753 function fromArray(out) { 11754 var buf = Buffer.allocUnsafe(16); 11755 buf.writeUInt32BE(out[0] >>> 0, 0); 11756 buf.writeUInt32BE(out[1] >>> 0, 4); 11757 buf.writeUInt32BE(out[2] >>> 0, 8); 11758 buf.writeUInt32BE(out[3] >>> 0, 12); 11759 return buf; 11760 } 11761 function GHASH(key) { 11762 this.h = key; 11763 this.state = Buffer.alloc(16, 0); 11764 this.cache = Buffer.allocUnsafe(0); 11765 } 11766 GHASH.prototype.ghash = function(block) { 11767 var i = -1; 11768 while (++i < block.length) this.state[i] ^= block[i]; 11769 this._multiply(); 11770 }; 11771 GHASH.prototype._multiply = function() { 11772 var Vi = toArray(this.h); 11773 var Zi = [ 11774 0, 11775 0, 11776 0, 11777 0 11778 ]; 11779 var j, xi, lsbVi; 11780 var i = -1; 11781 while (++i < 128) { 11782 xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0; 11783 if (xi) { 11784 Zi[0] ^= Vi[0]; 11785 Zi[1] ^= Vi[1]; 11786 Zi[2] ^= Vi[2]; 11787 Zi[3] ^= Vi[3]; 11788 } 11789 lsbVi = (Vi[3] & 1) !== 0; 11790 for (j = 3; j > 0; j--) Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31; 11791 Vi[0] = Vi[0] >>> 1; 11792 if (lsbVi) Vi[0] = Vi[0] ^ 225 << 24; 11793 } 11794 this.state = fromArray(Zi); 11795 }; 11796 GHASH.prototype.update = function(buf) { 11797 this.cache = Buffer.concat([this.cache, buf]); 11798 var chunk; 11799 while (this.cache.length >= 16) { 11800 chunk = this.cache.slice(0, 16); 11801 this.cache = this.cache.slice(16); 11802 this.ghash(chunk); 11803 } 11804 }; 11805 GHASH.prototype.final = function(abl, bl) { 11806 if (this.cache.length) this.ghash(Buffer.concat([this.cache, ZEROES], 16)); 11807 this.ghash(fromArray([ 11808 0, 11809 abl, 11810 0, 11811 bl 11812 ])); 11813 return this.state; 11814 }; 11815 module.exports = GHASH; 11816})); 11817//#endregion 11818//#region node_modules/browserify-aes/authCipher.js 11819var require_authCipher = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11820 var aes = require_aes(); 11821 var Buffer = require_safe_buffer$2().Buffer; 11822 var Transform = require_cipher_base(); 11823 var inherits = require_inherits_browser(); 11824 var GHASH = require_ghash(); 11825 var xor = require_buffer_xor(); 11826 var incr32 = require_incr32(); 11827 function xorTest(a, b) { 11828 var out = 0; 11829 if (a.length !== b.length) out++; 11830 var len = Math.min(a.length, b.length); 11831 for (var i = 0; i < len; ++i) out += a[i] ^ b[i]; 11832 return out; 11833 } 11834 function calcIv(self, iv, ck) { 11835 if (iv.length === 12) { 11836 self._finID = Buffer.concat([iv, Buffer.from([ 11837 0, 11838 0, 11839 0, 11840 1 11841 ])]); 11842 return Buffer.concat([iv, Buffer.from([ 11843 0, 11844 0, 11845 0, 11846 2 11847 ])]); 11848 } 11849 var ghash = new GHASH(ck); 11850 var len = iv.length; 11851 var toPad = len % 16; 11852 ghash.update(iv); 11853 if (toPad) { 11854 toPad = 16 - toPad; 11855 ghash.update(Buffer.alloc(toPad, 0)); 11856 } 11857 ghash.update(Buffer.alloc(8, 0)); 11858 var ivBits = len * 8; 11859 var tail = Buffer.alloc(8); 11860 tail.writeUIntBE(ivBits, 0, 8); 11861 ghash.update(tail); 11862 self._finID = ghash.state; 11863 var out = Buffer.from(self._finID); 11864 incr32(out); 11865 return out; 11866 } 11867 function StreamCipher(mode, key, iv, decrypt) { 11868 Transform.call(this); 11869 var h = Buffer.alloc(4, 0); 11870 this._cipher = new aes.AES(key); 11871 var ck = this._cipher.encryptBlock(h); 11872 this._ghash = new GHASH(ck); 11873 iv = calcIv(this, iv, ck); 11874 this._prev = Buffer.from(iv); 11875 this._cache = Buffer.allocUnsafe(0); 11876 this._secCache = Buffer.allocUnsafe(0); 11877 this._decrypt = decrypt; 11878 this._alen = 0; 11879 this._len = 0; 11880 this._mode = mode; 11881 this._authTag = null; 11882 this._called = false; 11883 } 11884 inherits(StreamCipher, Transform); 11885 StreamCipher.prototype._update = function(chunk) { 11886 if (!this._called && this._alen) { 11887 var rump = 16 - this._alen % 16; 11888 if (rump < 16) { 11889 rump = Buffer.alloc(rump, 0); 11890 this._ghash.update(rump); 11891 } 11892 } 11893 this._called = true; 11894 var out = this._mode.encrypt(this, chunk); 11895 if (this._decrypt) this._ghash.update(chunk); 11896 else this._ghash.update(out); 11897 this._len += chunk.length; 11898 return out; 11899 }; 11900 StreamCipher.prototype._final = function() { 11901 if (this._decrypt && !this._authTag) throw new Error("Unsupported state or unable to authenticate data"); 11902 var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID)); 11903 if (this._decrypt && xorTest(tag, this._authTag)) throw new Error("Unsupported state or unable to authenticate data"); 11904 this._authTag = tag; 11905 this._cipher.scrub(); 11906 }; 11907 StreamCipher.prototype.getAuthTag = function getAuthTag() { 11908 if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error("Attempting to get auth tag in unsupported state"); 11909 return this._authTag; 11910 }; 11911 StreamCipher.prototype.setAuthTag = function setAuthTag(tag) { 11912 if (!this._decrypt) throw new Error("Attempting to set auth tag in unsupported state"); 11913 this._authTag = tag; 11914 }; 11915 StreamCipher.prototype.setAAD = function setAAD(buf) { 11916 if (this._called) throw new Error("Attempting to set AAD in unsupported state"); 11917 this._ghash.update(buf); 11918 this._alen += buf.length; 11919 }; 11920 module.exports = StreamCipher; 11921})); 11922//#endregion 11923//#region node_modules/browserify-aes/streamCipher.js 11924var require_streamCipher = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11925 var aes = require_aes(); 11926 var Buffer = require_safe_buffer$2().Buffer; 11927 var Transform = require_cipher_base(); 11928 var inherits = require_inherits_browser(); 11929 function StreamCipher(mode, key, iv, decrypt) { 11930 Transform.call(this); 11931 this._cipher = new aes.AES(key); 11932 this._prev = Buffer.from(iv); 11933 this._cache = Buffer.allocUnsafe(0); 11934 this._secCache = Buffer.allocUnsafe(0); 11935 this._decrypt = decrypt; 11936 this._mode = mode; 11937 } 11938 inherits(StreamCipher, Transform); 11939 StreamCipher.prototype._update = function(chunk) { 11940 return this._mode.encrypt(this, chunk, this._decrypt); 11941 }; 11942 StreamCipher.prototype._final = function() { 11943 this._cipher.scrub(); 11944 }; 11945 module.exports = StreamCipher; 11946})); 11947//#endregion 11948//#region node_modules/evp_bytestokey/index.js 11949var require_evp_bytestokey = /* @__PURE__ */ __commonJSMin(((exports, module) => { 11950 var Buffer = require_safe_buffer$2().Buffer; 11951 var MD5 = require_md5_js(); 11952 function EVP_BytesToKey(password, salt, keyBits, ivLen) { 11953 if (!Buffer.isBuffer(password)) password = Buffer.from(password, "binary"); 11954 if (salt) { 11955 if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, "binary"); 11956 if (salt.length !== 8) throw new RangeError("salt should be Buffer with 8 byte length"); 11957 } 11958 var keyLen = keyBits / 8; 11959 var key = Buffer.alloc(keyLen); 11960 var iv = Buffer.alloc(ivLen || 0); 11961 var tmp = Buffer.alloc(0); 11962 while (keyLen > 0 || ivLen > 0) { 11963 var hash = new MD5(); 11964 hash.update(tmp); 11965 hash.update(password); 11966 if (salt) hash.update(salt); 11967 tmp = hash.digest(); 11968 var used = 0; 11969 if (keyLen > 0) { 11970 var keyStart = key.length - keyLen; 11971 used = Math.min(keyLen, tmp.length); 11972 tmp.copy(key, keyStart, 0, used); 11973 keyLen -= used; 11974 } 11975 if (used < tmp.length && ivLen > 0) { 11976 var ivStart = iv.length - ivLen; 11977 var length = Math.min(ivLen, tmp.length - used); 11978 tmp.copy(iv, ivStart, used, used + length); 11979 ivLen -= length; 11980 } 11981 } 11982 tmp.fill(0); 11983 return { 11984 key, 11985 iv 11986 }; 11987 } 11988 module.exports = EVP_BytesToKey; 11989})); 11990//#endregion 11991//#region node_modules/browserify-aes/encrypter.js 11992var require_encrypter = /* @__PURE__ */ __commonJSMin(((exports) => { 11993 var MODES = require_modes$1(); 11994 var AuthCipher = require_authCipher(); 11995 var Buffer = require_safe_buffer$2().Buffer; 11996 var StreamCipher = require_streamCipher(); 11997 var Transform = require_cipher_base(); 11998 var aes = require_aes(); 11999 var ebtk = require_evp_bytestokey(); 12000 var inherits = require_inherits_browser(); 12001 function Cipher(mode, key, iv) { 12002 Transform.call(this); 12003 this._cache = new Splitter(); 12004 this._cipher = new aes.AES(key); 12005 this._prev = Buffer.from(iv); 12006 this._mode = mode; 12007 this._autopadding = true; 12008 } 12009 inherits(Cipher, Transform); 12010 Cipher.prototype._update = function(data) { 12011 this._cache.add(data); 12012 var chunk; 12013 var thing; 12014 var out = []; 12015 while (chunk = this._cache.get()) { 12016 thing = this._mode.encrypt(this, chunk); 12017 out.push(thing); 12018 } 12019 return Buffer.concat(out); 12020 }; 12021 var PADDING = Buffer.alloc(16, 16); 12022 Cipher.prototype._final = function() { 12023 var chunk = this._cache.flush(); 12024 if (this._autopadding) { 12025 chunk = this._mode.encrypt(this, chunk); 12026 this._cipher.scrub(); 12027 return chunk; 12028 } 12029 if (!chunk.equals(PADDING)) { 12030 this._cipher.scrub(); 12031 throw new Error("data not multiple of block length"); 12032 } 12033 }; 12034 Cipher.prototype.setAutoPadding = function(setTo) { 12035 this._autopadding = !!setTo; 12036 return this; 12037 }; 12038 function Splitter() { 12039 this.cache = Buffer.allocUnsafe(0); 12040 } 12041 Splitter.prototype.add = function(data) { 12042 this.cache = Buffer.concat([this.cache, data]); 12043 }; 12044 Splitter.prototype.get = function() { 12045 if (this.cache.length > 15) { 12046 var out = this.cache.slice(0, 16); 12047 this.cache = this.cache.slice(16); 12048 return out; 12049 } 12050 return null; 12051 }; 12052 Splitter.prototype.flush = function() { 12053 var len = 16 - this.cache.length; 12054 var padBuff = Buffer.allocUnsafe(len); 12055 var i = -1; 12056 while (++i < len) padBuff.writeUInt8(len, i); 12057 return Buffer.concat([this.cache, padBuff]); 12058 }; 12059 function createCipheriv(suite, password, iv) { 12060 var config = MODES[suite.toLowerCase()]; 12061 if (!config) throw new TypeError("invalid suite type"); 12062 if (typeof password === "string") password = Buffer.from(password); 12063 if (password.length !== config.key / 8) throw new TypeError("invalid key length " + password.length); 12064 if (typeof iv === "string") iv = Buffer.from(iv); 12065 if (config.mode !== "GCM" && iv.length !== config.iv) throw new TypeError("invalid iv length " + iv.length); 12066 if (config.type === "stream") return new StreamCipher(config.module, password, iv); 12067 else if (config.type === "auth") return new AuthCipher(config.module, password, iv); 12068 return new Cipher(config.module, password, iv); 12069 } 12070 function createCipher(suite, password) { 12071 var config = MODES[suite.toLowerCase()]; 12072 if (!config) throw new TypeError("invalid suite type"); 12073 var keys = ebtk(password, false, config.key, config.iv); 12074 return createCipheriv(suite, keys.key, keys.iv); 12075 } 12076 exports.createCipheriv = createCipheriv; 12077 exports.createCipher = createCipher; 12078})); 12079//#endregion 12080//#region node_modules/browserify-aes/decrypter.js 12081var require_decrypter = /* @__PURE__ */ __commonJSMin(((exports) => { 12082 var AuthCipher = require_authCipher(); 12083 var Buffer = require_safe_buffer$2().Buffer; 12084 var MODES = require_modes$1(); 12085 var StreamCipher = require_streamCipher(); 12086 var Transform = require_cipher_base(); 12087 var aes = require_aes(); 12088 var ebtk = require_evp_bytestokey(); 12089 var inherits = require_inherits_browser(); 12090 function Decipher(mode, key, iv) { 12091 Transform.call(this); 12092 this._cache = new Splitter(); 12093 this._last = void 0; 12094 this._cipher = new aes.AES(key); 12095 this._prev = Buffer.from(iv); 12096 this._mode = mode; 12097 this._autopadding = true; 12098 } 12099 inherits(Decipher, Transform); 12100 Decipher.prototype._update = function(data) { 12101 this._cache.add(data); 12102 var chunk; 12103 var thing; 12104 var out = []; 12105 while (chunk = this._cache.get(this._autopadding)) { 12106 thing = this._mode.decrypt(this, chunk); 12107 out.push(thing); 12108 } 12109 return Buffer.concat(out); 12110 }; 12111 Decipher.prototype._final = function() { 12112 var chunk = this._cache.flush(); 12113 if (this._autopadding) return unpad(this._mode.decrypt(this, chunk)); 12114 else if (chunk) throw new Error("data not multiple of block length"); 12115 }; 12116 Decipher.prototype.setAutoPadding = function(setTo) { 12117 this._autopadding = !!setTo; 12118 return this; 12119 }; 12120 function Splitter() { 12121 this.cache = Buffer.allocUnsafe(0); 12122 } 12123 Splitter.prototype.add = function(data) { 12124 this.cache = Buffer.concat([this.cache, data]); 12125 }; 12126 Splitter.prototype.get = function(autoPadding) { 12127 var out; 12128 if (autoPadding) { 12129 if (this.cache.length > 16) { 12130 out = this.cache.slice(0, 16); 12131 this.cache = this.cache.slice(16); 12132 return out; 12133 } 12134 } else if (this.cache.length >= 16) { 12135 out = this.cache.slice(0, 16); 12136 this.cache = this.cache.slice(16); 12137 return out; 12138 } 12139 return null; 12140 }; 12141 Splitter.prototype.flush = function() { 12142 if (this.cache.length) return this.cache; 12143 }; 12144 function unpad(last) { 12145 var padded = last[15]; 12146 if (padded < 1 || padded > 16) throw new Error("unable to decrypt data"); 12147 var i = -1; 12148 while (++i < padded) if (last[i + (16 - padded)] !== padded) throw new Error("unable to decrypt data"); 12149 if (padded === 16) return; 12150 return last.slice(0, 16 - padded); 12151 } 12152 function createDecipheriv(suite, password, iv) { 12153 var config = MODES[suite.toLowerCase()]; 12154 if (!config) throw new TypeError("invalid suite type"); 12155 if (typeof iv === "string") iv = Buffer.from(iv); 12156 if (config.mode !== "GCM" && iv.length !== config.iv) throw new TypeError("invalid iv length " + iv.length); 12157 if (typeof password === "string") password = Buffer.from(password); 12158 if (password.length !== config.key / 8) throw new TypeError("invalid key length " + password.length); 12159 if (config.type === "stream") return new StreamCipher(config.module, password, iv, true); 12160 else if (config.type === "auth") return new AuthCipher(config.module, password, iv, true); 12161 return new Decipher(config.module, password, iv); 12162 } 12163 function createDecipher(suite, password) { 12164 var config = MODES[suite.toLowerCase()]; 12165 if (!config) throw new TypeError("invalid suite type"); 12166 var keys = ebtk(password, false, config.key, config.iv); 12167 return createDecipheriv(suite, keys.key, keys.iv); 12168 } 12169 exports.createDecipher = createDecipher; 12170 exports.createDecipheriv = createDecipheriv; 12171})); 12172//#endregion 12173//#region node_modules/browserify-aes/browser.js 12174var require_browser$7 = /* @__PURE__ */ __commonJSMin(((exports) => { 12175 var ciphers = require_encrypter(); 12176 var deciphers = require_decrypter(); 12177 var modes = (init_list(), __toCommonJS(list_exports).default); 12178 function getCiphers() { 12179 return Object.keys(modes); 12180 } 12181 exports.createCipher = exports.Cipher = ciphers.createCipher; 12182 exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv; 12183 exports.createDecipher = exports.Decipher = deciphers.createDecipher; 12184 exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv; 12185 exports.listCiphers = exports.getCiphers = getCiphers; 12186})); 12187//#endregion 12188//#region node_modules/browserify-des/modes.js 12189var require_modes = /* @__PURE__ */ __commonJSMin(((exports) => { 12190 exports["des-ecb"] = { 12191 key: 8, 12192 iv: 0 12193 }; 12194 exports["des-cbc"] = exports.des = { 12195 key: 8, 12196 iv: 8 12197 }; 12198 exports["des-ede3-cbc"] = exports.des3 = { 12199 key: 24, 12200 iv: 8 12201 }; 12202 exports["des-ede3"] = { 12203 key: 24, 12204 iv: 0 12205 }; 12206 exports["des-ede-cbc"] = { 12207 key: 16, 12208 iv: 8 12209 }; 12210 exports["des-ede"] = { 12211 key: 16, 12212 iv: 0 12213 }; 12214})); 12215//#endregion 12216//#region node_modules/browserify-cipher/browser.js 12217var require_browser$6 = /* @__PURE__ */ __commonJSMin(((exports) => { 12218 var DES = require_browserify_des(); 12219 var aes = require_browser$7(); 12220 var aesModes = require_modes$1(); 12221 var desModes = require_modes(); 12222 var ebtk = require_evp_bytestokey(); 12223 function createCipher(suite, password) { 12224 suite = suite.toLowerCase(); 12225 var keyLen, ivLen; 12226 if (aesModes[suite]) { 12227 keyLen = aesModes[suite].key; 12228 ivLen = aesModes[suite].iv; 12229 } else if (desModes[suite]) { 12230 keyLen = desModes[suite].key * 8; 12231 ivLen = desModes[suite].iv; 12232 } else throw new TypeError("invalid suite type"); 12233 var keys = ebtk(password, false, keyLen, ivLen); 12234 return createCipheriv(suite, keys.key, keys.iv); 12235 } 12236 function createDecipher(suite, password) { 12237 suite = suite.toLowerCase(); 12238 var keyLen, ivLen; 12239 if (aesModes[suite]) { 12240 keyLen = aesModes[suite].key; 12241 ivLen = aesModes[suite].iv; 12242 } else if (desModes[suite]) { 12243 keyLen = desModes[suite].key * 8; 12244 ivLen = desModes[suite].iv; 12245 } else throw new TypeError("invalid suite type"); 12246 var keys = ebtk(password, false, keyLen, ivLen); 12247 return createDecipheriv(suite, keys.key, keys.iv); 12248 } 12249 function createCipheriv(suite, key, iv) { 12250 suite = suite.toLowerCase(); 12251 if (aesModes[suite]) return aes.createCipheriv(suite, key, iv); 12252 if (desModes[suite]) return new DES({ 12253 key, 12254 iv, 12255 mode: suite 12256 }); 12257 throw new TypeError("invalid suite type"); 12258 } 12259 function createDecipheriv(suite, key, iv) { 12260 suite = suite.toLowerCase(); 12261 if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv); 12262 if (desModes[suite]) return new DES({ 12263 key, 12264 iv, 12265 mode: suite, 12266 decrypt: true 12267 }); 12268 throw new TypeError("invalid suite type"); 12269 } 12270 function getCiphers() { 12271 return Object.keys(desModes).concat(aes.getCiphers()); 12272 } 12273 exports.createCipher = exports.Cipher = createCipher; 12274 exports.createCipheriv = exports.Cipheriv = createCipheriv; 12275 exports.createDecipher = exports.Decipher = createDecipher; 12276 exports.createDecipheriv = exports.Decipheriv = createDecipheriv; 12277 exports.listCiphers = exports.getCiphers = getCiphers; 12278})); 12279//#endregion 12280//#region node_modules/bn.js/lib/bn.js 12281var require_bn$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 12282 (function(module$4, exports$8) { 12283 "use strict"; 12284 function assert(val, msg) { 12285 if (!val) throw new Error(msg || "Assertion failed"); 12286 } 12287 function inherits(ctor, superCtor) { 12288 ctor.super_ = superCtor; 12289 var TempCtor = function() {}; 12290 TempCtor.prototype = superCtor.prototype; 12291 ctor.prototype = new TempCtor(); 12292 ctor.prototype.constructor = ctor; 12293 } 12294 function BN(number, base, endian) { 12295 if (BN.isBN(number)) return number; 12296 this.negative = 0; 12297 this.words = null; 12298 this.length = 0; 12299 this.red = null; 12300 if (number !== null) { 12301 if (base === "le" || base === "be") { 12302 endian = base; 12303 base = 10; 12304 } 12305 this._init(number || 0, base || 10, endian || "be"); 12306 } 12307 } 12308 if (typeof module$4 === "object") module$4.exports = BN; 12309 else exports$8.BN = BN; 12310 BN.BN = BN; 12311 BN.wordSize = 26; 12312 var Buffer; 12313 try { 12314 Buffer = require_buffer$1().Buffer; 12315 } catch (e) {} 12316 BN.isBN = function isBN(num) { 12317 if (num instanceof BN) return true; 12318 return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); 12319 }; 12320 BN.max = function max(left, right) { 12321 if (left.cmp(right) > 0) return left; 12322 return right; 12323 }; 12324 BN.min = function min(left, right) { 12325 if (left.cmp(right) < 0) return left; 12326 return right; 12327 }; 12328 BN.prototype._init = function init(number, base, endian) { 12329 if (typeof number === "number") return this._initNumber(number, base, endian); 12330 if (typeof number === "object") return this._initArray(number, base, endian); 12331 if (base === "hex") base = 16; 12332 assert(base === (base | 0) && base >= 2 && base <= 36); 12333 number = number.toString().replace(/\s+/g, ""); 12334 var start = 0; 12335 if (number[0] === "-") start++; 12336 if (base === 16) this._parseHex(number, start); 12337 else this._parseBase(number, base, start); 12338 if (number[0] === "-") this.negative = 1; 12339 this.strip(); 12340 if (endian !== "le") return; 12341 this._initArray(this.toArray(), base, endian); 12342 }; 12343 BN.prototype._initNumber = function _initNumber(number, base, endian) { 12344 if (number < 0) { 12345 this.negative = 1; 12346 number = -number; 12347 } 12348 if (number < 67108864) { 12349 this.words = [number & 67108863]; 12350 this.length = 1; 12351 } else if (number < 4503599627370496) { 12352 this.words = [number & 67108863, number / 67108864 & 67108863]; 12353 this.length = 2; 12354 } else { 12355 assert(number < 9007199254740992); 12356 this.words = [ 12357 number & 67108863, 12358 number / 67108864 & 67108863, 12359 1 12360 ]; 12361 this.length = 3; 12362 } 12363 if (endian !== "le") return; 12364 this._initArray(this.toArray(), base, endian); 12365 }; 12366 BN.prototype._initArray = function _initArray(number, base, endian) { 12367 assert(typeof number.length === "number"); 12368 if (number.length <= 0) { 12369 this.words = [0]; 12370 this.length = 1; 12371 return this; 12372 } 12373 this.length = Math.ceil(number.length / 3); 12374 this.words = new Array(this.length); 12375 for (var i = 0; i < this.length; i++) this.words[i] = 0; 12376 var j, w; 12377 var off = 0; 12378 if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) { 12379 w = number[i] | number[i - 1] << 8 | number[i - 2] << 16; 12380 this.words[j] |= w << off & 67108863; 12381 this.words[j + 1] = w >>> 26 - off & 67108863; 12382 off += 24; 12383 if (off >= 26) { 12384 off -= 26; 12385 j++; 12386 } 12387 } 12388 else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) { 12389 w = number[i] | number[i + 1] << 8 | number[i + 2] << 16; 12390 this.words[j] |= w << off & 67108863; 12391 this.words[j + 1] = w >>> 26 - off & 67108863; 12392 off += 24; 12393 if (off >= 26) { 12394 off -= 26; 12395 j++; 12396 } 12397 } 12398 return this.strip(); 12399 }; 12400 function parseHex(str, start, end) { 12401 var r = 0; 12402 var len = Math.min(str.length, end); 12403 for (var i = start; i < len; i++) { 12404 var c = str.charCodeAt(i) - 48; 12405 r <<= 4; 12406 if (c >= 49 && c <= 54) r |= c - 49 + 10; 12407 else if (c >= 17 && c <= 22) r |= c - 17 + 10; 12408 else r |= c & 15; 12409 } 12410 return r; 12411 } 12412 BN.prototype._parseHex = function _parseHex(number, start) { 12413 this.length = Math.ceil((number.length - start) / 6); 12414 this.words = new Array(this.length); 12415 for (var i = 0; i < this.length; i++) this.words[i] = 0; 12416 var j, w; 12417 var off = 0; 12418 for (i = number.length - 6, j = 0; i >= start; i -= 6) { 12419 w = parseHex(number, i, i + 6); 12420 this.words[j] |= w << off & 67108863; 12421 this.words[j + 1] |= w >>> 26 - off & 4194303; 12422 off += 24; 12423 if (off >= 26) { 12424 off -= 26; 12425 j++; 12426 } 12427 } 12428 if (i + 6 !== start) { 12429 w = parseHex(number, start, i + 6); 12430 this.words[j] |= w << off & 67108863; 12431 this.words[j + 1] |= w >>> 26 - off & 4194303; 12432 } 12433 this.strip(); 12434 }; 12435 function parseBase(str, start, end, mul) { 12436 var r = 0; 12437 var len = Math.min(str.length, end); 12438 for (var i = start; i < len; i++) { 12439 var c = str.charCodeAt(i) - 48; 12440 r *= mul; 12441 if (c >= 49) r += c - 49 + 10; 12442 else if (c >= 17) r += c - 17 + 10; 12443 else r += c; 12444 } 12445 return r; 12446 } 12447 BN.prototype._parseBase = function _parseBase(number, base, start) { 12448 this.words = [0]; 12449 this.length = 1; 12450 for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++; 12451 limbLen--; 12452 limbPow = limbPow / base | 0; 12453 var total = number.length - start; 12454 var mod = total % limbLen; 12455 var end = Math.min(total, total - mod) + start; 12456 var word = 0; 12457 for (var i = start; i < end; i += limbLen) { 12458 word = parseBase(number, i, i + limbLen, base); 12459 this.imuln(limbPow); 12460 if (this.words[0] + word < 67108864) this.words[0] += word; 12461 else this._iaddn(word); 12462 } 12463 if (mod !== 0) { 12464 var pow = 1; 12465 word = parseBase(number, i, number.length, base); 12466 for (i = 0; i < mod; i++) pow *= base; 12467 this.imuln(pow); 12468 if (this.words[0] + word < 67108864) this.words[0] += word; 12469 else this._iaddn(word); 12470 } 12471 }; 12472 BN.prototype.copy = function copy(dest) { 12473 dest.words = new Array(this.length); 12474 for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i]; 12475 dest.length = this.length; 12476 dest.negative = this.negative; 12477 dest.red = this.red; 12478 }; 12479 BN.prototype.clone = function clone() { 12480 var r = new BN(null); 12481 this.copy(r); 12482 return r; 12483 }; 12484 BN.prototype._expand = function _expand(size) { 12485 while (this.length < size) this.words[this.length++] = 0; 12486 return this; 12487 }; 12488 BN.prototype.strip = function strip() { 12489 while (this.length > 1 && this.words[this.length - 1] === 0) this.length--; 12490 return this._normSign(); 12491 }; 12492 BN.prototype._normSign = function _normSign() { 12493 if (this.length === 1 && this.words[0] === 0) this.negative = 0; 12494 return this; 12495 }; 12496 BN.prototype.inspect = function inspect() { 12497 return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"; 12498 }; 12499 var zeros = [ 12500 "", 12501 "0", 12502 "00", 12503 "000", 12504 "0000", 12505 "00000", 12506 "000000", 12507 "0000000", 12508 "00000000", 12509 "000000000", 12510 "0000000000", 12511 "00000000000", 12512 "000000000000", 12513 "0000000000000", 12514 "00000000000000", 12515 "000000000000000", 12516 "0000000000000000", 12517 "00000000000000000", 12518 "000000000000000000", 12519 "0000000000000000000", 12520 "00000000000000000000", 12521 "000000000000000000000", 12522 "0000000000000000000000", 12523 "00000000000000000000000", 12524 "000000000000000000000000", 12525 "0000000000000000000000000" 12526 ]; 12527 var groupSizes = [ 12528 0, 12529 0, 12530 25, 12531 16, 12532 12, 12533 11, 12534 10, 12535 9, 12536 8, 12537 8, 12538 7, 12539 7, 12540 7, 12541 7, 12542 6, 12543 6, 12544 6, 12545 6, 12546 6, 12547 6, 12548 6, 12549 5, 12550 5, 12551 5, 12552 5, 12553 5, 12554 5, 12555 5, 12556 5, 12557 5, 12558 5, 12559 5, 12560 5, 12561 5, 12562 5, 12563 5, 12564 5 12565 ]; 12566 var groupBases = [ 12567 0, 12568 0, 12569 33554432, 12570 43046721, 12571 16777216, 12572 48828125, 12573 60466176, 12574 40353607, 12575 16777216, 12576 43046721, 12577 1e7, 12578 19487171, 12579 35831808, 12580 62748517, 12581 7529536, 12582 11390625, 12583 16777216, 12584 24137569, 12585 34012224, 12586 47045881, 12587 64e6, 12588 4084101, 12589 5153632, 12590 6436343, 12591 7962624, 12592 9765625, 12593 11881376, 12594 14348907, 12595 17210368, 12596 20511149, 12597 243e5, 12598 28629151, 12599 33554432, 12600 39135393, 12601 45435424, 12602 52521875, 12603 60466176 12604 ]; 12605 BN.prototype.toString = function toString(base, padding) { 12606 base = base || 10; 12607 padding = padding | 0 || 1; 12608 var out; 12609 if (base === 16 || base === "hex") { 12610 out = ""; 12611 var off = 0; 12612 var carry = 0; 12613 for (var i = 0; i < this.length; i++) { 12614 var w = this.words[i]; 12615 var word = ((w << off | carry) & 16777215).toString(16); 12616 carry = w >>> 24 - off & 16777215; 12617 if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out; 12618 else out = word + out; 12619 off += 2; 12620 if (off >= 26) { 12621 off -= 26; 12622 i--; 12623 } 12624 } 12625 if (carry !== 0) out = carry.toString(16) + out; 12626 while (out.length % padding !== 0) out = "0" + out; 12627 if (this.negative !== 0) out = "-" + out; 12628 return out; 12629 } 12630 if (base === (base | 0) && base >= 2 && base <= 36) { 12631 var groupSize = groupSizes[base]; 12632 var groupBase = groupBases[base]; 12633 out = ""; 12634 var c = this.clone(); 12635 c.negative = 0; 12636 while (!c.isZero()) { 12637 var r = c.modn(groupBase).toString(base); 12638 c = c.idivn(groupBase); 12639 if (!c.isZero()) out = zeros[groupSize - r.length] + r + out; 12640 else out = r + out; 12641 } 12642 if (this.isZero()) out = "0" + out; 12643 while (out.length % padding !== 0) out = "0" + out; 12644 if (this.negative !== 0) out = "-" + out; 12645 return out; 12646 } 12647 assert(false, "Base should be between 2 and 36"); 12648 }; 12649 BN.prototype.toNumber = function toNumber() { 12650 var ret = this.words[0]; 12651 if (this.length === 2) ret += this.words[1] * 67108864; 12652 else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864; 12653 else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits"); 12654 return this.negative !== 0 ? -ret : ret; 12655 }; 12656 BN.prototype.toJSON = function toJSON() { 12657 return this.toString(16); 12658 }; 12659 BN.prototype.toBuffer = function toBuffer(endian, length) { 12660 assert(typeof Buffer !== "undefined"); 12661 return this.toArrayLike(Buffer, endian, length); 12662 }; 12663 BN.prototype.toArray = function toArray(endian, length) { 12664 return this.toArrayLike(Array, endian, length); 12665 }; 12666 BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { 12667 var byteLength = this.byteLength(); 12668 var reqLength = length || Math.max(1, byteLength); 12669 assert(byteLength <= reqLength, "byte array longer than desired length"); 12670 assert(reqLength > 0, "Requested array length <= 0"); 12671 this.strip(); 12672 var littleEndian = endian === "le"; 12673 var res = new ArrayType(reqLength); 12674 var b, i; 12675 var q = this.clone(); 12676 if (!littleEndian) { 12677 for (i = 0; i < reqLength - byteLength; i++) res[i] = 0; 12678 for (i = 0; !q.isZero(); i++) { 12679 b = q.andln(255); 12680 q.iushrn(8); 12681 res[reqLength - i - 1] = b; 12682 } 12683 } else { 12684 for (i = 0; !q.isZero(); i++) { 12685 b = q.andln(255); 12686 q.iushrn(8); 12687 res[i] = b; 12688 } 12689 for (; i < reqLength; i++) res[i] = 0; 12690 } 12691 return res; 12692 }; 12693 if (Math.clz32) BN.prototype._countBits = function _countBits(w) { 12694 return 32 - Math.clz32(w); 12695 }; 12696 else BN.prototype._countBits = function _countBits(w) { 12697 var t = w; 12698 var r = 0; 12699 if (t >= 4096) { 12700 r += 13; 12701 t >>>= 13; 12702 } 12703 if (t >= 64) { 12704 r += 7; 12705 t >>>= 7; 12706 } 12707 if (t >= 8) { 12708 r += 4; 12709 t >>>= 4; 12710 } 12711 if (t >= 2) { 12712 r += 2; 12713 t >>>= 2; 12714 } 12715 return r + t; 12716 }; 12717 BN.prototype._zeroBits = function _zeroBits(w) { 12718 if (w === 0) return 26; 12719 var t = w; 12720 var r = 0; 12721 if ((t & 8191) === 0) { 12722 r += 13; 12723 t >>>= 13; 12724 } 12725 if ((t & 127) === 0) { 12726 r += 7; 12727 t >>>= 7; 12728 } 12729 if ((t & 15) === 0) { 12730 r += 4; 12731 t >>>= 4; 12732 } 12733 if ((t & 3) === 0) { 12734 r += 2; 12735 t >>>= 2; 12736 } 12737 if ((t & 1) === 0) r++; 12738 return r; 12739 }; 12740 BN.prototype.bitLength = function bitLength() { 12741 var w = this.words[this.length - 1]; 12742 var hi = this._countBits(w); 12743 return (this.length - 1) * 26 + hi; 12744 }; 12745 function toBitArray(num) { 12746 var w = new Array(num.bitLength()); 12747 for (var bit = 0; bit < w.length; bit++) { 12748 var off = bit / 26 | 0; 12749 var wbit = bit % 26; 12750 w[bit] = (num.words[off] & 1 << wbit) >>> wbit; 12751 } 12752 return w; 12753 } 12754 BN.prototype.zeroBits = function zeroBits() { 12755 if (this.isZero()) return 0; 12756 var r = 0; 12757 for (var i = 0; i < this.length; i++) { 12758 var b = this._zeroBits(this.words[i]); 12759 r += b; 12760 if (b !== 26) break; 12761 } 12762 return r; 12763 }; 12764 BN.prototype.byteLength = function byteLength() { 12765 return Math.ceil(this.bitLength() / 8); 12766 }; 12767 BN.prototype.toTwos = function toTwos(width) { 12768 if (this.negative !== 0) return this.abs().inotn(width).iaddn(1); 12769 return this.clone(); 12770 }; 12771 BN.prototype.fromTwos = function fromTwos(width) { 12772 if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg(); 12773 return this.clone(); 12774 }; 12775 BN.prototype.isNeg = function isNeg() { 12776 return this.negative !== 0; 12777 }; 12778 BN.prototype.neg = function neg() { 12779 return this.clone().ineg(); 12780 }; 12781 BN.prototype.ineg = function ineg() { 12782 if (!this.isZero()) this.negative ^= 1; 12783 return this; 12784 }; 12785 BN.prototype.iuor = function iuor(num) { 12786 while (this.length < num.length) this.words[this.length++] = 0; 12787 for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i]; 12788 return this.strip(); 12789 }; 12790 BN.prototype.ior = function ior(num) { 12791 assert((this.negative | num.negative) === 0); 12792 return this.iuor(num); 12793 }; 12794 BN.prototype.or = function or(num) { 12795 if (this.length > num.length) return this.clone().ior(num); 12796 return num.clone().ior(this); 12797 }; 12798 BN.prototype.uor = function uor(num) { 12799 if (this.length > num.length) return this.clone().iuor(num); 12800 return num.clone().iuor(this); 12801 }; 12802 BN.prototype.iuand = function iuand(num) { 12803 var b; 12804 if (this.length > num.length) b = num; 12805 else b = this; 12806 for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i]; 12807 this.length = b.length; 12808 return this.strip(); 12809 }; 12810 BN.prototype.iand = function iand(num) { 12811 assert((this.negative | num.negative) === 0); 12812 return this.iuand(num); 12813 }; 12814 BN.prototype.and = function and(num) { 12815 if (this.length > num.length) return this.clone().iand(num); 12816 return num.clone().iand(this); 12817 }; 12818 BN.prototype.uand = function uand(num) { 12819 if (this.length > num.length) return this.clone().iuand(num); 12820 return num.clone().iuand(this); 12821 }; 12822 BN.prototype.iuxor = function iuxor(num) { 12823 var a; 12824 var b; 12825 if (this.length > num.length) { 12826 a = this; 12827 b = num; 12828 } else { 12829 a = num; 12830 b = this; 12831 } 12832 for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i]; 12833 if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i]; 12834 this.length = a.length; 12835 return this.strip(); 12836 }; 12837 BN.prototype.ixor = function ixor(num) { 12838 assert((this.negative | num.negative) === 0); 12839 return this.iuxor(num); 12840 }; 12841 BN.prototype.xor = function xor(num) { 12842 if (this.length > num.length) return this.clone().ixor(num); 12843 return num.clone().ixor(this); 12844 }; 12845 BN.prototype.uxor = function uxor(num) { 12846 if (this.length > num.length) return this.clone().iuxor(num); 12847 return num.clone().iuxor(this); 12848 }; 12849 BN.prototype.inotn = function inotn(width) { 12850 assert(typeof width === "number" && width >= 0); 12851 var bytesNeeded = Math.ceil(width / 26) | 0; 12852 var bitsLeft = width % 26; 12853 this._expand(bytesNeeded); 12854 if (bitsLeft > 0) bytesNeeded--; 12855 for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863; 12856 if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft; 12857 return this.strip(); 12858 }; 12859 BN.prototype.notn = function notn(width) { 12860 return this.clone().inotn(width); 12861 }; 12862 BN.prototype.setn = function setn(bit, val) { 12863 assert(typeof bit === "number" && bit >= 0); 12864 var off = bit / 26 | 0; 12865 var wbit = bit % 26; 12866 this._expand(off + 1); 12867 if (val) this.words[off] = this.words[off] | 1 << wbit; 12868 else this.words[off] = this.words[off] & ~(1 << wbit); 12869 return this.strip(); 12870 }; 12871 BN.prototype.iadd = function iadd(num) { 12872 var r; 12873 if (this.negative !== 0 && num.negative === 0) { 12874 this.negative = 0; 12875 r = this.isub(num); 12876 this.negative ^= 1; 12877 return this._normSign(); 12878 } else if (this.negative === 0 && num.negative !== 0) { 12879 num.negative = 0; 12880 r = this.isub(num); 12881 num.negative = 1; 12882 return r._normSign(); 12883 } 12884 var a, b; 12885 if (this.length > num.length) { 12886 a = this; 12887 b = num; 12888 } else { 12889 a = num; 12890 b = this; 12891 } 12892 var carry = 0; 12893 for (var i = 0; i < b.length; i++) { 12894 r = (a.words[i] | 0) + (b.words[i] | 0) + carry; 12895 this.words[i] = r & 67108863; 12896 carry = r >>> 26; 12897 } 12898 for (; carry !== 0 && i < a.length; i++) { 12899 r = (a.words[i] | 0) + carry; 12900 this.words[i] = r & 67108863; 12901 carry = r >>> 26; 12902 } 12903 this.length = a.length; 12904 if (carry !== 0) { 12905 this.words[this.length] = carry; 12906 this.length++; 12907 } else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 12908 return this; 12909 }; 12910 BN.prototype.add = function add(num) { 12911 var res; 12912 if (num.negative !== 0 && this.negative === 0) { 12913 num.negative = 0; 12914 res = this.sub(num); 12915 num.negative ^= 1; 12916 return res; 12917 } else if (num.negative === 0 && this.negative !== 0) { 12918 this.negative = 0; 12919 res = num.sub(this); 12920 this.negative = 1; 12921 return res; 12922 } 12923 if (this.length > num.length) return this.clone().iadd(num); 12924 return num.clone().iadd(this); 12925 }; 12926 BN.prototype.isub = function isub(num) { 12927 if (num.negative !== 0) { 12928 num.negative = 0; 12929 var r = this.iadd(num); 12930 num.negative = 1; 12931 return r._normSign(); 12932 } else if (this.negative !== 0) { 12933 this.negative = 0; 12934 this.iadd(num); 12935 this.negative = 1; 12936 return this._normSign(); 12937 } 12938 var cmp = this.cmp(num); 12939 if (cmp === 0) { 12940 this.negative = 0; 12941 this.length = 1; 12942 this.words[0] = 0; 12943 return this; 12944 } 12945 var a, b; 12946 if (cmp > 0) { 12947 a = this; 12948 b = num; 12949 } else { 12950 a = num; 12951 b = this; 12952 } 12953 var carry = 0; 12954 for (var i = 0; i < b.length; i++) { 12955 r = (a.words[i] | 0) - (b.words[i] | 0) + carry; 12956 carry = r >> 26; 12957 this.words[i] = r & 67108863; 12958 } 12959 for (; carry !== 0 && i < a.length; i++) { 12960 r = (a.words[i] | 0) + carry; 12961 carry = r >> 26; 12962 this.words[i] = r & 67108863; 12963 } 12964 if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 12965 this.length = Math.max(this.length, i); 12966 if (a !== this) this.negative = 1; 12967 return this.strip(); 12968 }; 12969 BN.prototype.sub = function sub(num) { 12970 return this.clone().isub(num); 12971 }; 12972 function smallMulTo(self, num, out) { 12973 out.negative = num.negative ^ self.negative; 12974 var len = self.length + num.length | 0; 12975 out.length = len; 12976 len = len - 1 | 0; 12977 var a = self.words[0] | 0; 12978 var b = num.words[0] | 0; 12979 var r = a * b; 12980 var lo = r & 67108863; 12981 var carry = r / 67108864 | 0; 12982 out.words[0] = lo; 12983 for (var k = 1; k < len; k++) { 12984 var ncarry = carry >>> 26; 12985 var rword = carry & 67108863; 12986 var maxJ = Math.min(k, num.length - 1); 12987 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 12988 var i = k - j | 0; 12989 a = self.words[i] | 0; 12990 b = num.words[j] | 0; 12991 r = a * b + rword; 12992 ncarry += r / 67108864 | 0; 12993 rword = r & 67108863; 12994 } 12995 out.words[k] = rword | 0; 12996 carry = ncarry | 0; 12997 } 12998 if (carry !== 0) out.words[k] = carry | 0; 12999 else out.length--; 13000 return out.strip(); 13001 } 13002 var comb10MulTo = function comb10MulTo(self, num, out) { 13003 var a = self.words; 13004 var b = num.words; 13005 var o = out.words; 13006 var c = 0; 13007 var lo; 13008 var mid; 13009 var hi; 13010 var a0 = a[0] | 0; 13011 var al0 = a0 & 8191; 13012 var ah0 = a0 >>> 13; 13013 var a1 = a[1] | 0; 13014 var al1 = a1 & 8191; 13015 var ah1 = a1 >>> 13; 13016 var a2 = a[2] | 0; 13017 var al2 = a2 & 8191; 13018 var ah2 = a2 >>> 13; 13019 var a3 = a[3] | 0; 13020 var al3 = a3 & 8191; 13021 var ah3 = a3 >>> 13; 13022 var a4 = a[4] | 0; 13023 var al4 = a4 & 8191; 13024 var ah4 = a4 >>> 13; 13025 var a5 = a[5] | 0; 13026 var al5 = a5 & 8191; 13027 var ah5 = a5 >>> 13; 13028 var a6 = a[6] | 0; 13029 var al6 = a6 & 8191; 13030 var ah6 = a6 >>> 13; 13031 var a7 = a[7] | 0; 13032 var al7 = a7 & 8191; 13033 var ah7 = a7 >>> 13; 13034 var a8 = a[8] | 0; 13035 var al8 = a8 & 8191; 13036 var ah8 = a8 >>> 13; 13037 var a9 = a[9] | 0; 13038 var al9 = a9 & 8191; 13039 var ah9 = a9 >>> 13; 13040 var b0 = b[0] | 0; 13041 var bl0 = b0 & 8191; 13042 var bh0 = b0 >>> 13; 13043 var b1 = b[1] | 0; 13044 var bl1 = b1 & 8191; 13045 var bh1 = b1 >>> 13; 13046 var b2 = b[2] | 0; 13047 var bl2 = b2 & 8191; 13048 var bh2 = b2 >>> 13; 13049 var b3 = b[3] | 0; 13050 var bl3 = b3 & 8191; 13051 var bh3 = b3 >>> 13; 13052 var b4 = b[4] | 0; 13053 var bl4 = b4 & 8191; 13054 var bh4 = b4 >>> 13; 13055 var b5 = b[5] | 0; 13056 var bl5 = b5 & 8191; 13057 var bh5 = b5 >>> 13; 13058 var b6 = b[6] | 0; 13059 var bl6 = b6 & 8191; 13060 var bh6 = b6 >>> 13; 13061 var b7 = b[7] | 0; 13062 var bl7 = b7 & 8191; 13063 var bh7 = b7 >>> 13; 13064 var b8 = b[8] | 0; 13065 var bl8 = b8 & 8191; 13066 var bh8 = b8 >>> 13; 13067 var b9 = b[9] | 0; 13068 var bl9 = b9 & 8191; 13069 var bh9 = b9 >>> 13; 13070 out.negative = self.negative ^ num.negative; 13071 out.length = 19; 13072 lo = Math.imul(al0, bl0); 13073 mid = Math.imul(al0, bh0); 13074 mid = mid + Math.imul(ah0, bl0) | 0; 13075 hi = Math.imul(ah0, bh0); 13076 var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13077 c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; 13078 w0 &= 67108863; 13079 lo = Math.imul(al1, bl0); 13080 mid = Math.imul(al1, bh0); 13081 mid = mid + Math.imul(ah1, bl0) | 0; 13082 hi = Math.imul(ah1, bh0); 13083 lo = lo + Math.imul(al0, bl1) | 0; 13084 mid = mid + Math.imul(al0, bh1) | 0; 13085 mid = mid + Math.imul(ah0, bl1) | 0; 13086 hi = hi + Math.imul(ah0, bh1) | 0; 13087 var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13088 c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; 13089 w1 &= 67108863; 13090 lo = Math.imul(al2, bl0); 13091 mid = Math.imul(al2, bh0); 13092 mid = mid + Math.imul(ah2, bl0) | 0; 13093 hi = Math.imul(ah2, bh0); 13094 lo = lo + Math.imul(al1, bl1) | 0; 13095 mid = mid + Math.imul(al1, bh1) | 0; 13096 mid = mid + Math.imul(ah1, bl1) | 0; 13097 hi = hi + Math.imul(ah1, bh1) | 0; 13098 lo = lo + Math.imul(al0, bl2) | 0; 13099 mid = mid + Math.imul(al0, bh2) | 0; 13100 mid = mid + Math.imul(ah0, bl2) | 0; 13101 hi = hi + Math.imul(ah0, bh2) | 0; 13102 var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13103 c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0; 13104 w2 &= 67108863; 13105 lo = Math.imul(al3, bl0); 13106 mid = Math.imul(al3, bh0); 13107 mid = mid + Math.imul(ah3, bl0) | 0; 13108 hi = Math.imul(ah3, bh0); 13109 lo = lo + Math.imul(al2, bl1) | 0; 13110 mid = mid + Math.imul(al2, bh1) | 0; 13111 mid = mid + Math.imul(ah2, bl1) | 0; 13112 hi = hi + Math.imul(ah2, bh1) | 0; 13113 lo = lo + Math.imul(al1, bl2) | 0; 13114 mid = mid + Math.imul(al1, bh2) | 0; 13115 mid = mid + Math.imul(ah1, bl2) | 0; 13116 hi = hi + Math.imul(ah1, bh2) | 0; 13117 lo = lo + Math.imul(al0, bl3) | 0; 13118 mid = mid + Math.imul(al0, bh3) | 0; 13119 mid = mid + Math.imul(ah0, bl3) | 0; 13120 hi = hi + Math.imul(ah0, bh3) | 0; 13121 var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13122 c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0; 13123 w3 &= 67108863; 13124 lo = Math.imul(al4, bl0); 13125 mid = Math.imul(al4, bh0); 13126 mid = mid + Math.imul(ah4, bl0) | 0; 13127 hi = Math.imul(ah4, bh0); 13128 lo = lo + Math.imul(al3, bl1) | 0; 13129 mid = mid + Math.imul(al3, bh1) | 0; 13130 mid = mid + Math.imul(ah3, bl1) | 0; 13131 hi = hi + Math.imul(ah3, bh1) | 0; 13132 lo = lo + Math.imul(al2, bl2) | 0; 13133 mid = mid + Math.imul(al2, bh2) | 0; 13134 mid = mid + Math.imul(ah2, bl2) | 0; 13135 hi = hi + Math.imul(ah2, bh2) | 0; 13136 lo = lo + Math.imul(al1, bl3) | 0; 13137 mid = mid + Math.imul(al1, bh3) | 0; 13138 mid = mid + Math.imul(ah1, bl3) | 0; 13139 hi = hi + Math.imul(ah1, bh3) | 0; 13140 lo = lo + Math.imul(al0, bl4) | 0; 13141 mid = mid + Math.imul(al0, bh4) | 0; 13142 mid = mid + Math.imul(ah0, bl4) | 0; 13143 hi = hi + Math.imul(ah0, bh4) | 0; 13144 var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13145 c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0; 13146 w4 &= 67108863; 13147 lo = Math.imul(al5, bl0); 13148 mid = Math.imul(al5, bh0); 13149 mid = mid + Math.imul(ah5, bl0) | 0; 13150 hi = Math.imul(ah5, bh0); 13151 lo = lo + Math.imul(al4, bl1) | 0; 13152 mid = mid + Math.imul(al4, bh1) | 0; 13153 mid = mid + Math.imul(ah4, bl1) | 0; 13154 hi = hi + Math.imul(ah4, bh1) | 0; 13155 lo = lo + Math.imul(al3, bl2) | 0; 13156 mid = mid + Math.imul(al3, bh2) | 0; 13157 mid = mid + Math.imul(ah3, bl2) | 0; 13158 hi = hi + Math.imul(ah3, bh2) | 0; 13159 lo = lo + Math.imul(al2, bl3) | 0; 13160 mid = mid + Math.imul(al2, bh3) | 0; 13161 mid = mid + Math.imul(ah2, bl3) | 0; 13162 hi = hi + Math.imul(ah2, bh3) | 0; 13163 lo = lo + Math.imul(al1, bl4) | 0; 13164 mid = mid + Math.imul(al1, bh4) | 0; 13165 mid = mid + Math.imul(ah1, bl4) | 0; 13166 hi = hi + Math.imul(ah1, bh4) | 0; 13167 lo = lo + Math.imul(al0, bl5) | 0;
vendor: 5,979 bytes, lines 13168-13323
13168 mid = mid + Math.imul(al0, bh5) | 0; 13169 mid = mid + Math.imul(ah0, bl5) | 0; 13170 hi = hi + Math.imul(ah0, bh5) | 0; 13171 var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13172 c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0; 13173 w5 &= 67108863; 13174 lo = Math.imul(al6, bl0); 13175 mid = Math.imul(al6, bh0); 13176 mid = mid + Math.imul(ah6, bl0) | 0; 13177 hi = Math.imul(ah6, bh0); 13178 lo = lo + Math.imul(al5, bl1) | 0; 13179 mid = mid + Math.imul(al5, bh1) | 0; 13180 mid = mid + Math.imul(ah5, bl1) | 0; 13181 hi = hi + Math.imul(ah5, bh1) | 0; 13182 lo = lo + Math.imul(al4, bl2) | 0; 13183 mid = mid + Math.imul(al4, bh2) | 0; 13184 mid = mid + Math.imul(ah4, bl2) | 0; 13185 hi = hi + Math.imul(ah4, bh2) | 0; 13186 lo = lo + Math.imul(al3, bl3) | 0; 13187 mid = mid + Math.imul(al3, bh3) | 0; 13188 mid = mid + Math.imul(ah3, bl3) | 0; 13189 hi = hi + Math.imul(ah3, bh3) | 0; 13190 lo = lo + Math.imul(al2, bl4) | 0; 13191 mid = mid + Math.imul(al2, bh4) | 0; 13192 mid = mid + Math.imul(ah2, bl4) | 0; 13193 hi = hi + Math.imul(ah2, bh4) | 0; 13194 lo = lo + Math.imul(al1, bl5) | 0; 13195 mid = mid + Math.imul(al1, bh5) | 0; 13196 mid = mid + Math.imul(ah1, bl5) | 0; 13197 hi = hi + Math.imul(ah1, bh5) | 0; 13198 lo = lo + Math.imul(al0, bl6) | 0; 13199 mid = mid + Math.imul(al0, bh6) | 0; 13200 mid = mid + Math.imul(ah0, bl6) | 0; 13201 hi = hi + Math.imul(ah0, bh6) | 0; 13202 var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13203 c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; 13204 w6 &= 67108863; 13205 lo = Math.imul(al7, bl0); 13206 mid = Math.imul(al7, bh0); 13207 mid = mid + Math.imul(ah7, bl0) | 0; 13208 hi = Math.imul(ah7, bh0); 13209 lo = lo + Math.imul(al6, bl1) | 0; 13210 mid = mid + Math.imul(al6, bh1) | 0; 13211 mid = mid + Math.imul(ah6, bl1) | 0; 13212 hi = hi + Math.imul(ah6, bh1) | 0; 13213 lo = lo + Math.imul(al5, bl2) | 0; 13214 mid = mid + Math.imul(al5, bh2) | 0; 13215 mid = mid + Math.imul(ah5, bl2) | 0; 13216 hi = hi + Math.imul(ah5, bh2) | 0; 13217 lo = lo + Math.imul(al4, bl3) | 0; 13218 mid = mid + Math.imul(al4, bh3) | 0; 13219 mid = mid + Math.imul(ah4, bl3) | 0; 13220 hi = hi + Math.imul(ah4, bh3) | 0; 13221 lo = lo + Math.imul(al3, bl4) | 0; 13222 mid = mid + Math.imul(al3, bh4) | 0; 13223 mid = mid + Math.imul(ah3, bl4) | 0; 13224 hi = hi + Math.imul(ah3, bh4) | 0; 13225 lo = lo + Math.imul(al2, bl5) | 0; 13226 mid = mid + Math.imul(al2, bh5) | 0; 13227 mid = mid + Math.imul(ah2, bl5) | 0; 13228 hi = hi + Math.imul(ah2, bh5) | 0; 13229 lo = lo + Math.imul(al1, bl6) | 0; 13230 mid = mid + Math.imul(al1, bh6) | 0; 13231 mid = mid + Math.imul(ah1, bl6) | 0; 13232 hi = hi + Math.imul(ah1, bh6) | 0; 13233 lo = lo + Math.imul(al0, bl7) | 0; 13234 mid = mid + Math.imul(al0, bh7) | 0; 13235 mid = mid + Math.imul(ah0, bl7) | 0; 13236 hi = hi + Math.imul(ah0, bh7) | 0; 13237 var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13238 c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; 13239 w7 &= 67108863; 13240 lo = Math.imul(al8, bl0); 13241 mid = Math.imul(al8, bh0); 13242 mid = mid + Math.imul(ah8, bl0) | 0; 13243 hi = Math.imul(ah8, bh0); 13244 lo = lo + Math.imul(al7, bl1) | 0; 13245 mid = mid + Math.imul(al7, bh1) | 0; 13246 mid = mid + Math.imul(ah7, bl1) | 0; 13247 hi = hi + Math.imul(ah7, bh1) | 0; 13248 lo = lo + Math.imul(al6, bl2) | 0; 13249 mid = mid + Math.imul(al6, bh2) | 0; 13250 mid = mid + Math.imul(ah6, bl2) | 0; 13251 hi = hi + Math.imul(ah6, bh2) | 0; 13252 lo = lo + Math.imul(al5, bl3) | 0; 13253 mid = mid + Math.imul(al5, bh3) | 0; 13254 mid = mid + Math.imul(ah5, bl3) | 0; 13255 hi = hi + Math.imul(ah5, bh3) | 0; 13256 lo = lo + Math.imul(al4, bl4) | 0; 13257 mid = mid + Math.imul(al4, bh4) | 0; 13258 mid = mid + Math.imul(ah4, bl4) | 0; 13259 hi = hi + Math.imul(ah4, bh4) | 0; 13260 lo = lo + Math.imul(al3, bl5) | 0; 13261 mid = mid + Math.imul(al3, bh5) | 0; 13262 mid = mid + Math.imul(ah3, bl5) | 0; 13263 hi = hi + Math.imul(ah3, bh5) | 0; 13264 lo = lo + Math.imul(al2, bl6) | 0; 13265 mid = mid + Math.imul(al2, bh6) | 0; 13266 mid = mid + Math.imul(ah2, bl6) | 0; 13267 hi = hi + Math.imul(ah2, bh6) | 0; 13268 lo = lo + Math.imul(al1, bl7) | 0; 13269 mid = mid + Math.imul(al1, bh7) | 0; 13270 mid = mid + Math.imul(ah1, bl7) | 0; 13271 hi = hi + Math.imul(ah1, bh7) | 0; 13272 lo = lo + Math.imul(al0, bl8) | 0; 13273 mid = mid + Math.imul(al0, bh8) | 0; 13274 mid = mid + Math.imul(ah0, bl8) | 0; 13275 hi = hi + Math.imul(ah0, bh8) | 0; 13276 var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13277 c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; 13278 w8 &= 67108863; 13279 lo = Math.imul(al9, bl0); 13280 mid = Math.imul(al9, bh0); 13281 mid = mid + Math.imul(ah9, bl0) | 0; 13282 hi = Math.imul(ah9, bh0); 13283 lo = lo + Math.imul(al8, bl1) | 0; 13284 mid = mid + Math.imul(al8, bh1) | 0; 13285 mid = mid + Math.imul(ah8, bl1) | 0; 13286 hi = hi + Math.imul(ah8, bh1) | 0; 13287 lo = lo + Math.imul(al7, bl2) | 0; 13288 mid = mid + Math.imul(al7, bh2) | 0; 13289 mid = mid + Math.imul(ah7, bl2) | 0; 13290 hi = hi + Math.imul(ah7, bh2) | 0; 13291 lo = lo + Math.imul(al6, bl3) | 0; 13292 mid = mid + Math.imul(al6, bh3) | 0; 13293 mid = mid + Math.imul(ah6, bl3) | 0; 13294 hi = hi + Math.imul(ah6, bh3) | 0; 13295 lo = lo + Math.imul(al5, bl4) | 0; 13296 mid = mid + Math.imul(al5, bh4) | 0; 13297 mid = mid + Math.imul(ah5, bl4) | 0; 13298 hi = hi + Math.imul(ah5, bh4) | 0; 13299 lo = lo + Math.imul(al4, bl5) | 0; 13300 mid = mid + Math.imul(al4, bh5) | 0; 13301 mid = mid + Math.imul(ah4, bl5) | 0; 13302 hi = hi + Math.imul(ah4, bh5) | 0; 13303 lo = lo + Math.imul(al3, bl6) | 0; 13304 mid = mid + Math.imul(al3, bh6) | 0; 13305 mid = mid + Math.imul(ah3, bl6) | 0; 13306 hi = hi + Math.imul(ah3, bh6) | 0; 13307 lo = lo + Math.imul(al2, bl7) | 0; 13308 mid = mid + Math.imul(al2, bh7) | 0; 13309 mid = mid + Math.imul(ah2, bl7) | 0; 13310 hi = hi + Math.imul(ah2, bh7) | 0; 13311 lo = lo + Math.imul(al1, bl8) | 0; 13312 mid = mid + Math.imul(al1, bh8) | 0; 13313 mid = mid + Math.imul(ah1, bl8) | 0; 13314 hi = hi + Math.imul(ah1, bh8) | 0; 13315 lo = lo + Math.imul(al0, bl9) | 0; 13316 mid = mid + Math.imul(al0, bh9) | 0; 13317 mid = mid + Math.imul(ah0, bl9) | 0; 13318 hi = hi + Math.imul(ah0, bh9) | 0; 13319 var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13320 c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; 13321 w9 &= 67108863; 13322 lo = Math.imul(al9, bl1); 13323 mid = Math.imul(al9, bh1);
vendor: 135,387 bytes, lines 13324-17572
13324 mid = mid + Math.imul(ah9, bl1) | 0; 13325 hi = Math.imul(ah9, bh1); 13326 lo = lo + Math.imul(al8, bl2) | 0; 13327 mid = mid + Math.imul(al8, bh2) | 0; 13328 mid = mid + Math.imul(ah8, bl2) | 0; 13329 hi = hi + Math.imul(ah8, bh2) | 0; 13330 lo = lo + Math.imul(al7, bl3) | 0; 13331 mid = mid + Math.imul(al7, bh3) | 0; 13332 mid = mid + Math.imul(ah7, bl3) | 0; 13333 hi = hi + Math.imul(ah7, bh3) | 0; 13334 lo = lo + Math.imul(al6, bl4) | 0; 13335 mid = mid + Math.imul(al6, bh4) | 0; 13336 mid = mid + Math.imul(ah6, bl4) | 0; 13337 hi = hi + Math.imul(ah6, bh4) | 0; 13338 lo = lo + Math.imul(al5, bl5) | 0; 13339 mid = mid + Math.imul(al5, bh5) | 0; 13340 mid = mid + Math.imul(ah5, bl5) | 0; 13341 hi = hi + Math.imul(ah5, bh5) | 0; 13342 lo = lo + Math.imul(al4, bl6) | 0; 13343 mid = mid + Math.imul(al4, bh6) | 0; 13344 mid = mid + Math.imul(ah4, bl6) | 0; 13345 hi = hi + Math.imul(ah4, bh6) | 0; 13346 lo = lo + Math.imul(al3, bl7) | 0; 13347 mid = mid + Math.imul(al3, bh7) | 0; 13348 mid = mid + Math.imul(ah3, bl7) | 0; 13349 hi = hi + Math.imul(ah3, bh7) | 0; 13350 lo = lo + Math.imul(al2, bl8) | 0; 13351 mid = mid + Math.imul(al2, bh8) | 0; 13352 mid = mid + Math.imul(ah2, bl8) | 0; 13353 hi = hi + Math.imul(ah2, bh8) | 0; 13354 lo = lo + Math.imul(al1, bl9) | 0; 13355 mid = mid + Math.imul(al1, bh9) | 0; 13356 mid = mid + Math.imul(ah1, bl9) | 0; 13357 hi = hi + Math.imul(ah1, bh9) | 0; 13358 var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13359 c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; 13360 w10 &= 67108863; 13361 lo = Math.imul(al9, bl2); 13362 mid = Math.imul(al9, bh2); 13363 mid = mid + Math.imul(ah9, bl2) | 0; 13364 hi = Math.imul(ah9, bh2); 13365 lo = lo + Math.imul(al8, bl3) | 0; 13366 mid = mid + Math.imul(al8, bh3) | 0; 13367 mid = mid + Math.imul(ah8, bl3) | 0; 13368 hi = hi + Math.imul(ah8, bh3) | 0; 13369 lo = lo + Math.imul(al7, bl4) | 0; 13370 mid = mid + Math.imul(al7, bh4) | 0; 13371 mid = mid + Math.imul(ah7, bl4) | 0; 13372 hi = hi + Math.imul(ah7, bh4) | 0; 13373 lo = lo + Math.imul(al6, bl5) | 0; 13374 mid = mid + Math.imul(al6, bh5) | 0; 13375 mid = mid + Math.imul(ah6, bl5) | 0; 13376 hi = hi + Math.imul(ah6, bh5) | 0; 13377 lo = lo + Math.imul(al5, bl6) | 0; 13378 mid = mid + Math.imul(al5, bh6) | 0; 13379 mid = mid + Math.imul(ah5, bl6) | 0; 13380 hi = hi + Math.imul(ah5, bh6) | 0; 13381 lo = lo + Math.imul(al4, bl7) | 0; 13382 mid = mid + Math.imul(al4, bh7) | 0; 13383 mid = mid + Math.imul(ah4, bl7) | 0; 13384 hi = hi + Math.imul(ah4, bh7) | 0; 13385 lo = lo + Math.imul(al3, bl8) | 0; 13386 mid = mid + Math.imul(al3, bh8) | 0; 13387 mid = mid + Math.imul(ah3, bl8) | 0; 13388 hi = hi + Math.imul(ah3, bh8) | 0; 13389 lo = lo + Math.imul(al2, bl9) | 0; 13390 mid = mid + Math.imul(al2, bh9) | 0; 13391 mid = mid + Math.imul(ah2, bl9) | 0; 13392 hi = hi + Math.imul(ah2, bh9) | 0; 13393 var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13394 c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; 13395 w11 &= 67108863; 13396 lo = Math.imul(al9, bl3); 13397 mid = Math.imul(al9, bh3); 13398 mid = mid + Math.imul(ah9, bl3) | 0; 13399 hi = Math.imul(ah9, bh3); 13400 lo = lo + Math.imul(al8, bl4) | 0; 13401 mid = mid + Math.imul(al8, bh4) | 0; 13402 mid = mid + Math.imul(ah8, bl4) | 0; 13403 hi = hi + Math.imul(ah8, bh4) | 0; 13404 lo = lo + Math.imul(al7, bl5) | 0; 13405 mid = mid + Math.imul(al7, bh5) | 0; 13406 mid = mid + Math.imul(ah7, bl5) | 0; 13407 hi = hi + Math.imul(ah7, bh5) | 0; 13408 lo = lo + Math.imul(al6, bl6) | 0; 13409 mid = mid + Math.imul(al6, bh6) | 0; 13410 mid = mid + Math.imul(ah6, bl6) | 0; 13411 hi = hi + Math.imul(ah6, bh6) | 0; 13412 lo = lo + Math.imul(al5, bl7) | 0; 13413 mid = mid + Math.imul(al5, bh7) | 0; 13414 mid = mid + Math.imul(ah5, bl7) | 0; 13415 hi = hi + Math.imul(ah5, bh7) | 0; 13416 lo = lo + Math.imul(al4, bl8) | 0; 13417 mid = mid + Math.imul(al4, bh8) | 0; 13418 mid = mid + Math.imul(ah4, bl8) | 0; 13419 hi = hi + Math.imul(ah4, bh8) | 0; 13420 lo = lo + Math.imul(al3, bl9) | 0; 13421 mid = mid + Math.imul(al3, bh9) | 0; 13422 mid = mid + Math.imul(ah3, bl9) | 0; 13423 hi = hi + Math.imul(ah3, bh9) | 0; 13424 var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13425 c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; 13426 w12 &= 67108863; 13427 lo = Math.imul(al9, bl4); 13428 mid = Math.imul(al9, bh4); 13429 mid = mid + Math.imul(ah9, bl4) | 0; 13430 hi = Math.imul(ah9, bh4); 13431 lo = lo + Math.imul(al8, bl5) | 0; 13432 mid = mid + Math.imul(al8, bh5) | 0; 13433 mid = mid + Math.imul(ah8, bl5) | 0; 13434 hi = hi + Math.imul(ah8, bh5) | 0; 13435 lo = lo + Math.imul(al7, bl6) | 0; 13436 mid = mid + Math.imul(al7, bh6) | 0; 13437 mid = mid + Math.imul(ah7, bl6) | 0; 13438 hi = hi + Math.imul(ah7, bh6) | 0; 13439 lo = lo + Math.imul(al6, bl7) | 0; 13440 mid = mid + Math.imul(al6, bh7) | 0; 13441 mid = mid + Math.imul(ah6, bl7) | 0; 13442 hi = hi + Math.imul(ah6, bh7) | 0; 13443 lo = lo + Math.imul(al5, bl8) | 0; 13444 mid = mid + Math.imul(al5, bh8) | 0; 13445 mid = mid + Math.imul(ah5, bl8) | 0; 13446 hi = hi + Math.imul(ah5, bh8) | 0; 13447 lo = lo + Math.imul(al4, bl9) | 0; 13448 mid = mid + Math.imul(al4, bh9) | 0; 13449 mid = mid + Math.imul(ah4, bl9) | 0; 13450 hi = hi + Math.imul(ah4, bh9) | 0; 13451 var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13452 c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; 13453 w13 &= 67108863; 13454 lo = Math.imul(al9, bl5); 13455 mid = Math.imul(al9, bh5); 13456 mid = mid + Math.imul(ah9, bl5) | 0; 13457 hi = Math.imul(ah9, bh5); 13458 lo = lo + Math.imul(al8, bl6) | 0; 13459 mid = mid + Math.imul(al8, bh6) | 0; 13460 mid = mid + Math.imul(ah8, bl6) | 0; 13461 hi = hi + Math.imul(ah8, bh6) | 0; 13462 lo = lo + Math.imul(al7, bl7) | 0; 13463 mid = mid + Math.imul(al7, bh7) | 0; 13464 mid = mid + Math.imul(ah7, bl7) | 0; 13465 hi = hi + Math.imul(ah7, bh7) | 0; 13466 lo = lo + Math.imul(al6, bl8) | 0; 13467 mid = mid + Math.imul(al6, bh8) | 0; 13468 mid = mid + Math.imul(ah6, bl8) | 0; 13469 hi = hi + Math.imul(ah6, bh8) | 0; 13470 lo = lo + Math.imul(al5, bl9) | 0; 13471 mid = mid + Math.imul(al5, bh9) | 0; 13472 mid = mid + Math.imul(ah5, bl9) | 0; 13473 hi = hi + Math.imul(ah5, bh9) | 0; 13474 var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13475 c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; 13476 w14 &= 67108863; 13477 lo = Math.imul(al9, bl6); 13478 mid = Math.imul(al9, bh6); 13479 mid = mid + Math.imul(ah9, bl6) | 0; 13480 hi = Math.imul(ah9, bh6); 13481 lo = lo + Math.imul(al8, bl7) | 0; 13482 mid = mid + Math.imul(al8, bh7) | 0; 13483 mid = mid + Math.imul(ah8, bl7) | 0; 13484 hi = hi + Math.imul(ah8, bh7) | 0; 13485 lo = lo + Math.imul(al7, bl8) | 0; 13486 mid = mid + Math.imul(al7, bh8) | 0; 13487 mid = mid + Math.imul(ah7, bl8) | 0; 13488 hi = hi + Math.imul(ah7, bh8) | 0; 13489 lo = lo + Math.imul(al6, bl9) | 0; 13490 mid = mid + Math.imul(al6, bh9) | 0; 13491 mid = mid + Math.imul(ah6, bl9) | 0; 13492 hi = hi + Math.imul(ah6, bh9) | 0; 13493 var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13494 c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; 13495 w15 &= 67108863; 13496 lo = Math.imul(al9, bl7); 13497 mid = Math.imul(al9, bh7); 13498 mid = mid + Math.imul(ah9, bl7) | 0; 13499 hi = Math.imul(ah9, bh7); 13500 lo = lo + Math.imul(al8, bl8) | 0; 13501 mid = mid + Math.imul(al8, bh8) | 0; 13502 mid = mid + Math.imul(ah8, bl8) | 0; 13503 hi = hi + Math.imul(ah8, bh8) | 0; 13504 lo = lo + Math.imul(al7, bl9) | 0; 13505 mid = mid + Math.imul(al7, bh9) | 0; 13506 mid = mid + Math.imul(ah7, bl9) | 0; 13507 hi = hi + Math.imul(ah7, bh9) | 0; 13508 var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13509 c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; 13510 w16 &= 67108863; 13511 lo = Math.imul(al9, bl8); 13512 mid = Math.imul(al9, bh8); 13513 mid = mid + Math.imul(ah9, bl8) | 0; 13514 hi = Math.imul(ah9, bh8); 13515 lo = lo + Math.imul(al8, bl9) | 0; 13516 mid = mid + Math.imul(al8, bh9) | 0; 13517 mid = mid + Math.imul(ah8, bl9) | 0; 13518 hi = hi + Math.imul(ah8, bh9) | 0; 13519 var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13520 c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; 13521 w17 &= 67108863; 13522 lo = Math.imul(al9, bl9); 13523 mid = Math.imul(al9, bh9); 13524 mid = mid + Math.imul(ah9, bl9) | 0; 13525 hi = Math.imul(ah9, bh9); 13526 var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 13527 c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; 13528 w18 &= 67108863; 13529 o[0] = w0; 13530 o[1] = w1; 13531 o[2] = w2; 13532 o[3] = w3; 13533 o[4] = w4; 13534 o[5] = w5; 13535 o[6] = w6; 13536 o[7] = w7; 13537 o[8] = w8; 13538 o[9] = w9; 13539 o[10] = w10; 13540 o[11] = w11; 13541 o[12] = w12; 13542 o[13] = w13; 13543 o[14] = w14; 13544 o[15] = w15; 13545 o[16] = w16; 13546 o[17] = w17; 13547 o[18] = w18; 13548 if (c !== 0) { 13549 o[19] = c; 13550 out.length++; 13551 } 13552 return out; 13553 }; 13554 if (!Math.imul) comb10MulTo = smallMulTo; 13555 function bigMulTo(self, num, out) { 13556 out.negative = num.negative ^ self.negative; 13557 out.length = self.length + num.length; 13558 var carry = 0; 13559 var hncarry = 0; 13560 for (var k = 0; k < out.length - 1; k++) { 13561 var ncarry = hncarry; 13562 hncarry = 0; 13563 var rword = carry & 67108863; 13564 var maxJ = Math.min(k, num.length - 1); 13565 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 13566 var i = k - j; 13567 var r = (self.words[i] | 0) * (num.words[j] | 0); 13568 var lo = r & 67108863; 13569 ncarry = ncarry + (r / 67108864 | 0) | 0; 13570 lo = lo + rword | 0; 13571 rword = lo & 67108863; 13572 ncarry = ncarry + (lo >>> 26) | 0; 13573 hncarry += ncarry >>> 26; 13574 ncarry &= 67108863; 13575 } 13576 out.words[k] = rword; 13577 carry = ncarry; 13578 ncarry = hncarry; 13579 } 13580 if (carry !== 0) out.words[k] = carry; 13581 else out.length--; 13582 return out.strip(); 13583 } 13584 function jumboMulTo(self, num, out) { 13585 return new FFTM().mulp(self, num, out); 13586 } 13587 BN.prototype.mulTo = function mulTo(num, out) { 13588 var res; 13589 var len = this.length + num.length; 13590 if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out); 13591 else if (len < 63) res = smallMulTo(this, num, out); 13592 else if (len < 1024) res = bigMulTo(this, num, out); 13593 else res = jumboMulTo(this, num, out); 13594 return res; 13595 }; 13596 function FFTM(x, y) { 13597 this.x = x; 13598 this.y = y; 13599 } 13600 FFTM.prototype.makeRBT = function makeRBT(N) { 13601 var t = new Array(N); 13602 var l = BN.prototype._countBits(N) - 1; 13603 for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N); 13604 return t; 13605 }; 13606 FFTM.prototype.revBin = function revBin(x, l, N) { 13607 if (x === 0 || x === N - 1) return x; 13608 var rb = 0; 13609 for (var i = 0; i < l; i++) { 13610 rb |= (x & 1) << l - i - 1; 13611 x >>= 1; 13612 } 13613 return rb; 13614 }; 13615 FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) { 13616 for (var i = 0; i < N; i++) { 13617 rtws[i] = rws[rbt[i]]; 13618 itws[i] = iws[rbt[i]]; 13619 } 13620 }; 13621 FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) { 13622 this.permute(rbt, rws, iws, rtws, itws, N); 13623 for (var s = 1; s < N; s <<= 1) { 13624 var l = s << 1; 13625 var rtwdf = Math.cos(2 * Math.PI / l); 13626 var itwdf = Math.sin(2 * Math.PI / l); 13627 for (var p = 0; p < N; p += l) { 13628 var rtwdf_ = rtwdf; 13629 var itwdf_ = itwdf; 13630 for (var j = 0; j < s; j++) { 13631 var re = rtws[p + j]; 13632 var ie = itws[p + j]; 13633 var ro = rtws[p + j + s]; 13634 var io = itws[p + j + s]; 13635 var rx = rtwdf_ * ro - itwdf_ * io; 13636 io = rtwdf_ * io + itwdf_ * ro; 13637 ro = rx; 13638 rtws[p + j] = re + ro; 13639 itws[p + j] = ie + io; 13640 rtws[p + j + s] = re - ro; 13641 itws[p + j + s] = ie - io; 13642 if (j !== l) { 13643 rx = rtwdf * rtwdf_ - itwdf * itwdf_; 13644 itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; 13645 rtwdf_ = rx; 13646 } 13647 } 13648 } 13649 } 13650 }; 13651 FFTM.prototype.guessLen13b = function guessLen13b(n, m) { 13652 var N = Math.max(m, n) | 1; 13653 var odd = N & 1; 13654 var i = 0; 13655 for (N = N / 2 | 0; N; N = N >>> 1) i++; 13656 return 1 << i + 1 + odd; 13657 }; 13658 FFTM.prototype.conjugate = function conjugate(rws, iws, N) { 13659 if (N <= 1) return; 13660 for (var i = 0; i < N / 2; i++) { 13661 var t = rws[i]; 13662 rws[i] = rws[N - i - 1]; 13663 rws[N - i - 1] = t; 13664 t = iws[i]; 13665 iws[i] = -iws[N - i - 1]; 13666 iws[N - i - 1] = -t; 13667 } 13668 }; 13669 FFTM.prototype.normalize13b = function normalize13b(ws, N) { 13670 var carry = 0; 13671 for (var i = 0; i < N / 2; i++) { 13672 var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry; 13673 ws[i] = w & 67108863; 13674 if (w < 67108864) carry = 0; 13675 else carry = w / 67108864 | 0; 13676 } 13677 return ws; 13678 }; 13679 FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) { 13680 var carry = 0; 13681 for (var i = 0; i < len; i++) { 13682 carry = carry + (ws[i] | 0); 13683 rws[2 * i] = carry & 8191; 13684 carry = carry >>> 13; 13685 rws[2 * i + 1] = carry & 8191; 13686 carry = carry >>> 13; 13687 } 13688 for (i = 2 * len; i < N; ++i) rws[i] = 0; 13689 assert(carry === 0); 13690 assert((carry & -8192) === 0); 13691 }; 13692 FFTM.prototype.stub = function stub(N) { 13693 var ph = new Array(N); 13694 for (var i = 0; i < N; i++) ph[i] = 0; 13695 return ph; 13696 }; 13697 FFTM.prototype.mulp = function mulp(x, y, out) { 13698 var N = 2 * this.guessLen13b(x.length, y.length); 13699 var rbt = this.makeRBT(N); 13700 var _ = this.stub(N); 13701 var rws = new Array(N); 13702 var rwst = new Array(N); 13703 var iwst = new Array(N); 13704 var nrws = new Array(N); 13705 var nrwst = new Array(N); 13706 var niwst = new Array(N); 13707 var rmws = out.words; 13708 rmws.length = N; 13709 this.convert13b(x.words, x.length, rws, N); 13710 this.convert13b(y.words, y.length, nrws, N); 13711 this.transform(rws, _, rwst, iwst, N, rbt); 13712 this.transform(nrws, _, nrwst, niwst, N, rbt); 13713 for (var i = 0; i < N; i++) { 13714 var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; 13715 iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; 13716 rwst[i] = rx; 13717 } 13718 this.conjugate(rwst, iwst, N); 13719 this.transform(rwst, iwst, rmws, _, N, rbt); 13720 this.conjugate(rmws, _, N); 13721 this.normalize13b(rmws, N); 13722 out.negative = x.negative ^ y.negative; 13723 out.length = x.length + y.length; 13724 return out.strip(); 13725 }; 13726 BN.prototype.mul = function mul(num) { 13727 var out = new BN(null); 13728 out.words = new Array(this.length + num.length); 13729 return this.mulTo(num, out); 13730 }; 13731 BN.prototype.mulf = function mulf(num) { 13732 var out = new BN(null); 13733 out.words = new Array(this.length + num.length); 13734 return jumboMulTo(this, num, out); 13735 }; 13736 BN.prototype.imul = function imul(num) { 13737 return this.clone().mulTo(num, this); 13738 }; 13739 BN.prototype.imuln = function imuln(num) { 13740 assert(typeof num === "number"); 13741 assert(num < 67108864); 13742 var carry = 0; 13743 for (var i = 0; i < this.length; i++) { 13744 var w = (this.words[i] | 0) * num; 13745 var lo = (w & 67108863) + (carry & 67108863); 13746 carry >>= 26; 13747 carry += w / 67108864 | 0; 13748 carry += lo >>> 26; 13749 this.words[i] = lo & 67108863; 13750 } 13751 if (carry !== 0) { 13752 this.words[i] = carry; 13753 this.length++; 13754 } 13755 return this; 13756 }; 13757 BN.prototype.muln = function muln(num) { 13758 return this.clone().imuln(num); 13759 }; 13760 BN.prototype.sqr = function sqr() { 13761 return this.mul(this); 13762 }; 13763 BN.prototype.isqr = function isqr() { 13764 return this.imul(this.clone()); 13765 }; 13766 BN.prototype.pow = function pow(num) { 13767 var w = toBitArray(num); 13768 if (w.length === 0) return new BN(1); 13769 var res = this; 13770 for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break; 13771 if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { 13772 if (w[i] === 0) continue; 13773 res = res.mul(q); 13774 } 13775 return res; 13776 }; 13777 BN.prototype.iushln = function iushln(bits) { 13778 assert(typeof bits === "number" && bits >= 0); 13779 var r = bits % 26; 13780 var s = (bits - r) / 26; 13781 var carryMask = 67108863 >>> 26 - r << 26 - r; 13782 var i; 13783 if (r !== 0) { 13784 var carry = 0; 13785 for (i = 0; i < this.length; i++) { 13786 var newCarry = this.words[i] & carryMask; 13787 var c = (this.words[i] | 0) - newCarry << r; 13788 this.words[i] = c | carry; 13789 carry = newCarry >>> 26 - r; 13790 } 13791 if (carry) { 13792 this.words[i] = carry; 13793 this.length++; 13794 } 13795 } 13796 if (s !== 0) { 13797 for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i]; 13798 for (i = 0; i < s; i++) this.words[i] = 0; 13799 this.length += s; 13800 } 13801 return this.strip(); 13802 }; 13803 BN.prototype.ishln = function ishln(bits) { 13804 assert(this.negative === 0); 13805 return this.iushln(bits); 13806 }; 13807 BN.prototype.iushrn = function iushrn(bits, hint, extended) { 13808 assert(typeof bits === "number" && bits >= 0); 13809 var h; 13810 if (hint) h = (hint - hint % 26) / 26; 13811 else h = 0; 13812 var r = bits % 26; 13813 var s = Math.min((bits - r) / 26, this.length); 13814 var mask = 67108863 ^ 67108863 >>> r << r; 13815 var maskedWords = extended; 13816 h -= s; 13817 h = Math.max(0, h); 13818 if (maskedWords) { 13819 for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i]; 13820 maskedWords.length = s; 13821 } 13822 if (s === 0) {} else if (this.length > s) { 13823 this.length -= s; 13824 for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s]; 13825 } else { 13826 this.words[0] = 0; 13827 this.length = 1; 13828 } 13829 var carry = 0; 13830 for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { 13831 var word = this.words[i] | 0; 13832 this.words[i] = carry << 26 - r | word >>> r; 13833 carry = word & mask; 13834 } 13835 if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry; 13836 if (this.length === 0) { 13837 this.words[0] = 0; 13838 this.length = 1; 13839 } 13840 return this.strip(); 13841 }; 13842 BN.prototype.ishrn = function ishrn(bits, hint, extended) { 13843 assert(this.negative === 0); 13844 return this.iushrn(bits, hint, extended); 13845 }; 13846 BN.prototype.shln = function shln(bits) { 13847 return this.clone().ishln(bits); 13848 }; 13849 BN.prototype.ushln = function ushln(bits) { 13850 return this.clone().iushln(bits); 13851 }; 13852 BN.prototype.shrn = function shrn(bits) { 13853 return this.clone().ishrn(bits); 13854 }; 13855 BN.prototype.ushrn = function ushrn(bits) { 13856 return this.clone().iushrn(bits); 13857 }; 13858 BN.prototype.testn = function testn(bit) { 13859 assert(typeof bit === "number" && bit >= 0); 13860 var r = bit % 26; 13861 var s = (bit - r) / 26; 13862 var q = 1 << r; 13863 if (this.length <= s) return false; 13864 return !!(this.words[s] & q); 13865 }; 13866 BN.prototype.imaskn = function imaskn(bits) { 13867 assert(typeof bits === "number" && bits >= 0); 13868 var r = bits % 26; 13869 var s = (bits - r) / 26; 13870 assert(this.negative === 0, "imaskn works only with positive numbers"); 13871 if (this.length <= s) return this; 13872 if (r !== 0) s++; 13873 this.length = Math.min(s, this.length); 13874 if (r !== 0) { 13875 var mask = 67108863 ^ 67108863 >>> r << r; 13876 this.words[this.length - 1] &= mask; 13877 } 13878 return this.strip(); 13879 }; 13880 BN.prototype.maskn = function maskn(bits) { 13881 return this.clone().imaskn(bits); 13882 }; 13883 BN.prototype.iaddn = function iaddn(num) { 13884 assert(typeof num === "number"); 13885 assert(num < 67108864); 13886 if (num < 0) return this.isubn(-num); 13887 if (this.negative !== 0) { 13888 if (this.length === 1 && (this.words[0] | 0) < num) { 13889 this.words[0] = num - (this.words[0] | 0); 13890 this.negative = 0; 13891 return this; 13892 } 13893 this.negative = 0; 13894 this.isubn(num); 13895 this.negative = 1; 13896 return this; 13897 } 13898 return this._iaddn(num); 13899 }; 13900 BN.prototype._iaddn = function _iaddn(num) { 13901 this.words[0] += num; 13902 for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) { 13903 this.words[i] -= 67108864; 13904 if (i === this.length - 1) this.words[i + 1] = 1; 13905 else this.words[i + 1]++; 13906 } 13907 this.length = Math.max(this.length, i + 1); 13908 return this; 13909 }; 13910 BN.prototype.isubn = function isubn(num) { 13911 assert(typeof num === "number"); 13912 assert(num < 67108864); 13913 if (num < 0) return this.iaddn(-num); 13914 if (this.negative !== 0) { 13915 this.negative = 0; 13916 this.iaddn(num); 13917 this.negative = 1; 13918 return this; 13919 } 13920 this.words[0] -= num; 13921 if (this.length === 1 && this.words[0] < 0) { 13922 this.words[0] = -this.words[0]; 13923 this.negative = 1; 13924 } else for (var i = 0; i < this.length && this.words[i] < 0; i++) { 13925 this.words[i] += 67108864; 13926 this.words[i + 1] -= 1; 13927 } 13928 return this.strip(); 13929 }; 13930 BN.prototype.addn = function addn(num) { 13931 return this.clone().iaddn(num); 13932 }; 13933 BN.prototype.subn = function subn(num) { 13934 return this.clone().isubn(num); 13935 }; 13936 BN.prototype.iabs = function iabs() { 13937 this.negative = 0; 13938 return this; 13939 }; 13940 BN.prototype.abs = function abs() { 13941 return this.clone().iabs(); 13942 }; 13943 BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { 13944 var len = num.length + shift; 13945 var i; 13946 this._expand(len); 13947 var w; 13948 var carry = 0; 13949 for (i = 0; i < num.length; i++) { 13950 w = (this.words[i + shift] | 0) + carry; 13951 var right = (num.words[i] | 0) * mul; 13952 w -= right & 67108863; 13953 carry = (w >> 26) - (right / 67108864 | 0); 13954 this.words[i + shift] = w & 67108863; 13955 } 13956 for (; i < this.length - shift; i++) { 13957 w = (this.words[i + shift] | 0) + carry; 13958 carry = w >> 26; 13959 this.words[i + shift] = w & 67108863; 13960 } 13961 if (carry === 0) return this.strip(); 13962 assert(carry === -1); 13963 carry = 0; 13964 for (i = 0; i < this.length; i++) { 13965 w = -(this.words[i] | 0) + carry; 13966 carry = w >> 26; 13967 this.words[i] = w & 67108863; 13968 } 13969 this.negative = 1; 13970 return this.strip(); 13971 }; 13972 BN.prototype._wordDiv = function _wordDiv(num, mode) { 13973 var shift = this.length - num.length; 13974 var a = this.clone(); 13975 var b = num; 13976 var bhi = b.words[b.length - 1] | 0; 13977 shift = 26 - this._countBits(bhi); 13978 if (shift !== 0) { 13979 b = b.ushln(shift); 13980 a.iushln(shift); 13981 bhi = b.words[b.length - 1] | 0; 13982 } 13983 var m = a.length - b.length; 13984 var q; 13985 if (mode !== "mod") { 13986 q = new BN(null); 13987 q.length = m + 1; 13988 q.words = new Array(q.length); 13989 for (var i = 0; i < q.length; i++) q.words[i] = 0; 13990 } 13991 var diff = a.clone()._ishlnsubmul(b, 1, m); 13992 if (diff.negative === 0) { 13993 a = diff; 13994 if (q) q.words[m] = 1; 13995 } 13996 for (var j = m - 1; j >= 0; j--) { 13997 var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0); 13998 qj = Math.min(qj / bhi | 0, 67108863); 13999 a._ishlnsubmul(b, qj, j); 14000 while (a.negative !== 0) { 14001 qj--; 14002 a.negative = 0; 14003 a._ishlnsubmul(b, 1, j); 14004 if (!a.isZero()) a.negative ^= 1; 14005 } 14006 if (q) q.words[j] = qj; 14007 } 14008 if (q) q.strip(); 14009 a.strip(); 14010 if (mode !== "div" && shift !== 0) a.iushrn(shift); 14011 return { 14012 div: q || null, 14013 mod: a 14014 }; 14015 }; 14016 BN.prototype.divmod = function divmod(num, mode, positive) { 14017 assert(!num.isZero()); 14018 if (this.isZero()) return { 14019 div: new BN(0), 14020 mod: new BN(0) 14021 }; 14022 var div, mod, res; 14023 if (this.negative !== 0 && num.negative === 0) { 14024 res = this.neg().divmod(num, mode); 14025 if (mode !== "mod") div = res.div.neg(); 14026 if (mode !== "div") { 14027 mod = res.mod.neg(); 14028 if (positive && mod.negative !== 0) mod.iadd(num); 14029 } 14030 return { 14031 div, 14032 mod 14033 }; 14034 } 14035 if (this.negative === 0 && num.negative !== 0) { 14036 res = this.divmod(num.neg(), mode); 14037 if (mode !== "mod") div = res.div.neg(); 14038 return { 14039 div, 14040 mod: res.mod 14041 }; 14042 } 14043 if ((this.negative & num.negative) !== 0) { 14044 res = this.neg().divmod(num.neg(), mode); 14045 if (mode !== "div") { 14046 mod = res.mod.neg(); 14047 if (positive && mod.negative !== 0) mod.isub(num); 14048 } 14049 return { 14050 div: res.div, 14051 mod 14052 }; 14053 } 14054 if (num.length > this.length || this.cmp(num) < 0) return { 14055 div: new BN(0), 14056 mod: this 14057 }; 14058 if (num.length === 1) { 14059 if (mode === "div") return { 14060 div: this.divn(num.words[0]), 14061 mod: null 14062 }; 14063 if (mode === "mod") return { 14064 div: null, 14065 mod: new BN(this.modn(num.words[0])) 14066 }; 14067 return { 14068 div: this.divn(num.words[0]), 14069 mod: new BN(this.modn(num.words[0])) 14070 }; 14071 } 14072 return this._wordDiv(num, mode); 14073 }; 14074 BN.prototype.div = function div(num) { 14075 return this.divmod(num, "div", false).div; 14076 }; 14077 BN.prototype.mod = function mod(num) { 14078 return this.divmod(num, "mod", false).mod; 14079 }; 14080 BN.prototype.umod = function umod(num) { 14081 return this.divmod(num, "mod", true).mod; 14082 }; 14083 BN.prototype.divRound = function divRound(num) { 14084 var dm = this.divmod(num); 14085 if (dm.mod.isZero()) return dm.div; 14086 var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; 14087 var half = num.ushrn(1); 14088 var r2 = num.andln(1); 14089 var cmp = mod.cmp(half); 14090 if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; 14091 return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); 14092 }; 14093 BN.prototype.modn = function modn(num) { 14094 assert(num <= 67108863); 14095 var p = (1 << 26) % num; 14096 var acc = 0; 14097 for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num; 14098 return acc; 14099 }; 14100 BN.prototype.idivn = function idivn(num) { 14101 assert(num <= 67108863); 14102 var carry = 0; 14103 for (var i = this.length - 1; i >= 0; i--) { 14104 var w = (this.words[i] | 0) + carry * 67108864; 14105 this.words[i] = w / num | 0; 14106 carry = w % num; 14107 } 14108 return this.strip(); 14109 }; 14110 BN.prototype.divn = function divn(num) { 14111 return this.clone().idivn(num); 14112 }; 14113 BN.prototype.egcd = function egcd(p) { 14114 assert(p.negative === 0); 14115 assert(!p.isZero()); 14116 var x = this; 14117 var y = p.clone(); 14118 if (x.negative !== 0) x = x.umod(p); 14119 else x = x.clone(); 14120 var A = new BN(1); 14121 var B = new BN(0); 14122 var C = new BN(0); 14123 var D = new BN(1); 14124 var g = 0; 14125 while (x.isEven() && y.isEven()) { 14126 x.iushrn(1); 14127 y.iushrn(1); 14128 ++g; 14129 } 14130 var yp = y.clone(); 14131 var xp = x.clone(); 14132 while (!x.isZero()) { 14133 for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 14134 if (i > 0) { 14135 x.iushrn(i); 14136 while (i-- > 0) { 14137 if (A.isOdd() || B.isOdd()) { 14138 A.iadd(yp); 14139 B.isub(xp); 14140 } 14141 A.iushrn(1); 14142 B.iushrn(1); 14143 } 14144 } 14145 for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 14146 if (j > 0) { 14147 y.iushrn(j); 14148 while (j-- > 0) { 14149 if (C.isOdd() || D.isOdd()) { 14150 C.iadd(yp); 14151 D.isub(xp); 14152 } 14153 C.iushrn(1); 14154 D.iushrn(1); 14155 } 14156 } 14157 if (x.cmp(y) >= 0) { 14158 x.isub(y); 14159 A.isub(C); 14160 B.isub(D); 14161 } else { 14162 y.isub(x); 14163 C.isub(A); 14164 D.isub(B); 14165 } 14166 } 14167 return { 14168 a: C, 14169 b: D, 14170 gcd: y.iushln(g) 14171 }; 14172 }; 14173 BN.prototype._invmp = function _invmp(p) { 14174 assert(p.negative === 0); 14175 assert(!p.isZero()); 14176 var a = this; 14177 var b = p.clone(); 14178 if (a.negative !== 0) a = a.umod(p); 14179 else a = a.clone(); 14180 var x1 = new BN(1); 14181 var x2 = new BN(0); 14182 var delta = b.clone(); 14183 while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { 14184 for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 14185 if (i > 0) { 14186 a.iushrn(i); 14187 while (i-- > 0) { 14188 if (x1.isOdd()) x1.iadd(delta); 14189 x1.iushrn(1); 14190 } 14191 } 14192 for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 14193 if (j > 0) { 14194 b.iushrn(j); 14195 while (j-- > 0) { 14196 if (x2.isOdd()) x2.iadd(delta); 14197 x2.iushrn(1); 14198 } 14199 } 14200 if (a.cmp(b) >= 0) { 14201 a.isub(b); 14202 x1.isub(x2); 14203 } else { 14204 b.isub(a); 14205 x2.isub(x1); 14206 } 14207 } 14208 var res; 14209 if (a.cmpn(1) === 0) res = x1; 14210 else res = x2; 14211 if (res.cmpn(0) < 0) res.iadd(p); 14212 return res; 14213 }; 14214 BN.prototype.gcd = function gcd(num) { 14215 if (this.isZero()) return num.abs(); 14216 if (num.isZero()) return this.abs(); 14217 var a = this.clone(); 14218 var b = num.clone(); 14219 a.negative = 0; 14220 b.negative = 0; 14221 for (var shift = 0; a.isEven() && b.isEven(); shift++) { 14222 a.iushrn(1); 14223 b.iushrn(1); 14224 } 14225 do { 14226 while (a.isEven()) a.iushrn(1); 14227 while (b.isEven()) b.iushrn(1); 14228 var r = a.cmp(b); 14229 if (r < 0) { 14230 var t = a; 14231 a = b; 14232 b = t; 14233 } else if (r === 0 || b.cmpn(1) === 0) break; 14234 a.isub(b); 14235 } while (true); 14236 return b.iushln(shift); 14237 }; 14238 BN.prototype.invm = function invm(num) { 14239 return this.egcd(num).a.umod(num); 14240 }; 14241 BN.prototype.isEven = function isEven() { 14242 return (this.words[0] & 1) === 0; 14243 }; 14244 BN.prototype.isOdd = function isOdd() { 14245 return (this.words[0] & 1) === 1; 14246 }; 14247 BN.prototype.andln = function andln(num) { 14248 return this.words[0] & num; 14249 }; 14250 BN.prototype.bincn = function bincn(bit) { 14251 assert(typeof bit === "number"); 14252 var r = bit % 26; 14253 var s = (bit - r) / 26; 14254 var q = 1 << r; 14255 if (this.length <= s) { 14256 this._expand(s + 1); 14257 this.words[s] |= q; 14258 return this; 14259 } 14260 var carry = q; 14261 for (var i = s; carry !== 0 && i < this.length; i++) { 14262 var w = this.words[i] | 0; 14263 w += carry; 14264 carry = w >>> 26; 14265 w &= 67108863; 14266 this.words[i] = w; 14267 } 14268 if (carry !== 0) { 14269 this.words[i] = carry; 14270 this.length++; 14271 } 14272 return this; 14273 }; 14274 BN.prototype.isZero = function isZero() { 14275 return this.length === 1 && this.words[0] === 0; 14276 }; 14277 BN.prototype.cmpn = function cmpn(num) { 14278 var negative = num < 0; 14279 if (this.negative !== 0 && !negative) return -1; 14280 if (this.negative === 0 && negative) return 1; 14281 this.strip(); 14282 var res; 14283 if (this.length > 1) res = 1; 14284 else { 14285 if (negative) num = -num; 14286 assert(num <= 67108863, "Number is too big"); 14287 var w = this.words[0] | 0; 14288 res = w === num ? 0 : w < num ? -1 : 1; 14289 } 14290 if (this.negative !== 0) return -res | 0; 14291 return res; 14292 }; 14293 BN.prototype.cmp = function cmp(num) { 14294 if (this.negative !== 0 && num.negative === 0) return -1; 14295 if (this.negative === 0 && num.negative !== 0) return 1; 14296 var res = this.ucmp(num); 14297 if (this.negative !== 0) return -res | 0; 14298 return res; 14299 }; 14300 BN.prototype.ucmp = function ucmp(num) { 14301 if (this.length > num.length) return 1; 14302 if (this.length < num.length) return -1; 14303 var res = 0; 14304 for (var i = this.length - 1; i >= 0; i--) { 14305 var a = this.words[i] | 0; 14306 var b = num.words[i] | 0; 14307 if (a === b) continue; 14308 if (a < b) res = -1; 14309 else if (a > b) res = 1; 14310 break; 14311 } 14312 return res; 14313 }; 14314 BN.prototype.gtn = function gtn(num) { 14315 return this.cmpn(num) === 1; 14316 }; 14317 BN.prototype.gt = function gt(num) { 14318 return this.cmp(num) === 1; 14319 }; 14320 BN.prototype.gten = function gten(num) { 14321 return this.cmpn(num) >= 0; 14322 }; 14323 BN.prototype.gte = function gte(num) { 14324 return this.cmp(num) >= 0; 14325 }; 14326 BN.prototype.ltn = function ltn(num) { 14327 return this.cmpn(num) === -1; 14328 }; 14329 BN.prototype.lt = function lt(num) { 14330 return this.cmp(num) === -1; 14331 }; 14332 BN.prototype.lten = function lten(num) { 14333 return this.cmpn(num) <= 0; 14334 }; 14335 BN.prototype.lte = function lte(num) { 14336 return this.cmp(num) <= 0; 14337 }; 14338 BN.prototype.eqn = function eqn(num) { 14339 return this.cmpn(num) === 0; 14340 }; 14341 BN.prototype.eq = function eq(num) { 14342 return this.cmp(num) === 0; 14343 }; 14344 BN.red = function red(num) { 14345 return new Red(num); 14346 }; 14347 BN.prototype.toRed = function toRed(ctx) { 14348 assert(!this.red, "Already a number in reduction context"); 14349 assert(this.negative === 0, "red works only with positives"); 14350 return ctx.convertTo(this)._forceRed(ctx); 14351 }; 14352 BN.prototype.fromRed = function fromRed() { 14353 assert(this.red, "fromRed works only with numbers in reduction context"); 14354 return this.red.convertFrom(this); 14355 }; 14356 BN.prototype._forceRed = function _forceRed(ctx) { 14357 this.red = ctx; 14358 return this; 14359 }; 14360 BN.prototype.forceRed = function forceRed(ctx) { 14361 assert(!this.red, "Already a number in reduction context"); 14362 return this._forceRed(ctx); 14363 }; 14364 BN.prototype.redAdd = function redAdd(num) { 14365 assert(this.red, "redAdd works only with red numbers"); 14366 return this.red.add(this, num); 14367 }; 14368 BN.prototype.redIAdd = function redIAdd(num) { 14369 assert(this.red, "redIAdd works only with red numbers"); 14370 return this.red.iadd(this, num); 14371 }; 14372 BN.prototype.redSub = function redSub(num) { 14373 assert(this.red, "redSub works only with red numbers"); 14374 return this.red.sub(this, num); 14375 }; 14376 BN.prototype.redISub = function redISub(num) { 14377 assert(this.red, "redISub works only with red numbers"); 14378 return this.red.isub(this, num); 14379 }; 14380 BN.prototype.redShl = function redShl(num) { 14381 assert(this.red, "redShl works only with red numbers"); 14382 return this.red.shl(this, num); 14383 }; 14384 BN.prototype.redMul = function redMul(num) { 14385 assert(this.red, "redMul works only with red numbers"); 14386 this.red._verify2(this, num); 14387 return this.red.mul(this, num); 14388 }; 14389 BN.prototype.redIMul = function redIMul(num) { 14390 assert(this.red, "redMul works only with red numbers"); 14391 this.red._verify2(this, num); 14392 return this.red.imul(this, num); 14393 }; 14394 BN.prototype.redSqr = function redSqr() { 14395 assert(this.red, "redSqr works only with red numbers"); 14396 this.red._verify1(this); 14397 return this.red.sqr(this); 14398 }; 14399 BN.prototype.redISqr = function redISqr() { 14400 assert(this.red, "redISqr works only with red numbers"); 14401 this.red._verify1(this); 14402 return this.red.isqr(this); 14403 }; 14404 BN.prototype.redSqrt = function redSqrt() { 14405 assert(this.red, "redSqrt works only with red numbers"); 14406 this.red._verify1(this); 14407 return this.red.sqrt(this); 14408 }; 14409 BN.prototype.redInvm = function redInvm() { 14410 assert(this.red, "redInvm works only with red numbers"); 14411 this.red._verify1(this); 14412 return this.red.invm(this); 14413 }; 14414 BN.prototype.redNeg = function redNeg() { 14415 assert(this.red, "redNeg works only with red numbers"); 14416 this.red._verify1(this); 14417 return this.red.neg(this); 14418 }; 14419 BN.prototype.redPow = function redPow(num) { 14420 assert(this.red && !num.red, "redPow(normalNum)"); 14421 this.red._verify1(this); 14422 return this.red.pow(this, num); 14423 }; 14424 var primes = { 14425 k256: null, 14426 p224: null, 14427 p192: null, 14428 p25519: null 14429 }; 14430 function MPrime(name, p) { 14431 this.name = name; 14432 this.p = new BN(p, 16); 14433 this.n = this.p.bitLength(); 14434 this.k = new BN(1).iushln(this.n).isub(this.p); 14435 this.tmp = this._tmp(); 14436 } 14437 MPrime.prototype._tmp = function _tmp() { 14438 var tmp = new BN(null); 14439 tmp.words = new Array(Math.ceil(this.n / 13)); 14440 return tmp; 14441 }; 14442 MPrime.prototype.ireduce = function ireduce(num) { 14443 var r = num; 14444 var rlen; 14445 do { 14446 this.split(r, this.tmp); 14447 r = this.imulK(r); 14448 r = r.iadd(this.tmp); 14449 rlen = r.bitLength(); 14450 } while (rlen > this.n); 14451 var cmp = rlen < this.n ? -1 : r.ucmp(this.p); 14452 if (cmp === 0) { 14453 r.words[0] = 0; 14454 r.length = 1; 14455 } else if (cmp > 0) r.isub(this.p); 14456 else r.strip(); 14457 return r; 14458 }; 14459 MPrime.prototype.split = function split(input, out) { 14460 input.iushrn(this.n, 0, out); 14461 }; 14462 MPrime.prototype.imulK = function imulK(num) { 14463 return num.imul(this.k); 14464 }; 14465 function K256() { 14466 MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); 14467 } 14468 inherits(K256, MPrime); 14469 K256.prototype.split = function split(input, output) { 14470 var mask = 4194303; 14471 var outLen = Math.min(input.length, 9); 14472 for (var i = 0; i < outLen; i++) output.words[i] = input.words[i]; 14473 output.length = outLen; 14474 if (input.length <= 9) { 14475 input.words[0] = 0; 14476 input.length = 1; 14477 return; 14478 } 14479 var prev = input.words[9]; 14480 output.words[output.length++] = prev & mask; 14481 for (i = 10; i < input.length; i++) { 14482 var next = input.words[i] | 0; 14483 input.words[i - 10] = (next & mask) << 4 | prev >>> 22; 14484 prev = next; 14485 } 14486 prev >>>= 22; 14487 input.words[i - 10] = prev; 14488 if (prev === 0 && input.length > 10) input.length -= 10; 14489 else input.length -= 9; 14490 }; 14491 K256.prototype.imulK = function imulK(num) { 14492 num.words[num.length] = 0; 14493 num.words[num.length + 1] = 0; 14494 num.length += 2; 14495 var lo = 0; 14496 for (var i = 0; i < num.length; i++) { 14497 var w = num.words[i] | 0; 14498 lo += w * 977; 14499 num.words[i] = lo & 67108863; 14500 lo = w * 64 + (lo / 67108864 | 0); 14501 } 14502 if (num.words[num.length - 1] === 0) { 14503 num.length--; 14504 if (num.words[num.length - 1] === 0) num.length--; 14505 } 14506 return num; 14507 }; 14508 function P224() { 14509 MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); 14510 } 14511 inherits(P224, MPrime); 14512 function P192() { 14513 MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); 14514 } 14515 inherits(P192, MPrime); 14516 function P25519() { 14517 MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); 14518 } 14519 inherits(P25519, MPrime); 14520 P25519.prototype.imulK = function imulK(num) { 14521 var carry = 0; 14522 for (var i = 0; i < num.length; i++) { 14523 var hi = (num.words[i] | 0) * 19 + carry; 14524 var lo = hi & 67108863; 14525 hi >>>= 26; 14526 num.words[i] = lo; 14527 carry = hi; 14528 } 14529 if (carry !== 0) num.words[num.length++] = carry; 14530 return num; 14531 }; 14532 BN._prime = function prime(name) { 14533 if (primes[name]) return primes[name]; 14534 var prime; 14535 if (name === "k256") prime = new K256(); 14536 else if (name === "p224") prime = new P224(); 14537 else if (name === "p192") prime = new P192(); 14538 else if (name === "p25519") prime = new P25519(); 14539 else throw new Error("Unknown prime " + name); 14540 primes[name] = prime; 14541 return prime; 14542 }; 14543 function Red(m) { 14544 if (typeof m === "string") { 14545 var prime = BN._prime(m); 14546 this.m = prime.p; 14547 this.prime = prime; 14548 } else { 14549 assert(m.gtn(1), "modulus must be greater than 1"); 14550 this.m = m; 14551 this.prime = null; 14552 } 14553 } 14554 Red.prototype._verify1 = function _verify1(a) { 14555 assert(a.negative === 0, "red works only with positives"); 14556 assert(a.red, "red works only with red numbers"); 14557 }; 14558 Red.prototype._verify2 = function _verify2(a, b) { 14559 assert((a.negative | b.negative) === 0, "red works only with positives"); 14560 assert(a.red && a.red === b.red, "red works only with red numbers"); 14561 }; 14562 Red.prototype.imod = function imod(a) { 14563 if (this.prime) return this.prime.ireduce(a)._forceRed(this); 14564 return a.umod(this.m)._forceRed(this); 14565 }; 14566 Red.prototype.neg = function neg(a) { 14567 if (a.isZero()) return a.clone(); 14568 return this.m.sub(a)._forceRed(this); 14569 }; 14570 Red.prototype.add = function add(a, b) { 14571 this._verify2(a, b); 14572 var res = a.add(b); 14573 if (res.cmp(this.m) >= 0) res.isub(this.m); 14574 return res._forceRed(this); 14575 }; 14576 Red.prototype.iadd = function iadd(a, b) { 14577 this._verify2(a, b); 14578 var res = a.iadd(b); 14579 if (res.cmp(this.m) >= 0) res.isub(this.m); 14580 return res; 14581 }; 14582 Red.prototype.sub = function sub(a, b) { 14583 this._verify2(a, b); 14584 var res = a.sub(b); 14585 if (res.cmpn(0) < 0) res.iadd(this.m); 14586 return res._forceRed(this); 14587 }; 14588 Red.prototype.isub = function isub(a, b) { 14589 this._verify2(a, b); 14590 var res = a.isub(b); 14591 if (res.cmpn(0) < 0) res.iadd(this.m); 14592 return res; 14593 }; 14594 Red.prototype.shl = function shl(a, num) { 14595 this._verify1(a); 14596 return this.imod(a.ushln(num)); 14597 }; 14598 Red.prototype.imul = function imul(a, b) { 14599 this._verify2(a, b); 14600 return this.imod(a.imul(b)); 14601 }; 14602 Red.prototype.mul = function mul(a, b) { 14603 this._verify2(a, b); 14604 return this.imod(a.mul(b)); 14605 }; 14606 Red.prototype.isqr = function isqr(a) { 14607 return this.imul(a, a.clone()); 14608 }; 14609 Red.prototype.sqr = function sqr(a) { 14610 return this.mul(a, a); 14611 }; 14612 Red.prototype.sqrt = function sqrt(a) { 14613 if (a.isZero()) return a.clone(); 14614 var mod3 = this.m.andln(3); 14615 assert(mod3 % 2 === 1); 14616 if (mod3 === 3) { 14617 var pow = this.m.add(new BN(1)).iushrn(2); 14618 return this.pow(a, pow); 14619 } 14620 var q = this.m.subn(1); 14621 var s = 0; 14622 while (!q.isZero() && q.andln(1) === 0) { 14623 s++; 14624 q.iushrn(1); 14625 } 14626 assert(!q.isZero()); 14627 var one = new BN(1).toRed(this); 14628 var nOne = one.redNeg(); 14629 var lpow = this.m.subn(1).iushrn(1); 14630 var z = this.m.bitLength(); 14631 z = new BN(2 * z * z).toRed(this); 14632 while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne); 14633 var c = this.pow(z, q); 14634 var r = this.pow(a, q.addn(1).iushrn(1)); 14635 var t = this.pow(a, q); 14636 var m = s; 14637 while (t.cmp(one) !== 0) { 14638 var tmp = t; 14639 for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr(); 14640 assert(i < m); 14641 var b = this.pow(c, new BN(1).iushln(m - i - 1)); 14642 r = r.redMul(b); 14643 c = b.redSqr(); 14644 t = t.redMul(c); 14645 m = i; 14646 } 14647 return r; 14648 }; 14649 Red.prototype.invm = function invm(a) { 14650 var inv = a._invmp(this.m); 14651 if (inv.negative !== 0) { 14652 inv.negative = 0; 14653 return this.imod(inv).redNeg(); 14654 } else return this.imod(inv); 14655 }; 14656 Red.prototype.pow = function pow(a, num) { 14657 if (num.isZero()) return new BN(1).toRed(this); 14658 if (num.cmpn(1) === 0) return a.clone(); 14659 var windowSize = 4; 14660 var wnd = new Array(1 << windowSize); 14661 wnd[0] = new BN(1).toRed(this); 14662 wnd[1] = a; 14663 for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a); 14664 var res = wnd[0]; 14665 var current = 0; 14666 var currentLen = 0; 14667 var start = num.bitLength() % 26; 14668 if (start === 0) start = 26; 14669 for (i = num.length - 1; i >= 0; i--) { 14670 var word = num.words[i]; 14671 for (var j = start - 1; j >= 0; j--) { 14672 var bit = word >> j & 1; 14673 if (res !== wnd[0]) res = this.sqr(res); 14674 if (bit === 0 && current === 0) { 14675 currentLen = 0; 14676 continue; 14677 } 14678 current <<= 1; 14679 current |= bit; 14680 currentLen++; 14681 if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; 14682 res = this.mul(res, wnd[current]); 14683 currentLen = 0; 14684 current = 0; 14685 } 14686 start = 26; 14687 } 14688 return res; 14689 }; 14690 Red.prototype.convertTo = function convertTo(num) { 14691 var r = num.umod(this.m); 14692 return r === num ? r.clone() : r; 14693 }; 14694 Red.prototype.convertFrom = function convertFrom(num) { 14695 var res = num.clone(); 14696 res.red = null; 14697 return res; 14698 }; 14699 BN.mont = function mont(num) { 14700 return new Mont(num); 14701 }; 14702 function Mont(m) { 14703 Red.call(this, m); 14704 this.shift = this.m.bitLength(); 14705 if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26; 14706 this.r = new BN(1).iushln(this.shift); 14707 this.r2 = this.imod(this.r.sqr()); 14708 this.rinv = this.r._invmp(this.m); 14709 this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); 14710 this.minv = this.minv.umod(this.r); 14711 this.minv = this.r.sub(this.minv); 14712 } 14713 inherits(Mont, Red); 14714 Mont.prototype.convertTo = function convertTo(num) { 14715 return this.imod(num.ushln(this.shift)); 14716 }; 14717 Mont.prototype.convertFrom = function convertFrom(num) { 14718 var r = this.imod(num.mul(this.rinv)); 14719 r.red = null; 14720 return r; 14721 }; 14722 Mont.prototype.imul = function imul(a, b) { 14723 if (a.isZero() || b.isZero()) { 14724 a.words[0] = 0; 14725 a.length = 1; 14726 return a; 14727 } 14728 var t = a.imul(b); 14729 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 14730 var u = t.isub(c).iushrn(this.shift); 14731 var res = u; 14732 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 14733 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 14734 return res._forceRed(this); 14735 }; 14736 Mont.prototype.mul = function mul(a, b) { 14737 if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); 14738 var t = a.mul(b); 14739 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 14740 var u = t.isub(c).iushrn(this.shift); 14741 var res = u; 14742 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 14743 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 14744 return res._forceRed(this); 14745 }; 14746 Mont.prototype.invm = function invm(a) { 14747 return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this); 14748 }; 14749 })(typeof module === "undefined" || module, exports); 14750})); 14751//#endregion 14752//#region node_modules/brorand/index.js 14753var require_brorand = /* @__PURE__ */ __commonJSMin(((exports, module) => { 14754 var r; 14755 module.exports = function rand(len) { 14756 if (!r) r = new Rand(null); 14757 return r.generate(len); 14758 }; 14759 function Rand(rand) { 14760 this.rand = rand; 14761 } 14762 module.exports.Rand = Rand; 14763 Rand.prototype.generate = function generate(len) { 14764 return this._rand(len); 14765 }; 14766 Rand.prototype._rand = function _rand(n) { 14767 if (this.rand.getBytes) return this.rand.getBytes(n); 14768 var res = new Uint8Array(n); 14769 for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte(); 14770 return res; 14771 }; 14772 if (typeof self === "object") { 14773 if (self.crypto && self.crypto.getRandomValues) Rand.prototype._rand = function _rand(n) { 14774 var arr = new Uint8Array(n); 14775 self.crypto.getRandomValues(arr); 14776 return arr; 14777 }; 14778 else if (self.msCrypto && self.msCrypto.getRandomValues) Rand.prototype._rand = function _rand(n) { 14779 var arr = new Uint8Array(n); 14780 self.msCrypto.getRandomValues(arr); 14781 return arr; 14782 }; 14783 else if (typeof window === "object") Rand.prototype._rand = function() { 14784 throw new Error("Not implemented yet"); 14785 }; 14786 } else try { 14787 var crypto = require_crypto_browserify(); 14788 if (typeof crypto.randomBytes !== "function") throw new Error("Not supported"); 14789 Rand.prototype._rand = function _rand(n) { 14790 return crypto.randomBytes(n); 14791 }; 14792 } catch (e) {} 14793})); 14794//#endregion 14795//#region node_modules/miller-rabin/lib/mr.js 14796var require_mr = /* @__PURE__ */ __commonJSMin(((exports, module) => { 14797 var bn = require_bn$3(); 14798 var brorand = require_brorand(); 14799 function MillerRabin(rand) { 14800 this.rand = rand || new brorand.Rand(); 14801 } 14802 module.exports = MillerRabin; 14803 MillerRabin.create = function create(rand) { 14804 return new MillerRabin(rand); 14805 }; 14806 MillerRabin.prototype._randbelow = function _randbelow(n) { 14807 var len = n.bitLength(); 14808 var min_bytes = Math.ceil(len / 8); 14809 do 14810 var a = new bn(this.rand.generate(min_bytes)); 14811 while (a.cmp(n) >= 0); 14812 return a; 14813 }; 14814 MillerRabin.prototype._randrange = function _randrange(start, stop) { 14815 var size = stop.sub(start); 14816 return start.add(this._randbelow(size)); 14817 }; 14818 MillerRabin.prototype.test = function test(n, k, cb) { 14819 var len = n.bitLength(); 14820 var red = bn.mont(n); 14821 var rone = new bn(1).toRed(red); 14822 if (!k) k = Math.max(1, len / 48 | 0); 14823 var n1 = n.subn(1); 14824 for (var s = 0; !n1.testn(s); s++); 14825 var d = n.shrn(s); 14826 var rn1 = n1.toRed(red); 14827 var prime = true; 14828 for (; k > 0; k--) { 14829 var a = this._randrange(new bn(2), n1); 14830 if (cb) cb(a); 14831 var x = a.toRed(red).redPow(d); 14832 if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue; 14833 for (var i = 1; i < s; i++) { 14834 x = x.redSqr(); 14835 if (x.cmp(rone) === 0) return false; 14836 if (x.cmp(rn1) === 0) break; 14837 } 14838 if (i === s) return false; 14839 } 14840 return prime; 14841 }; 14842 MillerRabin.prototype.getDivisor = function getDivisor(n, k) { 14843 var len = n.bitLength(); 14844 var red = bn.mont(n); 14845 var rone = new bn(1).toRed(red); 14846 if (!k) k = Math.max(1, len / 48 | 0); 14847 var n1 = n.subn(1); 14848 for (var s = 0; !n1.testn(s); s++); 14849 var d = n.shrn(s); 14850 var rn1 = n1.toRed(red); 14851 for (; k > 0; k--) { 14852 var a = this._randrange(new bn(2), n1); 14853 var g = n.gcd(a); 14854 if (g.cmpn(1) !== 0) return g; 14855 var x = a.toRed(red).redPow(d); 14856 if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue; 14857 for (var i = 1; i < s; i++) { 14858 x = x.redSqr(); 14859 if (x.cmp(rone) === 0) return x.fromRed().subn(1).gcd(n); 14860 if (x.cmp(rn1) === 0) break; 14861 } 14862 if (i === s) { 14863 x = x.redSqr(); 14864 return x.fromRed().subn(1).gcd(n); 14865 } 14866 } 14867 return false; 14868 }; 14869})); 14870//#endregion 14871//#region node_modules/diffie-hellman/lib/generatePrime.js 14872var require_generatePrime = /* @__PURE__ */ __commonJSMin(((exports, module) => { 14873 var randomBytes = require_browser$12(); 14874 module.exports = findPrime; 14875 findPrime.simpleSieve = simpleSieve; 14876 findPrime.fermatTest = fermatTest; 14877 var BN = require_bn$3(); 14878 var TWENTYFOUR = new BN(24); 14879 var millerRabin = new (require_mr())(); 14880 var ONE = new BN(1); 14881 var TWO = new BN(2); 14882 var FIVE = new BN(5); 14883 new BN(16); 14884 new BN(8); 14885 var TEN = new BN(10); 14886 var THREE = new BN(3); 14887 new BN(7); 14888 var ELEVEN = new BN(11); 14889 var FOUR = new BN(4); 14890 new BN(12); 14891 var primes = null; 14892 function _getPrimes() { 14893 if (primes !== null) return primes; 14894 var limit = 1048576; 14895 var res = []; 14896 res[0] = 2; 14897 for (var i = 1, k = 3; k < limit; k += 2) { 14898 var sqrt = Math.ceil(Math.sqrt(k)); 14899 for (var j = 0; j < i && res[j] <= sqrt; j++) if (k % res[j] === 0) break; 14900 if (i !== j && res[j] <= sqrt) continue; 14901 res[i++] = k; 14902 } 14903 primes = res; 14904 return res; 14905 } 14906 function simpleSieve(p) { 14907 var primes = _getPrimes(); 14908 for (var i = 0; i < primes.length; i++) if (p.modn(primes[i]) === 0) if (p.cmpn(primes[i]) === 0) return true; 14909 else return false; 14910 return true; 14911 } 14912 function fermatTest(p) { 14913 var red = BN.mont(p); 14914 return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0; 14915 } 14916 function findPrime(bits, gen) { 14917 if (bits < 16) if (gen === 2 || gen === 5) return new BN([140, 123]); 14918 else return new BN([140, 39]); 14919 gen = new BN(gen); 14920 var num, n2; 14921 while (true) { 14922 num = new BN(randomBytes(Math.ceil(bits / 8))); 14923 while (num.bitLength() > bits) num.ishrn(1); 14924 if (num.isEven()) num.iadd(ONE); 14925 if (!num.testn(1)) num.iadd(TWO); 14926 if (!gen.cmp(TWO)) while (num.mod(TWENTYFOUR).cmp(ELEVEN)) num.iadd(FOUR); 14927 else if (!gen.cmp(FIVE)) while (num.mod(TEN).cmp(THREE)) num.iadd(FOUR); 14928 n2 = num.shrn(1); 14929 if (simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num)) return num; 14930 } 14931 } 14932})); 14933//#endregion 14934//#region node_modules/diffie-hellman/lib/primes.json 14935var primes_exports = /* @__PURE__ */ __exportAll({ 14936 default: () => primes_default, 14937 modp1: () => modp1, 14938 modp14: () => modp14, 14939 modp15: () => modp15, 14940 modp16: () => modp16, 14941 modp17: () => modp17, 14942 modp18: () => modp18, 14943 modp2: () => modp2, 14944 modp5: () => modp5 14945}); 14946var modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, primes_default; 14947var init_primes = __esmMin((() => { 14948 modp1 = { 14949 "gen": "02", 14950 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" 14951 }; 14952 modp2 = { 14953 "gen": "02", 14954 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" 14955 }; 14956 modp5 = { 14957 "gen": "02", 14958 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" 14959 }; 14960 modp14 = { 14961 "gen": "02", 14962 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" 14963 }; 14964 modp15 = { 14965 "gen": "02", 14966 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" 14967 }; 14968 modp16 = { 14969 "gen": "02", 14970 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" 14971 }; 14972 modp17 = { 14973 "gen": "02", 14974 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" 14975 }; 14976 modp18 = { 14977 "gen": "02", 14978 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" 14979 }; 14980 primes_default = { 14981 modp1, 14982 modp2, 14983 modp5, 14984 modp14, 14985 modp15, 14986 modp16, 14987 modp17, 14988 modp18 14989 }; 14990})); 14991//#endregion 14992//#region node_modules/diffie-hellman/lib/dh.js 14993var require_dh = /* @__PURE__ */ __commonJSMin(((exports, module) => { 14994 var Buffer = require_buffer$1().Buffer; 14995 var BN = require_bn$3(); 14996 var millerRabin = new (require_mr())(); 14997 var TWENTYFOUR = new BN(24); 14998 var ELEVEN = new BN(11); 14999 var TEN = new BN(10); 15000 var THREE = new BN(3); 15001 var SEVEN = new BN(7); 15002 var primes = require_generatePrime(); 15003 var randomBytes = require_browser$12(); 15004 module.exports = DH; 15005 function setPublicKey(pub, enc) { 15006 enc = enc || "utf8"; 15007 if (!Buffer.isBuffer(pub)) pub = new Buffer(pub, enc); 15008 this._pub = new BN(pub); 15009 return this; 15010 } 15011 function setPrivateKey(priv, enc) { 15012 enc = enc || "utf8"; 15013 if (!Buffer.isBuffer(priv)) priv = new Buffer(priv, enc); 15014 this._priv = new BN(priv); 15015 return this; 15016 } 15017 var primeCache = {}; 15018 function checkPrime(prime, generator) { 15019 var gen = generator.toString("hex"); 15020 var hex = [gen, prime.toString(16)].join("_"); 15021 if (hex in primeCache) return primeCache[hex]; 15022 var error = 0; 15023 if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) { 15024 error += 1; 15025 if (gen === "02" || gen === "05") error += 8; 15026 else error += 4; 15027 primeCache[hex] = error; 15028 return error; 15029 } 15030 if (!millerRabin.test(prime.shrn(1))) error += 2; 15031 var rem; 15032 switch (gen) { 15033 case "02": 15034 if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) error += 8; 15035 break; 15036 case "05": 15037 rem = prime.mod(TEN); 15038 if (rem.cmp(THREE) && rem.cmp(SEVEN)) error += 8; 15039 break; 15040 default: error += 4; 15041 } 15042 primeCache[hex] = error; 15043 return error; 15044 } 15045 function DH(prime, generator, malleable) { 15046 this.setGenerator(generator); 15047 this.__prime = new BN(prime); 15048 this._prime = BN.mont(this.__prime); 15049 this._primeLen = prime.length; 15050 this._pub = void 0; 15051 this._priv = void 0; 15052 this._primeCode = void 0; 15053 if (malleable) { 15054 this.setPublicKey = setPublicKey; 15055 this.setPrivateKey = setPrivateKey; 15056 } else this._primeCode = 8; 15057 } 15058 Object.defineProperty(DH.prototype, "verifyError", { 15059 enumerable: true, 15060 get: function() { 15061 if (typeof this._primeCode !== "number") this._primeCode = checkPrime(this.__prime, this.__gen); 15062 return this._primeCode; 15063 } 15064 }); 15065 DH.prototype.generateKeys = function() { 15066 if (!this._priv) this._priv = new BN(randomBytes(this._primeLen)); 15067 this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(); 15068 return this.getPublicKey(); 15069 }; 15070 DH.prototype.computeSecret = function(other) { 15071 other = new BN(other); 15072 other = other.toRed(this._prime); 15073 var out = new Buffer(other.redPow(this._priv).fromRed().toArray()); 15074 var prime = this.getPrime(); 15075 if (out.length < prime.length) { 15076 var front = new Buffer(prime.length - out.length); 15077 front.fill(0); 15078 out = Buffer.concat([front, out]); 15079 } 15080 return out; 15081 }; 15082 DH.prototype.getPublicKey = function getPublicKey(enc) { 15083 return formatReturnValue(this._pub, enc); 15084 }; 15085 DH.prototype.getPrivateKey = function getPrivateKey(enc) { 15086 return formatReturnValue(this._priv, enc); 15087 }; 15088 DH.prototype.getPrime = function(enc) { 15089 return formatReturnValue(this.__prime, enc); 15090 }; 15091 DH.prototype.getGenerator = function(enc) { 15092 return formatReturnValue(this._gen, enc); 15093 }; 15094 DH.prototype.setGenerator = function(gen, enc) { 15095 enc = enc || "utf8"; 15096 if (!Buffer.isBuffer(gen)) gen = new Buffer(gen, enc); 15097 this.__gen = gen; 15098 this._gen = new BN(gen); 15099 return this; 15100 }; 15101 function formatReturnValue(bn, enc) { 15102 var buf = new Buffer(bn.toArray()); 15103 if (!enc) return buf; 15104 else return buf.toString(enc); 15105 } 15106})); 15107//#endregion 15108//#region node_modules/diffie-hellman/browser.js 15109var require_browser$5 = /* @__PURE__ */ __commonJSMin(((exports) => { 15110 var Buffer = require_buffer$1().Buffer; 15111 var generatePrime = require_generatePrime(); 15112 var primes = (init_primes(), __toCommonJS(primes_exports).default); 15113 var DH = require_dh(); 15114 function getDiffieHellman(mod) { 15115 return new DH(new Buffer(primes[mod].prime, "hex"), new Buffer(primes[mod].gen, "hex")); 15116 } 15117 var ENCODINGS = { 15118 "binary": true, 15119 "hex": true, 15120 "base64": true 15121 }; 15122 function createDiffieHellman(prime, enc, generator, genc) { 15123 if (Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0) return createDiffieHellman(prime, "binary", enc, generator); 15124 enc = enc || "binary"; 15125 genc = genc || "binary"; 15126 generator = generator || new Buffer([2]); 15127 if (!Buffer.isBuffer(generator)) generator = new Buffer(generator, genc); 15128 if (typeof prime === "number") return new DH(generatePrime(prime, generator), generator, true); 15129 if (!Buffer.isBuffer(prime)) prime = new Buffer(prime, enc); 15130 return new DH(prime, generator, true); 15131 } 15132 exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman; 15133 exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman; 15134})); 15135//#endregion 15136//#region node_modules/process-nextick-args/index.js 15137var require_process_nextick_args = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15138 var process = require_browser$15(); 15139 if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) module.exports = { nextTick }; 15140 else module.exports = process; 15141 function nextTick(fn, arg1, arg2, arg3) { 15142 if (typeof fn !== "function") throw new TypeError("\"callback\" argument must be a function"); 15143 var len = arguments.length; 15144 var args, i; 15145 switch (len) { 15146 case 0: 15147 case 1: return process.nextTick(fn); 15148 case 2: return process.nextTick(function afterTickOne() { 15149 fn.call(null, arg1); 15150 }); 15151 case 3: return process.nextTick(function afterTickTwo() { 15152 fn.call(null, arg1, arg2); 15153 }); 15154 case 4: return process.nextTick(function afterTickThree() { 15155 fn.call(null, arg1, arg2, arg3); 15156 }); 15157 default: 15158 args = new Array(len - 1); 15159 i = 0; 15160 while (i < args.length) args[i++] = arguments[i]; 15161 return process.nextTick(function afterTick() { 15162 fn.apply(null, args); 15163 }); 15164 } 15165 } 15166})); 15167//#endregion 15168//#region node_modules/isarray/index.js 15169var require_isarray = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15170 var toString = {}.toString; 15171 module.exports = Array.isArray || function(arr) { 15172 return toString.call(arr) == "[object Array]"; 15173 }; 15174})); 15175//#endregion 15176//#region node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js 15177var require_stream_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15178 module.exports = require_events().EventEmitter; 15179})); 15180//#endregion 15181//#region node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js 15182var require_safe_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15183 var buffer = require_buffer$1(); 15184 var Buffer = buffer.Buffer; 15185 function copyProps(src, dst) { 15186 for (var key in src) dst[key] = src[key]; 15187 } 15188 if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer; 15189 else { 15190 copyProps(buffer, exports); 15191 exports.Buffer = SafeBuffer; 15192 } 15193 function SafeBuffer(arg, encodingOrOffset, length) { 15194 return Buffer(arg, encodingOrOffset, length); 15195 } 15196 copyProps(Buffer, SafeBuffer); 15197 SafeBuffer.from = function(arg, encodingOrOffset, length) { 15198 if (typeof arg === "number") throw new TypeError("Argument must not be a number"); 15199 return Buffer(arg, encodingOrOffset, length); 15200 }; 15201 SafeBuffer.alloc = function(size, fill, encoding) { 15202 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 15203 var buf = Buffer(size); 15204 if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding); 15205 else buf.fill(fill); 15206 else buf.fill(0); 15207 return buf; 15208 }; 15209 SafeBuffer.allocUnsafe = function(size) { 15210 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 15211 return Buffer(size); 15212 }; 15213 SafeBuffer.allocUnsafeSlow = function(size) { 15214 if (typeof size !== "number") throw new TypeError("Argument must be a number"); 15215 return buffer.SlowBuffer(size); 15216 }; 15217})); 15218//#endregion 15219//#region node_modules/core-util-is/lib/util.js 15220var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { 15221 var Buffer = require_buffer$1().Buffer; 15222 function isArray(arg) { 15223 if (Array.isArray) return Array.isArray(arg); 15224 return objectToString(arg) === "[object Array]"; 15225 } 15226 exports.isArray = isArray; 15227 function isBoolean(arg) { 15228 return typeof arg === "boolean"; 15229 } 15230 exports.isBoolean = isBoolean; 15231 function isNull(arg) { 15232 return arg === null; 15233 } 15234 exports.isNull = isNull; 15235 function isNullOrUndefined(arg) { 15236 return arg == null; 15237 } 15238 exports.isNullOrUndefined = isNullOrUndefined; 15239 function isNumber(arg) { 15240 return typeof arg === "number"; 15241 } 15242 exports.isNumber = isNumber; 15243 function isString(arg) { 15244 return typeof arg === "string"; 15245 } 15246 exports.isString = isString; 15247 function isSymbol(arg) { 15248 return typeof arg === "symbol"; 15249 } 15250 exports.isSymbol = isSymbol; 15251 function isUndefined(arg) { 15252 return arg === void 0; 15253 } 15254 exports.isUndefined = isUndefined; 15255 function isRegExp(re) { 15256 return objectToString(re) === "[object RegExp]"; 15257 } 15258 exports.isRegExp = isRegExp; 15259 function isObject(arg) { 15260 return typeof arg === "object" && arg !== null; 15261 } 15262 exports.isObject = isObject; 15263 function isDate(d) { 15264 return objectToString(d) === "[object Date]"; 15265 } 15266 exports.isDate = isDate; 15267 function isError(e) { 15268 return objectToString(e) === "[object Error]" || e instanceof Error; 15269 } 15270 exports.isError = isError; 15271 function isFunction(arg) { 15272 return typeof arg === "function"; 15273 } 15274 exports.isFunction = isFunction; 15275 function isPrimitive(arg) { 15276 return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined"; 15277 } 15278 exports.isPrimitive = isPrimitive; 15279 exports.isBuffer = Buffer.isBuffer; 15280 function objectToString(o) { 15281 return Object.prototype.toString.call(o); 15282 } 15283})); 15284//#endregion 15285//#region node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/BufferList.js 15286var require_BufferList = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15287 function _classCallCheck(instance, Constructor) { 15288 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 15289 } 15290 var Buffer = require_safe_buffer().Buffer; 15291 var util = require___vite_browser_external(); 15292 function copyBuffer(src, target, offset) { 15293 src.copy(target, offset); 15294 } 15295 module.exports = function() { 15296 function BufferList() { 15297 _classCallCheck(this, BufferList); 15298 this.head = null; 15299 this.tail = null; 15300 this.length = 0; 15301 } 15302 BufferList.prototype.push = function push(v) { 15303 var entry = { 15304 data: v, 15305 next: null 15306 }; 15307 if (this.length > 0) this.tail.next = entry; 15308 else this.head = entry; 15309 this.tail = entry; 15310 ++this.length; 15311 }; 15312 BufferList.prototype.unshift = function unshift(v) { 15313 var entry = { 15314 data: v, 15315 next: this.head 15316 }; 15317 if (this.length === 0) this.tail = entry; 15318 this.head = entry; 15319 ++this.length; 15320 }; 15321 BufferList.prototype.shift = function shift() { 15322 if (this.length === 0) return; 15323 var ret = this.head.data; 15324 if (this.length === 1) this.head = this.tail = null; 15325 else this.head = this.head.next; 15326 --this.length; 15327 return ret; 15328 }; 15329 BufferList.prototype.clear = function clear() { 15330 this.head = this.tail = null; 15331 this.length = 0; 15332 }; 15333 BufferList.prototype.join = function join(s) { 15334 if (this.length === 0) return ""; 15335 var p = this.head; 15336 var ret = "" + p.data; 15337 while (p = p.next) ret += s + p.data; 15338 return ret; 15339 }; 15340 BufferList.prototype.concat = function concat(n) { 15341 if (this.length === 0) return Buffer.alloc(0); 15342 var ret = Buffer.allocUnsafe(n >>> 0); 15343 var p = this.head; 15344 var i = 0; 15345 while (p) { 15346 copyBuffer(p.data, ret, i); 15347 i += p.data.length; 15348 p = p.next; 15349 } 15350 return ret; 15351 }; 15352 return BufferList; 15353 }(); 15354 if (util && util.inspect && util.inspect.custom) module.exports.prototype[util.inspect.custom] = function() { 15355 var obj = util.inspect({ length: this.length }); 15356 return this.constructor.name + " " + obj; 15357 }; 15358})); 15359//#endregion 15360//#region node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js 15361var require_destroy = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15362 require_browser$15(); 15363 var pna = require_process_nextick_args(); 15364 function destroy(err, cb) { 15365 var _this = this; 15366 var readableDestroyed = this._readableState && this._readableState.destroyed; 15367 var writableDestroyed = this._writableState && this._writableState.destroyed; 15368 if (readableDestroyed || writableDestroyed) { 15369 if (cb) cb(err); 15370 else if (err) { 15371 if (!this._writableState) pna.nextTick(emitErrorNT, this, err); 15372 else if (!this._writableState.errorEmitted) { 15373 this._writableState.errorEmitted = true; 15374 pna.nextTick(emitErrorNT, this, err); 15375 } 15376 } 15377 return this; 15378 } 15379 if (this._readableState) this._readableState.destroyed = true; 15380 if (this._writableState) this._writableState.destroyed = true; 15381 this._destroy(err || null, function(err) { 15382 if (!cb && err) { 15383 if (!_this._writableState) pna.nextTick(emitErrorNT, _this, err); 15384 else if (!_this._writableState.errorEmitted) { 15385 _this._writableState.errorEmitted = true; 15386 pna.nextTick(emitErrorNT, _this, err); 15387 } 15388 } else if (cb) cb(err); 15389 }); 15390 return this; 15391 } 15392 function undestroy() { 15393 if (this._readableState) { 15394 this._readableState.destroyed = false; 15395 this._readableState.reading = false; 15396 this._readableState.ended = false; 15397 this._readableState.endEmitted = false; 15398 } 15399 if (this._writableState) { 15400 this._writableState.destroyed = false; 15401 this._writableState.ended = false; 15402 this._writableState.ending = false; 15403 this._writableState.finalCalled = false; 15404 this._writableState.prefinished = false; 15405 this._writableState.finished = false; 15406 this._writableState.errorEmitted = false; 15407 } 15408 } 15409 function emitErrorNT(self, err) { 15410 self.emit("error", err); 15411 } 15412 module.exports = { 15413 destroy, 15414 undestroy 15415 }; 15416})); 15417//#endregion 15418//#region node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_writable.js 15419var require__stream_writable = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15420 var process = require_browser$15(); 15421 var pna = require_process_nextick_args(); 15422 module.exports = Writable; 15423 function CorkedRequest(state) { 15424 var _this = this; 15425 this.next = null; 15426 this.entry = null; 15427 this.finish = function() { 15428 onCorkedFinish(_this, state); 15429 }; 15430 } 15431 var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; 15432 var Duplex; 15433 Writable.WritableState = WritableState; 15434 var util = Object.create(require_util()); 15435 util.inherits = require_inherits_browser(); 15436 var internalUtil = { deprecate: require_browser$11() }; 15437 var Stream = require_stream_browser(); 15438 var Buffer = require_safe_buffer().Buffer; 15439 var OurUint8Array = (typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {}; 15440 function _uint8ArrayToBuffer(chunk) { 15441 return Buffer.from(chunk); 15442 } 15443 function _isUint8Array(obj) { 15444 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; 15445 } 15446 var destroyImpl = require_destroy(); 15447 util.inherits(Writable, Stream); 15448 function nop() {} 15449 function WritableState(options, stream) { 15450 Duplex = Duplex || require__stream_duplex(); 15451 options = options || {}; 15452 var isDuplex = stream instanceof Duplex; 15453 this.objectMode = !!options.objectMode; 15454 if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; 15455 var hwm = options.highWaterMark; 15456 var writableHwm = options.writableHighWaterMark; 15457 var defaultHwm = this.objectMode ? 16 : 16 * 1024; 15458 if (hwm || hwm === 0) this.highWaterMark = hwm; 15459 else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm; 15460 else this.highWaterMark = defaultHwm; 15461 this.highWaterMark = Math.floor(this.highWaterMark); 15462 this.finalCalled = false; 15463 this.needDrain = false; 15464 this.ending = false; 15465 this.ended = false; 15466 this.finished = false; 15467 this.destroyed = false; 15468 var noDecode = options.decodeStrings === false; 15469 this.decodeStrings = !noDecode; 15470 this.defaultEncoding = options.defaultEncoding || "utf8"; 15471 this.length = 0; 15472 this.writing = false; 15473 this.corked = 0; 15474 this.sync = true; 15475 this.bufferProcessing = false; 15476 this.onwrite = function(er) { 15477 onwrite(stream, er); 15478 }; 15479 this.writecb = null; 15480 this.writelen = 0; 15481 this.bufferedRequest = null; 15482 this.lastBufferedRequest = null; 15483 this.pendingcb = 0; 15484 this.prefinished = false; 15485 this.errorEmitted = false; 15486 this.bufferedRequestCount = 0; 15487 this.corkedRequestsFree = new CorkedRequest(this); 15488 } 15489 WritableState.prototype.getBuffer = function getBuffer() { 15490 var current = this.bufferedRequest; 15491 var out = []; 15492 while (current) { 15493 out.push(current); 15494 current = current.next; 15495 } 15496 return out; 15497 }; 15498 (function() { 15499 try { 15500 Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function() { 15501 return this.getBuffer(); 15502 }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); 15503 } catch (_) {} 15504 })(); 15505 var realHasInstance; 15506 if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { 15507 realHasInstance = Function.prototype[Symbol.hasInstance]; 15508 Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) { 15509 if (realHasInstance.call(this, object)) return true; 15510 if (this !== Writable) return false; 15511 return object && object._writableState instanceof WritableState; 15512 } }); 15513 } else realHasInstance = function(object) { 15514 return object instanceof this; 15515 }; 15516 function Writable(options) { 15517 Duplex = Duplex || require__stream_duplex(); 15518 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) return new Writable(options); 15519 this._writableState = new WritableState(options, this); 15520 this.writable = true; 15521 if (options) { 15522 if (typeof options.write === "function") this._write = options.write; 15523 if (typeof options.writev === "function") this._writev = options.writev; 15524 if (typeof options.destroy === "function") this._destroy = options.destroy; 15525 if (typeof options.final === "function") this._final = options.final; 15526 } 15527 Stream.call(this); 15528 } 15529 Writable.prototype.pipe = function() { 15530 this.emit("error", /* @__PURE__ */ new Error("Cannot pipe, not readable")); 15531 }; 15532 function writeAfterEnd(stream, cb) { 15533 var er = /* @__PURE__ */ new Error("write after end"); 15534 stream.emit("error", er); 15535 pna.nextTick(cb, er); 15536 } 15537 function validChunk(stream, state, chunk, cb) { 15538 var valid = true; 15539 var er = false; 15540 if (chunk === null) er = /* @__PURE__ */ new TypeError("May not write null values to stream"); 15541 else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk"); 15542 if (er) { 15543 stream.emit("error", er); 15544 pna.nextTick(cb, er); 15545 valid = false; 15546 } 15547 return valid; 15548 } 15549 Writable.prototype.write = function(chunk, encoding, cb) { 15550 var state = this._writableState; 15551 var ret = false; 15552 var isBuf = !state.objectMode && _isUint8Array(chunk); 15553 if (isBuf && !Buffer.isBuffer(chunk)) chunk = _uint8ArrayToBuffer(chunk); 15554 if (typeof encoding === "function") { 15555 cb = encoding; 15556 encoding = null; 15557 } 15558 if (isBuf) encoding = "buffer"; 15559 else if (!encoding) encoding = state.defaultEncoding; 15560 if (typeof cb !== "function") cb = nop; 15561 if (state.ended) writeAfterEnd(this, cb); 15562 else if (isBuf || validChunk(this, state, chunk, cb)) { 15563 state.pendingcb++; 15564 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); 15565 } 15566 return ret; 15567 }; 15568 Writable.prototype.cork = function() { 15569 var state = this._writableState; 15570 state.corked++; 15571 }; 15572 Writable.prototype.uncork = function() { 15573 var state = this._writableState; 15574 if (state.corked) { 15575 state.corked--; 15576 if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); 15577 } 15578 }; 15579 Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { 15580 if (typeof encoding === "string") encoding = encoding.toLowerCase(); 15581 if (!([ 15582 "hex", 15583 "utf8", 15584 "utf-8", 15585 "ascii", 15586 "binary", 15587 "base64", 15588 "ucs2", 15589 "ucs-2", 15590 "utf16le", 15591 "utf-16le", 15592 "raw" 15593 ].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding); 15594 this._writableState.defaultEncoding = encoding; 15595 return this; 15596 }; 15597 function decodeChunk(state, chunk, encoding) { 15598 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer.from(chunk, encoding); 15599 return chunk; 15600 } 15601 Object.defineProperty(Writable.prototype, "writableHighWaterMark", { 15602 enumerable: false, 15603 get: function() { 15604 return this._writableState.highWaterMark; 15605 } 15606 }); 15607 function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { 15608 if (!isBuf) { 15609 var newChunk = decodeChunk(state, chunk, encoding); 15610 if (chunk !== newChunk) { 15611 isBuf = true; 15612 encoding = "buffer"; 15613 chunk = newChunk; 15614 } 15615 } 15616 var len = state.objectMode ? 1 : chunk.length; 15617 state.length += len; 15618 var ret = state.length < state.highWaterMark; 15619 if (!ret) state.needDrain = true; 15620 if (state.writing || state.corked) { 15621 var last = state.lastBufferedRequest; 15622 state.lastBufferedRequest = { 15623 chunk, 15624 encoding, 15625 isBuf, 15626 callback: cb, 15627 next: null 15628 }; 15629 if (last) last.next = state.lastBufferedRequest; 15630 else state.bufferedRequest = state.lastBufferedRequest; 15631 state.bufferedRequestCount += 1; 15632 } else doWrite(stream, state, false, len, chunk, encoding, cb); 15633 return ret; 15634 } 15635 function doWrite(stream, state, writev, len, chunk, encoding, cb) { 15636 state.writelen = len; 15637 state.writecb = cb; 15638 state.writing = true; 15639 state.sync = true; 15640 if (writev) stream._writev(chunk, state.onwrite); 15641 else stream._write(chunk, encoding, state.onwrite); 15642 state.sync = false; 15643 } 15644 function onwriteError(stream, state, sync, er, cb) { 15645 --state.pendingcb; 15646 if (sync) { 15647 pna.nextTick(cb, er); 15648 pna.nextTick(finishMaybe, stream, state); 15649 stream._writableState.errorEmitted = true; 15650 stream.emit("error", er); 15651 } else { 15652 cb(er); 15653 stream._writableState.errorEmitted = true; 15654 stream.emit("error", er); 15655 finishMaybe(stream, state); 15656 } 15657 } 15658 function onwriteStateUpdate(state) { 15659 state.writing = false; 15660 state.writecb = null; 15661 state.length -= state.writelen; 15662 state.writelen = 0; 15663 } 15664 function onwrite(stream, er) { 15665 var state = stream._writableState; 15666 var sync = state.sync; 15667 var cb = state.writecb; 15668 onwriteStateUpdate(state); 15669 if (er) onwriteError(stream, state, sync, er, cb); 15670 else { 15671 var finished = needFinish(state); 15672 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state); 15673 if (sync) asyncWrite(afterWrite, stream, state, finished, cb); 15674 else afterWrite(stream, state, finished, cb); 15675 } 15676 } 15677 function afterWrite(stream, state, finished, cb) { 15678 if (!finished) onwriteDrain(stream, state); 15679 state.pendingcb--; 15680 cb(); 15681 finishMaybe(stream, state); 15682 } 15683 function onwriteDrain(stream, state) { 15684 if (state.length === 0 && state.needDrain) { 15685 state.needDrain = false; 15686 stream.emit("drain"); 15687 } 15688 } 15689 function clearBuffer(stream, state) { 15690 state.bufferProcessing = true; 15691 var entry = state.bufferedRequest; 15692 if (stream._writev && entry && entry.next) { 15693 var l = state.bufferedRequestCount; 15694 var buffer = new Array(l); 15695 var holder = state.corkedRequestsFree; 15696 holder.entry = entry; 15697 var count = 0; 15698 var allBuffers = true; 15699 while (entry) { 15700 buffer[count] = entry; 15701 if (!entry.isBuf) allBuffers = false; 15702 entry = entry.next; 15703 count += 1; 15704 } 15705 buffer.allBuffers = allBuffers; 15706 doWrite(stream, state, true, state.length, buffer, "", holder.finish); 15707 state.pendingcb++; 15708 state.lastBufferedRequest = null; 15709 if (holder.next) { 15710 state.corkedRequestsFree = holder.next; 15711 holder.next = null; 15712 } else state.corkedRequestsFree = new CorkedRequest(state); 15713 state.bufferedRequestCount = 0; 15714 } else { 15715 while (entry) { 15716 var chunk = entry.chunk; 15717 var encoding = entry.encoding; 15718 var cb = entry.callback; 15719 doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb); 15720 entry = entry.next; 15721 state.bufferedRequestCount--; 15722 if (state.writing) break; 15723 } 15724 if (entry === null) state.lastBufferedRequest = null; 15725 } 15726 state.bufferedRequest = entry; 15727 state.bufferProcessing = false; 15728 } 15729 Writable.prototype._write = function(chunk, encoding, cb) { 15730 cb(/* @__PURE__ */ new Error("_write() is not implemented")); 15731 }; 15732 Writable.prototype._writev = null; 15733 Writable.prototype.end = function(chunk, encoding, cb) { 15734 var state = this._writableState; 15735 if (typeof chunk === "function") { 15736 cb = chunk; 15737 chunk = null; 15738 encoding = null; 15739 } else if (typeof encoding === "function") { 15740 cb = encoding; 15741 encoding = null; 15742 } 15743 if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); 15744 if (state.corked) { 15745 state.corked = 1; 15746 this.uncork(); 15747 } 15748 if (!state.ending) endWritable(this, state, cb); 15749 }; 15750 function needFinish(state) { 15751 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; 15752 } 15753 function callFinal(stream, state) { 15754 stream._final(function(err) { 15755 state.pendingcb--; 15756 if (err) stream.emit("error", err); 15757 state.prefinished = true; 15758 stream.emit("prefinish"); 15759 finishMaybe(stream, state); 15760 }); 15761 } 15762 function prefinish(stream, state) { 15763 if (!state.prefinished && !state.finalCalled) if (typeof stream._final === "function") { 15764 state.pendingcb++; 15765 state.finalCalled = true; 15766 pna.nextTick(callFinal, stream, state); 15767 } else { 15768 state.prefinished = true; 15769 stream.emit("prefinish"); 15770 } 15771 } 15772 function finishMaybe(stream, state) { 15773 var need = needFinish(state); 15774 if (need) { 15775 prefinish(stream, state); 15776 if (state.pendingcb === 0) { 15777 state.finished = true; 15778 stream.emit("finish"); 15779 } 15780 } 15781 return need; 15782 } 15783 function endWritable(stream, state, cb) { 15784 state.ending = true; 15785 finishMaybe(stream, state); 15786 if (cb) if (state.finished) pna.nextTick(cb); 15787 else stream.once("finish", cb); 15788 state.ended = true; 15789 stream.writable = false; 15790 } 15791 function onCorkedFinish(corkReq, state, err) { 15792 var entry = corkReq.entry; 15793 corkReq.entry = null; 15794 while (entry) { 15795 var cb = entry.callback; 15796 state.pendingcb--; 15797 cb(err); 15798 entry = entry.next; 15799 } 15800 state.corkedRequestsFree.next = corkReq; 15801 } 15802 Object.defineProperty(Writable.prototype, "destroyed", { 15803 get: function() { 15804 if (this._writableState === void 0) return false; 15805 return this._writableState.destroyed; 15806 }, 15807 set: function(value) { 15808 if (!this._writableState) return; 15809 this._writableState.destroyed = value; 15810 } 15811 }); 15812 Writable.prototype.destroy = destroyImpl.destroy; 15813 Writable.prototype._undestroy = destroyImpl.undestroy; 15814 Writable.prototype._destroy = function(err, cb) { 15815 this.end(); 15816 cb(err); 15817 }; 15818})); 15819//#endregion 15820//#region node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js 15821var require__stream_duplex = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15822 require_browser$15(); 15823 var pna = require_process_nextick_args(); 15824 var objectKeys = Object.keys || function(obj) { 15825 var keys = []; 15826 for (var key in obj) keys.push(key); 15827 return keys; 15828 }; 15829 module.exports = Duplex; 15830 var util = Object.create(require_util()); 15831 util.inherits = require_inherits_browser(); 15832 var Readable = require__stream_readable(); 15833 var Writable = require__stream_writable(); 15834 util.inherits(Duplex, Readable); 15835 var keys = objectKeys(Writable.prototype); 15836 for (var v = 0; v < keys.length; v++) { 15837 var method = keys[v]; 15838 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; 15839 } 15840 function Duplex(options) { 15841 if (!(this instanceof Duplex)) return new Duplex(options); 15842 Readable.call(this, options); 15843 Writable.call(this, options); 15844 if (options && options.readable === false) this.readable = false; 15845 if (options && options.writable === false) this.writable = false; 15846 this.allowHalfOpen = true; 15847 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; 15848 this.once("end", onend); 15849 } 15850 Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { 15851 enumerable: false, 15852 get: function() { 15853 return this._writableState.highWaterMark; 15854 } 15855 }); 15856 function onend() { 15857 if (this.allowHalfOpen || this._writableState.ended) return; 15858 pna.nextTick(onEndNT, this); 15859 } 15860 function onEndNT(self) { 15861 self.end(); 15862 } 15863 Object.defineProperty(Duplex.prototype, "destroyed", { 15864 get: function() { 15865 if (this._readableState === void 0 || this._writableState === void 0) return false; 15866 return this._readableState.destroyed && this._writableState.destroyed; 15867 }, 15868 set: function(value) { 15869 if (this._readableState === void 0 || this._writableState === void 0) return; 15870 this._readableState.destroyed = value; 15871 this._writableState.destroyed = value; 15872 } 15873 }); 15874 Duplex.prototype._destroy = function(err, cb) { 15875 this.push(null); 15876 this.end(); 15877 pna.nextTick(cb, err); 15878 }; 15879})); 15880//#endregion 15881//#region node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_readable.js 15882var require__stream_readable = /* @__PURE__ */ __commonJSMin(((exports, module) => { 15883 var process = require_browser$15(); 15884 var pna = require_process_nextick_args(); 15885 module.exports = Readable; 15886 var isArray = require_isarray(); 15887 var Duplex; 15888 Readable.ReadableState = ReadableState; 15889 require_events().EventEmitter; 15890 var EElistenerCount = function(emitter, type) { 15891 return emitter.listeners(type).length; 15892 }; 15893 var Stream = require_stream_browser(); 15894 var Buffer = require_safe_buffer().Buffer; 15895 var OurUint8Array = (typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {}; 15896 function _uint8ArrayToBuffer(chunk) { 15897 return Buffer.from(chunk); 15898 } 15899 function _isUint8Array(obj) { 15900 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; 15901 } 15902 var util = Object.create(require_util()); 15903 util.inherits = require_inherits_browser(); 15904 var debugUtil = require___vite_browser_external(); 15905 var debug = void 0; 15906 if (debugUtil && debugUtil.debuglog) debug = debugUtil.debuglog("stream"); 15907 else debug = function() {}; 15908 var BufferList = require_BufferList(); 15909 var destroyImpl = require_destroy(); 15910 var StringDecoder; 15911 util.inherits(Readable, Stream); 15912 var kProxyEvents = [ 15913 "error", 15914 "close", 15915 "destroy", 15916 "pause", 15917 "resume" 15918 ]; 15919 function prependListener(emitter, event, fn) { 15920 if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); 15921 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); 15922 else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn); 15923 else emitter._events[event] = [fn, emitter._events[event]]; 15924 } 15925 function ReadableState(options, stream) { 15926 Duplex = Duplex || require__stream_duplex(); 15927 options = options || {}; 15928 var isDuplex = stream instanceof Duplex; 15929 this.objectMode = !!options.objectMode; 15930 if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; 15931 var hwm = options.highWaterMark; 15932 var readableHwm = options.readableHighWaterMark; 15933 var defaultHwm = this.objectMode ? 16 : 16 * 1024; 15934 if (hwm || hwm === 0) this.highWaterMark = hwm; 15935 else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm; 15936 else this.highWaterMark = defaultHwm; 15937 this.highWaterMark = Math.floor(this.highWaterMark); 15938 this.buffer = new BufferList(); 15939 this.length = 0; 15940 this.pipes = null; 15941 this.pipesCount = 0; 15942 this.flowing = null; 15943 this.ended = false; 15944 this.endEmitted = false; 15945 this.reading = false; 15946 this.sync = true; 15947 this.needReadable = false; 15948 this.emittedReadable = false; 15949 this.readableListening = false; 15950 this.resumeScheduled = false; 15951 this.destroyed = false; 15952 this.defaultEncoding = options.defaultEncoding || "utf8"; 15953 this.awaitDrain = 0; 15954 this.readingMore = false; 15955 this.decoder = null; 15956 this.encoding = null; 15957 if (options.encoding) { 15958 if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; 15959 this.decoder = new StringDecoder(options.encoding); 15960 this.encoding = options.encoding; 15961 } 15962 } 15963 function Readable(options) { 15964 Duplex = Duplex || require__stream_duplex(); 15965 if (!(this instanceof Readable)) return new Readable(options); 15966 this._readableState = new ReadableState(options, this); 15967 this.readable = true; 15968 if (options) { 15969 if (typeof options.read === "function") this._read = options.read; 15970 if (typeof options.destroy === "function") this._destroy = options.destroy; 15971 } 15972 Stream.call(this); 15973 } 15974 Object.defineProperty(Readable.prototype, "destroyed", { 15975 get: function() { 15976 if (this._readableState === void 0) return false; 15977 return this._readableState.destroyed; 15978 }, 15979 set: function(value) { 15980 if (!this._readableState) return; 15981 this._readableState.destroyed = value; 15982 } 15983 }); 15984 Readable.prototype.destroy = destroyImpl.destroy; 15985 Readable.prototype._undestroy = destroyImpl.undestroy; 15986 Readable.prototype._destroy = function(err, cb) { 15987 this.push(null); 15988 cb(err); 15989 }; 15990 Readable.prototype.push = function(chunk, encoding) { 15991 var state = this._readableState; 15992 var skipChunkCheck; 15993 if (!state.objectMode) { 15994 if (typeof chunk === "string") { 15995 encoding = encoding || state.defaultEncoding; 15996 if (encoding !== state.encoding) { 15997 chunk = Buffer.from(chunk, encoding); 15998 encoding = ""; 15999 } 16000 skipChunkCheck = true; 16001 } 16002 } else skipChunkCheck = true; 16003 return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); 16004 }; 16005 Readable.prototype.unshift = function(chunk) { 16006 return readableAddChunk(this, chunk, null, true, false); 16007 }; 16008 function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { 16009 var state = stream._readableState; 16010 if (chunk === null) { 16011 state.reading = false; 16012 onEofChunk(stream, state); 16013 } else { 16014 var er; 16015 if (!skipChunkCheck) er = chunkInvalid(state, chunk); 16016 if (er) stream.emit("error", er); 16017 else if (state.objectMode || chunk && chunk.length > 0) { 16018 if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) chunk = _uint8ArrayToBuffer(chunk); 16019 if (addToFront) if (state.endEmitted) stream.emit("error", /* @__PURE__ */ new Error("stream.unshift() after end event")); 16020 else addChunk(stream, state, chunk, true); 16021 else if (state.ended) stream.emit("error", /* @__PURE__ */ new Error("stream.push() after EOF")); 16022 else { 16023 state.reading = false; 16024 if (state.decoder && !encoding) { 16025 chunk = state.decoder.write(chunk); 16026 if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); 16027 else maybeReadMore(stream, state); 16028 } else addChunk(stream, state, chunk, false); 16029 } 16030 } else if (!addToFront) state.reading = false; 16031 } 16032 return needMoreData(state); 16033 } 16034 function addChunk(stream, state, chunk, addToFront) { 16035 if (state.flowing && state.length === 0 && !state.sync) { 16036 stream.emit("data", chunk); 16037 stream.read(0); 16038 } else { 16039 state.length += state.objectMode ? 1 : chunk.length; 16040 if (addToFront) state.buffer.unshift(chunk); 16041 else state.buffer.push(chunk); 16042 if (state.needReadable) emitReadable(stream); 16043 } 16044 maybeReadMore(stream, state); 16045 } 16046 function chunkInvalid(state, chunk) { 16047 var er; 16048 if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk"); 16049 return er; 16050 } 16051 function needMoreData(state) { 16052 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); 16053 } 16054 Readable.prototype.isPaused = function() { 16055 return this._readableState.flowing === false; 16056 }; 16057 Readable.prototype.setEncoding = function(enc) { 16058 if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; 16059 this._readableState.decoder = new StringDecoder(enc); 16060 this._readableState.encoding = enc; 16061 return this; 16062 }; 16063 var MAX_HWM = 8388608; 16064 function computeNewHighWaterMark(n) { 16065 if (n >= MAX_HWM) n = MAX_HWM; 16066 else { 16067 n--; 16068 n |= n >>> 1; 16069 n |= n >>> 2; 16070 n |= n >>> 4; 16071 n |= n >>> 8; 16072 n |= n >>> 16; 16073 n++; 16074 } 16075 return n; 16076 } 16077 function howMuchToRead(n, state) { 16078 if (n <= 0 || state.length === 0 && state.ended) return 0; 16079 if (state.objectMode) return 1; 16080 if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length; 16081 else return state.length; 16082 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); 16083 if (n <= state.length) return n; 16084 if (!state.ended) { 16085 state.needReadable = true; 16086 return 0; 16087 } 16088 return state.length; 16089 } 16090 Readable.prototype.read = function(n) { 16091 debug("read", n); 16092 n = parseInt(n, 10); 16093 var state = this._readableState; 16094 var nOrig = n; 16095 if (n !== 0) state.emittedReadable = false; 16096 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { 16097 debug("read: emitReadable", state.length, state.ended); 16098 if (state.length === 0 && state.ended) endReadable(this); 16099 else emitReadable(this); 16100 return null; 16101 } 16102 n = howMuchToRead(n, state); 16103 if (n === 0 && state.ended) { 16104 if (state.length === 0) endReadable(this); 16105 return null; 16106 } 16107 var doRead = state.needReadable; 16108 debug("need readable", doRead); 16109 if (state.length === 0 || state.length - n < state.highWaterMark) { 16110 doRead = true; 16111 debug("length less than watermark", doRead); 16112 } 16113 if (state.ended || state.reading) { 16114 doRead = false; 16115 debug("reading or ended", doRead); 16116 } else if (doRead) { 16117 debug("do read"); 16118 state.reading = true; 16119 state.sync = true; 16120 if (state.length === 0) state.needReadable = true; 16121 this._read(state.highWaterMark); 16122 state.sync = false; 16123 if (!state.reading) n = howMuchToRead(nOrig, state); 16124 } 16125 var ret; 16126 if (n > 0) ret = fromList(n, state); 16127 else ret = null; 16128 if (ret === null) { 16129 state.needReadable = true; 16130 n = 0; 16131 } else state.length -= n; 16132 if (state.length === 0) { 16133 if (!state.ended) state.needReadable = true; 16134 if (nOrig !== n && state.ended) endReadable(this); 16135 } 16136 if (ret !== null) this.emit("data", ret); 16137 return ret; 16138 }; 16139 function onEofChunk(stream, state) { 16140 if (state.ended) return; 16141 if (state.decoder) { 16142 var chunk = state.decoder.end(); 16143 if (chunk && chunk.length) { 16144 state.buffer.push(chunk); 16145 state.length += state.objectMode ? 1 : chunk.length; 16146 } 16147 } 16148 state.ended = true; 16149 emitReadable(stream); 16150 } 16151 function emitReadable(stream) { 16152 var state = stream._readableState; 16153 state.needReadable = false; 16154 if (!state.emittedReadable) { 16155 debug("emitReadable", state.flowing); 16156 state.emittedReadable = true; 16157 if (state.sync) pna.nextTick(emitReadable_, stream); 16158 else emitReadable_(stream); 16159 } 16160 } 16161 function emitReadable_(stream) { 16162 debug("emit readable"); 16163 stream.emit("readable"); 16164 flow(stream); 16165 } 16166 function maybeReadMore(stream, state) { 16167 if (!state.readingMore) { 16168 state.readingMore = true; 16169 pna.nextTick(maybeReadMore_, stream, state); 16170 } 16171 } 16172 function maybeReadMore_(stream, state) { 16173 var len = state.length; 16174 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { 16175 debug("maybeReadMore read 0"); 16176 stream.read(0); 16177 if (len === state.length) break; 16178 else len = state.length; 16179 } 16180 state.readingMore = false; 16181 } 16182 Readable.prototype._read = function(n) { 16183 this.emit("error", /* @__PURE__ */ new Error("_read() is not implemented")); 16184 }; 16185 Readable.prototype.pipe = function(dest, pipeOpts) { 16186 var src = this; 16187 var state = this._readableState; 16188 switch (state.pipesCount) { 16189 case 0: 16190 state.pipes = dest; 16191 break; 16192 case 1: 16193 state.pipes = [state.pipes, dest]; 16194 break; 16195 default: 16196 state.pipes.push(dest); 16197 break; 16198 } 16199 state.pipesCount += 1; 16200 debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); 16201 var endFn = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr ? onend : unpipe; 16202 if (state.endEmitted) pna.nextTick(endFn); 16203 else src.once("end", endFn); 16204 dest.on("unpipe", onunpipe); 16205 function onunpipe(readable, unpipeInfo) { 16206 debug("onunpipe"); 16207 if (readable === src) { 16208 if (unpipeInfo && unpipeInfo.hasUnpiped === false) { 16209 unpipeInfo.hasUnpiped = true; 16210 cleanup(); 16211 } 16212 } 16213 } 16214 function onend() { 16215 debug("onend"); 16216 dest.end(); 16217 } 16218 var ondrain = pipeOnDrain(src); 16219 dest.on("drain", ondrain); 16220 var cleanedUp = false; 16221 function cleanup() { 16222 debug("cleanup"); 16223 dest.removeListener("close", onclose); 16224 dest.removeListener("finish", onfinish); 16225 dest.removeListener("drain", ondrain); 16226 dest.removeListener("error", onerror); 16227 dest.removeListener("unpipe", onunpipe); 16228 src.removeListener("end", onend); 16229 src.removeListener("end", unpipe); 16230 src.removeListener("data", ondata); 16231 cleanedUp = true; 16232 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); 16233 } 16234 var increasedAwaitDrain = false; 16235 src.on("data", ondata); 16236 function ondata(chunk) { 16237 debug("ondata"); 16238 increasedAwaitDrain = false; 16239 if (false === dest.write(chunk) && !increasedAwaitDrain) { 16240 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { 16241 debug("false write response, pause", state.awaitDrain); 16242 state.awaitDrain++; 16243 increasedAwaitDrain = true; 16244 } 16245 src.pause(); 16246 } 16247 } 16248 function onerror(er) { 16249 debug("onerror", er); 16250 unpipe(); 16251 dest.removeListener("error", onerror); 16252 if (EElistenerCount(dest, "error") === 0) dest.emit("error", er); 16253 } 16254 prependListener(dest, "error", onerror); 16255 function onclose() { 16256 dest.removeListener("finish", onfinish); 16257 unpipe(); 16258 } 16259 dest.once("close", onclose); 16260 function onfinish() { 16261 debug("onfinish"); 16262 dest.removeListener("close", onclose); 16263 unpipe(); 16264 } 16265 dest.once("finish", onfinish); 16266 function unpipe() { 16267 debug("unpipe"); 16268 src.unpipe(dest); 16269 } 16270 dest.emit("pipe", src); 16271 if (!state.flowing) { 16272 debug("pipe resume"); 16273 src.resume(); 16274 } 16275 return dest; 16276 }; 16277 function pipeOnDrain(src) { 16278 return function() { 16279 var state = src._readableState; 16280 debug("pipeOnDrain", state.awaitDrain); 16281 if (state.awaitDrain) state.awaitDrain--; 16282 if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { 16283 state.flowing = true; 16284 flow(src); 16285 } 16286 }; 16287 } 16288 Readable.prototype.unpipe = function(dest) { 16289 var state = this._readableState; 16290 var unpipeInfo = { hasUnpiped: false }; 16291 if (state.pipesCount === 0) return this; 16292 if (state.pipesCount === 1) { 16293 if (dest && dest !== state.pipes) return this; 16294 if (!dest) dest = state.pipes; 16295 state.pipes = null; 16296 state.pipesCount = 0; 16297 state.flowing = false; 16298 if (dest) dest.emit("unpipe", this, unpipeInfo); 16299 return this; 16300 } 16301 if (!dest) { 16302 var dests = state.pipes; 16303 var len = state.pipesCount; 16304 state.pipes = null; 16305 state.pipesCount = 0; 16306 state.flowing = false; 16307 for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false }); 16308 return this; 16309 } 16310 var index = indexOf(state.pipes, dest); 16311 if (index === -1) return this; 16312 state.pipes.splice(index, 1); 16313 state.pipesCount -= 1; 16314 if (state.pipesCount === 1) state.pipes = state.pipes[0]; 16315 dest.emit("unpipe", this, unpipeInfo); 16316 return this; 16317 }; 16318 Readable.prototype.on = function(ev, fn) { 16319 var res = Stream.prototype.on.call(this, ev, fn); 16320 if (ev === "data") { 16321 if (this._readableState.flowing !== false) this.resume(); 16322 } else if (ev === "readable") { 16323 var state = this._readableState; 16324 if (!state.endEmitted && !state.readableListening) { 16325 state.readableListening = state.needReadable = true; 16326 state.emittedReadable = false; 16327 if (!state.reading) pna.nextTick(nReadingNextTick, this); 16328 else if (state.length) emitReadable(this); 16329 } 16330 } 16331 return res; 16332 }; 16333 Readable.prototype.addListener = Readable.prototype.on; 16334 function nReadingNextTick(self) { 16335 debug("readable nexttick read 0"); 16336 self.read(0); 16337 } 16338 Readable.prototype.resume = function() { 16339 var state = this._readableState; 16340 if (!state.flowing) { 16341 debug("resume"); 16342 state.flowing = true; 16343 resume(this, state); 16344 } 16345 return this; 16346 }; 16347 function resume(stream, state) { 16348 if (!state.resumeScheduled) { 16349 state.resumeScheduled = true; 16350 pna.nextTick(resume_, stream, state); 16351 } 16352 } 16353 function resume_(stream, state) { 16354 if (!state.reading) { 16355 debug("resume read 0"); 16356 stream.read(0); 16357 } 16358 state.resumeScheduled = false; 16359 state.awaitDrain = 0; 16360 stream.emit("resume"); 16361 flow(stream); 16362 if (state.flowing && !state.reading) stream.read(0); 16363 } 16364 Readable.prototype.pause = function() { 16365 debug("call pause flowing=%j", this._readableState.flowing); 16366 if (false !== this._readableState.flowing) { 16367 debug("pause"); 16368 this._readableState.flowing = false; 16369 this.emit("pause"); 16370 } 16371 return this; 16372 }; 16373 function flow(stream) { 16374 var state = stream._readableState; 16375 debug("flow", state.flowing); 16376 while (state.flowing && stream.read() !== null); 16377 } 16378 Readable.prototype.wrap = function(stream) { 16379 var _this = this; 16380 var state = this._readableState; 16381 var paused = false; 16382 stream.on("end", function() { 16383 debug("wrapped end"); 16384 if (state.decoder && !state.ended) { 16385 var chunk = state.decoder.end(); 16386 if (chunk && chunk.length) _this.push(chunk); 16387 } 16388 _this.push(null); 16389 }); 16390 stream.on("data", function(chunk) { 16391 debug("wrapped data"); 16392 if (state.decoder) chunk = state.decoder.write(chunk); 16393 if (state.objectMode && (chunk === null || chunk === void 0)) return; 16394 else if (!state.objectMode && (!chunk || !chunk.length)) return; 16395 if (!_this.push(chunk)) { 16396 paused = true; 16397 stream.pause(); 16398 } 16399 }); 16400 for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function(method) { 16401 return function() { 16402 return stream[method].apply(stream, arguments); 16403 }; 16404 }(i); 16405 for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); 16406 this._read = function(n) { 16407 debug("wrapped _read", n); 16408 if (paused) { 16409 paused = false; 16410 stream.resume(); 16411 } 16412 }; 16413 return this; 16414 }; 16415 Object.defineProperty(Readable.prototype, "readableHighWaterMark", { 16416 enumerable: false, 16417 get: function() { 16418 return this._readableState.highWaterMark; 16419 } 16420 }); 16421 Readable._fromList = fromList; 16422 function fromList(n, state) { 16423 if (state.length === 0) return null; 16424 var ret; 16425 if (state.objectMode) ret = state.buffer.shift(); 16426 else if (!n || n >= state.length) { 16427 if (state.decoder) ret = state.buffer.join(""); 16428 else if (state.buffer.length === 1) ret = state.buffer.head.data; 16429 else ret = state.buffer.concat(state.length); 16430 state.buffer.clear(); 16431 } else ret = fromListPartial(n, state.buffer, state.decoder); 16432 return ret; 16433 } 16434 function fromListPartial(n, list, hasStrings) { 16435 var ret; 16436 if (n < list.head.data.length) { 16437 ret = list.head.data.slice(0, n); 16438 list.head.data = list.head.data.slice(n); 16439 } else if (n === list.head.data.length) ret = list.shift(); 16440 else ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); 16441 return ret; 16442 } 16443 function copyFromBufferString(n, list) { 16444 var p = list.head; 16445 var c = 1; 16446 var ret = p.data; 16447 n -= ret.length; 16448 while (p = p.next) { 16449 var str = p.data; 16450 var nb = n > str.length ? str.length : n; 16451 if (nb === str.length) ret += str; 16452 else ret += str.slice(0, n); 16453 n -= nb; 16454 if (n === 0) { 16455 if (nb === str.length) { 16456 ++c; 16457 if (p.next) list.head = p.next; 16458 else list.head = list.tail = null; 16459 } else { 16460 list.head = p; 16461 p.data = str.slice(nb); 16462 } 16463 break; 16464 } 16465 ++c; 16466 } 16467 list.length -= c; 16468 return ret; 16469 } 16470 function copyFromBuffer(n, list) { 16471 var ret = Buffer.allocUnsafe(n); 16472 var p = list.head; 16473 var c = 1; 16474 p.data.copy(ret); 16475 n -= p.data.length; 16476 while (p = p.next) { 16477 var buf = p.data; 16478 var nb = n > buf.length ? buf.length : n; 16479 buf.copy(ret, ret.length - n, 0, nb); 16480 n -= nb; 16481 if (n === 0) { 16482 if (nb === buf.length) { 16483 ++c; 16484 if (p.next) list.head = p.next; 16485 else list.head = list.tail = null; 16486 } else { 16487 list.head = p; 16488 p.data = buf.slice(nb); 16489 } 16490 break; 16491 } 16492 ++c; 16493 } 16494 list.length -= c; 16495 return ret; 16496 } 16497 function endReadable(stream) { 16498 var state = stream._readableState; 16499 if (state.length > 0) throw new Error("\"endReadable()\" called on non-empty stream"); 16500 if (!state.endEmitted) { 16501 state.ended = true; 16502 pna.nextTick(endReadableNT, state, stream); 16503 } 16504 } 16505 function endReadableNT(state, stream) { 16506 if (!state.endEmitted && state.length === 0) { 16507 state.endEmitted = true; 16508 stream.readable = false; 16509 stream.emit("end"); 16510 } 16511 } 16512 function indexOf(xs, x) { 16513 for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; 16514 return -1; 16515 } 16516})); 16517//#endregion 16518//#region node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_transform.js 16519var require__stream_transform = /* @__PURE__ */ __commonJSMin(((exports, module) => { 16520 module.exports = Transform; 16521 var Duplex = require__stream_duplex(); 16522 var util = Object.create(require_util()); 16523 util.inherits = require_inherits_browser(); 16524 util.inherits(Transform, Duplex); 16525 function afterTransform(er, data) { 16526 var ts = this._transformState; 16527 ts.transforming = false; 16528 var cb = ts.writecb; 16529 if (!cb) return this.emit("error", /* @__PURE__ */ new Error("write callback called multiple times")); 16530 ts.writechunk = null; 16531 ts.writecb = null; 16532 if (data != null) this.push(data); 16533 cb(er); 16534 var rs = this._readableState; 16535 rs.reading = false; 16536 if (rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); 16537 } 16538 function Transform(options) { 16539 if (!(this instanceof Transform)) return new Transform(options); 16540 Duplex.call(this, options); 16541 this._transformState = { 16542 afterTransform: afterTransform.bind(this), 16543 needTransform: false, 16544 transforming: false, 16545 writecb: null, 16546 writechunk: null, 16547 writeencoding: null 16548 }; 16549 this._readableState.needReadable = true; 16550 this._readableState.sync = false; 16551 if (options) { 16552 if (typeof options.transform === "function") this._transform = options.transform; 16553 if (typeof options.flush === "function") this._flush = options.flush; 16554 } 16555 this.on("prefinish", prefinish); 16556 } 16557 function prefinish() { 16558 var _this = this; 16559 if (typeof this._flush === "function") this._flush(function(er, data) { 16560 done(_this, er, data); 16561 }); 16562 else done(this, null, null); 16563 } 16564 Transform.prototype.push = function(chunk, encoding) { 16565 this._transformState.needTransform = false; 16566 return Duplex.prototype.push.call(this, chunk, encoding); 16567 }; 16568 Transform.prototype._transform = function(chunk, encoding, cb) { 16569 throw new Error("_transform() is not implemented"); 16570 }; 16571 Transform.prototype._write = function(chunk, encoding, cb) { 16572 var ts = this._transformState; 16573 ts.writecb = cb; 16574 ts.writechunk = chunk; 16575 ts.writeencoding = encoding; 16576 if (!ts.transforming) { 16577 var rs = this._readableState; 16578 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); 16579 } 16580 }; 16581 Transform.prototype._read = function(n) { 16582 var ts = this._transformState; 16583 if (ts.writechunk !== null && ts.writecb && !ts.transforming) { 16584 ts.transforming = true; 16585 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); 16586 } else ts.needTransform = true; 16587 }; 16588 Transform.prototype._destroy = function(err, cb) { 16589 var _this2 = this; 16590 Duplex.prototype._destroy.call(this, err, function(err2) { 16591 cb(err2); 16592 _this2.emit("close"); 16593 }); 16594 }; 16595 function done(stream, er, data) { 16596 if (er) return stream.emit("error", er); 16597 if (data != null) stream.push(data); 16598 if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0"); 16599 if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming"); 16600 return stream.push(null); 16601 } 16602})); 16603//#endregion 16604//#region node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_passthrough.js 16605var require__stream_passthrough = /* @__PURE__ */ __commonJSMin(((exports, module) => { 16606 module.exports = PassThrough; 16607 var Transform = require__stream_transform(); 16608 var util = Object.create(require_util()); 16609 util.inherits = require_inherits_browser(); 16610 util.inherits(PassThrough, Transform); 16611 function PassThrough(options) { 16612 if (!(this instanceof PassThrough)) return new PassThrough(options); 16613 Transform.call(this, options); 16614 } 16615 PassThrough.prototype._transform = function(chunk, encoding, cb) { 16616 cb(null, chunk); 16617 }; 16618})); 16619//#endregion 16620//#region node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js 16621var require_readable_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 16622 exports = module.exports = require__stream_readable(); 16623 exports.Stream = exports; 16624 exports.Readable = exports; 16625 exports.Writable = require__stream_writable(); 16626 exports.Duplex = require__stream_duplex(); 16627 exports.Transform = require__stream_transform(); 16628 exports.PassThrough = require__stream_passthrough(); 16629})); 16630//#endregion 16631//#region node_modules/browserify-rsa/node_modules/bn.js/lib/bn.js 16632var require_bn$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 16633 (function(module$3, exports$7) { 16634 "use strict"; 16635 function assert(val, msg) { 16636 if (!val) throw new Error(msg || "Assertion failed"); 16637 } 16638 function inherits(ctor, superCtor) { 16639 ctor.super_ = superCtor; 16640 var TempCtor = function() {}; 16641 TempCtor.prototype = superCtor.prototype; 16642 ctor.prototype = new TempCtor(); 16643 ctor.prototype.constructor = ctor; 16644 } 16645 function BN(number, base, endian) { 16646 if (BN.isBN(number)) return number; 16647 this.negative = 0; 16648 this.words = null; 16649 this.length = 0; 16650 this.red = null; 16651 if (number !== null) { 16652 if (base === "le" || base === "be") { 16653 endian = base; 16654 base = 10; 16655 } 16656 this._init(number || 0, base || 10, endian || "be"); 16657 } 16658 } 16659 if (typeof module$3 === "object") module$3.exports = BN; 16660 else exports$7.BN = BN; 16661 BN.BN = BN; 16662 BN.wordSize = 26; 16663 var Buffer; 16664 try { 16665 Buffer = require_buffer$1().Buffer; 16666 } catch (e) {} 16667 BN.isBN = function isBN(num) { 16668 if (num instanceof BN) return true; 16669 return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); 16670 }; 16671 BN.max = function max(left, right) { 16672 if (left.cmp(right) > 0) return left; 16673 return right; 16674 }; 16675 BN.min = function min(left, right) { 16676 if (left.cmp(right) < 0) return left; 16677 return right; 16678 }; 16679 BN.prototype._init = function init(number, base, endian) { 16680 if (typeof number === "number") return this._initNumber(number, base, endian); 16681 if (typeof number === "object") return this._initArray(number, base, endian); 16682 if (base === "hex") base = 16; 16683 assert(base === (base | 0) && base >= 2 && base <= 36); 16684 number = number.toString().replace(/\s+/g, ""); 16685 var start = 0; 16686 if (number[0] === "-") start++; 16687 if (base === 16) this._parseHex(number, start); 16688 else this._parseBase(number, base, start); 16689 if (number[0] === "-") this.negative = 1; 16690 this._strip(); 16691 if (endian !== "le") return; 16692 this._initArray(this.toArray(), base, endian); 16693 }; 16694 BN.prototype._initNumber = function _initNumber(number, base, endian) { 16695 if (number < 0) { 16696 this.negative = 1; 16697 number = -number; 16698 } 16699 if (number < 67108864) { 16700 this.words = [number & 67108863]; 16701 this.length = 1; 16702 } else if (number < 4503599627370496) { 16703 this.words = [number & 67108863, number / 67108864 & 67108863]; 16704 this.length = 2; 16705 } else { 16706 assert(number < 9007199254740992); 16707 this.words = [ 16708 number & 67108863, 16709 number / 67108864 & 67108863, 16710 1 16711 ]; 16712 this.length = 3; 16713 } 16714 if (endian !== "le") return; 16715 this._initArray(this.toArray(), base, endian); 16716 }; 16717 BN.prototype._initArray = function _initArray(number, base, endian) { 16718 assert(typeof number.length === "number"); 16719 if (number.length <= 0) { 16720 this.words = [0]; 16721 this.length = 1; 16722 return this; 16723 } 16724 this.length = Math.ceil(number.length / 3); 16725 this.words = new Array(this.length); 16726 for (var i = 0; i < this.length; i++) this.words[i] = 0; 16727 var j, w; 16728 var off = 0; 16729 if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) { 16730 w = number[i] | number[i - 1] << 8 | number[i - 2] << 16; 16731 this.words[j] |= w << off & 67108863; 16732 this.words[j + 1] = w >>> 26 - off & 67108863; 16733 off += 24; 16734 if (off >= 26) { 16735 off -= 26; 16736 j++; 16737 } 16738 } 16739 else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) { 16740 w = number[i] | number[i + 1] << 8 | number[i + 2] << 16; 16741 this.words[j] |= w << off & 67108863; 16742 this.words[j + 1] = w >>> 26 - off & 67108863; 16743 off += 24; 16744 if (off >= 26) { 16745 off -= 26; 16746 j++; 16747 } 16748 } 16749 return this._strip(); 16750 }; 16751 function parseHex(str, start, end) { 16752 var r = 0; 16753 var len = Math.min(str.length, end); 16754 var z = 0; 16755 for (var i = start; i < len; i++) { 16756 var c = str.charCodeAt(i) - 48; 16757 r <<= 4; 16758 var b; 16759 if (c >= 49 && c <= 54) b = c - 49 + 10; 16760 else if (c >= 17 && c <= 22) b = c - 17 + 10; 16761 else b = c; 16762 r |= b; 16763 z |= b; 16764 } 16765 assert(!(z & 240), "Invalid character in " + str); 16766 return r; 16767 } 16768 BN.prototype._parseHex = function _parseHex(number, start) { 16769 this.length = Math.ceil((number.length - start) / 6); 16770 this.words = new Array(this.length); 16771 for (var i = 0; i < this.length; i++) this.words[i] = 0; 16772 var j, w; 16773 var off = 0; 16774 for (i = number.length - 6, j = 0; i >= start; i -= 6) { 16775 w = parseHex(number, i, i + 6); 16776 this.words[j] |= w << off & 67108863; 16777 this.words[j + 1] |= w >>> 26 - off & 4194303; 16778 off += 24; 16779 if (off >= 26) { 16780 off -= 26; 16781 j++; 16782 } 16783 } 16784 if (i + 6 !== start) { 16785 w = parseHex(number, start, i + 6); 16786 this.words[j] |= w << off & 67108863; 16787 this.words[j + 1] |= w >>> 26 - off & 4194303; 16788 } 16789 this._strip(); 16790 }; 16791 function parseBase(str, start, end, mul) { 16792 var r = 0; 16793 var b = 0; 16794 var len = Math.min(str.length, end); 16795 for (var i = start; i < len; i++) { 16796 var c = str.charCodeAt(i) - 48; 16797 r *= mul; 16798 if (c >= 49) b = c - 49 + 10; 16799 else if (c >= 17) b = c - 17 + 10; 16800 else b = c; 16801 assert(c >= 0 && b < mul, "Invalid character"); 16802 r += b; 16803 } 16804 return r; 16805 } 16806 BN.prototype._parseBase = function _parseBase(number, base, start) { 16807 this.words = [0]; 16808 this.length = 1; 16809 for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++; 16810 limbLen--; 16811 limbPow = limbPow / base | 0; 16812 var total = number.length - start; 16813 var mod = total % limbLen; 16814 var end = Math.min(total, total - mod) + start; 16815 var word = 0; 16816 for (var i = start; i < end; i += limbLen) { 16817 word = parseBase(number, i, i + limbLen, base); 16818 this.imuln(limbPow); 16819 if (this.words[0] + word < 67108864) this.words[0] += word; 16820 else this._iaddn(word); 16821 } 16822 if (mod !== 0) { 16823 var pow = 1; 16824 word = parseBase(number, i, number.length, base); 16825 for (i = 0; i < mod; i++) pow *= base; 16826 this.imuln(pow); 16827 if (this.words[0] + word < 67108864) this.words[0] += word; 16828 else this._iaddn(word); 16829 } 16830 }; 16831 BN.prototype.copy = function copy(dest) { 16832 dest.words = new Array(this.length); 16833 for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i]; 16834 dest.length = this.length; 16835 dest.negative = this.negative; 16836 dest.red = this.red; 16837 }; 16838 function move(dest, src) { 16839 dest.words = src.words; 16840 dest.length = src.length; 16841 dest.negative = src.negative; 16842 dest.red = src.red; 16843 } 16844 BN.prototype._move = function _move(dest) { 16845 move(dest, this); 16846 }; 16847 BN.prototype.clone = function clone() { 16848 var r = new BN(null); 16849 this.copy(r); 16850 return r; 16851 }; 16852 BN.prototype._expand = function _expand(size) { 16853 while (this.length < size) this.words[this.length++] = 0; 16854 return this; 16855 }; 16856 BN.prototype._strip = function strip() { 16857 while (this.length > 1 && this.words[this.length - 1] === 0) this.length--; 16858 return this._normSign(); 16859 }; 16860 BN.prototype._normSign = function _normSign() { 16861 if (this.length === 1 && this.words[0] === 0) this.negative = 0; 16862 return this; 16863 }; 16864 if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") try { 16865 BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect; 16866 } catch (e) { 16867 BN.prototype.inspect = inspect; 16868 } 16869 else BN.prototype.inspect = inspect; 16870 function inspect() { 16871 return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"; 16872 } 16873 var zeros = [ 16874 "", 16875 "0", 16876 "00", 16877 "000", 16878 "0000", 16879 "00000", 16880 "000000", 16881 "0000000", 16882 "00000000", 16883 "000000000", 16884 "0000000000", 16885 "00000000000", 16886 "000000000000", 16887 "0000000000000", 16888 "00000000000000", 16889 "000000000000000", 16890 "0000000000000000", 16891 "00000000000000000", 16892 "000000000000000000", 16893 "0000000000000000000", 16894 "00000000000000000000", 16895 "000000000000000000000", 16896 "0000000000000000000000", 16897 "00000000000000000000000", 16898 "000000000000000000000000", 16899 "0000000000000000000000000" 16900 ]; 16901 var groupSizes = [ 16902 0, 16903 0, 16904 25, 16905 16, 16906 12, 16907 11, 16908 10, 16909 9, 16910 8, 16911 8, 16912 7, 16913 7, 16914 7, 16915 7, 16916 6, 16917 6, 16918 6, 16919 6, 16920 6, 16921 6, 16922 6, 16923 5, 16924 5, 16925 5, 16926 5, 16927 5, 16928 5, 16929 5, 16930 5, 16931 5, 16932 5, 16933 5, 16934 5, 16935 5, 16936 5, 16937 5, 16938 5 16939 ]; 16940 var groupBases = [ 16941 0, 16942 0, 16943 33554432, 16944 43046721, 16945 16777216, 16946 48828125, 16947 60466176, 16948 40353607, 16949 16777216, 16950 43046721, 16951 1e7, 16952 19487171, 16953 35831808, 16954 62748517, 16955 7529536, 16956 11390625, 16957 16777216, 16958 24137569, 16959 34012224, 16960 47045881, 16961 64e6, 16962 4084101, 16963 5153632, 16964 6436343, 16965 7962624, 16966 9765625, 16967 11881376, 16968 14348907, 16969 17210368, 16970 20511149, 16971 243e5, 16972 28629151, 16973 33554432, 16974 39135393, 16975 45435424, 16976 52521875, 16977 60466176 16978 ]; 16979 BN.prototype.toString = function toString(base, padding) { 16980 base = base || 10; 16981 padding = padding | 0 || 1; 16982 var out; 16983 if (base === 16 || base === "hex") { 16984 out = ""; 16985 var off = 0; 16986 var carry = 0; 16987 for (var i = 0; i < this.length; i++) { 16988 var w = this.words[i]; 16989 var word = ((w << off | carry) & 16777215).toString(16); 16990 carry = w >>> 24 - off & 16777215; 16991 if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out; 16992 else out = word + out; 16993 off += 2; 16994 if (off >= 26) { 16995 off -= 26; 16996 i--; 16997 } 16998 } 16999 if (carry !== 0) out = carry.toString(16) + out; 17000 while (out.length % padding !== 0) out = "0" + out; 17001 if (this.negative !== 0) out = "-" + out; 17002 return out; 17003 } 17004 if (base === (base | 0) && base >= 2 && base <= 36) { 17005 var groupSize = groupSizes[base]; 17006 var groupBase = groupBases[base]; 17007 out = ""; 17008 var c = this.clone(); 17009 c.negative = 0; 17010 while (!c.isZero()) { 17011 var r = c.modrn(groupBase).toString(base); 17012 c = c.idivn(groupBase); 17013 if (!c.isZero()) out = zeros[groupSize - r.length] + r + out; 17014 else out = r + out; 17015 } 17016 if (this.isZero()) out = "0" + out; 17017 while (out.length % padding !== 0) out = "0" + out; 17018 if (this.negative !== 0) out = "-" + out; 17019 return out; 17020 } 17021 assert(false, "Base should be between 2 and 36"); 17022 }; 17023 BN.prototype.toNumber = function toNumber() { 17024 var ret = this.words[0]; 17025 if (this.length === 2) ret += this.words[1] * 67108864; 17026 else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864; 17027 else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits"); 17028 return this.negative !== 0 ? -ret : ret; 17029 }; 17030 BN.prototype.toJSON = function toJSON() { 17031 return this.toString(16, 2); 17032 }; 17033 if (Buffer) BN.prototype.toBuffer = function toBuffer(endian, length) { 17034 return this.toArrayLike(Buffer, endian, length); 17035 }; 17036 BN.prototype.toArray = function toArray(endian, length) { 17037 return this.toArrayLike(Array, endian, length); 17038 }; 17039 var allocate = function allocate(ArrayType, size) { 17040 if (ArrayType.allocUnsafe) return ArrayType.allocUnsafe(size); 17041 return new ArrayType(size); 17042 }; 17043 BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { 17044 this._strip(); 17045 var byteLength = this.byteLength(); 17046 var reqLength = length || Math.max(1, byteLength); 17047 assert(byteLength <= reqLength, "byte array longer than desired length"); 17048 assert(reqLength > 0, "Requested array length <= 0"); 17049 var res = allocate(ArrayType, reqLength); 17050 var postfix = endian === "le" ? "LE" : "BE"; 17051 this["_toArrayLike" + postfix](res, byteLength); 17052 return res; 17053 }; 17054 BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { 17055 var position = 0; 17056 var carry = 0; 17057 for (var i = 0, shift = 0; i < this.length; i++) { 17058 var word = this.words[i] << shift | carry; 17059 res[position++] = word & 255; 17060 if (position < res.length) res[position++] = word >> 8 & 255; 17061 if (position < res.length) res[position++] = word >> 16 & 255; 17062 if (shift === 6) { 17063 if (position < res.length) res[position++] = word >> 24 & 255; 17064 carry = 0; 17065 shift = 0; 17066 } else { 17067 carry = word >>> 24; 17068 shift += 2; 17069 } 17070 } 17071 if (position < res.length) { 17072 res[position++] = carry; 17073 while (position < res.length) res[position++] = 0; 17074 } 17075 }; 17076 BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { 17077 var position = res.length - 1; 17078 var carry = 0; 17079 for (var i = 0, shift = 0; i < this.length; i++) { 17080 var word = this.words[i] << shift | carry; 17081 res[position--] = word & 255; 17082 if (position >= 0) res[position--] = word >> 8 & 255; 17083 if (position >= 0) res[position--] = word >> 16 & 255; 17084 if (shift === 6) { 17085 if (position >= 0) res[position--] = word >> 24 & 255; 17086 carry = 0; 17087 shift = 0; 17088 } else { 17089 carry = word >>> 24; 17090 shift += 2; 17091 } 17092 } 17093 if (position >= 0) { 17094 res[position--] = carry; 17095 while (position >= 0) res[position--] = 0; 17096 } 17097 }; 17098 if (Math.clz32) BN.prototype._countBits = function _countBits(w) { 17099 return 32 - Math.clz32(w); 17100 }; 17101 else BN.prototype._countBits = function _countBits(w) { 17102 var t = w; 17103 var r = 0; 17104 if (t >= 4096) { 17105 r += 13; 17106 t >>>= 13; 17107 } 17108 if (t >= 64) { 17109 r += 7; 17110 t >>>= 7; 17111 } 17112 if (t >= 8) { 17113 r += 4; 17114 t >>>= 4; 17115 } 17116 if (t >= 2) { 17117 r += 2; 17118 t >>>= 2; 17119 } 17120 return r + t; 17121 }; 17122 BN.prototype._zeroBits = function _zeroBits(w) { 17123 if (w === 0) return 26; 17124 var t = w; 17125 var r = 0; 17126 if ((t & 8191) === 0) { 17127 r += 13; 17128 t >>>= 13; 17129 } 17130 if ((t & 127) === 0) { 17131 r += 7; 17132 t >>>= 7; 17133 } 17134 if ((t & 15) === 0) { 17135 r += 4; 17136 t >>>= 4; 17137 } 17138 if ((t & 3) === 0) { 17139 r += 2; 17140 t >>>= 2; 17141 } 17142 if ((t & 1) === 0) r++; 17143 return r; 17144 }; 17145 BN.prototype.bitLength = function bitLength() { 17146 var w = this.words[this.length - 1]; 17147 var hi = this._countBits(w); 17148 return (this.length - 1) * 26 + hi; 17149 }; 17150 function toBitArray(num) { 17151 var w = new Array(num.bitLength()); 17152 for (var bit = 0; bit < w.length; bit++) { 17153 var off = bit / 26 | 0; 17154 var wbit = bit % 26; 17155 w[bit] = num.words[off] >>> wbit & 1; 17156 } 17157 return w; 17158 } 17159 BN.prototype.zeroBits = function zeroBits() { 17160 if (this.isZero()) return 0; 17161 var r = 0; 17162 for (var i = 0; i < this.length; i++) { 17163 var b = this._zeroBits(this.words[i]); 17164 r += b; 17165 if (b !== 26) break; 17166 } 17167 return r; 17168 }; 17169 BN.prototype.byteLength = function byteLength() { 17170 return Math.ceil(this.bitLength() / 8); 17171 }; 17172 BN.prototype.toTwos = function toTwos(width) { 17173 if (this.negative !== 0) return this.abs().inotn(width).iaddn(1); 17174 return this.clone(); 17175 }; 17176 BN.prototype.fromTwos = function fromTwos(width) { 17177 if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg(); 17178 return this.clone(); 17179 }; 17180 BN.prototype.isNeg = function isNeg() { 17181 return this.negative !== 0; 17182 }; 17183 BN.prototype.neg = function neg() { 17184 return this.clone().ineg(); 17185 }; 17186 BN.prototype.ineg = function ineg() { 17187 if (!this.isZero()) this.negative ^= 1; 17188 return this; 17189 }; 17190 BN.prototype.iuor = function iuor(num) { 17191 while (this.length < num.length) this.words[this.length++] = 0; 17192 for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i]; 17193 return this._strip(); 17194 }; 17195 BN.prototype.ior = function ior(num) { 17196 assert((this.negative | num.negative) === 0); 17197 return this.iuor(num); 17198 }; 17199 BN.prototype.or = function or(num) { 17200 if (this.length > num.length) return this.clone().ior(num); 17201 return num.clone().ior(this); 17202 }; 17203 BN.prototype.uor = function uor(num) { 17204 if (this.length > num.length) return this.clone().iuor(num); 17205 return num.clone().iuor(this); 17206 }; 17207 BN.prototype.iuand = function iuand(num) { 17208 var b; 17209 if (this.length > num.length) b = num; 17210 else b = this; 17211 for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i]; 17212 this.length = b.length; 17213 return this._strip(); 17214 }; 17215 BN.prototype.iand = function iand(num) { 17216 assert((this.negative | num.negative) === 0); 17217 return this.iuand(num); 17218 }; 17219 BN.prototype.and = function and(num) { 17220 if (this.length > num.length) return this.clone().iand(num); 17221 return num.clone().iand(this); 17222 }; 17223 BN.prototype.uand = function uand(num) { 17224 if (this.length > num.length) return this.clone().iuand(num); 17225 return num.clone().iuand(this); 17226 }; 17227 BN.prototype.iuxor = function iuxor(num) { 17228 var a; 17229 var b; 17230 if (this.length > num.length) { 17231 a = this; 17232 b = num; 17233 } else { 17234 a = num; 17235 b = this; 17236 } 17237 for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i]; 17238 if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i]; 17239 this.length = a.length; 17240 return this._strip(); 17241 }; 17242 BN.prototype.ixor = function ixor(num) { 17243 assert((this.negative | num.negative) === 0); 17244 return this.iuxor(num); 17245 }; 17246 BN.prototype.xor = function xor(num) { 17247 if (this.length > num.length) return this.clone().ixor(num); 17248 return num.clone().ixor(this); 17249 }; 17250 BN.prototype.uxor = function uxor(num) { 17251 if (this.length > num.length) return this.clone().iuxor(num); 17252 return num.clone().iuxor(this); 17253 }; 17254 BN.prototype.inotn = function inotn(width) { 17255 assert(typeof width === "number" && width >= 0); 17256 var bytesNeeded = Math.ceil(width / 26) | 0; 17257 var bitsLeft = width % 26; 17258 this._expand(bytesNeeded); 17259 if (bitsLeft > 0) bytesNeeded--; 17260 for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863; 17261 if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft; 17262 return this._strip(); 17263 }; 17264 BN.prototype.notn = function notn(width) { 17265 return this.clone().inotn(width); 17266 }; 17267 BN.prototype.setn = function setn(bit, val) { 17268 assert(typeof bit === "number" && bit >= 0); 17269 var off = bit / 26 | 0; 17270 var wbit = bit % 26; 17271 this._expand(off + 1); 17272 if (val) this.words[off] = this.words[off] | 1 << wbit; 17273 else this.words[off] = this.words[off] & ~(1 << wbit); 17274 return this._strip(); 17275 }; 17276 BN.prototype.iadd = function iadd(num) { 17277 var r; 17278 if (this.negative !== 0 && num.negative === 0) { 17279 this.negative = 0; 17280 r = this.isub(num); 17281 this.negative ^= 1; 17282 return this._normSign(); 17283 } else if (this.negative === 0 && num.negative !== 0) { 17284 num.negative = 0; 17285 r = this.isub(num); 17286 num.negative = 1; 17287 return r._normSign(); 17288 } 17289 var a, b; 17290 if (this.length > num.length) { 17291 a = this; 17292 b = num; 17293 } else { 17294 a = num; 17295 b = this; 17296 } 17297 var carry = 0; 17298 for (var i = 0; i < b.length; i++) { 17299 r = (a.words[i] | 0) + (b.words[i] | 0) + carry; 17300 this.words[i] = r & 67108863; 17301 carry = r >>> 26; 17302 } 17303 for (; carry !== 0 && i < a.length; i++) { 17304 r = (a.words[i] | 0) + carry; 17305 this.words[i] = r & 67108863; 17306 carry = r >>> 26; 17307 } 17308 this.length = a.length; 17309 if (carry !== 0) { 17310 this.words[this.length] = carry; 17311 this.length++; 17312 } else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 17313 return this; 17314 }; 17315 BN.prototype.add = function add(num) { 17316 var res; 17317 if (num.negative !== 0 && this.negative === 0) { 17318 num.negative = 0; 17319 res = this.sub(num); 17320 num.negative ^= 1; 17321 return res; 17322 } else if (num.negative === 0 && this.negative !== 0) { 17323 this.negative = 0; 17324 res = num.sub(this); 17325 this.negative = 1; 17326 return res; 17327 } 17328 if (this.length > num.length) return this.clone().iadd(num); 17329 return num.clone().iadd(this); 17330 }; 17331 BN.prototype.isub = function isub(num) { 17332 if (num.negative !== 0) { 17333 num.negative = 0; 17334 var r = this.iadd(num); 17335 num.negative = 1; 17336 return r._normSign(); 17337 } else if (this.negative !== 0) { 17338 this.negative = 0; 17339 this.iadd(num); 17340 this.negative = 1; 17341 return this._normSign(); 17342 } 17343 var cmp = this.cmp(num); 17344 if (cmp === 0) { 17345 this.negative = 0; 17346 this.length = 1; 17347 this.words[0] = 0; 17348 return this; 17349 } 17350 var a, b; 17351 if (cmp > 0) { 17352 a = this; 17353 b = num; 17354 } else { 17355 a = num; 17356 b = this; 17357 } 17358 var carry = 0; 17359 for (var i = 0; i < b.length; i++) { 17360 r = (a.words[i] | 0) - (b.words[i] | 0) + carry; 17361 carry = r >> 26; 17362 this.words[i] = r & 67108863; 17363 } 17364 for (; carry !== 0 && i < a.length; i++) { 17365 r = (a.words[i] | 0) + carry; 17366 carry = r >> 26; 17367 this.words[i] = r & 67108863; 17368 } 17369 if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 17370 this.length = Math.max(this.length, i); 17371 if (a !== this) this.negative = 1; 17372 return this._strip(); 17373 }; 17374 BN.prototype.sub = function sub(num) { 17375 return this.clone().isub(num); 17376 }; 17377 function smallMulTo(self, num, out) { 17378 out.negative = num.negative ^ self.negative; 17379 var len = self.length + num.length | 0; 17380 out.length = len; 17381 len = len - 1 | 0; 17382 var a = self.words[0] | 0; 17383 var b = num.words[0] | 0; 17384 var r = a * b; 17385 var lo = r & 67108863; 17386 var carry = r / 67108864 | 0; 17387 out.words[0] = lo; 17388 for (var k = 1; k < len; k++) { 17389 var ncarry = carry >>> 26; 17390 var rword = carry & 67108863; 17391 var maxJ = Math.min(k, num.length - 1); 17392 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 17393 var i = k - j | 0; 17394 a = self.words[i] | 0; 17395 b = num.words[j] | 0; 17396 r = a * b + rword; 17397 ncarry += r / 67108864 | 0; 17398 rword = r & 67108863; 17399 } 17400 out.words[k] = rword | 0; 17401 carry = ncarry | 0; 17402 } 17403 if (carry !== 0) out.words[k] = carry | 0; 17404 else out.length--; 17405 return out._strip(); 17406 } 17407 var comb10MulTo = function comb10MulTo(self, num, out) { 17408 var a = self.words; 17409 var b = num.words; 17410 var o = out.words; 17411 var c = 0; 17412 var lo; 17413 var mid; 17414 var hi; 17415 var a0 = a[0] | 0; 17416 var al0 = a0 & 8191; 17417 var ah0 = a0 >>> 13; 17418 var a1 = a[1] | 0; 17419 var al1 = a1 & 8191; 17420 var ah1 = a1 >>> 13; 17421 var a2 = a[2] | 0; 17422 var al2 = a2 & 8191; 17423 var ah2 = a2 >>> 13; 17424 var a3 = a[3] | 0; 17425 var al3 = a3 & 8191; 17426 var ah3 = a3 >>> 13; 17427 var a4 = a[4] | 0; 17428 var al4 = a4 & 8191; 17429 var ah4 = a4 >>> 13; 17430 var a5 = a[5] | 0; 17431 var al5 = a5 & 8191; 17432 var ah5 = a5 >>> 13; 17433 var a6 = a[6] | 0; 17434 var al6 = a6 & 8191; 17435 var ah6 = a6 >>> 13; 17436 var a7 = a[7] | 0; 17437 var al7 = a7 & 8191; 17438 var ah7 = a7 >>> 13; 17439 var a8 = a[8] | 0; 17440 var al8 = a8 & 8191; 17441 var ah8 = a8 >>> 13; 17442 var a9 = a[9] | 0; 17443 var al9 = a9 & 8191; 17444 var ah9 = a9 >>> 13; 17445 var b0 = b[0] | 0; 17446 var bl0 = b0 & 8191; 17447 var bh0 = b0 >>> 13; 17448 var b1 = b[1] | 0; 17449 var bl1 = b1 & 8191; 17450 var bh1 = b1 >>> 13; 17451 var b2 = b[2] | 0; 17452 var bl2 = b2 & 8191; 17453 var bh2 = b2 >>> 13; 17454 var b3 = b[3] | 0; 17455 var bl3 = b3 & 8191; 17456 var bh3 = b3 >>> 13; 17457 var b4 = b[4] | 0; 17458 var bl4 = b4 & 8191; 17459 var bh4 = b4 >>> 13; 17460 var b5 = b[5] | 0; 17461 var bl5 = b5 & 8191; 17462 var bh5 = b5 >>> 13; 17463 var b6 = b[6] | 0; 17464 var bl6 = b6 & 8191; 17465 var bh6 = b6 >>> 13; 17466 var b7 = b[7] | 0; 17467 var bl7 = b7 & 8191; 17468 var bh7 = b7 >>> 13; 17469 var b8 = b[8] | 0; 17470 var bl8 = b8 & 8191; 17471 var bh8 = b8 >>> 13; 17472 var b9 = b[9] | 0; 17473 var bl9 = b9 & 8191; 17474 var bh9 = b9 >>> 13; 17475 out.negative = self.negative ^ num.negative; 17476 out.length = 19; 17477 lo = Math.imul(al0, bl0); 17478 mid = Math.imul(al0, bh0); 17479 mid = mid + Math.imul(ah0, bl0) | 0; 17480 hi = Math.imul(ah0, bh0); 17481 var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17482 c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; 17483 w0 &= 67108863; 17484 lo = Math.imul(al1, bl0); 17485 mid = Math.imul(al1, bh0); 17486 mid = mid + Math.imul(ah1, bl0) | 0; 17487 hi = Math.imul(ah1, bh0); 17488 lo = lo + Math.imul(al0, bl1) | 0; 17489 mid = mid + Math.imul(al0, bh1) | 0; 17490 mid = mid + Math.imul(ah0, bl1) | 0; 17491 hi = hi + Math.imul(ah0, bh1) | 0; 17492 var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17493 c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; 17494 w1 &= 67108863; 17495 lo = Math.imul(al2, bl0); 17496 mid = Math.imul(al2, bh0); 17497 mid = mid + Math.imul(ah2, bl0) | 0; 17498 hi = Math.imul(ah2, bh0); 17499 lo = lo + Math.imul(al1, bl1) | 0; 17500 mid = mid + Math.imul(al1, bh1) | 0; 17501 mid = mid + Math.imul(ah1, bl1) | 0; 17502 hi = hi + Math.imul(ah1, bh1) | 0; 17503 lo = lo + Math.imul(al0, bl2) | 0; 17504 mid = mid + Math.imul(al0, bh2) | 0; 17505 mid = mid + Math.imul(ah0, bl2) | 0; 17506 hi = hi + Math.imul(ah0, bh2) | 0; 17507 var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17508 c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0; 17509 w2 &= 67108863; 17510 lo = Math.imul(al3, bl0); 17511 mid = Math.imul(al3, bh0); 17512 mid = mid + Math.imul(ah3, bl0) | 0; 17513 hi = Math.imul(ah3, bh0); 17514 lo = lo + Math.imul(al2, bl1) | 0; 17515 mid = mid + Math.imul(al2, bh1) | 0; 17516 mid = mid + Math.imul(ah2, bl1) | 0; 17517 hi = hi + Math.imul(ah2, bh1) | 0; 17518 lo = lo + Math.imul(al1, bl2) | 0; 17519 mid = mid + Math.imul(al1, bh2) | 0; 17520 mid = mid + Math.imul(ah1, bl2) | 0; 17521 hi = hi + Math.imul(ah1, bh2) | 0; 17522 lo = lo + Math.imul(al0, bl3) | 0; 17523 mid = mid + Math.imul(al0, bh3) | 0; 17524 mid = mid + Math.imul(ah0, bl3) | 0; 17525 hi = hi + Math.imul(ah0, bh3) | 0; 17526 var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17527 c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0; 17528 w3 &= 67108863; 17529 lo = Math.imul(al4, bl0); 17530 mid = Math.imul(al4, bh0); 17531 mid = mid + Math.imul(ah4, bl0) | 0; 17532 hi = Math.imul(ah4, bh0); 17533 lo = lo + Math.imul(al3, bl1) | 0; 17534 mid = mid + Math.imul(al3, bh1) | 0; 17535 mid = mid + Math.imul(ah3, bl1) | 0; 17536 hi = hi + Math.imul(ah3, bh1) | 0; 17537 lo = lo + Math.imul(al2, bl2) | 0; 17538 mid = mid + Math.imul(al2, bh2) | 0; 17539 mid = mid + Math.imul(ah2, bl2) | 0; 17540 hi = hi + Math.imul(ah2, bh2) | 0; 17541 lo = lo + Math.imul(al1, bl3) | 0; 17542 mid = mid + Math.imul(al1, bh3) | 0; 17543 mid = mid + Math.imul(ah1, bl3) | 0; 17544 hi = hi + Math.imul(ah1, bh3) | 0; 17545 lo = lo + Math.imul(al0, bl4) | 0; 17546 mid = mid + Math.imul(al0, bh4) | 0; 17547 mid = mid + Math.imul(ah0, bl4) | 0; 17548 hi = hi + Math.imul(ah0, bh4) | 0; 17549 var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17550 c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0; 17551 w4 &= 67108863; 17552 lo = Math.imul(al5, bl0); 17553 mid = Math.imul(al5, bh0); 17554 mid = mid + Math.imul(ah5, bl0) | 0; 17555 hi = Math.imul(ah5, bh0); 17556 lo = lo + Math.imul(al4, bl1) | 0; 17557 mid = mid + Math.imul(al4, bh1) | 0; 17558 mid = mid + Math.imul(ah4, bl1) | 0; 17559 hi = hi + Math.imul(ah4, bh1) | 0; 17560 lo = lo + Math.imul(al3, bl2) | 0; 17561 mid = mid + Math.imul(al3, bh2) | 0; 17562 mid = mid + Math.imul(ah3, bl2) | 0; 17563 hi = hi + Math.imul(ah3, bh2) | 0; 17564 lo = lo + Math.imul(al2, bl3) | 0; 17565 mid = mid + Math.imul(al2, bh3) | 0; 17566 mid = mid + Math.imul(ah2, bl3) | 0; 17567 hi = hi + Math.imul(ah2, bh3) | 0; 17568 lo = lo + Math.imul(al1, bl4) | 0; 17569 mid = mid + Math.imul(al1, bh4) | 0; 17570 mid = mid + Math.imul(ah1, bl4) | 0; 17571 hi = hi + Math.imul(ah1, bh4) | 0; 17572 lo = lo + Math.imul(al0, bl5) | 0;
vendor: 5,979 bytes, lines 17573-17728
17573 mid = mid + Math.imul(al0, bh5) | 0; 17574 mid = mid + Math.imul(ah0, bl5) | 0; 17575 hi = hi + Math.imul(ah0, bh5) | 0; 17576 var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17577 c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0; 17578 w5 &= 67108863; 17579 lo = Math.imul(al6, bl0); 17580 mid = Math.imul(al6, bh0); 17581 mid = mid + Math.imul(ah6, bl0) | 0; 17582 hi = Math.imul(ah6, bh0); 17583 lo = lo + Math.imul(al5, bl1) | 0; 17584 mid = mid + Math.imul(al5, bh1) | 0; 17585 mid = mid + Math.imul(ah5, bl1) | 0; 17586 hi = hi + Math.imul(ah5, bh1) | 0; 17587 lo = lo + Math.imul(al4, bl2) | 0; 17588 mid = mid + Math.imul(al4, bh2) | 0; 17589 mid = mid + Math.imul(ah4, bl2) | 0; 17590 hi = hi + Math.imul(ah4, bh2) | 0; 17591 lo = lo + Math.imul(al3, bl3) | 0; 17592 mid = mid + Math.imul(al3, bh3) | 0; 17593 mid = mid + Math.imul(ah3, bl3) | 0; 17594 hi = hi + Math.imul(ah3, bh3) | 0; 17595 lo = lo + Math.imul(al2, bl4) | 0; 17596 mid = mid + Math.imul(al2, bh4) | 0; 17597 mid = mid + Math.imul(ah2, bl4) | 0; 17598 hi = hi + Math.imul(ah2, bh4) | 0; 17599 lo = lo + Math.imul(al1, bl5) | 0; 17600 mid = mid + Math.imul(al1, bh5) | 0; 17601 mid = mid + Math.imul(ah1, bl5) | 0; 17602 hi = hi + Math.imul(ah1, bh5) | 0; 17603 lo = lo + Math.imul(al0, bl6) | 0; 17604 mid = mid + Math.imul(al0, bh6) | 0; 17605 mid = mid + Math.imul(ah0, bl6) | 0; 17606 hi = hi + Math.imul(ah0, bh6) | 0; 17607 var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17608 c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; 17609 w6 &= 67108863; 17610 lo = Math.imul(al7, bl0); 17611 mid = Math.imul(al7, bh0); 17612 mid = mid + Math.imul(ah7, bl0) | 0; 17613 hi = Math.imul(ah7, bh0); 17614 lo = lo + Math.imul(al6, bl1) | 0; 17615 mid = mid + Math.imul(al6, bh1) | 0; 17616 mid = mid + Math.imul(ah6, bl1) | 0; 17617 hi = hi + Math.imul(ah6, bh1) | 0; 17618 lo = lo + Math.imul(al5, bl2) | 0; 17619 mid = mid + Math.imul(al5, bh2) | 0; 17620 mid = mid + Math.imul(ah5, bl2) | 0; 17621 hi = hi + Math.imul(ah5, bh2) | 0; 17622 lo = lo + Math.imul(al4, bl3) | 0; 17623 mid = mid + Math.imul(al4, bh3) | 0; 17624 mid = mid + Math.imul(ah4, bl3) | 0; 17625 hi = hi + Math.imul(ah4, bh3) | 0; 17626 lo = lo + Math.imul(al3, bl4) | 0; 17627 mid = mid + Math.imul(al3, bh4) | 0; 17628 mid = mid + Math.imul(ah3, bl4) | 0; 17629 hi = hi + Math.imul(ah3, bh4) | 0; 17630 lo = lo + Math.imul(al2, bl5) | 0; 17631 mid = mid + Math.imul(al2, bh5) | 0; 17632 mid = mid + Math.imul(ah2, bl5) | 0; 17633 hi = hi + Math.imul(ah2, bh5) | 0; 17634 lo = lo + Math.imul(al1, bl6) | 0; 17635 mid = mid + Math.imul(al1, bh6) | 0; 17636 mid = mid + Math.imul(ah1, bl6) | 0; 17637 hi = hi + Math.imul(ah1, bh6) | 0; 17638 lo = lo + Math.imul(al0, bl7) | 0; 17639 mid = mid + Math.imul(al0, bh7) | 0; 17640 mid = mid + Math.imul(ah0, bl7) | 0; 17641 hi = hi + Math.imul(ah0, bh7) | 0; 17642 var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17643 c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; 17644 w7 &= 67108863; 17645 lo = Math.imul(al8, bl0); 17646 mid = Math.imul(al8, bh0); 17647 mid = mid + Math.imul(ah8, bl0) | 0; 17648 hi = Math.imul(ah8, bh0); 17649 lo = lo + Math.imul(al7, bl1) | 0; 17650 mid = mid + Math.imul(al7, bh1) | 0; 17651 mid = mid + Math.imul(ah7, bl1) | 0; 17652 hi = hi + Math.imul(ah7, bh1) | 0; 17653 lo = lo + Math.imul(al6, bl2) | 0; 17654 mid = mid + Math.imul(al6, bh2) | 0; 17655 mid = mid + Math.imul(ah6, bl2) | 0; 17656 hi = hi + Math.imul(ah6, bh2) | 0; 17657 lo = lo + Math.imul(al5, bl3) | 0; 17658 mid = mid + Math.imul(al5, bh3) | 0; 17659 mid = mid + Math.imul(ah5, bl3) | 0; 17660 hi = hi + Math.imul(ah5, bh3) | 0; 17661 lo = lo + Math.imul(al4, bl4) | 0; 17662 mid = mid + Math.imul(al4, bh4) | 0; 17663 mid = mid + Math.imul(ah4, bl4) | 0; 17664 hi = hi + Math.imul(ah4, bh4) | 0; 17665 lo = lo + Math.imul(al3, bl5) | 0; 17666 mid = mid + Math.imul(al3, bh5) | 0; 17667 mid = mid + Math.imul(ah3, bl5) | 0; 17668 hi = hi + Math.imul(ah3, bh5) | 0; 17669 lo = lo + Math.imul(al2, bl6) | 0; 17670 mid = mid + Math.imul(al2, bh6) | 0; 17671 mid = mid + Math.imul(ah2, bl6) | 0; 17672 hi = hi + Math.imul(ah2, bh6) | 0; 17673 lo = lo + Math.imul(al1, bl7) | 0; 17674 mid = mid + Math.imul(al1, bh7) | 0; 17675 mid = mid + Math.imul(ah1, bl7) | 0; 17676 hi = hi + Math.imul(ah1, bh7) | 0; 17677 lo = lo + Math.imul(al0, bl8) | 0; 17678 mid = mid + Math.imul(al0, bh8) | 0; 17679 mid = mid + Math.imul(ah0, bl8) | 0; 17680 hi = hi + Math.imul(ah0, bh8) | 0; 17681 var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17682 c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; 17683 w8 &= 67108863; 17684 lo = Math.imul(al9, bl0); 17685 mid = Math.imul(al9, bh0); 17686 mid = mid + Math.imul(ah9, bl0) | 0; 17687 hi = Math.imul(ah9, bh0); 17688 lo = lo + Math.imul(al8, bl1) | 0; 17689 mid = mid + Math.imul(al8, bh1) | 0; 17690 mid = mid + Math.imul(ah8, bl1) | 0; 17691 hi = hi + Math.imul(ah8, bh1) | 0; 17692 lo = lo + Math.imul(al7, bl2) | 0; 17693 mid = mid + Math.imul(al7, bh2) | 0; 17694 mid = mid + Math.imul(ah7, bl2) | 0; 17695 hi = hi + Math.imul(ah7, bh2) | 0; 17696 lo = lo + Math.imul(al6, bl3) | 0; 17697 mid = mid + Math.imul(al6, bh3) | 0; 17698 mid = mid + Math.imul(ah6, bl3) | 0; 17699 hi = hi + Math.imul(ah6, bh3) | 0; 17700 lo = lo + Math.imul(al5, bl4) | 0; 17701 mid = mid + Math.imul(al5, bh4) | 0; 17702 mid = mid + Math.imul(ah5, bl4) | 0; 17703 hi = hi + Math.imul(ah5, bh4) | 0; 17704 lo = lo + Math.imul(al4, bl5) | 0; 17705 mid = mid + Math.imul(al4, bh5) | 0; 17706 mid = mid + Math.imul(ah4, bl5) | 0; 17707 hi = hi + Math.imul(ah4, bh5) | 0; 17708 lo = lo + Math.imul(al3, bl6) | 0; 17709 mid = mid + Math.imul(al3, bh6) | 0; 17710 mid = mid + Math.imul(ah3, bl6) | 0; 17711 hi = hi + Math.imul(ah3, bh6) | 0; 17712 lo = lo + Math.imul(al2, bl7) | 0; 17713 mid = mid + Math.imul(al2, bh7) | 0; 17714 mid = mid + Math.imul(ah2, bl7) | 0; 17715 hi = hi + Math.imul(ah2, bh7) | 0; 17716 lo = lo + Math.imul(al1, bl8) | 0; 17717 mid = mid + Math.imul(al1, bh8) | 0; 17718 mid = mid + Math.imul(ah1, bl8) | 0; 17719 hi = hi + Math.imul(ah1, bh8) | 0; 17720 lo = lo + Math.imul(al0, bl9) | 0; 17721 mid = mid + Math.imul(al0, bh9) | 0; 17722 mid = mid + Math.imul(ah0, bl9) | 0; 17723 hi = hi + Math.imul(ah0, bh9) | 0; 17724 var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17725 c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; 17726 w9 &= 67108863; 17727 lo = Math.imul(al9, bl1); 17728 mid = Math.imul(al9, bh1);
vendor: 70,907 bytes, lines 17729-20175
17729 mid = mid + Math.imul(ah9, bl1) | 0; 17730 hi = Math.imul(ah9, bh1); 17731 lo = lo + Math.imul(al8, bl2) | 0; 17732 mid = mid + Math.imul(al8, bh2) | 0; 17733 mid = mid + Math.imul(ah8, bl2) | 0; 17734 hi = hi + Math.imul(ah8, bh2) | 0; 17735 lo = lo + Math.imul(al7, bl3) | 0; 17736 mid = mid + Math.imul(al7, bh3) | 0; 17737 mid = mid + Math.imul(ah7, bl3) | 0; 17738 hi = hi + Math.imul(ah7, bh3) | 0; 17739 lo = lo + Math.imul(al6, bl4) | 0; 17740 mid = mid + Math.imul(al6, bh4) | 0; 17741 mid = mid + Math.imul(ah6, bl4) | 0; 17742 hi = hi + Math.imul(ah6, bh4) | 0; 17743 lo = lo + Math.imul(al5, bl5) | 0; 17744 mid = mid + Math.imul(al5, bh5) | 0; 17745 mid = mid + Math.imul(ah5, bl5) | 0; 17746 hi = hi + Math.imul(ah5, bh5) | 0; 17747 lo = lo + Math.imul(al4, bl6) | 0; 17748 mid = mid + Math.imul(al4, bh6) | 0; 17749 mid = mid + Math.imul(ah4, bl6) | 0; 17750 hi = hi + Math.imul(ah4, bh6) | 0; 17751 lo = lo + Math.imul(al3, bl7) | 0; 17752 mid = mid + Math.imul(al3, bh7) | 0; 17753 mid = mid + Math.imul(ah3, bl7) | 0; 17754 hi = hi + Math.imul(ah3, bh7) | 0; 17755 lo = lo + Math.imul(al2, bl8) | 0; 17756 mid = mid + Math.imul(al2, bh8) | 0; 17757 mid = mid + Math.imul(ah2, bl8) | 0; 17758 hi = hi + Math.imul(ah2, bh8) | 0; 17759 lo = lo + Math.imul(al1, bl9) | 0; 17760 mid = mid + Math.imul(al1, bh9) | 0; 17761 mid = mid + Math.imul(ah1, bl9) | 0; 17762 hi = hi + Math.imul(ah1, bh9) | 0; 17763 var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17764 c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; 17765 w10 &= 67108863; 17766 lo = Math.imul(al9, bl2); 17767 mid = Math.imul(al9, bh2); 17768 mid = mid + Math.imul(ah9, bl2) | 0; 17769 hi = Math.imul(ah9, bh2); 17770 lo = lo + Math.imul(al8, bl3) | 0; 17771 mid = mid + Math.imul(al8, bh3) | 0; 17772 mid = mid + Math.imul(ah8, bl3) | 0; 17773 hi = hi + Math.imul(ah8, bh3) | 0; 17774 lo = lo + Math.imul(al7, bl4) | 0; 17775 mid = mid + Math.imul(al7, bh4) | 0; 17776 mid = mid + Math.imul(ah7, bl4) | 0; 17777 hi = hi + Math.imul(ah7, bh4) | 0; 17778 lo = lo + Math.imul(al6, bl5) | 0; 17779 mid = mid + Math.imul(al6, bh5) | 0; 17780 mid = mid + Math.imul(ah6, bl5) | 0; 17781 hi = hi + Math.imul(ah6, bh5) | 0; 17782 lo = lo + Math.imul(al5, bl6) | 0; 17783 mid = mid + Math.imul(al5, bh6) | 0; 17784 mid = mid + Math.imul(ah5, bl6) | 0; 17785 hi = hi + Math.imul(ah5, bh6) | 0; 17786 lo = lo + Math.imul(al4, bl7) | 0; 17787 mid = mid + Math.imul(al4, bh7) | 0; 17788 mid = mid + Math.imul(ah4, bl7) | 0; 17789 hi = hi + Math.imul(ah4, bh7) | 0; 17790 lo = lo + Math.imul(al3, bl8) | 0; 17791 mid = mid + Math.imul(al3, bh8) | 0; 17792 mid = mid + Math.imul(ah3, bl8) | 0; 17793 hi = hi + Math.imul(ah3, bh8) | 0; 17794 lo = lo + Math.imul(al2, bl9) | 0; 17795 mid = mid + Math.imul(al2, bh9) | 0; 17796 mid = mid + Math.imul(ah2, bl9) | 0; 17797 hi = hi + Math.imul(ah2, bh9) | 0; 17798 var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17799 c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; 17800 w11 &= 67108863; 17801 lo = Math.imul(al9, bl3); 17802 mid = Math.imul(al9, bh3); 17803 mid = mid + Math.imul(ah9, bl3) | 0; 17804 hi = Math.imul(ah9, bh3); 17805 lo = lo + Math.imul(al8, bl4) | 0; 17806 mid = mid + Math.imul(al8, bh4) | 0; 17807 mid = mid + Math.imul(ah8, bl4) | 0; 17808 hi = hi + Math.imul(ah8, bh4) | 0; 17809 lo = lo + Math.imul(al7, bl5) | 0; 17810 mid = mid + Math.imul(al7, bh5) | 0; 17811 mid = mid + Math.imul(ah7, bl5) | 0; 17812 hi = hi + Math.imul(ah7, bh5) | 0; 17813 lo = lo + Math.imul(al6, bl6) | 0; 17814 mid = mid + Math.imul(al6, bh6) | 0; 17815 mid = mid + Math.imul(ah6, bl6) | 0; 17816 hi = hi + Math.imul(ah6, bh6) | 0; 17817 lo = lo + Math.imul(al5, bl7) | 0; 17818 mid = mid + Math.imul(al5, bh7) | 0; 17819 mid = mid + Math.imul(ah5, bl7) | 0; 17820 hi = hi + Math.imul(ah5, bh7) | 0; 17821 lo = lo + Math.imul(al4, bl8) | 0; 17822 mid = mid + Math.imul(al4, bh8) | 0; 17823 mid = mid + Math.imul(ah4, bl8) | 0; 17824 hi = hi + Math.imul(ah4, bh8) | 0; 17825 lo = lo + Math.imul(al3, bl9) | 0; 17826 mid = mid + Math.imul(al3, bh9) | 0; 17827 mid = mid + Math.imul(ah3, bl9) | 0; 17828 hi = hi + Math.imul(ah3, bh9) | 0; 17829 var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17830 c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; 17831 w12 &= 67108863; 17832 lo = Math.imul(al9, bl4); 17833 mid = Math.imul(al9, bh4); 17834 mid = mid + Math.imul(ah9, bl4) | 0; 17835 hi = Math.imul(ah9, bh4); 17836 lo = lo + Math.imul(al8, bl5) | 0; 17837 mid = mid + Math.imul(al8, bh5) | 0; 17838 mid = mid + Math.imul(ah8, bl5) | 0; 17839 hi = hi + Math.imul(ah8, bh5) | 0; 17840 lo = lo + Math.imul(al7, bl6) | 0; 17841 mid = mid + Math.imul(al7, bh6) | 0; 17842 mid = mid + Math.imul(ah7, bl6) | 0; 17843 hi = hi + Math.imul(ah7, bh6) | 0; 17844 lo = lo + Math.imul(al6, bl7) | 0; 17845 mid = mid + Math.imul(al6, bh7) | 0; 17846 mid = mid + Math.imul(ah6, bl7) | 0; 17847 hi = hi + Math.imul(ah6, bh7) | 0; 17848 lo = lo + Math.imul(al5, bl8) | 0; 17849 mid = mid + Math.imul(al5, bh8) | 0; 17850 mid = mid + Math.imul(ah5, bl8) | 0; 17851 hi = hi + Math.imul(ah5, bh8) | 0; 17852 lo = lo + Math.imul(al4, bl9) | 0; 17853 mid = mid + Math.imul(al4, bh9) | 0; 17854 mid = mid + Math.imul(ah4, bl9) | 0; 17855 hi = hi + Math.imul(ah4, bh9) | 0; 17856 var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17857 c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; 17858 w13 &= 67108863; 17859 lo = Math.imul(al9, bl5); 17860 mid = Math.imul(al9, bh5); 17861 mid = mid + Math.imul(ah9, bl5) | 0; 17862 hi = Math.imul(ah9, bh5); 17863 lo = lo + Math.imul(al8, bl6) | 0; 17864 mid = mid + Math.imul(al8, bh6) | 0; 17865 mid = mid + Math.imul(ah8, bl6) | 0; 17866 hi = hi + Math.imul(ah8, bh6) | 0; 17867 lo = lo + Math.imul(al7, bl7) | 0; 17868 mid = mid + Math.imul(al7, bh7) | 0; 17869 mid = mid + Math.imul(ah7, bl7) | 0; 17870 hi = hi + Math.imul(ah7, bh7) | 0; 17871 lo = lo + Math.imul(al6, bl8) | 0; 17872 mid = mid + Math.imul(al6, bh8) | 0; 17873 mid = mid + Math.imul(ah6, bl8) | 0; 17874 hi = hi + Math.imul(ah6, bh8) | 0; 17875 lo = lo + Math.imul(al5, bl9) | 0; 17876 mid = mid + Math.imul(al5, bh9) | 0; 17877 mid = mid + Math.imul(ah5, bl9) | 0; 17878 hi = hi + Math.imul(ah5, bh9) | 0; 17879 var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17880 c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; 17881 w14 &= 67108863; 17882 lo = Math.imul(al9, bl6); 17883 mid = Math.imul(al9, bh6); 17884 mid = mid + Math.imul(ah9, bl6) | 0; 17885 hi = Math.imul(ah9, bh6); 17886 lo = lo + Math.imul(al8, bl7) | 0; 17887 mid = mid + Math.imul(al8, bh7) | 0; 17888 mid = mid + Math.imul(ah8, bl7) | 0; 17889 hi = hi + Math.imul(ah8, bh7) | 0; 17890 lo = lo + Math.imul(al7, bl8) | 0; 17891 mid = mid + Math.imul(al7, bh8) | 0; 17892 mid = mid + Math.imul(ah7, bl8) | 0; 17893 hi = hi + Math.imul(ah7, bh8) | 0; 17894 lo = lo + Math.imul(al6, bl9) | 0; 17895 mid = mid + Math.imul(al6, bh9) | 0; 17896 mid = mid + Math.imul(ah6, bl9) | 0; 17897 hi = hi + Math.imul(ah6, bh9) | 0; 17898 var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17899 c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; 17900 w15 &= 67108863; 17901 lo = Math.imul(al9, bl7); 17902 mid = Math.imul(al9, bh7); 17903 mid = mid + Math.imul(ah9, bl7) | 0; 17904 hi = Math.imul(ah9, bh7); 17905 lo = lo + Math.imul(al8, bl8) | 0; 17906 mid = mid + Math.imul(al8, bh8) | 0; 17907 mid = mid + Math.imul(ah8, bl8) | 0; 17908 hi = hi + Math.imul(ah8, bh8) | 0; 17909 lo = lo + Math.imul(al7, bl9) | 0; 17910 mid = mid + Math.imul(al7, bh9) | 0; 17911 mid = mid + Math.imul(ah7, bl9) | 0; 17912 hi = hi + Math.imul(ah7, bh9) | 0; 17913 var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17914 c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; 17915 w16 &= 67108863; 17916 lo = Math.imul(al9, bl8); 17917 mid = Math.imul(al9, bh8); 17918 mid = mid + Math.imul(ah9, bl8) | 0; 17919 hi = Math.imul(ah9, bh8); 17920 lo = lo + Math.imul(al8, bl9) | 0; 17921 mid = mid + Math.imul(al8, bh9) | 0; 17922 mid = mid + Math.imul(ah8, bl9) | 0; 17923 hi = hi + Math.imul(ah8, bh9) | 0; 17924 var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17925 c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; 17926 w17 &= 67108863; 17927 lo = Math.imul(al9, bl9); 17928 mid = Math.imul(al9, bh9); 17929 mid = mid + Math.imul(ah9, bl9) | 0; 17930 hi = Math.imul(ah9, bh9); 17931 var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 17932 c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; 17933 w18 &= 67108863; 17934 o[0] = w0; 17935 o[1] = w1; 17936 o[2] = w2; 17937 o[3] = w3; 17938 o[4] = w4; 17939 o[5] = w5; 17940 o[6] = w6; 17941 o[7] = w7; 17942 o[8] = w8; 17943 o[9] = w9; 17944 o[10] = w10; 17945 o[11] = w11; 17946 o[12] = w12; 17947 o[13] = w13; 17948 o[14] = w14; 17949 o[15] = w15; 17950 o[16] = w16; 17951 o[17] = w17; 17952 o[18] = w18; 17953 if (c !== 0) { 17954 o[19] = c; 17955 out.length++; 17956 } 17957 return out; 17958 }; 17959 if (!Math.imul) comb10MulTo = smallMulTo; 17960 function bigMulTo(self, num, out) { 17961 out.negative = num.negative ^ self.negative; 17962 out.length = self.length + num.length; 17963 var carry = 0; 17964 var hncarry = 0; 17965 for (var k = 0; k < out.length - 1; k++) { 17966 var ncarry = hncarry; 17967 hncarry = 0; 17968 var rword = carry & 67108863; 17969 var maxJ = Math.min(k, num.length - 1); 17970 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 17971 var i = k - j; 17972 var r = (self.words[i] | 0) * (num.words[j] | 0); 17973 var lo = r & 67108863; 17974 ncarry = ncarry + (r / 67108864 | 0) | 0; 17975 lo = lo + rword | 0; 17976 rword = lo & 67108863; 17977 ncarry = ncarry + (lo >>> 26) | 0; 17978 hncarry += ncarry >>> 26; 17979 ncarry &= 67108863; 17980 } 17981 out.words[k] = rword; 17982 carry = ncarry; 17983 ncarry = hncarry; 17984 } 17985 if (carry !== 0) out.words[k] = carry; 17986 else out.length--; 17987 return out._strip(); 17988 } 17989 function jumboMulTo(self, num, out) { 17990 return bigMulTo(self, num, out); 17991 } 17992 BN.prototype.mulTo = function mulTo(num, out) { 17993 var res; 17994 var len = this.length + num.length; 17995 if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out); 17996 else if (len < 63) res = smallMulTo(this, num, out); 17997 else if (len < 1024) res = bigMulTo(this, num, out); 17998 else res = jumboMulTo(this, num, out); 17999 return res; 18000 }; 18001 function FFTM(x, y) { 18002 this.x = x; 18003 this.y = y; 18004 } 18005 FFTM.prototype.makeRBT = function makeRBT(N) { 18006 var t = new Array(N); 18007 var l = BN.prototype._countBits(N) - 1; 18008 for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N); 18009 return t; 18010 }; 18011 FFTM.prototype.revBin = function revBin(x, l, N) { 18012 if (x === 0 || x === N - 1) return x; 18013 var rb = 0; 18014 for (var i = 0; i < l; i++) { 18015 rb |= (x & 1) << l - i - 1; 18016 x >>= 1; 18017 } 18018 return rb; 18019 }; 18020 FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) { 18021 for (var i = 0; i < N; i++) { 18022 rtws[i] = rws[rbt[i]]; 18023 itws[i] = iws[rbt[i]]; 18024 } 18025 }; 18026 FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) { 18027 this.permute(rbt, rws, iws, rtws, itws, N); 18028 for (var s = 1; s < N; s <<= 1) { 18029 var l = s << 1; 18030 var rtwdf = Math.cos(2 * Math.PI / l); 18031 var itwdf = Math.sin(2 * Math.PI / l); 18032 for (var p = 0; p < N; p += l) { 18033 var rtwdf_ = rtwdf; 18034 var itwdf_ = itwdf; 18035 for (var j = 0; j < s; j++) { 18036 var re = rtws[p + j]; 18037 var ie = itws[p + j]; 18038 var ro = rtws[p + j + s]; 18039 var io = itws[p + j + s]; 18040 var rx = rtwdf_ * ro - itwdf_ * io; 18041 io = rtwdf_ * io + itwdf_ * ro; 18042 ro = rx; 18043 rtws[p + j] = re + ro; 18044 itws[p + j] = ie + io; 18045 rtws[p + j + s] = re - ro; 18046 itws[p + j + s] = ie - io; 18047 if (j !== l) { 18048 rx = rtwdf * rtwdf_ - itwdf * itwdf_; 18049 itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; 18050 rtwdf_ = rx; 18051 } 18052 } 18053 } 18054 } 18055 }; 18056 FFTM.prototype.guessLen13b = function guessLen13b(n, m) { 18057 var N = Math.max(m, n) | 1; 18058 var odd = N & 1; 18059 var i = 0; 18060 for (N = N / 2 | 0; N; N = N >>> 1) i++; 18061 return 1 << i + 1 + odd; 18062 }; 18063 FFTM.prototype.conjugate = function conjugate(rws, iws, N) { 18064 if (N <= 1) return; 18065 for (var i = 0; i < N / 2; i++) { 18066 var t = rws[i]; 18067 rws[i] = rws[N - i - 1]; 18068 rws[N - i - 1] = t; 18069 t = iws[i]; 18070 iws[i] = -iws[N - i - 1]; 18071 iws[N - i - 1] = -t; 18072 } 18073 }; 18074 FFTM.prototype.normalize13b = function normalize13b(ws, N) { 18075 var carry = 0; 18076 for (var i = 0; i < N / 2; i++) { 18077 var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry; 18078 ws[i] = w & 67108863; 18079 if (w < 67108864) carry = 0; 18080 else carry = w / 67108864 | 0; 18081 } 18082 return ws; 18083 }; 18084 FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) { 18085 var carry = 0; 18086 for (var i = 0; i < len; i++) { 18087 carry = carry + (ws[i] | 0); 18088 rws[2 * i] = carry & 8191; 18089 carry = carry >>> 13; 18090 rws[2 * i + 1] = carry & 8191; 18091 carry = carry >>> 13; 18092 } 18093 for (i = 2 * len; i < N; ++i) rws[i] = 0; 18094 assert(carry === 0); 18095 assert((carry & -8192) === 0); 18096 }; 18097 FFTM.prototype.stub = function stub(N) { 18098 var ph = new Array(N); 18099 for (var i = 0; i < N; i++) ph[i] = 0; 18100 return ph; 18101 }; 18102 FFTM.prototype.mulp = function mulp(x, y, out) { 18103 var N = 2 * this.guessLen13b(x.length, y.length); 18104 var rbt = this.makeRBT(N); 18105 var _ = this.stub(N); 18106 var rws = new Array(N); 18107 var rwst = new Array(N); 18108 var iwst = new Array(N); 18109 var nrws = new Array(N); 18110 var nrwst = new Array(N); 18111 var niwst = new Array(N); 18112 var rmws = out.words; 18113 rmws.length = N; 18114 this.convert13b(x.words, x.length, rws, N); 18115 this.convert13b(y.words, y.length, nrws, N); 18116 this.transform(rws, _, rwst, iwst, N, rbt); 18117 this.transform(nrws, _, nrwst, niwst, N, rbt); 18118 for (var i = 0; i < N; i++) { 18119 var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; 18120 iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; 18121 rwst[i] = rx; 18122 } 18123 this.conjugate(rwst, iwst, N); 18124 this.transform(rwst, iwst, rmws, _, N, rbt); 18125 this.conjugate(rmws, _, N); 18126 this.normalize13b(rmws, N); 18127 out.negative = x.negative ^ y.negative; 18128 out.length = x.length + y.length; 18129 return out._strip(); 18130 }; 18131 BN.prototype.mul = function mul(num) { 18132 var out = new BN(null); 18133 out.words = new Array(this.length + num.length); 18134 return this.mulTo(num, out); 18135 }; 18136 BN.prototype.mulf = function mulf(num) { 18137 var out = new BN(null); 18138 out.words = new Array(this.length + num.length); 18139 return jumboMulTo(this, num, out); 18140 }; 18141 BN.prototype.imul = function imul(num) { 18142 return this.clone().mulTo(num, this); 18143 }; 18144 BN.prototype.imuln = function imuln(num) { 18145 var isNegNum = num < 0; 18146 if (isNegNum) num = -num; 18147 assert(typeof num === "number"); 18148 assert(num < 67108864); 18149 var carry = 0; 18150 for (var i = 0; i < this.length; i++) { 18151 var w = (this.words[i] | 0) * num; 18152 var lo = (w & 67108863) + (carry & 67108863); 18153 carry >>= 26; 18154 carry += w / 67108864 | 0; 18155 carry += lo >>> 26; 18156 this.words[i] = lo & 67108863; 18157 } 18158 if (carry !== 0) { 18159 this.words[i] = carry; 18160 this.length++; 18161 } 18162 return isNegNum ? this.ineg() : this; 18163 }; 18164 BN.prototype.muln = function muln(num) { 18165 return this.clone().imuln(num); 18166 }; 18167 BN.prototype.sqr = function sqr() { 18168 return this.mul(this); 18169 }; 18170 BN.prototype.isqr = function isqr() { 18171 return this.imul(this.clone()); 18172 }; 18173 BN.prototype.pow = function pow(num) { 18174 var w = toBitArray(num); 18175 if (w.length === 0) return new BN(1); 18176 var res = this; 18177 for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break; 18178 if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { 18179 if (w[i] === 0) continue; 18180 res = res.mul(q); 18181 } 18182 return res; 18183 }; 18184 BN.prototype.iushln = function iushln(bits) { 18185 assert(typeof bits === "number" && bits >= 0); 18186 var r = bits % 26; 18187 var s = (bits - r) / 26; 18188 var carryMask = 67108863 >>> 26 - r << 26 - r; 18189 var i; 18190 if (r !== 0) { 18191 var carry = 0; 18192 for (i = 0; i < this.length; i++) { 18193 var newCarry = this.words[i] & carryMask; 18194 var c = (this.words[i] | 0) - newCarry << r; 18195 this.words[i] = c | carry; 18196 carry = newCarry >>> 26 - r; 18197 } 18198 if (carry) { 18199 this.words[i] = carry; 18200 this.length++; 18201 } 18202 } 18203 if (s !== 0) { 18204 for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i]; 18205 for (i = 0; i < s; i++) this.words[i] = 0; 18206 this.length += s; 18207 } 18208 return this._strip(); 18209 }; 18210 BN.prototype.ishln = function ishln(bits) { 18211 assert(this.negative === 0); 18212 return this.iushln(bits); 18213 }; 18214 BN.prototype.iushrn = function iushrn(bits, hint, extended) { 18215 assert(typeof bits === "number" && bits >= 0); 18216 var h; 18217 if (hint) h = (hint - hint % 26) / 26; 18218 else h = 0; 18219 var r = bits % 26; 18220 var s = Math.min((bits - r) / 26, this.length); 18221 var mask = 67108863 ^ 67108863 >>> r << r; 18222 var maskedWords = extended; 18223 h -= s; 18224 h = Math.max(0, h); 18225 if (maskedWords) { 18226 for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i]; 18227 maskedWords.length = s; 18228 } 18229 if (s === 0) {} else if (this.length > s) { 18230 this.length -= s; 18231 for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s]; 18232 } else { 18233 this.words[0] = 0; 18234 this.length = 1; 18235 } 18236 var carry = 0; 18237 for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { 18238 var word = this.words[i] | 0; 18239 this.words[i] = carry << 26 - r | word >>> r; 18240 carry = word & mask; 18241 } 18242 if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry; 18243 if (this.length === 0) { 18244 this.words[0] = 0; 18245 this.length = 1; 18246 } 18247 return this._strip(); 18248 }; 18249 BN.prototype.ishrn = function ishrn(bits, hint, extended) { 18250 assert(this.negative === 0); 18251 return this.iushrn(bits, hint, extended); 18252 }; 18253 BN.prototype.shln = function shln(bits) { 18254 return this.clone().ishln(bits); 18255 }; 18256 BN.prototype.ushln = function ushln(bits) { 18257 return this.clone().iushln(bits); 18258 }; 18259 BN.prototype.shrn = function shrn(bits) { 18260 return this.clone().ishrn(bits); 18261 }; 18262 BN.prototype.ushrn = function ushrn(bits) { 18263 return this.clone().iushrn(bits); 18264 }; 18265 BN.prototype.testn = function testn(bit) { 18266 assert(typeof bit === "number" && bit >= 0); 18267 var r = bit % 26; 18268 var s = (bit - r) / 26; 18269 var q = 1 << r; 18270 if (this.length <= s) return false; 18271 return !!(this.words[s] & q); 18272 }; 18273 BN.prototype.imaskn = function imaskn(bits) { 18274 assert(typeof bits === "number" && bits >= 0); 18275 var r = bits % 26; 18276 var s = (bits - r) / 26; 18277 assert(this.negative === 0, "imaskn works only with positive numbers"); 18278 if (this.length <= s) return this; 18279 if (r !== 0) s++; 18280 this.length = Math.min(s, this.length); 18281 if (r !== 0) { 18282 var mask = 67108863 ^ 67108863 >>> r << r; 18283 this.words[this.length - 1] &= mask; 18284 } 18285 return this._strip(); 18286 }; 18287 BN.prototype.maskn = function maskn(bits) { 18288 return this.clone().imaskn(bits); 18289 }; 18290 BN.prototype.iaddn = function iaddn(num) { 18291 assert(typeof num === "number"); 18292 assert(num < 67108864); 18293 if (num < 0) return this.isubn(-num); 18294 if (this.negative !== 0) { 18295 if (this.length === 1 && (this.words[0] | 0) <= num) { 18296 this.words[0] = num - (this.words[0] | 0); 18297 this.negative = 0; 18298 return this; 18299 } 18300 this.negative = 0; 18301 this.isubn(num); 18302 this.negative = 1; 18303 return this; 18304 } 18305 return this._iaddn(num); 18306 }; 18307 BN.prototype._iaddn = function _iaddn(num) { 18308 this.words[0] += num; 18309 for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) { 18310 this.words[i] -= 67108864; 18311 if (i === this.length - 1) this.words[i + 1] = 1; 18312 else this.words[i + 1]++; 18313 } 18314 this.length = Math.max(this.length, i + 1); 18315 return this; 18316 }; 18317 BN.prototype.isubn = function isubn(num) { 18318 assert(typeof num === "number"); 18319 assert(num < 67108864); 18320 if (num < 0) return this.iaddn(-num); 18321 if (this.negative !== 0) { 18322 this.negative = 0; 18323 this.iaddn(num); 18324 this.negative = 1; 18325 return this; 18326 } 18327 this.words[0] -= num; 18328 if (this.length === 1 && this.words[0] < 0) { 18329 this.words[0] = -this.words[0]; 18330 this.negative = 1; 18331 } else for (var i = 0; i < this.length && this.words[i] < 0; i++) { 18332 this.words[i] += 67108864; 18333 this.words[i + 1] -= 1; 18334 } 18335 return this._strip(); 18336 }; 18337 BN.prototype.addn = function addn(num) { 18338 return this.clone().iaddn(num); 18339 }; 18340 BN.prototype.subn = function subn(num) { 18341 return this.clone().isubn(num); 18342 }; 18343 BN.prototype.iabs = function iabs() { 18344 this.negative = 0; 18345 return this; 18346 }; 18347 BN.prototype.abs = function abs() { 18348 return this.clone().iabs(); 18349 }; 18350 BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { 18351 var len = num.length + shift; 18352 var i; 18353 this._expand(len); 18354 var w; 18355 var carry = 0; 18356 for (i = 0; i < num.length; i++) { 18357 w = (this.words[i + shift] | 0) + carry; 18358 var right = (num.words[i] | 0) * mul; 18359 w -= right & 67108863; 18360 carry = (w >> 26) - (right / 67108864 | 0); 18361 this.words[i + shift] = w & 67108863; 18362 } 18363 for (; i < this.length - shift; i++) { 18364 w = (this.words[i + shift] | 0) + carry; 18365 carry = w >> 26; 18366 this.words[i + shift] = w & 67108863; 18367 } 18368 if (carry === 0) return this._strip(); 18369 assert(carry === -1); 18370 carry = 0; 18371 for (i = 0; i < this.length; i++) { 18372 w = -(this.words[i] | 0) + carry; 18373 carry = w >> 26; 18374 this.words[i] = w & 67108863; 18375 } 18376 this.negative = 1; 18377 return this._strip(); 18378 }; 18379 BN.prototype._wordDiv = function _wordDiv(num, mode) { 18380 var shift = this.length - num.length; 18381 var a = this.clone(); 18382 var b = num; 18383 var bhi = b.words[b.length - 1] | 0; 18384 shift = 26 - this._countBits(bhi); 18385 if (shift !== 0) { 18386 b = b.ushln(shift); 18387 a.iushln(shift); 18388 bhi = b.words[b.length - 1] | 0; 18389 } 18390 var m = a.length - b.length; 18391 var q; 18392 if (mode !== "mod") { 18393 q = new BN(null); 18394 q.length = m + 1; 18395 q.words = new Array(q.length); 18396 for (var i = 0; i < q.length; i++) q.words[i] = 0; 18397 } 18398 var diff = a.clone()._ishlnsubmul(b, 1, m); 18399 if (diff.negative === 0) { 18400 a = diff; 18401 if (q) q.words[m] = 1; 18402 } 18403 for (var j = m - 1; j >= 0; j--) { 18404 var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0); 18405 qj = Math.min(qj / bhi | 0, 67108863); 18406 a._ishlnsubmul(b, qj, j); 18407 while (a.negative !== 0) { 18408 qj--; 18409 a.negative = 0; 18410 a._ishlnsubmul(b, 1, j); 18411 if (!a.isZero()) a.negative ^= 1; 18412 } 18413 if (q) q.words[j] = qj; 18414 } 18415 if (q) q._strip(); 18416 a._strip(); 18417 if (mode !== "div" && shift !== 0) a.iushrn(shift); 18418 return { 18419 div: q || null, 18420 mod: a 18421 }; 18422 }; 18423 BN.prototype.divmod = function divmod(num, mode, positive) { 18424 assert(!num.isZero()); 18425 if (this.isZero()) return { 18426 div: new BN(0), 18427 mod: new BN(0) 18428 }; 18429 var div, mod, res; 18430 if (this.negative !== 0 && num.negative === 0) { 18431 res = this.neg().divmod(num, mode); 18432 if (mode !== "mod") div = res.div.neg(); 18433 if (mode !== "div") { 18434 mod = res.mod.neg(); 18435 if (positive && mod.negative !== 0) mod.iadd(num); 18436 } 18437 return { 18438 div, 18439 mod 18440 }; 18441 } 18442 if (this.negative === 0 && num.negative !== 0) { 18443 res = this.divmod(num.neg(), mode); 18444 if (mode !== "mod") div = res.div.neg(); 18445 return { 18446 div, 18447 mod: res.mod 18448 }; 18449 } 18450 if ((this.negative & num.negative) !== 0) { 18451 res = this.neg().divmod(num.neg(), mode); 18452 if (mode !== "div") { 18453 mod = res.mod.neg(); 18454 if (positive && mod.negative !== 0) mod.isub(num); 18455 } 18456 return { 18457 div: res.div, 18458 mod 18459 }; 18460 } 18461 if (num.length > this.length || this.cmp(num) < 0) return { 18462 div: new BN(0), 18463 mod: this 18464 }; 18465 if (num.length === 1) { 18466 if (mode === "div") return { 18467 div: this.divn(num.words[0]), 18468 mod: null 18469 }; 18470 if (mode === "mod") return { 18471 div: null, 18472 mod: new BN(this.modrn(num.words[0])) 18473 }; 18474 return { 18475 div: this.divn(num.words[0]), 18476 mod: new BN(this.modrn(num.words[0])) 18477 }; 18478 } 18479 return this._wordDiv(num, mode); 18480 }; 18481 BN.prototype.div = function div(num) { 18482 return this.divmod(num, "div", false).div; 18483 }; 18484 BN.prototype.mod = function mod(num) { 18485 return this.divmod(num, "mod", false).mod; 18486 }; 18487 BN.prototype.umod = function umod(num) { 18488 return this.divmod(num, "mod", true).mod; 18489 }; 18490 BN.prototype.divRound = function divRound(num) { 18491 var dm = this.divmod(num); 18492 if (dm.mod.isZero()) return dm.div; 18493 var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; 18494 var half = num.ushrn(1); 18495 var r2 = num.andln(1); 18496 var cmp = mod.cmp(half); 18497 if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; 18498 return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); 18499 }; 18500 BN.prototype.modrn = function modrn(num) { 18501 var isNegNum = num < 0; 18502 if (isNegNum) num = -num; 18503 assert(num <= 67108863); 18504 var p = (1 << 26) % num; 18505 var acc = 0; 18506 for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num; 18507 return isNegNum ? -acc : acc; 18508 }; 18509 BN.prototype.modn = function modn(num) { 18510 return this.modrn(num); 18511 }; 18512 BN.prototype.idivn = function idivn(num) { 18513 var isNegNum = num < 0; 18514 if (isNegNum) num = -num; 18515 assert(num <= 67108863); 18516 var carry = 0; 18517 for (var i = this.length - 1; i >= 0; i--) { 18518 var w = (this.words[i] | 0) + carry * 67108864; 18519 this.words[i] = w / num | 0; 18520 carry = w % num; 18521 } 18522 this._strip(); 18523 return isNegNum ? this.ineg() : this; 18524 }; 18525 BN.prototype.divn = function divn(num) { 18526 return this.clone().idivn(num); 18527 }; 18528 BN.prototype.egcd = function egcd(p) { 18529 assert(p.negative === 0); 18530 assert(!p.isZero()); 18531 var x = this; 18532 var y = p.clone(); 18533 if (x.negative !== 0) x = x.umod(p); 18534 else x = x.clone(); 18535 var A = new BN(1); 18536 var B = new BN(0); 18537 var C = new BN(0); 18538 var D = new BN(1); 18539 var g = 0; 18540 while (x.isEven() && y.isEven()) { 18541 x.iushrn(1); 18542 y.iushrn(1); 18543 ++g; 18544 } 18545 var yp = y.clone(); 18546 var xp = x.clone(); 18547 while (!x.isZero()) { 18548 for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 18549 if (i > 0) { 18550 x.iushrn(i); 18551 while (i-- > 0) { 18552 if (A.isOdd() || B.isOdd()) { 18553 A.iadd(yp); 18554 B.isub(xp); 18555 } 18556 A.iushrn(1); 18557 B.iushrn(1); 18558 } 18559 } 18560 for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 18561 if (j > 0) { 18562 y.iushrn(j); 18563 while (j-- > 0) { 18564 if (C.isOdd() || D.isOdd()) { 18565 C.iadd(yp); 18566 D.isub(xp); 18567 } 18568 C.iushrn(1); 18569 D.iushrn(1); 18570 } 18571 } 18572 if (x.cmp(y) >= 0) { 18573 x.isub(y); 18574 A.isub(C); 18575 B.isub(D); 18576 } else { 18577 y.isub(x); 18578 C.isub(A); 18579 D.isub(B); 18580 } 18581 } 18582 return { 18583 a: C, 18584 b: D, 18585 gcd: y.iushln(g) 18586 }; 18587 }; 18588 BN.prototype._invmp = function _invmp(p) { 18589 assert(p.negative === 0); 18590 assert(!p.isZero()); 18591 var a = this; 18592 var b = p.clone(); 18593 if (a.negative !== 0) a = a.umod(p); 18594 else a = a.clone(); 18595 var x1 = new BN(1); 18596 var x2 = new BN(0); 18597 var delta = b.clone(); 18598 while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { 18599 for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 18600 if (i > 0) { 18601 a.iushrn(i); 18602 while (i-- > 0) { 18603 if (x1.isOdd()) x1.iadd(delta); 18604 x1.iushrn(1); 18605 } 18606 } 18607 for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 18608 if (j > 0) { 18609 b.iushrn(j); 18610 while (j-- > 0) { 18611 if (x2.isOdd()) x2.iadd(delta); 18612 x2.iushrn(1); 18613 } 18614 } 18615 if (a.cmp(b) >= 0) { 18616 a.isub(b); 18617 x1.isub(x2); 18618 } else { 18619 b.isub(a); 18620 x2.isub(x1); 18621 } 18622 } 18623 var res; 18624 if (a.cmpn(1) === 0) res = x1; 18625 else res = x2; 18626 if (res.cmpn(0) < 0) res.iadd(p); 18627 return res; 18628 }; 18629 BN.prototype.gcd = function gcd(num) { 18630 if (this.isZero()) return num.abs(); 18631 if (num.isZero()) return this.abs(); 18632 var a = this.clone(); 18633 var b = num.clone(); 18634 a.negative = 0; 18635 b.negative = 0; 18636 for (var shift = 0; a.isEven() && b.isEven(); shift++) { 18637 a.iushrn(1); 18638 b.iushrn(1); 18639 } 18640 do { 18641 while (a.isEven()) a.iushrn(1); 18642 while (b.isEven()) b.iushrn(1); 18643 var r = a.cmp(b); 18644 if (r < 0) { 18645 var t = a; 18646 a = b; 18647 b = t; 18648 } else if (r === 0 || b.cmpn(1) === 0) break; 18649 a.isub(b); 18650 } while (true); 18651 return b.iushln(shift); 18652 }; 18653 BN.prototype.invm = function invm(num) { 18654 return this.egcd(num).a.umod(num); 18655 }; 18656 BN.prototype.isEven = function isEven() { 18657 return (this.words[0] & 1) === 0; 18658 }; 18659 BN.prototype.isOdd = function isOdd() { 18660 return (this.words[0] & 1) === 1; 18661 }; 18662 BN.prototype.andln = function andln(num) { 18663 return this.words[0] & num; 18664 }; 18665 BN.prototype.bincn = function bincn(bit) { 18666 assert(typeof bit === "number"); 18667 var r = bit % 26; 18668 var s = (bit - r) / 26; 18669 var q = 1 << r; 18670 if (this.length <= s) { 18671 this._expand(s + 1); 18672 this.words[s] |= q; 18673 return this; 18674 } 18675 var carry = q; 18676 for (var i = s; carry !== 0 && i < this.length; i++) { 18677 var w = this.words[i] | 0; 18678 w += carry; 18679 carry = w >>> 26; 18680 w &= 67108863; 18681 this.words[i] = w; 18682 } 18683 if (carry !== 0) { 18684 this.words[i] = carry; 18685 this.length++; 18686 } 18687 return this; 18688 }; 18689 BN.prototype.isZero = function isZero() { 18690 return this.length === 1 && this.words[0] === 0; 18691 }; 18692 BN.prototype.cmpn = function cmpn(num) { 18693 var negative = num < 0; 18694 if (this.negative !== 0 && !negative) return -1; 18695 if (this.negative === 0 && negative) return 1; 18696 this._strip(); 18697 var res; 18698 if (this.length > 1) res = 1; 18699 else { 18700 if (negative) num = -num; 18701 assert(num <= 67108863, "Number is too big"); 18702 var w = this.words[0] | 0; 18703 res = w === num ? 0 : w < num ? -1 : 1; 18704 } 18705 if (this.negative !== 0) return -res | 0; 18706 return res; 18707 }; 18708 BN.prototype.cmp = function cmp(num) { 18709 if (this.negative !== 0 && num.negative === 0) return -1; 18710 if (this.negative === 0 && num.negative !== 0) return 1; 18711 var res = this.ucmp(num); 18712 if (this.negative !== 0) return -res | 0; 18713 return res; 18714 }; 18715 BN.prototype.ucmp = function ucmp(num) { 18716 if (this.length > num.length) return 1; 18717 if (this.length < num.length) return -1; 18718 var res = 0; 18719 for (var i = this.length - 1; i >= 0; i--) { 18720 var a = this.words[i] | 0; 18721 var b = num.words[i] | 0; 18722 if (a === b) continue; 18723 if (a < b) res = -1; 18724 else if (a > b) res = 1; 18725 break; 18726 } 18727 return res; 18728 }; 18729 BN.prototype.gtn = function gtn(num) { 18730 return this.cmpn(num) === 1; 18731 }; 18732 BN.prototype.gt = function gt(num) { 18733 return this.cmp(num) === 1; 18734 }; 18735 BN.prototype.gten = function gten(num) { 18736 return this.cmpn(num) >= 0; 18737 }; 18738 BN.prototype.gte = function gte(num) { 18739 return this.cmp(num) >= 0; 18740 }; 18741 BN.prototype.ltn = function ltn(num) { 18742 return this.cmpn(num) === -1; 18743 }; 18744 BN.prototype.lt = function lt(num) { 18745 return this.cmp(num) === -1; 18746 }; 18747 BN.prototype.lten = function lten(num) { 18748 return this.cmpn(num) <= 0; 18749 }; 18750 BN.prototype.lte = function lte(num) { 18751 return this.cmp(num) <= 0; 18752 }; 18753 BN.prototype.eqn = function eqn(num) { 18754 return this.cmpn(num) === 0; 18755 }; 18756 BN.prototype.eq = function eq(num) { 18757 return this.cmp(num) === 0; 18758 }; 18759 BN.red = function red(num) { 18760 return new Red(num); 18761 }; 18762 BN.prototype.toRed = function toRed(ctx) { 18763 assert(!this.red, "Already a number in reduction context"); 18764 assert(this.negative === 0, "red works only with positives"); 18765 return ctx.convertTo(this)._forceRed(ctx); 18766 }; 18767 BN.prototype.fromRed = function fromRed() { 18768 assert(this.red, "fromRed works only with numbers in reduction context"); 18769 return this.red.convertFrom(this); 18770 }; 18771 BN.prototype._forceRed = function _forceRed(ctx) { 18772 this.red = ctx; 18773 return this; 18774 }; 18775 BN.prototype.forceRed = function forceRed(ctx) { 18776 assert(!this.red, "Already a number in reduction context"); 18777 return this._forceRed(ctx); 18778 }; 18779 BN.prototype.redAdd = function redAdd(num) { 18780 assert(this.red, "redAdd works only with red numbers"); 18781 return this.red.add(this, num); 18782 }; 18783 BN.prototype.redIAdd = function redIAdd(num) { 18784 assert(this.red, "redIAdd works only with red numbers"); 18785 return this.red.iadd(this, num); 18786 }; 18787 BN.prototype.redSub = function redSub(num) { 18788 assert(this.red, "redSub works only with red numbers"); 18789 return this.red.sub(this, num); 18790 }; 18791 BN.prototype.redISub = function redISub(num) { 18792 assert(this.red, "redISub works only with red numbers"); 18793 return this.red.isub(this, num); 18794 }; 18795 BN.prototype.redShl = function redShl(num) { 18796 assert(this.red, "redShl works only with red numbers"); 18797 return this.red.shl(this, num); 18798 }; 18799 BN.prototype.redMul = function redMul(num) { 18800 assert(this.red, "redMul works only with red numbers"); 18801 this.red._verify2(this, num); 18802 return this.red.mul(this, num); 18803 }; 18804 BN.prototype.redIMul = function redIMul(num) { 18805 assert(this.red, "redMul works only with red numbers"); 18806 this.red._verify2(this, num); 18807 return this.red.imul(this, num); 18808 }; 18809 BN.prototype.redSqr = function redSqr() { 18810 assert(this.red, "redSqr works only with red numbers"); 18811 this.red._verify1(this); 18812 return this.red.sqr(this); 18813 }; 18814 BN.prototype.redISqr = function redISqr() { 18815 assert(this.red, "redISqr works only with red numbers"); 18816 this.red._verify1(this); 18817 return this.red.isqr(this); 18818 }; 18819 BN.prototype.redSqrt = function redSqrt() { 18820 assert(this.red, "redSqrt works only with red numbers"); 18821 this.red._verify1(this); 18822 return this.red.sqrt(this); 18823 }; 18824 BN.prototype.redInvm = function redInvm() { 18825 assert(this.red, "redInvm works only with red numbers"); 18826 this.red._verify1(this); 18827 return this.red.invm(this); 18828 }; 18829 BN.prototype.redNeg = function redNeg() { 18830 assert(this.red, "redNeg works only with red numbers"); 18831 this.red._verify1(this); 18832 return this.red.neg(this); 18833 }; 18834 BN.prototype.redPow = function redPow(num) { 18835 assert(this.red && !num.red, "redPow(normalNum)"); 18836 this.red._verify1(this); 18837 return this.red.pow(this, num); 18838 }; 18839 var primes = { 18840 k256: null, 18841 p224: null, 18842 p192: null, 18843 p25519: null 18844 }; 18845 function MPrime(name, p) { 18846 this.name = name; 18847 this.p = new BN(p, 16); 18848 this.n = this.p.bitLength(); 18849 this.k = new BN(1).iushln(this.n).isub(this.p); 18850 this.tmp = this._tmp(); 18851 } 18852 MPrime.prototype._tmp = function _tmp() { 18853 var tmp = new BN(null); 18854 tmp.words = new Array(Math.ceil(this.n / 13)); 18855 return tmp; 18856 }; 18857 MPrime.prototype.ireduce = function ireduce(num) { 18858 var r = num; 18859 var rlen; 18860 do { 18861 this.split(r, this.tmp); 18862 r = this.imulK(r); 18863 r = r.iadd(this.tmp); 18864 rlen = r.bitLength(); 18865 } while (rlen > this.n); 18866 var cmp = rlen < this.n ? -1 : r.ucmp(this.p); 18867 if (cmp === 0) { 18868 r.words[0] = 0; 18869 r.length = 1; 18870 } else if (cmp > 0) r.isub(this.p); 18871 else if (r.strip !== void 0) r.strip(); 18872 else r._strip(); 18873 return r; 18874 }; 18875 MPrime.prototype.split = function split(input, out) { 18876 input.iushrn(this.n, 0, out); 18877 }; 18878 MPrime.prototype.imulK = function imulK(num) { 18879 return num.imul(this.k); 18880 }; 18881 function K256() { 18882 MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); 18883 } 18884 inherits(K256, MPrime); 18885 K256.prototype.split = function split(input, output) { 18886 var mask = 4194303; 18887 var outLen = Math.min(input.length, 9); 18888 for (var i = 0; i < outLen; i++) output.words[i] = input.words[i]; 18889 output.length = outLen; 18890 if (input.length <= 9) { 18891 input.words[0] = 0; 18892 input.length = 1; 18893 return; 18894 } 18895 var prev = input.words[9]; 18896 output.words[output.length++] = prev & mask; 18897 for (i = 10; i < input.length; i++) { 18898 var next = input.words[i] | 0; 18899 input.words[i - 10] = (next & mask) << 4 | prev >>> 22; 18900 prev = next; 18901 } 18902 prev >>>= 22; 18903 input.words[i - 10] = prev; 18904 if (prev === 0 && input.length > 10) input.length -= 10; 18905 else input.length -= 9; 18906 }; 18907 K256.prototype.imulK = function imulK(num) { 18908 num.words[num.length] = 0; 18909 num.words[num.length + 1] = 0; 18910 num.length += 2; 18911 var lo = 0; 18912 for (var i = 0; i < num.length; i++) { 18913 var w = num.words[i] | 0; 18914 lo += w * 977; 18915 num.words[i] = lo & 67108863; 18916 lo = w * 64 + (lo / 67108864 | 0); 18917 } 18918 if (num.words[num.length - 1] === 0) { 18919 num.length--; 18920 if (num.words[num.length - 1] === 0) num.length--; 18921 } 18922 return num; 18923 }; 18924 function P224() { 18925 MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); 18926 } 18927 inherits(P224, MPrime); 18928 function P192() { 18929 MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); 18930 } 18931 inherits(P192, MPrime); 18932 function P25519() { 18933 MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); 18934 } 18935 inherits(P25519, MPrime); 18936 P25519.prototype.imulK = function imulK(num) { 18937 var carry = 0; 18938 for (var i = 0; i < num.length; i++) { 18939 var hi = (num.words[i] | 0) * 19 + carry; 18940 var lo = hi & 67108863; 18941 hi >>>= 26; 18942 num.words[i] = lo; 18943 carry = hi; 18944 } 18945 if (carry !== 0) num.words[num.length++] = carry; 18946 return num; 18947 }; 18948 BN._prime = function prime(name) { 18949 if (primes[name]) return primes[name]; 18950 var prime; 18951 if (name === "k256") prime = new K256(); 18952 else if (name === "p224") prime = new P224(); 18953 else if (name === "p192") prime = new P192(); 18954 else if (name === "p25519") prime = new P25519(); 18955 else throw new Error("Unknown prime " + name); 18956 primes[name] = prime; 18957 return prime; 18958 }; 18959 function Red(m) { 18960 if (typeof m === "string") { 18961 var prime = BN._prime(m); 18962 this.m = prime.p; 18963 this.prime = prime; 18964 } else { 18965 assert(m.gtn(1), "modulus must be greater than 1"); 18966 this.m = m; 18967 this.prime = null; 18968 } 18969 } 18970 Red.prototype._verify1 = function _verify1(a) { 18971 assert(a.negative === 0, "red works only with positives"); 18972 assert(a.red, "red works only with red numbers"); 18973 }; 18974 Red.prototype._verify2 = function _verify2(a, b) { 18975 assert((a.negative | b.negative) === 0, "red works only with positives"); 18976 assert(a.red && a.red === b.red, "red works only with red numbers"); 18977 }; 18978 Red.prototype.imod = function imod(a) { 18979 if (this.prime) return this.prime.ireduce(a)._forceRed(this); 18980 move(a, a.umod(this.m)._forceRed(this)); 18981 return a; 18982 }; 18983 Red.prototype.neg = function neg(a) { 18984 if (a.isZero()) return a.clone(); 18985 return this.m.sub(a)._forceRed(this); 18986 }; 18987 Red.prototype.add = function add(a, b) { 18988 this._verify2(a, b); 18989 var res = a.add(b); 18990 if (res.cmp(this.m) >= 0) res.isub(this.m); 18991 return res._forceRed(this); 18992 }; 18993 Red.prototype.iadd = function iadd(a, b) { 18994 this._verify2(a, b); 18995 var res = a.iadd(b); 18996 if (res.cmp(this.m) >= 0) res.isub(this.m); 18997 return res; 18998 }; 18999 Red.prototype.sub = function sub(a, b) { 19000 this._verify2(a, b); 19001 var res = a.sub(b); 19002 if (res.cmpn(0) < 0) res.iadd(this.m); 19003 return res._forceRed(this); 19004 }; 19005 Red.prototype.isub = function isub(a, b) { 19006 this._verify2(a, b); 19007 var res = a.isub(b); 19008 if (res.cmpn(0) < 0) res.iadd(this.m); 19009 return res; 19010 }; 19011 Red.prototype.shl = function shl(a, num) { 19012 this._verify1(a); 19013 return this.imod(a.ushln(num)); 19014 }; 19015 Red.prototype.imul = function imul(a, b) { 19016 this._verify2(a, b); 19017 return this.imod(a.imul(b)); 19018 }; 19019 Red.prototype.mul = function mul(a, b) { 19020 this._verify2(a, b); 19021 return this.imod(a.mul(b)); 19022 }; 19023 Red.prototype.isqr = function isqr(a) { 19024 return this.imul(a, a.clone()); 19025 }; 19026 Red.prototype.sqr = function sqr(a) { 19027 return this.mul(a, a); 19028 }; 19029 Red.prototype.sqrt = function sqrt(a) { 19030 if (a.isZero()) return a.clone(); 19031 var mod3 = this.m.andln(3); 19032 assert(mod3 % 2 === 1); 19033 if (mod3 === 3) { 19034 var pow = this.m.add(new BN(1)).iushrn(2); 19035 return this.pow(a, pow); 19036 } 19037 var q = this.m.subn(1); 19038 var s = 0; 19039 while (!q.isZero() && q.andln(1) === 0) { 19040 s++; 19041 q.iushrn(1); 19042 } 19043 assert(!q.isZero()); 19044 var one = new BN(1).toRed(this); 19045 var nOne = one.redNeg(); 19046 var lpow = this.m.subn(1).iushrn(1); 19047 var z = this.m.bitLength(); 19048 z = new BN(2 * z * z).toRed(this); 19049 while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne); 19050 var c = this.pow(z, q); 19051 var r = this.pow(a, q.addn(1).iushrn(1)); 19052 var t = this.pow(a, q); 19053 var m = s; 19054 while (t.cmp(one) !== 0) { 19055 var tmp = t; 19056 for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr(); 19057 assert(i < m); 19058 var b = this.pow(c, new BN(1).iushln(m - i - 1)); 19059 r = r.redMul(b); 19060 c = b.redSqr(); 19061 t = t.redMul(c); 19062 m = i; 19063 } 19064 return r; 19065 }; 19066 Red.prototype.invm = function invm(a) { 19067 var inv = a._invmp(this.m); 19068 if (inv.negative !== 0) { 19069 inv.negative = 0; 19070 return this.imod(inv).redNeg(); 19071 } else return this.imod(inv); 19072 }; 19073 Red.prototype.pow = function pow(a, num) { 19074 if (num.isZero()) return new BN(1).toRed(this); 19075 if (num.cmpn(1) === 0) return a.clone(); 19076 var windowSize = 4; 19077 var wnd = new Array(1 << windowSize); 19078 wnd[0] = new BN(1).toRed(this); 19079 wnd[1] = a; 19080 for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a); 19081 var res = wnd[0]; 19082 var current = 0; 19083 var currentLen = 0; 19084 var start = num.bitLength() % 26; 19085 if (start === 0) start = 26; 19086 for (i = num.length - 1; i >= 0; i--) { 19087 var word = num.words[i]; 19088 for (var j = start - 1; j >= 0; j--) { 19089 var bit = word >> j & 1; 19090 if (res !== wnd[0]) res = this.sqr(res); 19091 if (bit === 0 && current === 0) { 19092 currentLen = 0; 19093 continue; 19094 } 19095 current <<= 1; 19096 current |= bit; 19097 currentLen++; 19098 if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; 19099 res = this.mul(res, wnd[current]); 19100 currentLen = 0; 19101 current = 0; 19102 } 19103 start = 26; 19104 } 19105 return res; 19106 }; 19107 Red.prototype.convertTo = function convertTo(num) { 19108 var r = num.umod(this.m); 19109 return r === num ? r.clone() : r; 19110 }; 19111 Red.prototype.convertFrom = function convertFrom(num) { 19112 var res = num.clone(); 19113 res.red = null; 19114 return res; 19115 }; 19116 BN.mont = function mont(num) { 19117 return new Mont(num); 19118 }; 19119 function Mont(m) { 19120 Red.call(this, m); 19121 this.shift = this.m.bitLength(); 19122 if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26; 19123 this.r = new BN(1).iushln(this.shift); 19124 this.r2 = this.imod(this.r.sqr()); 19125 this.rinv = this.r._invmp(this.m); 19126 this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); 19127 this.minv = this.minv.umod(this.r); 19128 this.minv = this.r.sub(this.minv); 19129 } 19130 inherits(Mont, Red); 19131 Mont.prototype.convertTo = function convertTo(num) { 19132 return this.imod(num.ushln(this.shift)); 19133 }; 19134 Mont.prototype.convertFrom = function convertFrom(num) { 19135 var r = this.imod(num.mul(this.rinv)); 19136 r.red = null; 19137 return r; 19138 }; 19139 Mont.prototype.imul = function imul(a, b) { 19140 if (a.isZero() || b.isZero()) { 19141 a.words[0] = 0; 19142 a.length = 1; 19143 return a; 19144 } 19145 var t = a.imul(b); 19146 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 19147 var u = t.isub(c).iushrn(this.shift); 19148 var res = u; 19149 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 19150 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 19151 return res._forceRed(this); 19152 }; 19153 Mont.prototype.mul = function mul(a, b) { 19154 if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); 19155 var t = a.mul(b); 19156 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 19157 var u = t.isub(c).iushrn(this.shift); 19158 var res = u; 19159 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 19160 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 19161 return res._forceRed(this); 19162 }; 19163 Mont.prototype.invm = function invm(a) { 19164 return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this); 19165 }; 19166 })(typeof module === "undefined" || module, exports); 19167})); 19168//#endregion 19169//#region node_modules/browserify-rsa/index.js 19170var require_browserify_rsa = /* @__PURE__ */ __commonJSMin(((exports, module) => { 19171 var Buffer = require_buffer$1().Buffer; 19172 var BN = require_bn$2(); 19173 var randomBytes = require_browser$12(); 19174 function blind(priv) { 19175 var r = getr(priv); 19176 return { 19177 blinder: r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed(), 19178 unblinder: r.invm(priv.modulus) 19179 }; 19180 } 19181 function getr(priv) { 19182 var len = priv.modulus.byteLength(); 19183 var r; 19184 do 19185 r = new BN(randomBytes(len)); 19186 while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)); 19187 return r; 19188 } 19189 function crt(msg, priv) { 19190 var blinds = blind(priv); 19191 var len = priv.modulus.byteLength(); 19192 var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus); 19193 var c1 = blinded.toRed(BN.mont(priv.prime1)); 19194 var c2 = blinded.toRed(BN.mont(priv.prime2)); 19195 var qinv = priv.coefficient; 19196 var p = priv.prime1; 19197 var q = priv.prime2; 19198 var m1 = c1.redPow(priv.exponent1).fromRed(); 19199 var m2 = c2.redPow(priv.exponent2).fromRed(); 19200 var h = m1.isub(m2).imul(qinv).umod(p).imul(q); 19201 return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, "be", len); 19202 } 19203 crt.getr = getr; 19204 module.exports = crt; 19205})); 19206//#endregion 19207//#region node_modules/elliptic/package.json 19208var package_exports = /* @__PURE__ */ __exportAll({ 19209 author: () => author, 19210 bugs: () => bugs, 19211 default: () => package_default, 19212 dependencies: () => dependencies, 19213 description: () => description, 19214 devDependencies: () => devDependencies, 19215 files: () => files, 19216 homepage: () => homepage, 19217 keywords: () => keywords, 19218 license: () => "MIT", 19219 main: () => main, 19220 name: () => name, 19221 repository: () => repository, 19222 scripts: () => scripts, 19223 version: () => version$1 19224}), name, version$1, description, main, files, scripts, repository, keywords, author, bugs, homepage, devDependencies, dependencies, package_default; 19225var init_package = __esmMin((() => { 19226 name = "elliptic"; 19227 version$1 = "6.6.1"; 19228 description = "EC cryptography"; 19229 main = "lib/elliptic.js"; 19230 files = ["lib"]; 19231 scripts = { 19232 "lint": "eslint lib test", 19233 "lint:fix": "npm run lint -- --fix", 19234 "unit": "istanbul test _mocha --reporter=spec test/index.js", 19235 "test": "npm run lint && npm run unit", 19236 "version": "grunt dist && git add dist/" 19237 }; 19238 repository = { 19239 "type": "git", 19240 "url": "[email protected]:indutny/elliptic" 19241 }; 19242 keywords = [ 19243 "EC", 19244 "Elliptic", 19245 "curve", 19246 "Cryptography" 19247 ]; 19248 author = "Fedor Indutny <[email protected]>"; 19249 bugs = { "url": "https://github.com/indutny/elliptic/issues" }; 19250 homepage = "https://github.com/indutny/elliptic"; 19251 devDependencies = { 19252 "brfs": "^2.0.2", 19253 "coveralls": "^3.1.0", 19254 "eslint": "^7.6.0", 19255 "grunt": "^1.2.1", 19256 "grunt-browserify": "^5.3.0", 19257 "grunt-cli": "^1.3.2", 19258 "grunt-contrib-connect": "^3.0.0", 19259 "grunt-contrib-copy": "^1.0.0", 19260 "grunt-contrib-uglify": "^5.0.0", 19261 "grunt-mocha-istanbul": "^5.0.2", 19262 "grunt-saucelabs": "^9.0.1", 19263 "istanbul": "^0.4.5", 19264 "mocha": "^8.0.1" 19265 }; 19266 dependencies = { 19267 "bn.js": "^4.11.9", 19268 "brorand": "^1.1.0", 19269 "hash.js": "^1.0.0", 19270 "hmac-drbg": "^1.0.1", 19271 "inherits": "^2.0.4", 19272 "minimalistic-assert": "^1.0.1", 19273 "minimalistic-crypto-utils": "^1.0.1" 19274 }; 19275 package_default = { 19276 name, 19277 version: version$1, 19278 description, 19279 main, 19280 files, 19281 scripts, 19282 repository, 19283 keywords, 19284 author, 19285 license: "MIT", 19286 bugs, 19287 homepage, 19288 devDependencies, 19289 dependencies 19290 }; 19291})); 19292//#endregion 19293//#region node_modules/elliptic/node_modules/bn.js/lib/bn.js 19294var require_bn$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 19295 (function(module$2, exports$6) { 19296 "use strict"; 19297 function assert(val, msg) { 19298 if (!val) throw new Error(msg || "Assertion failed"); 19299 } 19300 function inherits(ctor, superCtor) { 19301 ctor.super_ = superCtor; 19302 var TempCtor = function() {}; 19303 TempCtor.prototype = superCtor.prototype; 19304 ctor.prototype = new TempCtor(); 19305 ctor.prototype.constructor = ctor; 19306 } 19307 function BN(number, base, endian) { 19308 if (BN.isBN(number)) return number; 19309 this.negative = 0; 19310 this.words = null; 19311 this.length = 0; 19312 this.red = null; 19313 if (number !== null) { 19314 if (base === "le" || base === "be") { 19315 endian = base; 19316 base = 10; 19317 } 19318 this._init(number || 0, base || 10, endian || "be"); 19319 } 19320 } 19321 if (typeof module$2 === "object") module$2.exports = BN; 19322 else exports$6.BN = BN; 19323 BN.BN = BN; 19324 BN.wordSize = 26; 19325 var Buffer; 19326 try { 19327 if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer = window.Buffer; 19328 else Buffer = require_buffer$1().Buffer; 19329 } catch (e) {} 19330 BN.isBN = function isBN(num) { 19331 if (num instanceof BN) return true; 19332 return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); 19333 }; 19334 BN.max = function max(left, right) { 19335 if (left.cmp(right) > 0) return left; 19336 return right; 19337 }; 19338 BN.min = function min(left, right) { 19339 if (left.cmp(right) < 0) return left; 19340 return right; 19341 }; 19342 BN.prototype._init = function init(number, base, endian) { 19343 if (typeof number === "number") return this._initNumber(number, base, endian); 19344 if (typeof number === "object") return this._initArray(number, base, endian); 19345 if (base === "hex") base = 16; 19346 assert(base === (base | 0) && base >= 2 && base <= 36); 19347 number = number.toString().replace(/\s+/g, ""); 19348 var start = 0; 19349 if (number[0] === "-") { 19350 start++; 19351 this.negative = 1; 19352 } 19353 if (start < number.length) if (base === 16) this._parseHex(number, start, endian); 19354 else { 19355 this._parseBase(number, base, start); 19356 if (endian === "le") this._initArray(this.toArray(), base, endian); 19357 } 19358 }; 19359 BN.prototype._initNumber = function _initNumber(number, base, endian) { 19360 if (number < 0) { 19361 this.negative = 1; 19362 number = -number; 19363 } 19364 if (number < 67108864) { 19365 this.words = [number & 67108863]; 19366 this.length = 1; 19367 } else if (number < 4503599627370496) { 19368 this.words = [number & 67108863, number / 67108864 & 67108863]; 19369 this.length = 2; 19370 } else { 19371 assert(number < 9007199254740992); 19372 this.words = [ 19373 number & 67108863, 19374 number / 67108864 & 67108863, 19375 1 19376 ]; 19377 this.length = 3; 19378 } 19379 if (endian !== "le") return; 19380 this._initArray(this.toArray(), base, endian); 19381 }; 19382 BN.prototype._initArray = function _initArray(number, base, endian) { 19383 assert(typeof number.length === "number"); 19384 if (number.length <= 0) { 19385 this.words = [0]; 19386 this.length = 1; 19387 return this; 19388 } 19389 this.length = Math.ceil(number.length / 3); 19390 this.words = new Array(this.length); 19391 for (var i = 0; i < this.length; i++) this.words[i] = 0; 19392 var j, w; 19393 var off = 0; 19394 if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) { 19395 w = number[i] | number[i - 1] << 8 | number[i - 2] << 16; 19396 this.words[j] |= w << off & 67108863; 19397 this.words[j + 1] = w >>> 26 - off & 67108863; 19398 off += 24; 19399 if (off >= 26) { 19400 off -= 26; 19401 j++; 19402 } 19403 } 19404 else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) { 19405 w = number[i] | number[i + 1] << 8 | number[i + 2] << 16; 19406 this.words[j] |= w << off & 67108863; 19407 this.words[j + 1] = w >>> 26 - off & 67108863; 19408 off += 24; 19409 if (off >= 26) { 19410 off -= 26; 19411 j++; 19412 } 19413 } 19414 return this.strip(); 19415 }; 19416 function parseHex4Bits(string, index) { 19417 var c = string.charCodeAt(index); 19418 if (c >= 65 && c <= 70) return c - 55; 19419 else if (c >= 97 && c <= 102) return c - 87; 19420 else return c - 48 & 15; 19421 } 19422 function parseHexByte(string, lowerBound, index) { 19423 var r = parseHex4Bits(string, index); 19424 if (index - 1 >= lowerBound) r |= parseHex4Bits(string, index - 1) << 4; 19425 return r; 19426 } 19427 BN.prototype._parseHex = function _parseHex(number, start, endian) { 19428 this.length = Math.ceil((number.length - start) / 6); 19429 this.words = new Array(this.length); 19430 for (var i = 0; i < this.length; i++) this.words[i] = 0; 19431 var off = 0; 19432 var j = 0; 19433 var w; 19434 if (endian === "be") for (i = number.length - 1; i >= start; i -= 2) { 19435 w = parseHexByte(number, start, i) << off; 19436 this.words[j] |= w & 67108863; 19437 if (off >= 18) { 19438 off -= 18; 19439 j += 1; 19440 this.words[j] |= w >>> 26; 19441 } else off += 8; 19442 } 19443 else for (i = (number.length - start) % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { 19444 w = parseHexByte(number, start, i) << off; 19445 this.words[j] |= w & 67108863; 19446 if (off >= 18) { 19447 off -= 18; 19448 j += 1; 19449 this.words[j] |= w >>> 26; 19450 } else off += 8; 19451 } 19452 this.strip(); 19453 }; 19454 function parseBase(str, start, end, mul) { 19455 var r = 0; 19456 var len = Math.min(str.length, end); 19457 for (var i = start; i < len; i++) { 19458 var c = str.charCodeAt(i) - 48; 19459 r *= mul; 19460 if (c >= 49) r += c - 49 + 10; 19461 else if (c >= 17) r += c - 17 + 10; 19462 else r += c; 19463 } 19464 return r; 19465 } 19466 BN.prototype._parseBase = function _parseBase(number, base, start) { 19467 this.words = [0]; 19468 this.length = 1; 19469 for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++; 19470 limbLen--; 19471 limbPow = limbPow / base | 0; 19472 var total = number.length - start; 19473 var mod = total % limbLen; 19474 var end = Math.min(total, total - mod) + start; 19475 var word = 0; 19476 for (var i = start; i < end; i += limbLen) { 19477 word = parseBase(number, i, i + limbLen, base); 19478 this.imuln(limbPow); 19479 if (this.words[0] + word < 67108864) this.words[0] += word; 19480 else this._iaddn(word); 19481 } 19482 if (mod !== 0) { 19483 var pow = 1; 19484 word = parseBase(number, i, number.length, base); 19485 for (i = 0; i < mod; i++) pow *= base; 19486 this.imuln(pow); 19487 if (this.words[0] + word < 67108864) this.words[0] += word; 19488 else this._iaddn(word); 19489 } 19490 this.strip(); 19491 }; 19492 BN.prototype.copy = function copy(dest) { 19493 dest.words = new Array(this.length); 19494 for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i]; 19495 dest.length = this.length; 19496 dest.negative = this.negative; 19497 dest.red = this.red; 19498 }; 19499 BN.prototype.clone = function clone() { 19500 var r = new BN(null); 19501 this.copy(r); 19502 return r; 19503 }; 19504 BN.prototype._expand = function _expand(size) { 19505 while (this.length < size) this.words[this.length++] = 0; 19506 return this; 19507 }; 19508 BN.prototype.strip = function strip() { 19509 while (this.length > 1 && this.words[this.length - 1] === 0) this.length--; 19510 return this._normSign(); 19511 }; 19512 BN.prototype._normSign = function _normSign() { 19513 if (this.length === 1 && this.words[0] === 0) this.negative = 0; 19514 return this; 19515 }; 19516 BN.prototype.inspect = function inspect() { 19517 return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"; 19518 }; 19519 var zeros = [ 19520 "", 19521 "0", 19522 "00", 19523 "000", 19524 "0000", 19525 "00000", 19526 "000000", 19527 "0000000", 19528 "00000000", 19529 "000000000", 19530 "0000000000", 19531 "00000000000", 19532 "000000000000", 19533 "0000000000000", 19534 "00000000000000", 19535 "000000000000000", 19536 "0000000000000000", 19537 "00000000000000000", 19538 "000000000000000000", 19539 "0000000000000000000", 19540 "00000000000000000000", 19541 "000000000000000000000", 19542 "0000000000000000000000", 19543 "00000000000000000000000", 19544 "000000000000000000000000", 19545 "0000000000000000000000000" 19546 ]; 19547 var groupSizes = [ 19548 0, 19549 0, 19550 25, 19551 16, 19552 12, 19553 11, 19554 10, 19555 9, 19556 8, 19557 8, 19558 7, 19559 7, 19560 7, 19561 7, 19562 6, 19563 6, 19564 6, 19565 6, 19566 6, 19567 6, 19568 6, 19569 5, 19570 5, 19571 5, 19572 5, 19573 5, 19574 5, 19575 5, 19576 5, 19577 5, 19578 5, 19579 5, 19580 5, 19581 5, 19582 5, 19583 5, 19584 5 19585 ]; 19586 var groupBases = [ 19587 0, 19588 0, 19589 33554432, 19590 43046721, 19591 16777216, 19592 48828125, 19593 60466176, 19594 40353607, 19595 16777216, 19596 43046721, 19597 1e7, 19598 19487171, 19599 35831808, 19600 62748517, 19601 7529536, 19602 11390625, 19603 16777216, 19604 24137569, 19605 34012224, 19606 47045881, 19607 64e6, 19608 4084101, 19609 5153632, 19610 6436343, 19611 7962624, 19612 9765625, 19613 11881376, 19614 14348907, 19615 17210368, 19616 20511149, 19617 243e5, 19618 28629151, 19619 33554432, 19620 39135393, 19621 45435424, 19622 52521875, 19623 60466176 19624 ]; 19625 BN.prototype.toString = function toString(base, padding) { 19626 base = base || 10; 19627 padding = padding | 0 || 1; 19628 var out; 19629 if (base === 16 || base === "hex") { 19630 out = ""; 19631 var off = 0; 19632 var carry = 0; 19633 for (var i = 0; i < this.length; i++) { 19634 var w = this.words[i]; 19635 var word = ((w << off | carry) & 16777215).toString(16); 19636 carry = w >>> 24 - off & 16777215; 19637 if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out; 19638 else out = word + out; 19639 off += 2; 19640 if (off >= 26) { 19641 off -= 26; 19642 i--; 19643 } 19644 } 19645 if (carry !== 0) out = carry.toString(16) + out; 19646 while (out.length % padding !== 0) out = "0" + out; 19647 if (this.negative !== 0) out = "-" + out; 19648 return out; 19649 } 19650 if (base === (base | 0) && base >= 2 && base <= 36) { 19651 var groupSize = groupSizes[base]; 19652 var groupBase = groupBases[base]; 19653 out = ""; 19654 var c = this.clone(); 19655 c.negative = 0; 19656 while (!c.isZero()) { 19657 var r = c.modn(groupBase).toString(base); 19658 c = c.idivn(groupBase); 19659 if (!c.isZero()) out = zeros[groupSize - r.length] + r + out; 19660 else out = r + out; 19661 } 19662 if (this.isZero()) out = "0" + out; 19663 while (out.length % padding !== 0) out = "0" + out; 19664 if (this.negative !== 0) out = "-" + out; 19665 return out; 19666 } 19667 assert(false, "Base should be between 2 and 36"); 19668 }; 19669 BN.prototype.toNumber = function toNumber() { 19670 var ret = this.words[0]; 19671 if (this.length === 2) ret += this.words[1] * 67108864; 19672 else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864; 19673 else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits"); 19674 return this.negative !== 0 ? -ret : ret; 19675 }; 19676 BN.prototype.toJSON = function toJSON() { 19677 return this.toString(16); 19678 }; 19679 BN.prototype.toBuffer = function toBuffer(endian, length) { 19680 assert(typeof Buffer !== "undefined"); 19681 return this.toArrayLike(Buffer, endian, length); 19682 }; 19683 BN.prototype.toArray = function toArray(endian, length) { 19684 return this.toArrayLike(Array, endian, length); 19685 }; 19686 BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { 19687 var byteLength = this.byteLength(); 19688 var reqLength = length || Math.max(1, byteLength); 19689 assert(byteLength <= reqLength, "byte array longer than desired length"); 19690 assert(reqLength > 0, "Requested array length <= 0"); 19691 this.strip(); 19692 var littleEndian = endian === "le"; 19693 var res = new ArrayType(reqLength); 19694 var b, i; 19695 var q = this.clone(); 19696 if (!littleEndian) { 19697 for (i = 0; i < reqLength - byteLength; i++) res[i] = 0; 19698 for (i = 0; !q.isZero(); i++) { 19699 b = q.andln(255); 19700 q.iushrn(8); 19701 res[reqLength - i - 1] = b; 19702 } 19703 } else { 19704 for (i = 0; !q.isZero(); i++) { 19705 b = q.andln(255); 19706 q.iushrn(8); 19707 res[i] = b; 19708 } 19709 for (; i < reqLength; i++) res[i] = 0; 19710 } 19711 return res; 19712 }; 19713 if (Math.clz32) BN.prototype._countBits = function _countBits(w) { 19714 return 32 - Math.clz32(w); 19715 }; 19716 else BN.prototype._countBits = function _countBits(w) { 19717 var t = w; 19718 var r = 0; 19719 if (t >= 4096) { 19720 r += 13; 19721 t >>>= 13; 19722 } 19723 if (t >= 64) { 19724 r += 7; 19725 t >>>= 7; 19726 } 19727 if (t >= 8) { 19728 r += 4; 19729 t >>>= 4; 19730 } 19731 if (t >= 2) { 19732 r += 2; 19733 t >>>= 2; 19734 } 19735 return r + t; 19736 }; 19737 BN.prototype._zeroBits = function _zeroBits(w) { 19738 if (w === 0) return 26; 19739 var t = w; 19740 var r = 0; 19741 if ((t & 8191) === 0) { 19742 r += 13; 19743 t >>>= 13; 19744 } 19745 if ((t & 127) === 0) { 19746 r += 7; 19747 t >>>= 7; 19748 } 19749 if ((t & 15) === 0) { 19750 r += 4; 19751 t >>>= 4; 19752 } 19753 if ((t & 3) === 0) { 19754 r += 2; 19755 t >>>= 2; 19756 } 19757 if ((t & 1) === 0) r++; 19758 return r; 19759 }; 19760 BN.prototype.bitLength = function bitLength() { 19761 var w = this.words[this.length - 1]; 19762 var hi = this._countBits(w); 19763 return (this.length - 1) * 26 + hi; 19764 }; 19765 function toBitArray(num) { 19766 var w = new Array(num.bitLength()); 19767 for (var bit = 0; bit < w.length; bit++) { 19768 var off = bit / 26 | 0; 19769 var wbit = bit % 26; 19770 w[bit] = (num.words[off] & 1 << wbit) >>> wbit; 19771 } 19772 return w; 19773 } 19774 BN.prototype.zeroBits = function zeroBits() { 19775 if (this.isZero()) return 0; 19776 var r = 0; 19777 for (var i = 0; i < this.length; i++) { 19778 var b = this._zeroBits(this.words[i]); 19779 r += b; 19780 if (b !== 26) break; 19781 } 19782 return r; 19783 }; 19784 BN.prototype.byteLength = function byteLength() { 19785 return Math.ceil(this.bitLength() / 8); 19786 }; 19787 BN.prototype.toTwos = function toTwos(width) { 19788 if (this.negative !== 0) return this.abs().inotn(width).iaddn(1); 19789 return this.clone(); 19790 }; 19791 BN.prototype.fromTwos = function fromTwos(width) { 19792 if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg(); 19793 return this.clone(); 19794 }; 19795 BN.prototype.isNeg = function isNeg() { 19796 return this.negative !== 0; 19797 }; 19798 BN.prototype.neg = function neg() { 19799 return this.clone().ineg(); 19800 }; 19801 BN.prototype.ineg = function ineg() { 19802 if (!this.isZero()) this.negative ^= 1; 19803 return this; 19804 }; 19805 BN.prototype.iuor = function iuor(num) { 19806 while (this.length < num.length) this.words[this.length++] = 0; 19807 for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i]; 19808 return this.strip(); 19809 }; 19810 BN.prototype.ior = function ior(num) { 19811 assert((this.negative | num.negative) === 0); 19812 return this.iuor(num); 19813 }; 19814 BN.prototype.or = function or(num) { 19815 if (this.length > num.length) return this.clone().ior(num); 19816 return num.clone().ior(this); 19817 }; 19818 BN.prototype.uor = function uor(num) { 19819 if (this.length > num.length) return this.clone().iuor(num); 19820 return num.clone().iuor(this); 19821 }; 19822 BN.prototype.iuand = function iuand(num) { 19823 var b; 19824 if (this.length > num.length) b = num; 19825 else b = this; 19826 for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i]; 19827 this.length = b.length; 19828 return this.strip(); 19829 }; 19830 BN.prototype.iand = function iand(num) { 19831 assert((this.negative | num.negative) === 0); 19832 return this.iuand(num); 19833 }; 19834 BN.prototype.and = function and(num) { 19835 if (this.length > num.length) return this.clone().iand(num); 19836 return num.clone().iand(this); 19837 }; 19838 BN.prototype.uand = function uand(num) { 19839 if (this.length > num.length) return this.clone().iuand(num); 19840 return num.clone().iuand(this); 19841 }; 19842 BN.prototype.iuxor = function iuxor(num) { 19843 var a; 19844 var b; 19845 if (this.length > num.length) { 19846 a = this; 19847 b = num; 19848 } else { 19849 a = num; 19850 b = this; 19851 } 19852 for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i]; 19853 if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i]; 19854 this.length = a.length; 19855 return this.strip(); 19856 }; 19857 BN.prototype.ixor = function ixor(num) { 19858 assert((this.negative | num.negative) === 0); 19859 return this.iuxor(num); 19860 }; 19861 BN.prototype.xor = function xor(num) { 19862 if (this.length > num.length) return this.clone().ixor(num); 19863 return num.clone().ixor(this); 19864 }; 19865 BN.prototype.uxor = function uxor(num) { 19866 if (this.length > num.length) return this.clone().iuxor(num); 19867 return num.clone().iuxor(this); 19868 }; 19869 BN.prototype.inotn = function inotn(width) { 19870 assert(typeof width === "number" && width >= 0); 19871 var bytesNeeded = Math.ceil(width / 26) | 0; 19872 var bitsLeft = width % 26; 19873 this._expand(bytesNeeded); 19874 if (bitsLeft > 0) bytesNeeded--; 19875 for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863; 19876 if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft; 19877 return this.strip(); 19878 }; 19879 BN.prototype.notn = function notn(width) { 19880 return this.clone().inotn(width); 19881 }; 19882 BN.prototype.setn = function setn(bit, val) { 19883 assert(typeof bit === "number" && bit >= 0); 19884 var off = bit / 26 | 0; 19885 var wbit = bit % 26; 19886 this._expand(off + 1); 19887 if (val) this.words[off] = this.words[off] | 1 << wbit; 19888 else this.words[off] = this.words[off] & ~(1 << wbit); 19889 return this.strip(); 19890 }; 19891 BN.prototype.iadd = function iadd(num) { 19892 var r; 19893 if (this.negative !== 0 && num.negative === 0) { 19894 this.negative = 0; 19895 r = this.isub(num); 19896 this.negative ^= 1; 19897 return this._normSign(); 19898 } else if (this.negative === 0 && num.negative !== 0) { 19899 num.negative = 0; 19900 r = this.isub(num); 19901 num.negative = 1; 19902 return r._normSign(); 19903 } 19904 var a, b; 19905 if (this.length > num.length) { 19906 a = this; 19907 b = num; 19908 } else { 19909 a = num; 19910 b = this; 19911 } 19912 var carry = 0; 19913 for (var i = 0; i < b.length; i++) { 19914 r = (a.words[i] | 0) + (b.words[i] | 0) + carry; 19915 this.words[i] = r & 67108863; 19916 carry = r >>> 26; 19917 } 19918 for (; carry !== 0 && i < a.length; i++) { 19919 r = (a.words[i] | 0) + carry; 19920 this.words[i] = r & 67108863; 19921 carry = r >>> 26; 19922 } 19923 this.length = a.length; 19924 if (carry !== 0) { 19925 this.words[this.length] = carry; 19926 this.length++; 19927 } else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 19928 return this; 19929 }; 19930 BN.prototype.add = function add(num) { 19931 var res; 19932 if (num.negative !== 0 && this.negative === 0) { 19933 num.negative = 0; 19934 res = this.sub(num); 19935 num.negative ^= 1; 19936 return res; 19937 } else if (num.negative === 0 && this.negative !== 0) { 19938 this.negative = 0; 19939 res = num.sub(this); 19940 this.negative = 1; 19941 return res; 19942 } 19943 if (this.length > num.length) return this.clone().iadd(num); 19944 return num.clone().iadd(this); 19945 }; 19946 BN.prototype.isub = function isub(num) { 19947 if (num.negative !== 0) { 19948 num.negative = 0; 19949 var r = this.iadd(num); 19950 num.negative = 1; 19951 return r._normSign(); 19952 } else if (this.negative !== 0) { 19953 this.negative = 0; 19954 this.iadd(num); 19955 this.negative = 1; 19956 return this._normSign(); 19957 } 19958 var cmp = this.cmp(num); 19959 if (cmp === 0) { 19960 this.negative = 0; 19961 this.length = 1; 19962 this.words[0] = 0; 19963 return this; 19964 } 19965 var a, b; 19966 if (cmp > 0) { 19967 a = this; 19968 b = num; 19969 } else { 19970 a = num; 19971 b = this; 19972 } 19973 var carry = 0; 19974 for (var i = 0; i < b.length; i++) { 19975 r = (a.words[i] | 0) - (b.words[i] | 0) + carry; 19976 carry = r >> 26; 19977 this.words[i] = r & 67108863; 19978 } 19979 for (; carry !== 0 && i < a.length; i++) { 19980 r = (a.words[i] | 0) + carry; 19981 carry = r >> 26; 19982 this.words[i] = r & 67108863; 19983 } 19984 if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 19985 this.length = Math.max(this.length, i); 19986 if (a !== this) this.negative = 1; 19987 return this.strip(); 19988 }; 19989 BN.prototype.sub = function sub(num) { 19990 return this.clone().isub(num); 19991 }; 19992 function smallMulTo(self, num, out) { 19993 out.negative = num.negative ^ self.negative; 19994 var len = self.length + num.length | 0; 19995 out.length = len; 19996 len = len - 1 | 0; 19997 var a = self.words[0] | 0; 19998 var b = num.words[0] | 0; 19999 var r = a * b; 20000 var lo = r & 67108863; 20001 var carry = r / 67108864 | 0; 20002 out.words[0] = lo; 20003 for (var k = 1; k < len; k++) { 20004 var ncarry = carry >>> 26; 20005 var rword = carry & 67108863; 20006 var maxJ = Math.min(k, num.length - 1); 20007 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 20008 var i = k - j | 0; 20009 a = self.words[i] | 0; 20010 b = num.words[j] | 0; 20011 r = a * b + rword; 20012 ncarry += r / 67108864 | 0; 20013 rword = r & 67108863; 20014 } 20015 out.words[k] = rword | 0; 20016 carry = ncarry | 0; 20017 } 20018 if (carry !== 0) out.words[k] = carry | 0; 20019 else out.length--; 20020 return out.strip(); 20021 } 20022 var comb10MulTo = function comb10MulTo(self, num, out) { 20023 var a = self.words; 20024 var b = num.words; 20025 var o = out.words; 20026 var c = 0; 20027 var lo; 20028 var mid; 20029 var hi; 20030 var a0 = a[0] | 0; 20031 var al0 = a0 & 8191; 20032 var ah0 = a0 >>> 13; 20033 var a1 = a[1] | 0; 20034 var al1 = a1 & 8191; 20035 var ah1 = a1 >>> 13; 20036 var a2 = a[2] | 0; 20037 var al2 = a2 & 8191; 20038 var ah2 = a2 >>> 13; 20039 var a3 = a[3] | 0; 20040 var al3 = a3 & 8191; 20041 var ah3 = a3 >>> 13; 20042 var a4 = a[4] | 0; 20043 var al4 = a4 & 8191; 20044 var ah4 = a4 >>> 13; 20045 var a5 = a[5] | 0; 20046 var al5 = a5 & 8191; 20047 var ah5 = a5 >>> 13; 20048 var a6 = a[6] | 0; 20049 var al6 = a6 & 8191; 20050 var ah6 = a6 >>> 13; 20051 var a7 = a[7] | 0; 20052 var al7 = a7 & 8191; 20053 var ah7 = a7 >>> 13; 20054 var a8 = a[8] | 0; 20055 var al8 = a8 & 8191; 20056 var ah8 = a8 >>> 13; 20057 var a9 = a[9] | 0; 20058 var al9 = a9 & 8191; 20059 var ah9 = a9 >>> 13; 20060 var b0 = b[0] | 0; 20061 var bl0 = b0 & 8191; 20062 var bh0 = b0 >>> 13; 20063 var b1 = b[1] | 0; 20064 var bl1 = b1 & 8191; 20065 var bh1 = b1 >>> 13; 20066 var b2 = b[2] | 0; 20067 var bl2 = b2 & 8191; 20068 var bh2 = b2 >>> 13; 20069 var b3 = b[3] | 0; 20070 var bl3 = b3 & 8191; 20071 var bh3 = b3 >>> 13; 20072 var b4 = b[4] | 0; 20073 var bl4 = b4 & 8191; 20074 var bh4 = b4 >>> 13; 20075 var b5 = b[5] | 0; 20076 var bl5 = b5 & 8191; 20077 var bh5 = b5 >>> 13; 20078 var b6 = b[6] | 0; 20079 var bl6 = b6 & 8191; 20080 var bh6 = b6 >>> 13; 20081 var b7 = b[7] | 0; 20082 var bl7 = b7 & 8191; 20083 var bh7 = b7 >>> 13; 20084 var b8 = b[8] | 0; 20085 var bl8 = b8 & 8191; 20086 var bh8 = b8 >>> 13; 20087 var b9 = b[9] | 0; 20088 var bl9 = b9 & 8191; 20089 var bh9 = b9 >>> 13; 20090 out.negative = self.negative ^ num.negative; 20091 out.length = 19; 20092 lo = Math.imul(al0, bl0); 20093 mid = Math.imul(al0, bh0); 20094 mid = mid + Math.imul(ah0, bl0) | 0; 20095 hi = Math.imul(ah0, bh0); 20096 var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20097 c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; 20098 w0 &= 67108863; 20099 lo = Math.imul(al1, bl0); 20100 mid = Math.imul(al1, bh0); 20101 mid = mid + Math.imul(ah1, bl0) | 0; 20102 hi = Math.imul(ah1, bh0); 20103 lo = lo + Math.imul(al0, bl1) | 0; 20104 mid = mid + Math.imul(al0, bh1) | 0; 20105 mid = mid + Math.imul(ah0, bl1) | 0; 20106 hi = hi + Math.imul(ah0, bh1) | 0; 20107 var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20108 c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; 20109 w1 &= 67108863; 20110 lo = Math.imul(al2, bl0); 20111 mid = Math.imul(al2, bh0); 20112 mid = mid + Math.imul(ah2, bl0) | 0; 20113 hi = Math.imul(ah2, bh0); 20114 lo = lo + Math.imul(al1, bl1) | 0; 20115 mid = mid + Math.imul(al1, bh1) | 0; 20116 mid = mid + Math.imul(ah1, bl1) | 0; 20117 hi = hi + Math.imul(ah1, bh1) | 0; 20118 lo = lo + Math.imul(al0, bl2) | 0; 20119 mid = mid + Math.imul(al0, bh2) | 0; 20120 mid = mid + Math.imul(ah0, bl2) | 0; 20121 hi = hi + Math.imul(ah0, bh2) | 0; 20122 var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20123 c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0; 20124 w2 &= 67108863; 20125 lo = Math.imul(al3, bl0); 20126 mid = Math.imul(al3, bh0); 20127 mid = mid + Math.imul(ah3, bl0) | 0; 20128 hi = Math.imul(ah3, bh0); 20129 lo = lo + Math.imul(al2, bl1) | 0; 20130 mid = mid + Math.imul(al2, bh1) | 0; 20131 mid = mid + Math.imul(ah2, bl1) | 0; 20132 hi = hi + Math.imul(ah2, bh1) | 0; 20133 lo = lo + Math.imul(al1, bl2) | 0; 20134 mid = mid + Math.imul(al1, bh2) | 0; 20135 mid = mid + Math.imul(ah1, bl2) | 0; 20136 hi = hi + Math.imul(ah1, bh2) | 0; 20137 lo = lo + Math.imul(al0, bl3) | 0; 20138 mid = mid + Math.imul(al0, bh3) | 0; 20139 mid = mid + Math.imul(ah0, bl3) | 0; 20140 hi = hi + Math.imul(ah0, bh3) | 0; 20141 var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20142 c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0; 20143 w3 &= 67108863; 20144 lo = Math.imul(al4, bl0); 20145 mid = Math.imul(al4, bh0); 20146 mid = mid + Math.imul(ah4, bl0) | 0; 20147 hi = Math.imul(ah4, bh0); 20148 lo = lo + Math.imul(al3, bl1) | 0; 20149 mid = mid + Math.imul(al3, bh1) | 0; 20150 mid = mid + Math.imul(ah3, bl1) | 0; 20151 hi = hi + Math.imul(ah3, bh1) | 0; 20152 lo = lo + Math.imul(al2, bl2) | 0; 20153 mid = mid + Math.imul(al2, bh2) | 0; 20154 mid = mid + Math.imul(ah2, bl2) | 0; 20155 hi = hi + Math.imul(ah2, bh2) | 0; 20156 lo = lo + Math.imul(al1, bl3) | 0; 20157 mid = mid + Math.imul(al1, bh3) | 0; 20158 mid = mid + Math.imul(ah1, bl3) | 0; 20159 hi = hi + Math.imul(ah1, bh3) | 0; 20160 lo = lo + Math.imul(al0, bl4) | 0; 20161 mid = mid + Math.imul(al0, bh4) | 0; 20162 mid = mid + Math.imul(ah0, bl4) | 0; 20163 hi = hi + Math.imul(ah0, bh4) | 0; 20164 var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20165 c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0; 20166 w4 &= 67108863; 20167 lo = Math.imul(al5, bl0); 20168 mid = Math.imul(al5, bh0); 20169 mid = mid + Math.imul(ah5, bl0) | 0; 20170 hi = Math.imul(ah5, bh0); 20171 lo = lo + Math.imul(al4, bl1) | 0; 20172 mid = mid + Math.imul(al4, bh1) | 0; 20173 mid = mid + Math.imul(ah4, bl1) | 0; 20174 hi = hi + Math.imul(ah4, bh1) | 0; 20175 lo = lo + Math.imul(al3, b
vendor: 6,456 bytes, lines 20175-20343
20175l2) | 0; 20176 mid = mid + Math.imul(al3, bh2) | 0; 20177 mid = mid + Math.imul(ah3, bl2) | 0; 20178 hi = hi + Math.imul(ah3, bh2) | 0; 20179 lo = lo + Math.imul(al2, bl3) | 0; 20180 mid = mid + Math.imul(al2, bh3) | 0; 20181 mid = mid + Math.imul(ah2, bl3) | 0; 20182 hi = hi + Math.imul(ah2, bh3) | 0; 20183 lo = lo + Math.imul(al1, bl4) | 0; 20184 mid = mid + Math.imul(al1, bh4) | 0; 20185 mid = mid + Math.imul(ah1, bl4) | 0; 20186 hi = hi + Math.imul(ah1, bh4) | 0; 20187 lo = lo + Math.imul(al0, bl5) | 0; 20188 mid = mid + Math.imul(al0, bh5) | 0; 20189 mid = mid + Math.imul(ah0, bl5) | 0; 20190 hi = hi + Math.imul(ah0, bh5) | 0; 20191 var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20192 c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0; 20193 w5 &= 67108863; 20194 lo = Math.imul(al6, bl0); 20195 mid = Math.imul(al6, bh0); 20196 mid = mid + Math.imul(ah6, bl0) | 0; 20197 hi = Math.imul(ah6, bh0); 20198 lo = lo + Math.imul(al5, bl1) | 0; 20199 mid = mid + Math.imul(al5, bh1) | 0; 20200 mid = mid + Math.imul(ah5, bl1) | 0; 20201 hi = hi + Math.imul(ah5, bh1) | 0; 20202 lo = lo + Math.imul(al4, bl2) | 0; 20203 mid = mid + Math.imul(al4, bh2) | 0; 20204 mid = mid + Math.imul(ah4, bl2) | 0; 20205 hi = hi + Math.imul(ah4, bh2) | 0; 20206 lo = lo + Math.imul(al3, bl3) | 0; 20207 mid = mid + Math.imul(al3, bh3) | 0; 20208 mid = mid + Math.imul(ah3, bl3) | 0; 20209 hi = hi + Math.imul(ah3, bh3) | 0; 20210 lo = lo + Math.imul(al2, bl4) | 0; 20211 mid = mid + Math.imul(al2, bh4) | 0; 20212 mid = mid + Math.imul(ah2, bl4) | 0; 20213 hi = hi + Math.imul(ah2, bh4) | 0; 20214 lo = lo + Math.imul(al1, bl5) | 0; 20215 mid = mid + Math.imul(al1, bh5) | 0; 20216 mid = mid + Math.imul(ah1, bl5) | 0; 20217 hi = hi + Math.imul(ah1, bh5) | 0; 20218 lo = lo + Math.imul(al0, bl6) | 0; 20219 mid = mid + Math.imul(al0, bh6) | 0; 20220 mid = mid + Math.imul(ah0, bl6) | 0; 20221 hi = hi + Math.imul(ah0, bh6) | 0; 20222 var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20223 c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; 20224 w6 &= 67108863; 20225 lo = Math.imul(al7, bl0); 20226 mid = Math.imul(al7, bh0); 20227 mid = mid + Math.imul(ah7, bl0) | 0; 20228 hi = Math.imul(ah7, bh0); 20229 lo = lo + Math.imul(al6, bl1) | 0; 20230 mid = mid + Math.imul(al6, bh1) | 0; 20231 mid = mid + Math.imul(ah6, bl1) | 0; 20232 hi = hi + Math.imul(ah6, bh1) | 0; 20233 lo = lo + Math.imul(al5, bl2) | 0; 20234 mid = mid + Math.imul(al5, bh2) | 0; 20235 mid = mid + Math.imul(ah5, bl2) | 0; 20236 hi = hi + Math.imul(ah5, bh2) | 0; 20237 lo = lo + Math.imul(al4, bl3) | 0; 20238 mid = mid + Math.imul(al4, bh3) | 0; 20239 mid = mid + Math.imul(ah4, bl3) | 0; 20240 hi = hi + Math.imul(ah4, bh3) | 0; 20241 lo = lo + Math.imul(al3, bl4) | 0; 20242 mid = mid + Math.imul(al3, bh4) | 0; 20243 mid = mid + Math.imul(ah3, bl4) | 0; 20244 hi = hi + Math.imul(ah3, bh4) | 0; 20245 lo = lo + Math.imul(al2, bl5) | 0; 20246 mid = mid + Math.imul(al2, bh5) | 0; 20247 mid = mid + Math.imul(ah2, bl5) | 0; 20248 hi = hi + Math.imul(ah2, bh5) | 0; 20249 lo = lo + Math.imul(al1, bl6) | 0; 20250 mid = mid + Math.imul(al1, bh6) | 0; 20251 mid = mid + Math.imul(ah1, bl6) | 0; 20252 hi = hi + Math.imul(ah1, bh6) | 0; 20253 lo = lo + Math.imul(al0, bl7) | 0; 20254 mid = mid + Math.imul(al0, bh7) | 0; 20255 mid = mid + Math.imul(ah0, bl7) | 0; 20256 hi = hi + Math.imul(ah0, bh7) | 0; 20257 var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20258 c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; 20259 w7 &= 67108863; 20260 lo = Math.imul(al8, bl0); 20261 mid = Math.imul(al8, bh0); 20262 mid = mid + Math.imul(ah8, bl0) | 0; 20263 hi = Math.imul(ah8, bh0); 20264 lo = lo + Math.imul(al7, bl1) | 0; 20265 mid = mid + Math.imul(al7, bh1) | 0; 20266 mid = mid + Math.imul(ah7, bl1) | 0; 20267 hi = hi + Math.imul(ah7, bh1) | 0; 20268 lo = lo + Math.imul(al6, bl2) | 0; 20269 mid = mid + Math.imul(al6, bh2) | 0; 20270 mid = mid + Math.imul(ah6, bl2) | 0; 20271 hi = hi + Math.imul(ah6, bh2) | 0; 20272 lo = lo + Math.imul(al5, bl3) | 0; 20273 mid = mid + Math.imul(al5, bh3) | 0; 20274 mid = mid + Math.imul(ah5, bl3) | 0; 20275 hi = hi + Math.imul(ah5, bh3) | 0; 20276 lo = lo + Math.imul(al4, bl4) | 0; 20277 mid = mid + Math.imul(al4, bh4) | 0; 20278 mid = mid + Math.imul(ah4, bl4) | 0; 20279 hi = hi + Math.imul(ah4, bh4) | 0; 20280 lo = lo + Math.imul(al3, bl5) | 0; 20281 mid = mid + Math.imul(al3, bh5) | 0; 20282 mid = mid + Math.imul(ah3, bl5) | 0; 20283 hi = hi + Math.imul(ah3, bh5) | 0; 20284 lo = lo + Math.imul(al2, bl6) | 0; 20285 mid = mid + Math.imul(al2, bh6) | 0; 20286 mid = mid + Math.imul(ah2, bl6) | 0; 20287 hi = hi + Math.imul(ah2, bh6) | 0; 20288 lo = lo + Math.imul(al1, bl7) | 0; 20289 mid = mid + Math.imul(al1, bh7) | 0; 20290 mid = mid + Math.imul(ah1, bl7) | 0; 20291 hi = hi + Math.imul(ah1, bh7) | 0; 20292 lo = lo + Math.imul(al0, bl8) | 0; 20293 mid = mid + Math.imul(al0, bh8) | 0; 20294 mid = mid + Math.imul(ah0, bl8) | 0; 20295 hi = hi + Math.imul(ah0, bh8) | 0; 20296 var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20297 c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; 20298 w8 &= 67108863; 20299 lo = Math.imul(al9, bl0); 20300 mid = Math.imul(al9, bh0); 20301 mid = mid + Math.imul(ah9, bl0) | 0; 20302 hi = Math.imul(ah9, bh0); 20303 lo = lo + Math.imul(al8, bl1) | 0; 20304 mid = mid + Math.imul(al8, bh1) | 0; 20305 mid = mid + Math.imul(ah8, bl1) | 0; 20306 hi = hi + Math.imul(ah8, bh1) | 0; 20307 lo = lo + Math.imul(al7, bl2) | 0; 20308 mid = mid + Math.imul(al7, bh2) | 0; 20309 mid = mid + Math.imul(ah7, bl2) | 0; 20310 hi = hi + Math.imul(ah7, bh2) | 0; 20311 lo = lo + Math.imul(al6, bl3) | 0; 20312 mid = mid + Math.imul(al6, bh3) | 0; 20313 mid = mid + Math.imul(ah6, bl3) | 0; 20314 hi = hi + Math.imul(ah6, bh3) | 0; 20315 lo = lo + Math.imul(al5, bl4) | 0; 20316 mid = mid + Math.imul(al5, bh4) | 0; 20317 mid = mid + Math.imul(ah5, bl4) | 0; 20318 hi = hi + Math.imul(ah5, bh4) | 0; 20319 lo = lo + Math.imul(al4, bl5) | 0; 20320 mid = mid + Math.imul(al4, bh5) | 0; 20321 mid = mid + Math.imul(ah4, bl5) | 0; 20322 hi = hi + Math.imul(ah4, bh5) | 0; 20323 lo = lo + Math.imul(al3, bl6) | 0; 20324 mid = mid + Math.imul(al3, bh6) | 0; 20325 mid = mid + Math.imul(ah3, bl6) | 0; 20326 hi = hi + Math.imul(ah3, bh6) | 0; 20327 lo = lo + Math.imul(al2, bl7) | 0; 20328 mid = mid + Math.imul(al2, bh7) | 0; 20329 mid = mid + Math.imul(ah2, bl7) | 0; 20330 hi = hi + Math.imul(ah2, bh7) | 0; 20331 lo = lo + Math.imul(al1, bl8) | 0; 20332 mid = mid + Math.imul(al1, bh8) | 0; 20333 mid = mid + Math.imul(ah1, bl8) | 0; 20334 hi = hi + Math.imul(ah1, bh8) | 0; 20335 lo = lo + Math.imul(al0, bl9) | 0; 20336 mid = mid + Math.imul(al0, bh9) | 0; 20337 mid = mid + Math.imul(ah0, bl9) | 0; 20338 hi = hi + Math.imul(ah0, bh9) | 0; 20339 var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20340 c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; 20341 w9 &= 67108863; 20342 lo = Math.imul(al9, bl1); 20343 mid = Math.imul(al9, bh1);
vendor: 86,392 bytes, lines 20344-23174
20344 mid = mid + Math.imul(ah9, bl1) | 0; 20345 hi = Math.imul(ah9, bh1); 20346 lo = lo + Math.imul(al8, bl2) | 0; 20347 mid = mid + Math.imul(al8, bh2) | 0; 20348 mid = mid + Math.imul(ah8, bl2) | 0; 20349 hi = hi + Math.imul(ah8, bh2) | 0; 20350 lo = lo + Math.imul(al7, bl3) | 0; 20351 mid = mid + Math.imul(al7, bh3) | 0; 20352 mid = mid + Math.imul(ah7, bl3) | 0; 20353 hi = hi + Math.imul(ah7, bh3) | 0; 20354 lo = lo + Math.imul(al6, bl4) | 0; 20355 mid = mid + Math.imul(al6, bh4) | 0; 20356 mid = mid + Math.imul(ah6, bl4) | 0; 20357 hi = hi + Math.imul(ah6, bh4) | 0; 20358 lo = lo + Math.imul(al5, bl5) | 0; 20359 mid = mid + Math.imul(al5, bh5) | 0; 20360 mid = mid + Math.imul(ah5, bl5) | 0; 20361 hi = hi + Math.imul(ah5, bh5) | 0; 20362 lo = lo + Math.imul(al4, bl6) | 0; 20363 mid = mid + Math.imul(al4, bh6) | 0; 20364 mid = mid + Math.imul(ah4, bl6) | 0; 20365 hi = hi + Math.imul(ah4, bh6) | 0; 20366 lo = lo + Math.imul(al3, bl7) | 0; 20367 mid = mid + Math.imul(al3, bh7) | 0; 20368 mid = mid + Math.imul(ah3, bl7) | 0; 20369 hi = hi + Math.imul(ah3, bh7) | 0; 20370 lo = lo + Math.imul(al2, bl8) | 0; 20371 mid = mid + Math.imul(al2, bh8) | 0; 20372 mid = mid + Math.imul(ah2, bl8) | 0; 20373 hi = hi + Math.imul(ah2, bh8) | 0; 20374 lo = lo + Math.imul(al1, bl9) | 0; 20375 mid = mid + Math.imul(al1, bh9) | 0; 20376 mid = mid + Math.imul(ah1, bl9) | 0; 20377 hi = hi + Math.imul(ah1, bh9) | 0; 20378 var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20379 c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; 20380 w10 &= 67108863; 20381 lo = Math.imul(al9, bl2); 20382 mid = Math.imul(al9, bh2); 20383 mid = mid + Math.imul(ah9, bl2) | 0; 20384 hi = Math.imul(ah9, bh2); 20385 lo = lo + Math.imul(al8, bl3) | 0; 20386 mid = mid + Math.imul(al8, bh3) | 0; 20387 mid = mid + Math.imul(ah8, bl3) | 0; 20388 hi = hi + Math.imul(ah8, bh3) | 0; 20389 lo = lo + Math.imul(al7, bl4) | 0; 20390 mid = mid + Math.imul(al7, bh4) | 0; 20391 mid = mid + Math.imul(ah7, bl4) | 0; 20392 hi = hi + Math.imul(ah7, bh4) | 0; 20393 lo = lo + Math.imul(al6, bl5) | 0; 20394 mid = mid + Math.imul(al6, bh5) | 0; 20395 mid = mid + Math.imul(ah6, bl5) | 0; 20396 hi = hi + Math.imul(ah6, bh5) | 0; 20397 lo = lo + Math.imul(al5, bl6) | 0; 20398 mid = mid + Math.imul(al5, bh6) | 0; 20399 mid = mid + Math.imul(ah5, bl6) | 0; 20400 hi = hi + Math.imul(ah5, bh6) | 0; 20401 lo = lo + Math.imul(al4, bl7) | 0; 20402 mid = mid + Math.imul(al4, bh7) | 0; 20403 mid = mid + Math.imul(ah4, bl7) | 0; 20404 hi = hi + Math.imul(ah4, bh7) | 0; 20405 lo = lo + Math.imul(al3, bl8) | 0; 20406 mid = mid + Math.imul(al3, bh8) | 0; 20407 mid = mid + Math.imul(ah3, bl8) | 0; 20408 hi = hi + Math.imul(ah3, bh8) | 0; 20409 lo = lo + Math.imul(al2, bl9) | 0; 20410 mid = mid + Math.imul(al2, bh9) | 0; 20411 mid = mid + Math.imul(ah2, bl9) | 0; 20412 hi = hi + Math.imul(ah2, bh9) | 0; 20413 var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20414 c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; 20415 w11 &= 67108863; 20416 lo = Math.imul(al9, bl3); 20417 mid = Math.imul(al9, bh3); 20418 mid = mid + Math.imul(ah9, bl3) | 0; 20419 hi = Math.imul(ah9, bh3); 20420 lo = lo + Math.imul(al8, bl4) | 0; 20421 mid = mid + Math.imul(al8, bh4) | 0; 20422 mid = mid + Math.imul(ah8, bl4) | 0; 20423 hi = hi + Math.imul(ah8, bh4) | 0; 20424 lo = lo + Math.imul(al7, bl5) | 0; 20425 mid = mid + Math.imul(al7, bh5) | 0; 20426 mid = mid + Math.imul(ah7, bl5) | 0; 20427 hi = hi + Math.imul(ah7, bh5) | 0; 20428 lo = lo + Math.imul(al6, bl6) | 0; 20429 mid = mid + Math.imul(al6, bh6) | 0; 20430 mid = mid + Math.imul(ah6, bl6) | 0; 20431 hi = hi + Math.imul(ah6, bh6) | 0; 20432 lo = lo + Math.imul(al5, bl7) | 0; 20433 mid = mid + Math.imul(al5, bh7) | 0; 20434 mid = mid + Math.imul(ah5, bl7) | 0; 20435 hi = hi + Math.imul(ah5, bh7) | 0; 20436 lo = lo + Math.imul(al4, bl8) | 0; 20437 mid = mid + Math.imul(al4, bh8) | 0; 20438 mid = mid + Math.imul(ah4, bl8) | 0; 20439 hi = hi + Math.imul(ah4, bh8) | 0; 20440 lo = lo + Math.imul(al3, bl9) | 0; 20441 mid = mid + Math.imul(al3, bh9) | 0; 20442 mid = mid + Math.imul(ah3, bl9) | 0; 20443 hi = hi + Math.imul(ah3, bh9) | 0; 20444 var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20445 c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; 20446 w12 &= 67108863; 20447 lo = Math.imul(al9, bl4); 20448 mid = Math.imul(al9, bh4); 20449 mid = mid + Math.imul(ah9, bl4) | 0; 20450 hi = Math.imul(ah9, bh4); 20451 lo = lo + Math.imul(al8, bl5) | 0; 20452 mid = mid + Math.imul(al8, bh5) | 0; 20453 mid = mid + Math.imul(ah8, bl5) | 0; 20454 hi = hi + Math.imul(ah8, bh5) | 0; 20455 lo = lo + Math.imul(al7, bl6) | 0; 20456 mid = mid + Math.imul(al7, bh6) | 0; 20457 mid = mid + Math.imul(ah7, bl6) | 0; 20458 hi = hi + Math.imul(ah7, bh6) | 0; 20459 lo = lo + Math.imul(al6, bl7) | 0; 20460 mid = mid + Math.imul(al6, bh7) | 0; 20461 mid = mid + Math.imul(ah6, bl7) | 0; 20462 hi = hi + Math.imul(ah6, bh7) | 0; 20463 lo = lo + Math.imul(al5, bl8) | 0; 20464 mid = mid + Math.imul(al5, bh8) | 0; 20465 mid = mid + Math.imul(ah5, bl8) | 0; 20466 hi = hi + Math.imul(ah5, bh8) | 0; 20467 lo = lo + Math.imul(al4, bl9) | 0; 20468 mid = mid + Math.imul(al4, bh9) | 0; 20469 mid = mid + Math.imul(ah4, bl9) | 0; 20470 hi = hi + Math.imul(ah4, bh9) | 0; 20471 var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20472 c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; 20473 w13 &= 67108863; 20474 lo = Math.imul(al9, bl5); 20475 mid = Math.imul(al9, bh5); 20476 mid = mid + Math.imul(ah9, bl5) | 0; 20477 hi = Math.imul(ah9, bh5); 20478 lo = lo + Math.imul(al8, bl6) | 0; 20479 mid = mid + Math.imul(al8, bh6) | 0; 20480 mid = mid + Math.imul(ah8, bl6) | 0; 20481 hi = hi + Math.imul(ah8, bh6) | 0; 20482 lo = lo + Math.imul(al7, bl7) | 0; 20483 mid = mid + Math.imul(al7, bh7) | 0; 20484 mid = mid + Math.imul(ah7, bl7) | 0; 20485 hi = hi + Math.imul(ah7, bh7) | 0; 20486 lo = lo + Math.imul(al6, bl8) | 0; 20487 mid = mid + Math.imul(al6, bh8) | 0; 20488 mid = mid + Math.imul(ah6, bl8) | 0; 20489 hi = hi + Math.imul(ah6, bh8) | 0; 20490 lo = lo + Math.imul(al5, bl9) | 0; 20491 mid = mid + Math.imul(al5, bh9) | 0; 20492 mid = mid + Math.imul(ah5, bl9) | 0; 20493 hi = hi + Math.imul(ah5, bh9) | 0; 20494 var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20495 c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; 20496 w14 &= 67108863; 20497 lo = Math.imul(al9, bl6); 20498 mid = Math.imul(al9, bh6); 20499 mid = mid + Math.imul(ah9, bl6) | 0; 20500 hi = Math.imul(ah9, bh6); 20501 lo = lo + Math.imul(al8, bl7) | 0; 20502 mid = mid + Math.imul(al8, bh7) | 0; 20503 mid = mid + Math.imul(ah8, bl7) | 0; 20504 hi = hi + Math.imul(ah8, bh7) | 0; 20505 lo = lo + Math.imul(al7, bl8) | 0; 20506 mid = mid + Math.imul(al7, bh8) | 0; 20507 mid = mid + Math.imul(ah7, bl8) | 0; 20508 hi = hi + Math.imul(ah7, bh8) | 0; 20509 lo = lo + Math.imul(al6, bl9) | 0; 20510 mid = mid + Math.imul(al6, bh9) | 0; 20511 mid = mid + Math.imul(ah6, bl9) | 0; 20512 hi = hi + Math.imul(ah6, bh9) | 0; 20513 var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20514 c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; 20515 w15 &= 67108863; 20516 lo = Math.imul(al9, bl7); 20517 mid = Math.imul(al9, bh7); 20518 mid = mid + Math.imul(ah9, bl7) | 0; 20519 hi = Math.imul(ah9, bh7); 20520 lo = lo + Math.imul(al8, bl8) | 0; 20521 mid = mid + Math.imul(al8, bh8) | 0; 20522 mid = mid + Math.imul(ah8, bl8) | 0; 20523 hi = hi + Math.imul(ah8, bh8) | 0; 20524 lo = lo + Math.imul(al7, bl9) | 0; 20525 mid = mid + Math.imul(al7, bh9) | 0; 20526 mid = mid + Math.imul(ah7, bl9) | 0; 20527 hi = hi + Math.imul(ah7, bh9) | 0; 20528 var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20529 c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; 20530 w16 &= 67108863; 20531 lo = Math.imul(al9, bl8); 20532 mid = Math.imul(al9, bh8); 20533 mid = mid + Math.imul(ah9, bl8) | 0; 20534 hi = Math.imul(ah9, bh8); 20535 lo = lo + Math.imul(al8, bl9) | 0; 20536 mid = mid + Math.imul(al8, bh9) | 0; 20537 mid = mid + Math.imul(ah8, bl9) | 0; 20538 hi = hi + Math.imul(ah8, bh9) | 0; 20539 var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20540 c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; 20541 w17 &= 67108863; 20542 lo = Math.imul(al9, bl9); 20543 mid = Math.imul(al9, bh9); 20544 mid = mid + Math.imul(ah9, bl9) | 0; 20545 hi = Math.imul(ah9, bh9); 20546 var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 20547 c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; 20548 w18 &= 67108863; 20549 o[0] = w0; 20550 o[1] = w1; 20551 o[2] = w2; 20552 o[3] = w3; 20553 o[4] = w4; 20554 o[5] = w5; 20555 o[6] = w6; 20556 o[7] = w7; 20557 o[8] = w8; 20558 o[9] = w9; 20559 o[10] = w10; 20560 o[11] = w11; 20561 o[12] = w12; 20562 o[13] = w13; 20563 o[14] = w14; 20564 o[15] = w15; 20565 o[16] = w16; 20566 o[17] = w17; 20567 o[18] = w18; 20568 if (c !== 0) { 20569 o[19] = c; 20570 out.length++; 20571 } 20572 return out; 20573 }; 20574 if (!Math.imul) comb10MulTo = smallMulTo; 20575 function bigMulTo(self, num, out) { 20576 out.negative = num.negative ^ self.negative; 20577 out.length = self.length + num.length; 20578 var carry = 0; 20579 var hncarry = 0; 20580 for (var k = 0; k < out.length - 1; k++) { 20581 var ncarry = hncarry; 20582 hncarry = 0; 20583 var rword = carry & 67108863; 20584 var maxJ = Math.min(k, num.length - 1); 20585 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 20586 var i = k - j; 20587 var r = (self.words[i] | 0) * (num.words[j] | 0); 20588 var lo = r & 67108863; 20589 ncarry = ncarry + (r / 67108864 | 0) | 0; 20590 lo = lo + rword | 0; 20591 rword = lo & 67108863; 20592 ncarry = ncarry + (lo >>> 26) | 0; 20593 hncarry += ncarry >>> 26; 20594 ncarry &= 67108863; 20595 } 20596 out.words[k] = rword; 20597 carry = ncarry; 20598 ncarry = hncarry; 20599 } 20600 if (carry !== 0) out.words[k] = carry; 20601 else out.length--; 20602 return out.strip(); 20603 } 20604 function jumboMulTo(self, num, out) { 20605 return new FFTM().mulp(self, num, out); 20606 } 20607 BN.prototype.mulTo = function mulTo(num, out) { 20608 var res; 20609 var len = this.length + num.length; 20610 if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out); 20611 else if (len < 63) res = smallMulTo(this, num, out); 20612 else if (len < 1024) res = bigMulTo(this, num, out); 20613 else res = jumboMulTo(this, num, out); 20614 return res; 20615 }; 20616 function FFTM(x, y) { 20617 this.x = x; 20618 this.y = y; 20619 } 20620 FFTM.prototype.makeRBT = function makeRBT(N) { 20621 var t = new Array(N); 20622 var l = BN.prototype._countBits(N) - 1; 20623 for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N); 20624 return t; 20625 }; 20626 FFTM.prototype.revBin = function revBin(x, l, N) { 20627 if (x === 0 || x === N - 1) return x; 20628 var rb = 0; 20629 for (var i = 0; i < l; i++) { 20630 rb |= (x & 1) << l - i - 1; 20631 x >>= 1; 20632 } 20633 return rb; 20634 }; 20635 FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) { 20636 for (var i = 0; i < N; i++) { 20637 rtws[i] = rws[rbt[i]]; 20638 itws[i] = iws[rbt[i]]; 20639 } 20640 }; 20641 FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) { 20642 this.permute(rbt, rws, iws, rtws, itws, N); 20643 for (var s = 1; s < N; s <<= 1) { 20644 var l = s << 1; 20645 var rtwdf = Math.cos(2 * Math.PI / l); 20646 var itwdf = Math.sin(2 * Math.PI / l); 20647 for (var p = 0; p < N; p += l) { 20648 var rtwdf_ = rtwdf; 20649 var itwdf_ = itwdf; 20650 for (var j = 0; j < s; j++) { 20651 var re = rtws[p + j]; 20652 var ie = itws[p + j]; 20653 var ro = rtws[p + j + s]; 20654 var io = itws[p + j + s]; 20655 var rx = rtwdf_ * ro - itwdf_ * io; 20656 io = rtwdf_ * io + itwdf_ * ro; 20657 ro = rx; 20658 rtws[p + j] = re + ro; 20659 itws[p + j] = ie + io; 20660 rtws[p + j + s] = re - ro; 20661 itws[p + j + s] = ie - io; 20662 if (j !== l) { 20663 rx = rtwdf * rtwdf_ - itwdf * itwdf_; 20664 itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; 20665 rtwdf_ = rx; 20666 } 20667 } 20668 } 20669 } 20670 }; 20671 FFTM.prototype.guessLen13b = function guessLen13b(n, m) { 20672 var N = Math.max(m, n) | 1; 20673 var odd = N & 1; 20674 var i = 0; 20675 for (N = N / 2 | 0; N; N = N >>> 1) i++; 20676 return 1 << i + 1 + odd; 20677 }; 20678 FFTM.prototype.conjugate = function conjugate(rws, iws, N) { 20679 if (N <= 1) return; 20680 for (var i = 0; i < N / 2; i++) { 20681 var t = rws[i]; 20682 rws[i] = rws[N - i - 1]; 20683 rws[N - i - 1] = t; 20684 t = iws[i]; 20685 iws[i] = -iws[N - i - 1]; 20686 iws[N - i - 1] = -t; 20687 } 20688 }; 20689 FFTM.prototype.normalize13b = function normalize13b(ws, N) { 20690 var carry = 0; 20691 for (var i = 0; i < N / 2; i++) { 20692 var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry; 20693 ws[i] = w & 67108863; 20694 if (w < 67108864) carry = 0; 20695 else carry = w / 67108864 | 0; 20696 } 20697 return ws; 20698 }; 20699 FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) { 20700 var carry = 0; 20701 for (var i = 0; i < len; i++) { 20702 carry = carry + (ws[i] | 0); 20703 rws[2 * i] = carry & 8191; 20704 carry = carry >>> 13; 20705 rws[2 * i + 1] = carry & 8191; 20706 carry = carry >>> 13; 20707 } 20708 for (i = 2 * len; i < N; ++i) rws[i] = 0; 20709 assert(carry === 0); 20710 assert((carry & -8192) === 0); 20711 }; 20712 FFTM.prototype.stub = function stub(N) { 20713 var ph = new Array(N); 20714 for (var i = 0; i < N; i++) ph[i] = 0; 20715 return ph; 20716 }; 20717 FFTM.prototype.mulp = function mulp(x, y, out) { 20718 var N = 2 * this.guessLen13b(x.length, y.length); 20719 var rbt = this.makeRBT(N); 20720 var _ = this.stub(N); 20721 var rws = new Array(N); 20722 var rwst = new Array(N); 20723 var iwst = new Array(N); 20724 var nrws = new Array(N); 20725 var nrwst = new Array(N); 20726 var niwst = new Array(N); 20727 var rmws = out.words; 20728 rmws.length = N; 20729 this.convert13b(x.words, x.length, rws, N); 20730 this.convert13b(y.words, y.length, nrws, N); 20731 this.transform(rws, _, rwst, iwst, N, rbt); 20732 this.transform(nrws, _, nrwst, niwst, N, rbt); 20733 for (var i = 0; i < N; i++) { 20734 var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; 20735 iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; 20736 rwst[i] = rx; 20737 } 20738 this.conjugate(rwst, iwst, N); 20739 this.transform(rwst, iwst, rmws, _, N, rbt); 20740 this.conjugate(rmws, _, N); 20741 this.normalize13b(rmws, N); 20742 out.negative = x.negative ^ y.negative; 20743 out.length = x.length + y.length; 20744 return out.strip(); 20745 }; 20746 BN.prototype.mul = function mul(num) { 20747 var out = new BN(null); 20748 out.words = new Array(this.length + num.length); 20749 return this.mulTo(num, out); 20750 }; 20751 BN.prototype.mulf = function mulf(num) { 20752 var out = new BN(null); 20753 out.words = new Array(this.length + num.length); 20754 return jumboMulTo(this, num, out); 20755 }; 20756 BN.prototype.imul = function imul(num) { 20757 return this.clone().mulTo(num, this); 20758 }; 20759 BN.prototype.imuln = function imuln(num) { 20760 assert(typeof num === "number"); 20761 assert(num < 67108864); 20762 var carry = 0; 20763 for (var i = 0; i < this.length; i++) { 20764 var w = (this.words[i] | 0) * num; 20765 var lo = (w & 67108863) + (carry & 67108863); 20766 carry >>= 26; 20767 carry += w / 67108864 | 0; 20768 carry += lo >>> 26; 20769 this.words[i] = lo & 67108863; 20770 } 20771 if (carry !== 0) { 20772 this.words[i] = carry; 20773 this.length++; 20774 } 20775 return this; 20776 }; 20777 BN.prototype.muln = function muln(num) { 20778 return this.clone().imuln(num); 20779 }; 20780 BN.prototype.sqr = function sqr() { 20781 return this.mul(this); 20782 }; 20783 BN.prototype.isqr = function isqr() { 20784 return this.imul(this.clone()); 20785 }; 20786 BN.prototype.pow = function pow(num) { 20787 var w = toBitArray(num); 20788 if (w.length === 0) return new BN(1); 20789 var res = this; 20790 for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break; 20791 if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { 20792 if (w[i] === 0) continue; 20793 res = res.mul(q); 20794 } 20795 return res; 20796 }; 20797 BN.prototype.iushln = function iushln(bits) { 20798 assert(typeof bits === "number" && bits >= 0); 20799 var r = bits % 26; 20800 var s = (bits - r) / 26; 20801 var carryMask = 67108863 >>> 26 - r << 26 - r; 20802 var i; 20803 if (r !== 0) { 20804 var carry = 0; 20805 for (i = 0; i < this.length; i++) { 20806 var newCarry = this.words[i] & carryMask; 20807 var c = (this.words[i] | 0) - newCarry << r; 20808 this.words[i] = c | carry; 20809 carry = newCarry >>> 26 - r; 20810 } 20811 if (carry) { 20812 this.words[i] = carry; 20813 this.length++; 20814 } 20815 } 20816 if (s !== 0) { 20817 for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i]; 20818 for (i = 0; i < s; i++) this.words[i] = 0; 20819 this.length += s; 20820 } 20821 return this.strip(); 20822 }; 20823 BN.prototype.ishln = function ishln(bits) { 20824 assert(this.negative === 0); 20825 return this.iushln(bits); 20826 }; 20827 BN.prototype.iushrn = function iushrn(bits, hint, extended) { 20828 assert(typeof bits === "number" && bits >= 0); 20829 var h; 20830 if (hint) h = (hint - hint % 26) / 26; 20831 else h = 0; 20832 var r = bits % 26; 20833 var s = Math.min((bits - r) / 26, this.length); 20834 var mask = 67108863 ^ 67108863 >>> r << r; 20835 var maskedWords = extended; 20836 h -= s; 20837 h = Math.max(0, h); 20838 if (maskedWords) { 20839 for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i]; 20840 maskedWords.length = s; 20841 } 20842 if (s === 0) {} else if (this.length > s) { 20843 this.length -= s; 20844 for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s]; 20845 } else { 20846 this.words[0] = 0; 20847 this.length = 1; 20848 } 20849 var carry = 0; 20850 for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { 20851 var word = this.words[i] | 0; 20852 this.words[i] = carry << 26 - r | word >>> r; 20853 carry = word & mask; 20854 } 20855 if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry; 20856 if (this.length === 0) { 20857 this.words[0] = 0; 20858 this.length = 1; 20859 } 20860 return this.strip(); 20861 }; 20862 BN.prototype.ishrn = function ishrn(bits, hint, extended) { 20863 assert(this.negative === 0); 20864 return this.iushrn(bits, hint, extended); 20865 }; 20866 BN.prototype.shln = function shln(bits) { 20867 return this.clone().ishln(bits); 20868 }; 20869 BN.prototype.ushln = function ushln(bits) { 20870 return this.clone().iushln(bits); 20871 }; 20872 BN.prototype.shrn = function shrn(bits) { 20873 return this.clone().ishrn(bits); 20874 }; 20875 BN.prototype.ushrn = function ushrn(bits) { 20876 return this.clone().iushrn(bits); 20877 }; 20878 BN.prototype.testn = function testn(bit) { 20879 assert(typeof bit === "number" && bit >= 0); 20880 var r = bit % 26; 20881 var s = (bit - r) / 26; 20882 var q = 1 << r; 20883 if (this.length <= s) return false; 20884 return !!(this.words[s] & q); 20885 }; 20886 BN.prototype.imaskn = function imaskn(bits) { 20887 assert(typeof bits === "number" && bits >= 0); 20888 var r = bits % 26; 20889 var s = (bits - r) / 26; 20890 assert(this.negative === 0, "imaskn works only with positive numbers"); 20891 if (this.length <= s) return this; 20892 if (r !== 0) s++; 20893 this.length = Math.min(s, this.length); 20894 if (r !== 0) { 20895 var mask = 67108863 ^ 67108863 >>> r << r; 20896 this.words[this.length - 1] &= mask; 20897 } 20898 return this.strip(); 20899 }; 20900 BN.prototype.maskn = function maskn(bits) { 20901 return this.clone().imaskn(bits); 20902 }; 20903 BN.prototype.iaddn = function iaddn(num) { 20904 assert(typeof num === "number"); 20905 assert(num < 67108864); 20906 if (num < 0) return this.isubn(-num); 20907 if (this.negative !== 0) { 20908 if (this.length === 1 && (this.words[0] | 0) < num) { 20909 this.words[0] = num - (this.words[0] | 0); 20910 this.negative = 0; 20911 return this; 20912 } 20913 this.negative = 0; 20914 this.isubn(num); 20915 this.negative = 1; 20916 return this; 20917 } 20918 return this._iaddn(num); 20919 }; 20920 BN.prototype._iaddn = function _iaddn(num) { 20921 this.words[0] += num; 20922 for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) { 20923 this.words[i] -= 67108864; 20924 if (i === this.length - 1) this.words[i + 1] = 1; 20925 else this.words[i + 1]++; 20926 } 20927 this.length = Math.max(this.length, i + 1); 20928 return this; 20929 }; 20930 BN.prototype.isubn = function isubn(num) { 20931 assert(typeof num === "number"); 20932 assert(num < 67108864); 20933 if (num < 0) return this.iaddn(-num); 20934 if (this.negative !== 0) { 20935 this.negative = 0; 20936 this.iaddn(num); 20937 this.negative = 1; 20938 return this; 20939 } 20940 this.words[0] -= num; 20941 if (this.length === 1 && this.words[0] < 0) { 20942 this.words[0] = -this.words[0]; 20943 this.negative = 1; 20944 } else for (var i = 0; i < this.length && this.words[i] < 0; i++) { 20945 this.words[i] += 67108864; 20946 this.words[i + 1] -= 1; 20947 } 20948 return this.strip(); 20949 }; 20950 BN.prototype.addn = function addn(num) { 20951 return this.clone().iaddn(num); 20952 }; 20953 BN.prototype.subn = function subn(num) { 20954 return this.clone().isubn(num); 20955 }; 20956 BN.prototype.iabs = function iabs() { 20957 this.negative = 0; 20958 return this; 20959 }; 20960 BN.prototype.abs = function abs() { 20961 return this.clone().iabs(); 20962 }; 20963 BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { 20964 var len = num.length + shift; 20965 var i; 20966 this._expand(len); 20967 var w; 20968 var carry = 0; 20969 for (i = 0; i < num.length; i++) { 20970 w = (this.words[i + shift] | 0) + carry; 20971 var right = (num.words[i] | 0) * mul; 20972 w -= right & 67108863; 20973 carry = (w >> 26) - (right / 67108864 | 0); 20974 this.words[i + shift] = w & 67108863; 20975 } 20976 for (; i < this.length - shift; i++) { 20977 w = (this.words[i + shift] | 0) + carry; 20978 carry = w >> 26; 20979 this.words[i + shift] = w & 67108863; 20980 } 20981 if (carry === 0) return this.strip(); 20982 assert(carry === -1); 20983 carry = 0; 20984 for (i = 0; i < this.length; i++) { 20985 w = -(this.words[i] | 0) + carry; 20986 carry = w >> 26; 20987 this.words[i] = w & 67108863; 20988 } 20989 this.negative = 1; 20990 return this.strip(); 20991 }; 20992 BN.prototype._wordDiv = function _wordDiv(num, mode) { 20993 var shift = this.length - num.length; 20994 var a = this.clone(); 20995 var b = num; 20996 var bhi = b.words[b.length - 1] | 0; 20997 shift = 26 - this._countBits(bhi); 20998 if (shift !== 0) { 20999 b = b.ushln(shift); 21000 a.iushln(shift); 21001 bhi = b.words[b.length - 1] | 0; 21002 } 21003 var m = a.length - b.length; 21004 var q; 21005 if (mode !== "mod") { 21006 q = new BN(null); 21007 q.length = m + 1; 21008 q.words = new Array(q.length); 21009 for (var i = 0; i < q.length; i++) q.words[i] = 0; 21010 } 21011 var diff = a.clone()._ishlnsubmul(b, 1, m); 21012 if (diff.negative === 0) { 21013 a = diff; 21014 if (q) q.words[m] = 1; 21015 } 21016 for (var j = m - 1; j >= 0; j--) { 21017 var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0); 21018 qj = Math.min(qj / bhi | 0, 67108863); 21019 a._ishlnsubmul(b, qj, j); 21020 while (a.negative !== 0) { 21021 qj--; 21022 a.negative = 0; 21023 a._ishlnsubmul(b, 1, j); 21024 if (!a.isZero()) a.negative ^= 1; 21025 } 21026 if (q) q.words[j] = qj; 21027 } 21028 if (q) q.strip(); 21029 a.strip(); 21030 if (mode !== "div" && shift !== 0) a.iushrn(shift); 21031 return { 21032 div: q || null, 21033 mod: a 21034 }; 21035 }; 21036 BN.prototype.divmod = function divmod(num, mode, positive) { 21037 assert(!num.isZero()); 21038 if (this.isZero()) return { 21039 div: new BN(0), 21040 mod: new BN(0) 21041 }; 21042 var div, mod, res; 21043 if (this.negative !== 0 && num.negative === 0) { 21044 res = this.neg().divmod(num, mode); 21045 if (mode !== "mod") div = res.div.neg(); 21046 if (mode !== "div") { 21047 mod = res.mod.neg(); 21048 if (positive && mod.negative !== 0) mod.iadd(num); 21049 } 21050 return { 21051 div, 21052 mod 21053 }; 21054 } 21055 if (this.negative === 0 && num.negative !== 0) { 21056 res = this.divmod(num.neg(), mode); 21057 if (mode !== "mod") div = res.div.neg(); 21058 return { 21059 div, 21060 mod: res.mod 21061 }; 21062 } 21063 if ((this.negative & num.negative) !== 0) { 21064 res = this.neg().divmod(num.neg(), mode); 21065 if (mode !== "div") { 21066 mod = res.mod.neg(); 21067 if (positive && mod.negative !== 0) mod.isub(num); 21068 } 21069 return { 21070 div: res.div, 21071 mod 21072 }; 21073 } 21074 if (num.length > this.length || this.cmp(num) < 0) return { 21075 div: new BN(0), 21076 mod: this 21077 }; 21078 if (num.length === 1) { 21079 if (mode === "div") return { 21080 div: this.divn(num.words[0]), 21081 mod: null 21082 }; 21083 if (mode === "mod") return { 21084 div: null, 21085 mod: new BN(this.modn(num.words[0])) 21086 }; 21087 return { 21088 div: this.divn(num.words[0]), 21089 mod: new BN(this.modn(num.words[0])) 21090 }; 21091 } 21092 return this._wordDiv(num, mode); 21093 }; 21094 BN.prototype.div = function div(num) { 21095 return this.divmod(num, "div", false).div; 21096 }; 21097 BN.prototype.mod = function mod(num) { 21098 return this.divmod(num, "mod", false).mod; 21099 }; 21100 BN.prototype.umod = function umod(num) { 21101 return this.divmod(num, "mod", true).mod; 21102 }; 21103 BN.prototype.divRound = function divRound(num) { 21104 var dm = this.divmod(num); 21105 if (dm.mod.isZero()) return dm.div; 21106 var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; 21107 var half = num.ushrn(1); 21108 var r2 = num.andln(1); 21109 var cmp = mod.cmp(half); 21110 if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; 21111 return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); 21112 }; 21113 BN.prototype.modn = function modn(num) { 21114 assert(num <= 67108863); 21115 var p = (1 << 26) % num; 21116 var acc = 0; 21117 for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num; 21118 return acc; 21119 }; 21120 BN.prototype.idivn = function idivn(num) { 21121 assert(num <= 67108863); 21122 var carry = 0; 21123 for (var i = this.length - 1; i >= 0; i--) { 21124 var w = (this.words[i] | 0) + carry * 67108864; 21125 this.words[i] = w / num | 0; 21126 carry = w % num; 21127 } 21128 return this.strip(); 21129 }; 21130 BN.prototype.divn = function divn(num) { 21131 return this.clone().idivn(num); 21132 }; 21133 BN.prototype.egcd = function egcd(p) { 21134 assert(p.negative === 0); 21135 assert(!p.isZero()); 21136 var x = this; 21137 var y = p.clone(); 21138 if (x.negative !== 0) x = x.umod(p); 21139 else x = x.clone(); 21140 var A = new BN(1); 21141 var B = new BN(0); 21142 var C = new BN(0); 21143 var D = new BN(1); 21144 var g = 0; 21145 while (x.isEven() && y.isEven()) { 21146 x.iushrn(1); 21147 y.iushrn(1); 21148 ++g; 21149 } 21150 var yp = y.clone(); 21151 var xp = x.clone(); 21152 while (!x.isZero()) { 21153 for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 21154 if (i > 0) { 21155 x.iushrn(i); 21156 while (i-- > 0) { 21157 if (A.isOdd() || B.isOdd()) { 21158 A.iadd(yp); 21159 B.isub(xp); 21160 } 21161 A.iushrn(1); 21162 B.iushrn(1); 21163 } 21164 } 21165 for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 21166 if (j > 0) { 21167 y.iushrn(j); 21168 while (j-- > 0) { 21169 if (C.isOdd() || D.isOdd()) { 21170 C.iadd(yp); 21171 D.isub(xp); 21172 } 21173 C.iushrn(1); 21174 D.iushrn(1); 21175 } 21176 } 21177 if (x.cmp(y) >= 0) { 21178 x.isub(y); 21179 A.isub(C); 21180 B.isub(D); 21181 } else { 21182 y.isub(x); 21183 C.isub(A); 21184 D.isub(B); 21185 } 21186 } 21187 return { 21188 a: C, 21189 b: D, 21190 gcd: y.iushln(g) 21191 }; 21192 }; 21193 BN.prototype._invmp = function _invmp(p) { 21194 assert(p.negative === 0); 21195 assert(!p.isZero()); 21196 var a = this; 21197 var b = p.clone(); 21198 if (a.negative !== 0) a = a.umod(p); 21199 else a = a.clone(); 21200 var x1 = new BN(1); 21201 var x2 = new BN(0); 21202 var delta = b.clone(); 21203 while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { 21204 for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 21205 if (i > 0) { 21206 a.iushrn(i); 21207 while (i-- > 0) { 21208 if (x1.isOdd()) x1.iadd(delta); 21209 x1.iushrn(1); 21210 } 21211 } 21212 for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 21213 if (j > 0) { 21214 b.iushrn(j); 21215 while (j-- > 0) { 21216 if (x2.isOdd()) x2.iadd(delta); 21217 x2.iushrn(1); 21218 } 21219 } 21220 if (a.cmp(b) >= 0) { 21221 a.isub(b); 21222 x1.isub(x2); 21223 } else { 21224 b.isub(a); 21225 x2.isub(x1); 21226 } 21227 } 21228 var res; 21229 if (a.cmpn(1) === 0) res = x1; 21230 else res = x2; 21231 if (res.cmpn(0) < 0) res.iadd(p); 21232 return res; 21233 }; 21234 BN.prototype.gcd = function gcd(num) { 21235 if (this.isZero()) return num.abs(); 21236 if (num.isZero()) return this.abs(); 21237 var a = this.clone(); 21238 var b = num.clone(); 21239 a.negative = 0; 21240 b.negative = 0; 21241 for (var shift = 0; a.isEven() && b.isEven(); shift++) { 21242 a.iushrn(1); 21243 b.iushrn(1); 21244 } 21245 do { 21246 while (a.isEven()) a.iushrn(1); 21247 while (b.isEven()) b.iushrn(1); 21248 var r = a.cmp(b); 21249 if (r < 0) { 21250 var t = a; 21251 a = b; 21252 b = t; 21253 } else if (r === 0 || b.cmpn(1) === 0) break; 21254 a.isub(b); 21255 } while (true); 21256 return b.iushln(shift); 21257 }; 21258 BN.prototype.invm = function invm(num) { 21259 return this.egcd(num).a.umod(num); 21260 }; 21261 BN.prototype.isEven = function isEven() { 21262 return (this.words[0] & 1) === 0; 21263 }; 21264 BN.prototype.isOdd = function isOdd() { 21265 return (this.words[0] & 1) === 1; 21266 }; 21267 BN.prototype.andln = function andln(num) { 21268 return this.words[0] & num; 21269 }; 21270 BN.prototype.bincn = function bincn(bit) { 21271 assert(typeof bit === "number"); 21272 var r = bit % 26; 21273 var s = (bit - r) / 26; 21274 var q = 1 << r; 21275 if (this.length <= s) { 21276 this._expand(s + 1); 21277 this.words[s] |= q; 21278 return this; 21279 } 21280 var carry = q; 21281 for (var i = s; carry !== 0 && i < this.length; i++) { 21282 var w = this.words[i] | 0; 21283 w += carry; 21284 carry = w >>> 26; 21285 w &= 67108863; 21286 this.words[i] = w; 21287 } 21288 if (carry !== 0) { 21289 this.words[i] = carry; 21290 this.length++; 21291 } 21292 return this; 21293 }; 21294 BN.prototype.isZero = function isZero() { 21295 return this.length === 1 && this.words[0] === 0; 21296 }; 21297 BN.prototype.cmpn = function cmpn(num) { 21298 var negative = num < 0; 21299 if (this.negative !== 0 && !negative) return -1; 21300 if (this.negative === 0 && negative) return 1; 21301 this.strip(); 21302 var res; 21303 if (this.length > 1) res = 1; 21304 else { 21305 if (negative) num = -num; 21306 assert(num <= 67108863, "Number is too big"); 21307 var w = this.words[0] | 0; 21308 res = w === num ? 0 : w < num ? -1 : 1; 21309 } 21310 if (this.negative !== 0) return -res | 0; 21311 return res; 21312 }; 21313 BN.prototype.cmp = function cmp(num) { 21314 if (this.negative !== 0 && num.negative === 0) return -1; 21315 if (this.negative === 0 && num.negative !== 0) return 1; 21316 var res = this.ucmp(num); 21317 if (this.negative !== 0) return -res | 0; 21318 return res; 21319 }; 21320 BN.prototype.ucmp = function ucmp(num) { 21321 if (this.length > num.length) return 1; 21322 if (this.length < num.length) return -1; 21323 var res = 0; 21324 for (var i = this.length - 1; i >= 0; i--) { 21325 var a = this.words[i] | 0; 21326 var b = num.words[i] | 0; 21327 if (a === b) continue; 21328 if (a < b) res = -1; 21329 else if (a > b) res = 1; 21330 break; 21331 } 21332 return res; 21333 }; 21334 BN.prototype.gtn = function gtn(num) { 21335 return this.cmpn(num) === 1; 21336 }; 21337 BN.prototype.gt = function gt(num) { 21338 return this.cmp(num) === 1; 21339 }; 21340 BN.prototype.gten = function gten(num) { 21341 return this.cmpn(num) >= 0; 21342 }; 21343 BN.prototype.gte = function gte(num) { 21344 return this.cmp(num) >= 0; 21345 }; 21346 BN.prototype.ltn = function ltn(num) { 21347 return this.cmpn(num) === -1; 21348 }; 21349 BN.prototype.lt = function lt(num) { 21350 return this.cmp(num) === -1; 21351 }; 21352 BN.prototype.lten = function lten(num) { 21353 return this.cmpn(num) <= 0; 21354 }; 21355 BN.prototype.lte = function lte(num) { 21356 return this.cmp(num) <= 0; 21357 }; 21358 BN.prototype.eqn = function eqn(num) { 21359 return this.cmpn(num) === 0; 21360 }; 21361 BN.prototype.eq = function eq(num) { 21362 return this.cmp(num) === 0; 21363 }; 21364 BN.red = function red(num) { 21365 return new Red(num); 21366 }; 21367 BN.prototype.toRed = function toRed(ctx) { 21368 assert(!this.red, "Already a number in reduction context"); 21369 assert(this.negative === 0, "red works only with positives"); 21370 return ctx.convertTo(this)._forceRed(ctx); 21371 }; 21372 BN.prototype.fromRed = function fromRed() { 21373 assert(this.red, "fromRed works only with numbers in reduction context"); 21374 return this.red.convertFrom(this); 21375 }; 21376 BN.prototype._forceRed = function _forceRed(ctx) { 21377 this.red = ctx; 21378 return this; 21379 }; 21380 BN.prototype.forceRed = function forceRed(ctx) { 21381 assert(!this.red, "Already a number in reduction context"); 21382 return this._forceRed(ctx); 21383 }; 21384 BN.prototype.redAdd = function redAdd(num) { 21385 assert(this.red, "redAdd works only with red numbers"); 21386 return this.red.add(this, num); 21387 }; 21388 BN.prototype.redIAdd = function redIAdd(num) { 21389 assert(this.red, "redIAdd works only with red numbers"); 21390 return this.red.iadd(this, num); 21391 }; 21392 BN.prototype.redSub = function redSub(num) { 21393 assert(this.red, "redSub works only with red numbers"); 21394 return this.red.sub(this, num); 21395 }; 21396 BN.prototype.redISub = function redISub(num) { 21397 assert(this.red, "redISub works only with red numbers"); 21398 return this.red.isub(this, num); 21399 }; 21400 BN.prototype.redShl = function redShl(num) { 21401 assert(this.red, "redShl works only with red numbers"); 21402 return this.red.shl(this, num); 21403 }; 21404 BN.prototype.redMul = function redMul(num) { 21405 assert(this.red, "redMul works only with red numbers"); 21406 this.red._verify2(this, num); 21407 return this.red.mul(this, num); 21408 }; 21409 BN.prototype.redIMul = function redIMul(num) { 21410 assert(this.red, "redMul works only with red numbers"); 21411 this.red._verify2(this, num); 21412 return this.red.imul(this, num); 21413 }; 21414 BN.prototype.redSqr = function redSqr() { 21415 assert(this.red, "redSqr works only with red numbers"); 21416 this.red._verify1(this); 21417 return this.red.sqr(this); 21418 }; 21419 BN.prototype.redISqr = function redISqr() { 21420 assert(this.red, "redISqr works only with red numbers"); 21421 this.red._verify1(this); 21422 return this.red.isqr(this); 21423 }; 21424 BN.prototype.redSqrt = function redSqrt() { 21425 assert(this.red, "redSqrt works only with red numbers"); 21426 this.red._verify1(this); 21427 return this.red.sqrt(this); 21428 }; 21429 BN.prototype.redInvm = function redInvm() { 21430 assert(this.red, "redInvm works only with red numbers"); 21431 this.red._verify1(this); 21432 return this.red.invm(this); 21433 }; 21434 BN.prototype.redNeg = function redNeg() { 21435 assert(this.red, "redNeg works only with red numbers"); 21436 this.red._verify1(this); 21437 return this.red.neg(this); 21438 }; 21439 BN.prototype.redPow = function redPow(num) { 21440 assert(this.red && !num.red, "redPow(normalNum)"); 21441 this.red._verify1(this); 21442 return this.red.pow(this, num); 21443 }; 21444 var primes = { 21445 k256: null, 21446 p224: null, 21447 p192: null, 21448 p25519: null 21449 }; 21450 function MPrime(name, p) { 21451 this.name = name; 21452 this.p = new BN(p, 16); 21453 this.n = this.p.bitLength(); 21454 this.k = new BN(1).iushln(this.n).isub(this.p); 21455 this.tmp = this._tmp(); 21456 } 21457 MPrime.prototype._tmp = function _tmp() { 21458 var tmp = new BN(null); 21459 tmp.words = new Array(Math.ceil(this.n / 13)); 21460 return tmp; 21461 }; 21462 MPrime.prototype.ireduce = function ireduce(num) { 21463 var r = num; 21464 var rlen; 21465 do { 21466 this.split(r, this.tmp); 21467 r = this.imulK(r); 21468 r = r.iadd(this.tmp); 21469 rlen = r.bitLength(); 21470 } while (rlen > this.n); 21471 var cmp = rlen < this.n ? -1 : r.ucmp(this.p); 21472 if (cmp === 0) { 21473 r.words[0] = 0; 21474 r.length = 1; 21475 } else if (cmp > 0) r.isub(this.p); 21476 else if (r.strip !== void 0) r.strip(); 21477 else r._strip(); 21478 return r; 21479 }; 21480 MPrime.prototype.split = function split(input, out) { 21481 input.iushrn(this.n, 0, out); 21482 }; 21483 MPrime.prototype.imulK = function imulK(num) { 21484 return num.imul(this.k); 21485 }; 21486 function K256() { 21487 MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); 21488 } 21489 inherits(K256, MPrime); 21490 K256.prototype.split = function split(input, output) { 21491 var mask = 4194303; 21492 var outLen = Math.min(input.length, 9); 21493 for (var i = 0; i < outLen; i++) output.words[i] = input.words[i]; 21494 output.length = outLen; 21495 if (input.length <= 9) { 21496 input.words[0] = 0; 21497 input.length = 1; 21498 return; 21499 } 21500 var prev = input.words[9]; 21501 output.words[output.length++] = prev & mask; 21502 for (i = 10; i < input.length; i++) { 21503 var next = input.words[i] | 0; 21504 input.words[i - 10] = (next & mask) << 4 | prev >>> 22; 21505 prev = next; 21506 } 21507 prev >>>= 22; 21508 input.words[i - 10] = prev; 21509 if (prev === 0 && input.length > 10) input.length -= 10; 21510 else input.length -= 9; 21511 }; 21512 K256.prototype.imulK = function imulK(num) { 21513 num.words[num.length] = 0; 21514 num.words[num.length + 1] = 0; 21515 num.length += 2; 21516 var lo = 0; 21517 for (var i = 0; i < num.length; i++) { 21518 var w = num.words[i] | 0; 21519 lo += w * 977; 21520 num.words[i] = lo & 67108863; 21521 lo = w * 64 + (lo / 67108864 | 0); 21522 } 21523 if (num.words[num.length - 1] === 0) { 21524 num.length--; 21525 if (num.words[num.length - 1] === 0) num.length--; 21526 } 21527 return num; 21528 }; 21529 function P224() { 21530 MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); 21531 } 21532 inherits(P224, MPrime); 21533 function P192() { 21534 MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); 21535 } 21536 inherits(P192, MPrime); 21537 function P25519() { 21538 MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); 21539 } 21540 inherits(P25519, MPrime); 21541 P25519.prototype.imulK = function imulK(num) { 21542 var carry = 0; 21543 for (var i = 0; i < num.length; i++) { 21544 var hi = (num.words[i] | 0) * 19 + carry; 21545 var lo = hi & 67108863; 21546 hi >>>= 26; 21547 num.words[i] = lo; 21548 carry = hi; 21549 } 21550 if (carry !== 0) num.words[num.length++] = carry; 21551 return num; 21552 }; 21553 BN._prime = function prime(name) { 21554 if (primes[name]) return primes[name]; 21555 var prime; 21556 if (name === "k256") prime = new K256(); 21557 else if (name === "p224") prime = new P224(); 21558 else if (name === "p192") prime = new P192(); 21559 else if (name === "p25519") prime = new P25519(); 21560 else throw new Error("Unknown prime " + name); 21561 primes[name] = prime; 21562 return prime; 21563 }; 21564 function Red(m) { 21565 if (typeof m === "string") { 21566 var prime = BN._prime(m); 21567 this.m = prime.p; 21568 this.prime = prime; 21569 } else { 21570 assert(m.gtn(1), "modulus must be greater than 1"); 21571 this.m = m; 21572 this.prime = null; 21573 } 21574 } 21575 Red.prototype._verify1 = function _verify1(a) { 21576 assert(a.negative === 0, "red works only with positives"); 21577 assert(a.red, "red works only with red numbers"); 21578 }; 21579 Red.prototype._verify2 = function _verify2(a, b) { 21580 assert((a.negative | b.negative) === 0, "red works only with positives"); 21581 assert(a.red && a.red === b.red, "red works only with red numbers"); 21582 }; 21583 Red.prototype.imod = function imod(a) { 21584 if (this.prime) return this.prime.ireduce(a)._forceRed(this); 21585 return a.umod(this.m)._forceRed(this); 21586 }; 21587 Red.prototype.neg = function neg(a) { 21588 if (a.isZero()) return a.clone(); 21589 return this.m.sub(a)._forceRed(this); 21590 }; 21591 Red.prototype.add = function add(a, b) { 21592 this._verify2(a, b); 21593 var res = a.add(b); 21594 if (res.cmp(this.m) >= 0) res.isub(this.m); 21595 return res._forceRed(this); 21596 }; 21597 Red.prototype.iadd = function iadd(a, b) { 21598 this._verify2(a, b); 21599 var res = a.iadd(b); 21600 if (res.cmp(this.m) >= 0) res.isub(this.m); 21601 return res; 21602 }; 21603 Red.prototype.sub = function sub(a, b) { 21604 this._verify2(a, b); 21605 var res = a.sub(b); 21606 if (res.cmpn(0) < 0) res.iadd(this.m); 21607 return res._forceRed(this); 21608 }; 21609 Red.prototype.isub = function isub(a, b) { 21610 this._verify2(a, b); 21611 var res = a.isub(b); 21612 if (res.cmpn(0) < 0) res.iadd(this.m); 21613 return res; 21614 }; 21615 Red.prototype.shl = function shl(a, num) { 21616 this._verify1(a); 21617 return this.imod(a.ushln(num)); 21618 }; 21619 Red.prototype.imul = function imul(a, b) { 21620 this._verify2(a, b); 21621 return this.imod(a.imul(b)); 21622 }; 21623 Red.prototype.mul = function mul(a, b) { 21624 this._verify2(a, b); 21625 return this.imod(a.mul(b)); 21626 }; 21627 Red.prototype.isqr = function isqr(a) { 21628 return this.imul(a, a.clone()); 21629 }; 21630 Red.prototype.sqr = function sqr(a) { 21631 return this.mul(a, a); 21632 }; 21633 Red.prototype.sqrt = function sqrt(a) { 21634 if (a.isZero()) return a.clone(); 21635 var mod3 = this.m.andln(3); 21636 assert(mod3 % 2 === 1); 21637 if (mod3 === 3) { 21638 var pow = this.m.add(new BN(1)).iushrn(2); 21639 return this.pow(a, pow); 21640 } 21641 var q = this.m.subn(1); 21642 var s = 0; 21643 while (!q.isZero() && q.andln(1) === 0) { 21644 s++; 21645 q.iushrn(1); 21646 } 21647 assert(!q.isZero()); 21648 var one = new BN(1).toRed(this); 21649 var nOne = one.redNeg(); 21650 var lpow = this.m.subn(1).iushrn(1); 21651 var z = this.m.bitLength(); 21652 z = new BN(2 * z * z).toRed(this); 21653 while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne); 21654 var c = this.pow(z, q); 21655 var r = this.pow(a, q.addn(1).iushrn(1)); 21656 var t = this.pow(a, q); 21657 var m = s; 21658 while (t.cmp(one) !== 0) { 21659 var tmp = t; 21660 for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr(); 21661 assert(i < m); 21662 var b = this.pow(c, new BN(1).iushln(m - i - 1)); 21663 r = r.redMul(b); 21664 c = b.redSqr(); 21665 t = t.redMul(c); 21666 m = i; 21667 } 21668 return r; 21669 }; 21670 Red.prototype.invm = function invm(a) { 21671 var inv = a._invmp(this.m); 21672 if (inv.negative !== 0) { 21673 inv.negative = 0; 21674 return this.imod(inv).redNeg(); 21675 } else return this.imod(inv); 21676 }; 21677 Red.prototype.pow = function pow(a, num) { 21678 if (num.isZero()) return new BN(1).toRed(this); 21679 if (num.cmpn(1) === 0) return a.clone(); 21680 var windowSize = 4; 21681 var wnd = new Array(1 << windowSize); 21682 wnd[0] = new BN(1).toRed(this); 21683 wnd[1] = a; 21684 for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a); 21685 var res = wnd[0]; 21686 var current = 0; 21687 var currentLen = 0; 21688 var start = num.bitLength() % 26; 21689 if (start === 0) start = 26; 21690 for (i = num.length - 1; i >= 0; i--) { 21691 var word = num.words[i]; 21692 for (var j = start - 1; j >= 0; j--) { 21693 var bit = word >> j & 1; 21694 if (res !== wnd[0]) res = this.sqr(res); 21695 if (bit === 0 && current === 0) { 21696 currentLen = 0; 21697 continue; 21698 } 21699 current <<= 1; 21700 current |= bit; 21701 currentLen++; 21702 if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; 21703 res = this.mul(res, wnd[current]); 21704 currentLen = 0; 21705 current = 0; 21706 } 21707 start = 26; 21708 } 21709 return res; 21710 }; 21711 Red.prototype.convertTo = function convertTo(num) { 21712 var r = num.umod(this.m); 21713 return r === num ? r.clone() : r; 21714 }; 21715 Red.prototype.convertFrom = function convertFrom(num) { 21716 var res = num.clone(); 21717 res.red = null; 21718 return res; 21719 }; 21720 BN.mont = function mont(num) { 21721 return new Mont(num); 21722 }; 21723 function Mont(m) { 21724 Red.call(this, m); 21725 this.shift = this.m.bitLength(); 21726 if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26; 21727 this.r = new BN(1).iushln(this.shift); 21728 this.r2 = this.imod(this.r.sqr()); 21729 this.rinv = this.r._invmp(this.m); 21730 this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); 21731 this.minv = this.minv.umod(this.r); 21732 this.minv = this.r.sub(this.minv); 21733 } 21734 inherits(Mont, Red); 21735 Mont.prototype.convertTo = function convertTo(num) { 21736 return this.imod(num.ushln(this.shift)); 21737 }; 21738 Mont.prototype.convertFrom = function convertFrom(num) { 21739 var r = this.imod(num.mul(this.rinv)); 21740 r.red = null; 21741 return r; 21742 }; 21743 Mont.prototype.imul = function imul(a, b) { 21744 if (a.isZero() || b.isZero()) { 21745 a.words[0] = 0; 21746 a.length = 1; 21747 return a; 21748 } 21749 var t = a.imul(b); 21750 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 21751 var u = t.isub(c).iushrn(this.shift); 21752 var res = u; 21753 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 21754 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 21755 return res._forceRed(this); 21756 }; 21757 Mont.prototype.mul = function mul(a, b) { 21758 if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); 21759 var t = a.mul(b); 21760 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 21761 var u = t.isub(c).iushrn(this.shift); 21762 var res = u; 21763 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 21764 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 21765 return res._forceRed(this); 21766 }; 21767 Mont.prototype.invm = function invm(a) { 21768 return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this); 21769 }; 21770 })(typeof module === "undefined" || module, exports); 21771})); 21772//#endregion 21773//#region node_modules/minimalistic-crypto-utils/lib/utils.js 21774var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => { 21775 var utils = exports; 21776 function toArray(msg, enc) { 21777 if (Array.isArray(msg)) return msg.slice(); 21778 if (!msg) return []; 21779 var res = []; 21780 if (typeof msg !== "string") { 21781 for (var i = 0; i < msg.length; i++) res[i] = msg[i] | 0; 21782 return res; 21783 } 21784 if (enc === "hex") { 21785 msg = msg.replace(/[^a-z0-9]+/gi, ""); 21786 if (msg.length % 2 !== 0) msg = "0" + msg; 21787 for (var i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16)); 21788 } else for (var i = 0; i < msg.length; i++) { 21789 var c = msg.charCodeAt(i); 21790 var hi = c >> 8; 21791 var lo = c & 255; 21792 if (hi) res.push(hi, lo); 21793 else res.push(lo); 21794 } 21795 return res; 21796 } 21797 utils.toArray = toArray; 21798 function zero2(word) { 21799 if (word.length === 1) return "0" + word; 21800 else return word; 21801 } 21802 utils.zero2 = zero2; 21803 function toHex(msg) { 21804 var res = ""; 21805 for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16)); 21806 return res; 21807 } 21808 utils.toHex = toHex; 21809 utils.encode = function encode(arr, enc) { 21810 if (enc === "hex") return toHex(arr); 21811 else return arr; 21812 }; 21813})); 21814//#endregion 21815//#region node_modules/elliptic/lib/elliptic/utils.js 21816var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => { 21817 var utils = exports; 21818 var BN = require_bn$1(); 21819 var minAssert = require_minimalistic_assert(); 21820 var minUtils = require_utils$3(); 21821 utils.assert = minAssert; 21822 utils.toArray = minUtils.toArray; 21823 utils.zero2 = minUtils.zero2; 21824 utils.toHex = minUtils.toHex; 21825 utils.encode = minUtils.encode; 21826 function getNAF(num, w, bits) { 21827 var naf = new Array(Math.max(num.bitLength(), bits) + 1); 21828 var i; 21829 for (i = 0; i < naf.length; i += 1) naf[i] = 0; 21830 var ws = 1 << w + 1; 21831 var k = num.clone(); 21832 for (i = 0; i < naf.length; i++) { 21833 var z; 21834 var mod = k.andln(ws - 1); 21835 if (k.isOdd()) { 21836 if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod; 21837 else z = mod; 21838 k.isubn(z); 21839 } else z = 0; 21840 naf[i] = z; 21841 k.iushrn(1); 21842 } 21843 return naf; 21844 } 21845 utils.getNAF = getNAF; 21846 function getJSF(k1, k2) { 21847 var jsf = [[], []]; 21848 k1 = k1.clone(); 21849 k2 = k2.clone(); 21850 var d1 = 0; 21851 var d2 = 0; 21852 var m8; 21853 while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { 21854 var m14 = k1.andln(3) + d1 & 3; 21855 var m24 = k2.andln(3) + d2 & 3; 21856 if (m14 === 3) m14 = -1; 21857 if (m24 === 3) m24 = -1; 21858 var u1; 21859 if ((m14 & 1) === 0) u1 = 0; 21860 else { 21861 m8 = k1.andln(7) + d1 & 7; 21862 if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14; 21863 else u1 = m14; 21864 } 21865 jsf[0].push(u1); 21866 var u2; 21867 if ((m24 & 1) === 0) u2 = 0; 21868 else { 21869 m8 = k2.andln(7) + d2 & 7; 21870 if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24; 21871 else u2 = m24; 21872 } 21873 jsf[1].push(u2); 21874 if (2 * d1 === u1 + 1) d1 = 1 - d1; 21875 if (2 * d2 === u2 + 1) d2 = 1 - d2; 21876 k1.iushrn(1); 21877 k2.iushrn(1); 21878 } 21879 return jsf; 21880 } 21881 utils.getJSF = getJSF; 21882 function cachedProperty(obj, name, computer) { 21883 var key = "_" + name; 21884 obj.prototype[name] = function cachedProperty() { 21885 return this[key] !== void 0 ? this[key] : this[key] = computer.call(this); 21886 }; 21887 } 21888 utils.cachedProperty = cachedProperty; 21889 function parseBytes(bytes) { 21890 return typeof bytes === "string" ? utils.toArray(bytes, "hex") : bytes; 21891 } 21892 utils.parseBytes = parseBytes; 21893 function intFromLE(bytes) { 21894 return new BN(bytes, "hex", "le"); 21895 } 21896 utils.intFromLE = intFromLE; 21897})); 21898//#endregion 21899//#region node_modules/elliptic/lib/elliptic/curve/base.js 21900var require_base$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 21901 var BN = require_bn$1(); 21902 var utils = require_utils$2(); 21903 var getNAF = utils.getNAF; 21904 var getJSF = utils.getJSF; 21905 var assert = utils.assert; 21906 function BaseCurve(type, conf) { 21907 this.type = type; 21908 this.p = new BN(conf.p, 16); 21909 this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); 21910 this.zero = new BN(0).toRed(this.red); 21911 this.one = new BN(1).toRed(this.red); 21912 this.two = new BN(2).toRed(this.red); 21913 this.n = conf.n && new BN(conf.n, 16); 21914 this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); 21915 this._wnafT1 = new Array(4); 21916 this._wnafT2 = new Array(4); 21917 this._wnafT3 = new Array(4); 21918 this._wnafT4 = new Array(4); 21919 this._bitLength = this.n ? this.n.bitLength() : 0; 21920 var adjustCount = this.n && this.p.div(this.n); 21921 if (!adjustCount || adjustCount.cmpn(100) > 0) this.redN = null; 21922 else { 21923 this._maxwellTrick = true; 21924 this.redN = this.n.toRed(this.red); 21925 } 21926 } 21927 module.exports = BaseCurve; 21928 BaseCurve.prototype.point = function point() { 21929 throw new Error("Not implemented"); 21930 }; 21931 BaseCurve.prototype.validate = function validate() { 21932 throw new Error("Not implemented"); 21933 }; 21934 BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { 21935 assert(p.precomputed); 21936 var doubles = p._getDoubles(); 21937 var naf = getNAF(k, 1, this._bitLength); 21938 var I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1); 21939 I /= 3; 21940 var repr = []; 21941 var j; 21942 var nafW; 21943 for (j = 0; j < naf.length; j += doubles.step) { 21944 nafW = 0; 21945 for (var l = j + doubles.step - 1; l >= j; l--) nafW = (nafW << 1) + naf[l]; 21946 repr.push(nafW); 21947 } 21948 var a = this.jpoint(null, null, null); 21949 var b = this.jpoint(null, null, null); 21950 for (var i = I; i > 0; i--) { 21951 for (j = 0; j < repr.length; j++) { 21952 nafW = repr[j]; 21953 if (nafW === i) b = b.mixedAdd(doubles.points[j]); 21954 else if (nafW === -i) b = b.mixedAdd(doubles.points[j].neg()); 21955 } 21956 a = a.add(b); 21957 } 21958 return a.toP(); 21959 }; 21960 BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { 21961 var w = 4; 21962 var nafPoints = p._getNAFPoints(w); 21963 w = nafPoints.wnd; 21964 var wnd = nafPoints.points; 21965 var naf = getNAF(k, w, this._bitLength); 21966 var acc = this.jpoint(null, null, null); 21967 for (var i = naf.length - 1; i >= 0; i--) { 21968 for (var l = 0; i >= 0 && naf[i] === 0; i--) l++; 21969 if (i >= 0) l++; 21970 acc = acc.dblp(l); 21971 if (i < 0) break; 21972 var z = naf[i]; 21973 assert(z !== 0); 21974 if (p.type === "affine") if (z > 0) acc = acc.mixedAdd(wnd[z - 1 >> 1]); 21975 else acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg()); 21976 else if (z > 0) acc = acc.add(wnd[z - 1 >> 1]); 21977 else acc = acc.add(wnd[-z - 1 >> 1].neg()); 21978 } 21979 return p.type === "affine" ? acc.toP() : acc; 21980 }; 21981 BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) { 21982 var wndWidth = this._wnafT1; 21983 var wnd = this._wnafT2; 21984 var naf = this._wnafT3; 21985 var max = 0; 21986 var i; 21987 var j; 21988 var p; 21989 for (i = 0; i < len; i++) { 21990 p = points[i]; 21991 var nafPoints = p._getNAFPoints(defW); 21992 wndWidth[i] = nafPoints.wnd; 21993 wnd[i] = nafPoints.points; 21994 } 21995 for (i = len - 1; i >= 1; i -= 2) { 21996 var a = i - 1; 21997 var b = i; 21998 if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { 21999 naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength); 22000 naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength); 22001 max = Math.max(naf[a].length, max); 22002 max = Math.max(naf[b].length, max); 22003 continue; 22004 } 22005 var comb = [ 22006 points[a], 22007 null, 22008 null, 22009 points[b] 22010 ]; 22011 if (points[a].y.cmp(points[b].y) === 0) { 22012 comb[1] = points[a].add(points[b]); 22013 comb[2] = points[a].toJ().mixedAdd(points[b].neg()); 22014 } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { 22015 comb[1] = points[a].toJ().mixedAdd(points[b]); 22016 comb[2] = points[a].add(points[b].neg()); 22017 } else { 22018 comb[1] = points[a].toJ().mixedAdd(points[b]); 22019 comb[2] = points[a].toJ().mixedAdd(points[b].neg()); 22020 } 22021 var index = [ 22022 -3, 22023 -1, 22024 -5, 22025 -7, 22026 0, 22027 7, 22028 5, 22029 1, 22030 3 22031 ]; 22032 var jsf = getJSF(coeffs[a], coeffs[b]); 22033 max = Math.max(jsf[0].length, max); 22034 naf[a] = new Array(max); 22035 naf[b] = new Array(max); 22036 for (j = 0; j < max; j++) { 22037 var ja = jsf[0][j] | 0; 22038 var jb = jsf[1][j] | 0; 22039 naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; 22040 naf[b][j] = 0; 22041 wnd[a] = comb; 22042 } 22043 } 22044 var acc = this.jpoint(null, null, null); 22045 var tmp = this._wnafT4; 22046 for (i = max; i >= 0; i--) { 22047 var k = 0; 22048 while (i >= 0) { 22049 var zero = true; 22050 for (j = 0; j < len; j++) { 22051 tmp[j] = naf[j][i] | 0; 22052 if (tmp[j] !== 0) zero = false; 22053 } 22054 if (!zero) break; 22055 k++; 22056 i--; 22057 } 22058 if (i >= 0) k++; 22059 acc = acc.dblp(k); 22060 if (i < 0) break; 22061 for (j = 0; j < len; j++) { 22062 var z = tmp[j]; 22063 if (z === 0) continue; 22064 else if (z > 0) p = wnd[j][z - 1 >> 1]; 22065 else if (z < 0) p = wnd[j][-z - 1 >> 1].neg(); 22066 if (p.type === "affine") acc = acc.mixedAdd(p); 22067 else acc = acc.add(p); 22068 } 22069 } 22070 for (i = 0; i < len; i++) wnd[i] = null; 22071 if (jacobianResult) return acc; 22072 else return acc.toP(); 22073 }; 22074 function BasePoint(curve, type) { 22075 this.curve = curve; 22076 this.type = type; 22077 this.precomputed = null; 22078 } 22079 BaseCurve.BasePoint = BasePoint; 22080 BasePoint.prototype.eq = function eq() { 22081 throw new Error("Not implemented"); 22082 }; 22083 BasePoint.prototype.validate = function validate() { 22084 return this.curve.validate(this); 22085 }; 22086 BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { 22087 bytes = utils.toArray(bytes, enc); 22088 var len = this.p.byteLength(); 22089 if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) { 22090 if (bytes[0] === 6) assert(bytes[bytes.length - 1] % 2 === 0); 22091 else if (bytes[0] === 7) assert(bytes[bytes.length - 1] % 2 === 1); 22092 return this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len)); 22093 } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3); 22094 throw new Error("Unknown point format"); 22095 }; 22096 BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { 22097 return this.encode(enc, true); 22098 }; 22099 BasePoint.prototype._encode = function _encode(compact) { 22100 var len = this.curve.p.byteLength(); 22101 var x = this.getX().toArray("be", len); 22102 if (compact) return [this.getY().isEven() ? 2 : 3].concat(x); 22103 return [4].concat(x, this.getY().toArray("be", len)); 22104 }; 22105 BasePoint.prototype.encode = function encode(enc, compact) { 22106 return utils.encode(this._encode(compact), enc); 22107 }; 22108 BasePoint.prototype.precompute = function precompute(power) { 22109 if (this.precomputed) return this; 22110 var precomputed = { 22111 doubles: null, 22112 naf: null, 22113 beta: null 22114 }; 22115 precomputed.naf = this._getNAFPoints(8); 22116 precomputed.doubles = this._getDoubles(4, power); 22117 precomputed.beta = this._getBeta(); 22118 this.precomputed = precomputed; 22119 return this; 22120 }; 22121 BasePoint.prototype._hasDoubles = function _hasDoubles(k) { 22122 if (!this.precomputed) return false; 22123 var doubles = this.precomputed.doubles; 22124 if (!doubles) return false; 22125 return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); 22126 }; 22127 BasePoint.prototype._getDoubles = function _getDoubles(step, power) { 22128 if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; 22129 var doubles = [this]; 22130 var acc = this; 22131 for (var i = 0; i < power; i += step) { 22132 for (var j = 0; j < step; j++) acc = acc.dbl(); 22133 doubles.push(acc); 22134 } 22135 return { 22136 step, 22137 points: doubles 22138 }; 22139 }; 22140 BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { 22141 if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; 22142 var res = [this]; 22143 var max = (1 << wnd) - 1; 22144 var dbl = max === 1 ? null : this.dbl(); 22145 for (var i = 1; i < max; i++) res[i] = res[i - 1].add(dbl); 22146 return { 22147 wnd, 22148 points: res 22149 }; 22150 }; 22151 BasePoint.prototype._getBeta = function _getBeta() { 22152 return null; 22153 }; 22154 BasePoint.prototype.dblp = function dblp(k) { 22155 var r = this; 22156 for (var i = 0; i < k; i++) r = r.dbl(); 22157 return r; 22158 }; 22159})); 22160//#endregion 22161//#region node_modules/elliptic/lib/elliptic/curve/short.js 22162var require_short = /* @__PURE__ */ __commonJSMin(((exports, module) => { 22163 var utils = require_utils$2(); 22164 var BN = require_bn$1(); 22165 var inherits = require_inherits_browser(); 22166 var Base = require_base$1(); 22167 var assert = utils.assert; 22168 function ShortCurve(conf) { 22169 Base.call(this, "short", conf); 22170 this.a = new BN(conf.a, 16).toRed(this.red); 22171 this.b = new BN(conf.b, 16).toRed(this.red); 22172 this.tinv = this.two.redInvm(); 22173 this.zeroA = this.a.fromRed().cmpn(0) === 0; 22174 this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; 22175 this.endo = this._getEndomorphism(conf); 22176 this._endoWnafT1 = new Array(4); 22177 this._endoWnafT2 = new Array(4); 22178 } 22179 inherits(ShortCurve, Base); 22180 module.exports = ShortCurve; 22181 ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { 22182 if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return; 22183 var beta; 22184 var lambda; 22185 if (conf.beta) beta = new BN(conf.beta, 16).toRed(this.red); 22186 else { 22187 var betas = this._getEndoRoots(this.p); 22188 beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; 22189 beta = beta.toRed(this.red); 22190 } 22191 if (conf.lambda) lambda = new BN(conf.lambda, 16); 22192 else { 22193 var lambdas = this._getEndoRoots(this.n); 22194 if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) lambda = lambdas[0]; 22195 else { 22196 lambda = lambdas[1]; 22197 assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); 22198 } 22199 } 22200 var basis; 22201 if (conf.basis) basis = conf.basis.map(function(vec) { 22202 return { 22203 a: new BN(vec.a, 16), 22204 b: new BN(vec.b, 16) 22205 }; 22206 }); 22207 else basis = this._getEndoBasis(lambda); 22208 return { 22209 beta, 22210 lambda, 22211 basis 22212 }; 22213 }; 22214 ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { 22215 var red = num === this.p ? this.red : BN.mont(num); 22216 var tinv = new BN(2).toRed(red).redInvm(); 22217 var ntinv = tinv.redNeg(); 22218 var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); 22219 return [ntinv.redAdd(s).fromRed(), ntinv.redSub(s).fromRed()]; 22220 }; 22221 ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { 22222 var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); 22223 var u = lambda; 22224 var v = this.n.clone(); 22225 var x1 = new BN(1); 22226 var y1 = new BN(0); 22227 var x2 = new BN(0); 22228 var y2 = new BN(1); 22229 var a0; 22230 var b0; 22231 var a1; 22232 var b1; 22233 var a2; 22234 var b2; 22235 var prevR; 22236 var i = 0; 22237 var r; 22238 var x; 22239 while (u.cmpn(0) !== 0) { 22240 var q = v.div(u); 22241 r = v.sub(q.mul(u)); 22242 x = x2.sub(q.mul(x1)); 22243 var y = y2.sub(q.mul(y1)); 22244 if (!a1 && r.cmp(aprxSqrt) < 0) { 22245 a0 = prevR.neg(); 22246 b0 = x1; 22247 a1 = r.neg(); 22248 b1 = x; 22249 } else if (a1 && ++i === 2) break; 22250 prevR = r; 22251 v = u; 22252 u = r; 22253 x2 = x1; 22254 x1 = x; 22255 y2 = y1; 22256 y1 = y; 22257 } 22258 a2 = r.neg(); 22259 b2 = x; 22260 var len1 = a1.sqr().add(b1.sqr()); 22261 if (a2.sqr().add(b2.sqr()).cmp(len1) >= 0) { 22262 a2 = a0; 22263 b2 = b0; 22264 } 22265 if (a1.negative) { 22266 a1 = a1.neg(); 22267 b1 = b1.neg(); 22268 } 22269 if (a2.negative) { 22270 a2 = a2.neg(); 22271 b2 = b2.neg(); 22272 } 22273 return [{ 22274 a: a1, 22275 b: b1 22276 }, { 22277 a: a2, 22278 b: b2 22279 }]; 22280 }; 22281 ShortCurve.prototype._endoSplit = function _endoSplit(k) { 22282 var basis = this.endo.basis; 22283 var v1 = basis[0]; 22284 var v2 = basis[1]; 22285 var c1 = v2.b.mul(k).divRound(this.n); 22286 var c2 = v1.b.neg().mul(k).divRound(this.n); 22287 var p1 = c1.mul(v1.a); 22288 var p2 = c2.mul(v2.a); 22289 var q1 = c1.mul(v1.b); 22290 var q2 = c2.mul(v2.b); 22291 return { 22292 k1: k.sub(p1).sub(p2), 22293 k2: q1.add(q2).neg() 22294 }; 22295 }; 22296 ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { 22297 x = new BN(x, 16); 22298 if (!x.red) x = x.toRed(this.red); 22299 var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); 22300 var y = y2.redSqrt(); 22301 if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point"); 22302 var isOdd = y.fromRed().isOdd(); 22303 if (odd && !isOdd || !odd && isOdd) y = y.redNeg(); 22304 return this.point(x, y); 22305 }; 22306 ShortCurve.prototype.validate = function validate(point) { 22307 if (point.inf) return true; 22308 var x = point.x; 22309 var y = point.y; 22310 var ax = this.a.redMul(x); 22311 var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); 22312 return y.redSqr().redISub(rhs).cmpn(0) === 0; 22313 }; 22314 ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) { 22315 var npoints = this._endoWnafT1; 22316 var ncoeffs = this._endoWnafT2; 22317 for (var i = 0; i < points.length; i++) { 22318 var split = this._endoSplit(coeffs[i]); 22319 var p = points[i]; 22320 var beta = p._getBeta(); 22321 if (split.k1.negative) { 22322 split.k1.ineg(); 22323 p = p.neg(true); 22324 } 22325 if (split.k2.negative) { 22326 split.k2.ineg(); 22327 beta = beta.neg(true); 22328 } 22329 npoints[i * 2] = p; 22330 npoints[i * 2 + 1] = beta; 22331 ncoeffs[i * 2] = split.k1; 22332 ncoeffs[i * 2 + 1] = split.k2; 22333 } 22334 var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); 22335 for (var j = 0; j < i * 2; j++) { 22336 npoints[j] = null; 22337 ncoeffs[j] = null; 22338 } 22339 return res; 22340 }; 22341 function Point(curve, x, y, isRed) { 22342 Base.BasePoint.call(this, curve, "affine"); 22343 if (x === null && y === null) { 22344 this.x = null; 22345 this.y = null; 22346 this.inf = true; 22347 } else { 22348 this.x = new BN(x, 16); 22349 this.y = new BN(y, 16); 22350 if (isRed) { 22351 this.x.forceRed(this.curve.red); 22352 this.y.forceRed(this.curve.red); 22353 } 22354 if (!this.x.red) this.x = this.x.toRed(this.curve.red); 22355 if (!this.y.red) this.y = this.y.toRed(this.curve.red); 22356 this.inf = false; 22357 } 22358 } 22359 inherits(Point, Base.BasePoint); 22360 ShortCurve.prototype.point = function point(x, y, isRed) { 22361 return new Point(this, x, y, isRed); 22362 }; 22363 ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { 22364 return Point.fromJSON(this, obj, red); 22365 }; 22366 Point.prototype._getBeta = function _getBeta() { 22367 if (!this.curve.endo) return; 22368 var pre = this.precomputed; 22369 if (pre && pre.beta) return pre.beta; 22370 var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); 22371 if (pre) { 22372 var curve = this.curve; 22373 var endoMul = function(p) { 22374 return curve.point(p.x.redMul(curve.endo.beta), p.y); 22375 }; 22376 pre.beta = beta; 22377 beta.precomputed = { 22378 beta: null, 22379 naf: pre.naf && { 22380 wnd: pre.naf.wnd, 22381 points: pre.naf.points.map(endoMul) 22382 }, 22383 doubles: pre.doubles && { 22384 step: pre.doubles.step, 22385 points: pre.doubles.points.map(endoMul) 22386 } 22387 }; 22388 } 22389 return beta; 22390 }; 22391 Point.prototype.toJSON = function toJSON() { 22392 if (!this.precomputed) return [this.x, this.y]; 22393 return [ 22394 this.x, 22395 this.y, 22396 this.precomputed && { 22397 doubles: this.precomputed.doubles && { 22398 step: this.precomputed.doubles.step, 22399 points: this.precomputed.doubles.points.slice(1) 22400 }, 22401 naf: this.precomputed.naf && { 22402 wnd: this.precomputed.naf.wnd, 22403 points: this.precomputed.naf.points.slice(1) 22404 } 22405 } 22406 ]; 22407 }; 22408 Point.fromJSON = function fromJSON(curve, obj, red) { 22409 if (typeof obj === "string") obj = JSON.parse(obj); 22410 var res = curve.point(obj[0], obj[1], red); 22411 if (!obj[2]) return res; 22412 function obj2point(obj) { 22413 return curve.point(obj[0], obj[1], red); 22414 } 22415 var pre = obj[2]; 22416 res.precomputed = { 22417 beta: null, 22418 doubles: pre.doubles && { 22419 step: pre.doubles.step, 22420 points: [res].concat(pre.doubles.points.map(obj2point)) 22421 }, 22422 naf: pre.naf && { 22423 wnd: pre.naf.wnd, 22424 points: [res].concat(pre.naf.points.map(obj2point)) 22425 } 22426 }; 22427 return res; 22428 }; 22429 Point.prototype.inspect = function inspect() { 22430 if (this.isInfinity()) return "<EC Point Infinity>"; 22431 return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">"; 22432 }; 22433 Point.prototype.isInfinity = function isInfinity() { 22434 return this.inf; 22435 }; 22436 Point.prototype.add = function add(p) { 22437 if (this.inf) return p; 22438 if (p.inf) return this; 22439 if (this.eq(p)) return this.dbl(); 22440 if (this.neg().eq(p)) return this.curve.point(null, null); 22441 if (this.x.cmp(p.x) === 0) return this.curve.point(null, null); 22442 var c = this.y.redSub(p.y); 22443 if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm()); 22444 var nx = c.redSqr().redISub(this.x).redISub(p.x); 22445 var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); 22446 return this.curve.point(nx, ny); 22447 }; 22448 Point.prototype.dbl = function dbl() { 22449 if (this.inf) return this; 22450 var ys1 = this.y.redAdd(this.y); 22451 if (ys1.cmpn(0) === 0) return this.curve.point(null, null); 22452 var a = this.curve.a; 22453 var x2 = this.x.redSqr(); 22454 var dyinv = ys1.redInvm(); 22455 var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); 22456 var nx = c.redSqr().redISub(this.x.redAdd(this.x)); 22457 var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); 22458 return this.curve.point(nx, ny); 22459 }; 22460 Point.prototype.getX = function getX() { 22461 return this.x.fromRed(); 22462 }; 22463 Point.prototype.getY = function getY() { 22464 return this.y.fromRed(); 22465 }; 22466 Point.prototype.mul = function mul(k) { 22467 k = new BN(k, 16); 22468 if (this.isInfinity()) return this; 22469 else if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k); 22470 else if (this.curve.endo) return this.curve._endoWnafMulAdd([this], [k]); 22471 else return this.curve._wnafMul(this, k); 22472 }; 22473 Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { 22474 var points = [this, p2]; 22475 var coeffs = [k1, k2]; 22476 if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs); 22477 else return this.curve._wnafMulAdd(1, points, coeffs, 2); 22478 }; 22479 Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { 22480 var points = [this, p2]; 22481 var coeffs = [k1, k2]; 22482 if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs, true); 22483 else return this.curve._wnafMulAdd(1, points, coeffs, 2, true); 22484 }; 22485 Point.prototype.eq = function eq(p) { 22486 return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); 22487 }; 22488 Point.prototype.neg = function neg(_precompute) { 22489 if (this.inf) return this; 22490 var res = this.curve.point(this.x, this.y.redNeg()); 22491 if (_precompute && this.precomputed) { 22492 var pre = this.precomputed; 22493 var negate = function(p) { 22494 return p.neg(); 22495 }; 22496 res.precomputed = { 22497 naf: pre.naf && { 22498 wnd: pre.naf.wnd, 22499 points: pre.naf.points.map(negate) 22500 }, 22501 doubles: pre.doubles && { 22502 step: pre.doubles.step, 22503 points: pre.doubles.points.map(negate) 22504 } 22505 }; 22506 } 22507 return res; 22508 }; 22509 Point.prototype.toJ = function toJ() { 22510 if (this.inf) return this.curve.jpoint(null, null, null); 22511 return this.curve.jpoint(this.x, this.y, this.curve.one); 22512 }; 22513 function JPoint(curve, x, y, z) { 22514 Base.BasePoint.call(this, curve, "jacobian"); 22515 if (x === null && y === null && z === null) { 22516 this.x = this.curve.one; 22517 this.y = this.curve.one; 22518 this.z = new BN(0); 22519 } else { 22520 this.x = new BN(x, 16); 22521 this.y = new BN(y, 16); 22522 this.z = new BN(z, 16); 22523 } 22524 if (!this.x.red) this.x = this.x.toRed(this.curve.red); 22525 if (!this.y.red) this.y = this.y.toRed(this.curve.red); 22526 if (!this.z.red) this.z = this.z.toRed(this.curve.red); 22527 this.zOne = this.z === this.curve.one; 22528 } 22529 inherits(JPoint, Base.BasePoint); 22530 ShortCurve.prototype.jpoint = function jpoint(x, y, z) { 22531 return new JPoint(this, x, y, z); 22532 }; 22533 JPoint.prototype.toP = function toP() { 22534 if (this.isInfinity()) return this.curve.point(null, null); 22535 var zinv = this.z.redInvm(); 22536 var zinv2 = zinv.redSqr(); 22537 var ax = this.x.redMul(zinv2); 22538 var ay = this.y.redMul(zinv2).redMul(zinv); 22539 return this.curve.point(ax, ay); 22540 }; 22541 JPoint.prototype.neg = function neg() { 22542 return this.curve.jpoint(this.x, this.y.redNeg(), this.z); 22543 }; 22544 JPoint.prototype.add = function add(p) { 22545 if (this.isInfinity()) return p; 22546 if (p.isInfinity()) return this; 22547 var pz2 = p.z.redSqr(); 22548 var z2 = this.z.redSqr(); 22549 var u1 = this.x.redMul(pz2); 22550 var u2 = p.x.redMul(z2); 22551 var s1 = this.y.redMul(pz2.redMul(p.z)); 22552 var s2 = p.y.redMul(z2.redMul(this.z)); 22553 var h = u1.redSub(u2); 22554 var r = s1.redSub(s2); 22555 if (h.cmpn(0) === 0) if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); 22556 else return this.dbl(); 22557 var h2 = h.redSqr(); 22558 var h3 = h2.redMul(h); 22559 var v = u1.redMul(h2); 22560 var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); 22561 var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); 22562 var nz = this.z.redMul(p.z).redMul(h); 22563 return this.curve.jpoint(nx, ny, nz); 22564 }; 22565 JPoint.prototype.mixedAdd = function mixedAdd(p) { 22566 if (this.isInfinity()) return p.toJ(); 22567 if (p.isInfinity()) return this; 22568 var z2 = this.z.redSqr(); 22569 var u1 = this.x; 22570 var u2 = p.x.redMul(z2); 22571 var s1 = this.y; 22572 var s2 = p.y.redMul(z2).redMul(this.z); 22573 var h = u1.redSub(u2); 22574 var r = s1.redSub(s2); 22575 if (h.cmpn(0) === 0) if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); 22576 else return this.dbl(); 22577 var h2 = h.redSqr(); 22578 var h3 = h2.redMul(h); 22579 var v = u1.redMul(h2); 22580 var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); 22581 var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); 22582 var nz = this.z.redMul(h); 22583 return this.curve.jpoint(nx, ny, nz); 22584 }; 22585 JPoint.prototype.dblp = function dblp(pow) { 22586 if (pow === 0) return this; 22587 if (this.isInfinity()) return this; 22588 if (!pow) return this.dbl(); 22589 var i; 22590 if (this.curve.zeroA || this.curve.threeA) { 22591 var r = this; 22592 for (i = 0; i < pow; i++) r = r.dbl(); 22593 return r; 22594 } 22595 var a = this.curve.a; 22596 var tinv = this.curve.tinv; 22597 var jx = this.x; 22598 var jy = this.y; 22599 var jz = this.z; 22600 var jz4 = jz.redSqr().redSqr(); 22601 var jyd = jy.redAdd(jy); 22602 for (i = 0; i < pow; i++) { 22603 var jx2 = jx.redSqr(); 22604 var jyd2 = jyd.redSqr(); 22605 var jyd4 = jyd2.redSqr(); 22606 var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); 22607 var t1 = jx.redMul(jyd2); 22608 var nx = c.redSqr().redISub(t1.redAdd(t1)); 22609 var t2 = t1.redISub(nx); 22610 var dny = c.redMul(t2); 22611 dny = dny.redIAdd(dny).redISub(jyd4); 22612 var nz = jyd.redMul(jz); 22613 if (i + 1 < pow) jz4 = jz4.redMul(jyd4); 22614 jx = nx; 22615 jz = nz; 22616 jyd = dny; 22617 } 22618 return this.curve.jpoint(jx, jyd.redMul(tinv), jz); 22619 }; 22620 JPoint.prototype.dbl = function dbl() { 22621 if (this.isInfinity()) return this; 22622 if (this.curve.zeroA) return this._zeroDbl(); 22623 else if (this.curve.threeA) return this._threeDbl(); 22624 else return this._dbl(); 22625 }; 22626 JPoint.prototype._zeroDbl = function _zeroDbl() { 22627 var nx; 22628 var ny; 22629 var nz; 22630 if (this.zOne) { 22631 var xx = this.x.redSqr(); 22632 var yy = this.y.redSqr(); 22633 var yyyy = yy.redSqr(); 22634 var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); 22635 s = s.redIAdd(s); 22636 var m = xx.redAdd(xx).redIAdd(xx); 22637 var t = m.redSqr().redISub(s).redISub(s); 22638 var yyyy8 = yyyy.redIAdd(yyyy); 22639 yyyy8 = yyyy8.redIAdd(yyyy8); 22640 yyyy8 = yyyy8.redIAdd(yyyy8); 22641 nx = t; 22642 ny = m.redMul(s.redISub(t)).redISub(yyyy8); 22643 nz = this.y.redAdd(this.y); 22644 } else { 22645 var a = this.x.redSqr(); 22646 var b = this.y.redSqr(); 22647 var c = b.redSqr(); 22648 var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); 22649 d = d.redIAdd(d); 22650 var e = a.redAdd(a).redIAdd(a); 22651 var f = e.redSqr(); 22652 var c8 = c.redIAdd(c); 22653 c8 = c8.redIAdd(c8); 22654 c8 = c8.redIAdd(c8); 22655 nx = f.redISub(d).redISub(d); 22656 ny = e.redMul(d.redISub(nx)).redISub(c8); 22657 nz = this.y.redMul(this.z); 22658 nz = nz.redIAdd(nz); 22659 } 22660 return this.curve.jpoint(nx, ny, nz); 22661 }; 22662 JPoint.prototype._threeDbl = function _threeDbl() { 22663 var nx; 22664 var ny; 22665 var nz; 22666 if (this.zOne) { 22667 var xx = this.x.redSqr(); 22668 var yy = this.y.redSqr(); 22669 var yyyy = yy.redSqr(); 22670 var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); 22671 s = s.redIAdd(s); 22672 var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); 22673 var t = m.redSqr().redISub(s).redISub(s); 22674 nx = t; 22675 var yyyy8 = yyyy.redIAdd(yyyy); 22676 yyyy8 = yyyy8.redIAdd(yyyy8); 22677 yyyy8 = yyyy8.redIAdd(yyyy8); 22678 ny = m.redMul(s.redISub(t)).redISub(yyyy8); 22679 nz = this.y.redAdd(this.y); 22680 } else { 22681 var delta = this.z.redSqr(); 22682 var gamma = this.y.redSqr(); 22683 var beta = this.x.redMul(gamma); 22684 var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); 22685 alpha = alpha.redAdd(alpha).redIAdd(alpha); 22686 var beta4 = beta.redIAdd(beta); 22687 beta4 = beta4.redIAdd(beta4); 22688 var beta8 = beta4.redAdd(beta4); 22689 nx = alpha.redSqr().redISub(beta8); 22690 nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); 22691 var ggamma8 = gamma.redSqr(); 22692 ggamma8 = ggamma8.redIAdd(ggamma8); 22693 ggamma8 = ggamma8.redIAdd(ggamma8); 22694 ggamma8 = ggamma8.redIAdd(ggamma8); 22695 ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); 22696 } 22697 return this.curve.jpoint(nx, ny, nz); 22698 }; 22699 JPoint.prototype._dbl = function _dbl() { 22700 var a = this.curve.a; 22701 var jx = this.x; 22702 var jy = this.y; 22703 var jz = this.z; 22704 var jz4 = jz.redSqr().redSqr(); 22705 var jx2 = jx.redSqr(); 22706 var jy2 = jy.redSqr(); 22707 var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); 22708 var jxd4 = jx.redAdd(jx); 22709 jxd4 = jxd4.redIAdd(jxd4); 22710 var t1 = jxd4.redMul(jy2); 22711 var nx = c.redSqr().redISub(t1.redAdd(t1)); 22712 var t2 = t1.redISub(nx); 22713 var jyd8 = jy2.redSqr(); 22714 jyd8 = jyd8.redIAdd(jyd8); 22715 jyd8 = jyd8.redIAdd(jyd8); 22716 jyd8 = jyd8.redIAdd(jyd8); 22717 var ny = c.redMul(t2).redISub(jyd8); 22718 var nz = jy.redAdd(jy).redMul(jz); 22719 return this.curve.jpoint(nx, ny, nz); 22720 }; 22721 JPoint.prototype.trpl = function trpl() { 22722 if (!this.curve.zeroA) return this.dbl().add(this); 22723 var xx = this.x.redSqr(); 22724 var yy = this.y.redSqr(); 22725 var zz = this.z.redSqr(); 22726 var yyyy = yy.redSqr(); 22727 var m = xx.redAdd(xx).redIAdd(xx); 22728 var mm = m.redSqr(); 22729 var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); 22730 e = e.redIAdd(e); 22731 e = e.redAdd(e).redIAdd(e); 22732 e = e.redISub(mm); 22733 var ee = e.redSqr(); 22734 var t = yyyy.redIAdd(yyyy); 22735 t = t.redIAdd(t); 22736 t = t.redIAdd(t); 22737 t = t.redIAdd(t); 22738 var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); 22739 var yyu4 = yy.redMul(u); 22740 yyu4 = yyu4.redIAdd(yyu4); 22741 yyu4 = yyu4.redIAdd(yyu4); 22742 var nx = this.x.redMul(ee).redISub(yyu4); 22743 nx = nx.redIAdd(nx); 22744 nx = nx.redIAdd(nx); 22745 var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); 22746 ny = ny.redIAdd(ny); 22747 ny = ny.redIAdd(ny); 22748 ny = ny.redIAdd(ny); 22749 var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); 22750 return this.curve.jpoint(nx, ny, nz); 22751 }; 22752 JPoint.prototype.mul = function mul(k, kbase) { 22753 k = new BN(k, kbase); 22754 return this.curve._wnafMul(this, k); 22755 }; 22756 JPoint.prototype.eq = function eq(p) { 22757 if (p.type === "affine") return this.eq(p.toJ()); 22758 if (this === p) return true; 22759 var z2 = this.z.redSqr(); 22760 var pz2 = p.z.redSqr(); 22761 if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) return false; 22762 var z3 = z2.redMul(this.z); 22763 var pz3 = pz2.redMul(p.z); 22764 return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; 22765 }; 22766 JPoint.prototype.eqXToP = function eqXToP(x) { 22767 var zs = this.z.redSqr(); 22768 var rx = x.toRed(this.curve.red).redMul(zs); 22769 if (this.x.cmp(rx) === 0) return true; 22770 var xc = x.clone(); 22771 var t = this.curve.redN.redMul(zs); 22772 for (;;) { 22773 xc.iadd(this.curve.n); 22774 if (xc.cmp(this.curve.p) >= 0) return false; 22775 rx.redIAdd(t); 22776 if (this.x.cmp(rx) === 0) return true; 22777 } 22778 }; 22779 JPoint.prototype.inspect = function inspect() { 22780 if (this.isInfinity()) return "<EC JPoint Infinity>"; 22781 return "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">"; 22782 }; 22783 JPoint.prototype.isInfinity = function isInfinity() { 22784 return this.z.cmpn(0) === 0; 22785 }; 22786})); 22787//#endregion 22788//#region node_modules/elliptic/lib/elliptic/curve/mont.js 22789var require_mont = /* @__PURE__ */ __commonJSMin(((exports, module) => { 22790 var BN = require_bn$1(); 22791 var inherits = require_inherits_browser(); 22792 var Base = require_base$1(); 22793 var utils = require_utils$2(); 22794 function MontCurve(conf) { 22795 Base.call(this, "mont", conf); 22796 this.a = new BN(conf.a, 16).toRed(this.red); 22797 this.b = new BN(conf.b, 16).toRed(this.red); 22798 this.i4 = new BN(4).toRed(this.red).redInvm(); 22799 this.two = new BN(2).toRed(this.red); 22800 this.a24 = this.i4.redMul(this.a.redAdd(this.two)); 22801 } 22802 inherits(MontCurve, Base); 22803 module.exports = MontCurve; 22804 MontCurve.prototype.validate = function validate(point) { 22805 var x = point.normalize().x; 22806 var x2 = x.redSqr(); 22807 var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); 22808 return rhs.redSqrt().redSqr().cmp(rhs) === 0; 22809 }; 22810 function Point(curve, x, z) { 22811 Base.BasePoint.call(this, curve, "projective"); 22812 if (x === null && z === null) { 22813 this.x = this.curve.one; 22814 this.z = this.curve.zero; 22815 } else { 22816 this.x = new BN(x, 16); 22817 this.z = new BN(z, 16); 22818 if (!this.x.red) this.x = this.x.toRed(this.curve.red); 22819 if (!this.z.red) this.z = this.z.toRed(this.curve.red); 22820 } 22821 } 22822 inherits(Point, Base.BasePoint); 22823 MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { 22824 return this.point(utils.toArray(bytes, enc), 1); 22825 }; 22826 MontCurve.prototype.point = function point(x, z) { 22827 return new Point(this, x, z); 22828 }; 22829 MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { 22830 return Point.fromJSON(this, obj); 22831 }; 22832 Point.prototype.precompute = function precompute() {}; 22833 Point.prototype._encode = function _encode() { 22834 return this.getX().toArray("be", this.curve.p.byteLength()); 22835 }; 22836 Point.fromJSON = function fromJSON(curve, obj) { 22837 return new Point(curve, obj[0], obj[1] || curve.one); 22838 }; 22839 Point.prototype.inspect = function inspect() { 22840 if (this.isInfinity()) return "<EC Point Infinity>"; 22841 return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">"; 22842 }; 22843 Point.prototype.isInfinity = function isInfinity() { 22844 return this.z.cmpn(0) === 0; 22845 }; 22846 Point.prototype.dbl = function dbl() { 22847 var aa = this.x.redAdd(this.z).redSqr(); 22848 var bb = this.x.redSub(this.z).redSqr(); 22849 var c = aa.redSub(bb); 22850 var nx = aa.redMul(bb); 22851 var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); 22852 return this.curve.point(nx, nz); 22853 }; 22854 Point.prototype.add = function add() { 22855 throw new Error("Not supported on Montgomery curve"); 22856 }; 22857 Point.prototype.diffAdd = function diffAdd(p, diff) { 22858 var a = this.x.redAdd(this.z); 22859 var b = this.x.redSub(this.z); 22860 var c = p.x.redAdd(p.z); 22861 var da = p.x.redSub(p.z).redMul(a); 22862 var cb = c.redMul(b); 22863 var nx = diff.z.redMul(da.redAdd(cb).redSqr()); 22864 var nz = diff.x.redMul(da.redISub(cb).redSqr()); 22865 return this.curve.point(nx, nz); 22866 }; 22867 Point.prototype.mul = function mul(k) { 22868 var t = k.clone(); 22869 var a = this; 22870 var b = this.curve.point(null, null); 22871 var c = this; 22872 for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) bits.push(t.andln(1)); 22873 for (var i = bits.length - 1; i >= 0; i--) if (bits[i] === 0) { 22874 a = a.diffAdd(b, c); 22875 b = b.dbl(); 22876 } else { 22877 b = a.diffAdd(b, c); 22878 a = a.dbl(); 22879 } 22880 return b; 22881 }; 22882 Point.prototype.mulAdd = function mulAdd() { 22883 throw new Error("Not supported on Montgomery curve"); 22884 }; 22885 Point.prototype.jumlAdd = function jumlAdd() { 22886 throw new Error("Not supported on Montgomery curve"); 22887 }; 22888 Point.prototype.eq = function eq(other) { 22889 return this.getX().cmp(other.getX()) === 0; 22890 }; 22891 Point.prototype.normalize = function normalize() { 22892 this.x = this.x.redMul(this.z.redInvm()); 22893 this.z = this.curve.one; 22894 return this; 22895 }; 22896 Point.prototype.getX = function getX() { 22897 this.normalize(); 22898 return this.x.fromRed(); 22899 }; 22900})); 22901//#endregion 22902//#region node_modules/elliptic/lib/elliptic/curve/edwards.js 22903var require_edwards = /* @__PURE__ */ __commonJSMin(((exports, module) => { 22904 var utils = require_utils$2(); 22905 var BN = require_bn$1(); 22906 var inherits = require_inherits_browser(); 22907 var Base = require_base$1(); 22908 var assert = utils.assert; 22909 function EdwardsCurve(conf) { 22910 this.twisted = (conf.a | 0) !== 1; 22911 this.mOneA = this.twisted && (conf.a | 0) === -1; 22912 this.extended = this.mOneA; 22913 Base.call(this, "edwards", conf); 22914 this.a = new BN(conf.a, 16).umod(this.red.m); 22915 this.a = this.a.toRed(this.red); 22916 this.c = new BN(conf.c, 16).toRed(this.red); 22917 this.c2 = this.c.redSqr(); 22918 this.d = new BN(conf.d, 16).toRed(this.red); 22919 this.dd = this.d.redAdd(this.d); 22920 assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); 22921 this.oneC = (conf.c | 0) === 1; 22922 } 22923 inherits(EdwardsCurve, Base); 22924 module.exports = EdwardsCurve; 22925 EdwardsCurve.prototype._mulA = function _mulA(num) { 22926 if (this.mOneA) return num.redNeg(); 22927 else return this.a.redMul(num); 22928 }; 22929 EdwardsCurve.prototype._mulC = function _mulC(num) { 22930 if (this.oneC) return num; 22931 else return this.c.redMul(num); 22932 }; 22933 EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { 22934 return this.point(x, y, z, t); 22935 }; 22936 EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { 22937 x = new BN(x, 16); 22938 if (!x.red) x = x.toRed(this.red); 22939 var x2 = x.redSqr(); 22940 var rhs = this.c2.redSub(this.a.redMul(x2)); 22941 var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); 22942 var y2 = rhs.redMul(lhs.redInvm()); 22943 var y = y2.redSqrt(); 22944 if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point"); 22945 var isOdd = y.fromRed().isOdd(); 22946 if (odd && !isOdd || !odd && isOdd) y = y.redNeg(); 22947 return this.point(x, y); 22948 }; 22949 EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) { 22950 y = new BN(y, 16); 22951 if (!y.red) y = y.toRed(this.red); 22952 var y2 = y.redSqr(); 22953 var lhs = y2.redSub(this.c2); 22954 var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a); 22955 var x2 = lhs.redMul(rhs.redInvm()); 22956 if (x2.cmp(this.zero) === 0) if (odd) throw new Error("invalid point"); 22957 else return this.point(this.zero, y); 22958 var x = x2.redSqrt(); 22959 if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) throw new Error("invalid point"); 22960 if (x.fromRed().isOdd() !== odd) x = x.redNeg(); 22961 return this.point(x, y); 22962 }; 22963 EdwardsCurve.prototype.validate = function validate(point) { 22964 if (point.isInfinity()) return true; 22965 point.normalize(); 22966 var x2 = point.x.redSqr(); 22967 var y2 = point.y.redSqr(); 22968 var lhs = x2.redMul(this.a).redAdd(y2); 22969 var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); 22970 return lhs.cmp(rhs) === 0; 22971 }; 22972 function Point(curve, x, y, z, t) { 22973 Base.BasePoint.call(this, curve, "projective"); 22974 if (x === null && y === null && z === null) { 22975 this.x = this.curve.zero; 22976 this.y = this.curve.one; 22977 this.z = this.curve.one; 22978 this.t = this.curve.zero; 22979 this.zOne = true; 22980 } else { 22981 this.x = new BN(x, 16); 22982 this.y = new BN(y, 16); 22983 this.z = z ? new BN(z, 16) : this.curve.one; 22984 this.t = t && new BN(t, 16); 22985 if (!this.x.red) this.x = this.x.toRed(this.curve.red); 22986 if (!this.y.red) this.y = this.y.toRed(this.curve.red); 22987 if (!this.z.red) this.z = this.z.toRed(this.curve.red); 22988 if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red); 22989 this.zOne = this.z === this.curve.one; 22990 if (this.curve.extended && !this.t) { 22991 this.t = this.x.redMul(this.y); 22992 if (!this.zOne) this.t = this.t.redMul(this.z.redInvm()); 22993 } 22994 } 22995 } 22996 inherits(Point, Base.BasePoint); 22997 EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { 22998 return Point.fromJSON(this, obj); 22999 }; 23000 EdwardsCurve.prototype.point = function point(x, y, z, t) { 23001 return new Point(this, x, y, z, t); 23002 }; 23003 Point.fromJSON = function fromJSON(curve, obj) { 23004 return new Point(curve, obj[0], obj[1], obj[2]); 23005 }; 23006 Point.prototype.inspect = function inspect() { 23007 if (this.isInfinity()) return "<EC Point Infinity>"; 23008 return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">"; 23009 }; 23010 Point.prototype.isInfinity = function isInfinity() { 23011 return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0); 23012 }; 23013 Point.prototype._extDbl = function _extDbl() { 23014 var a = this.x.redSqr(); 23015 var b = this.y.redSqr(); 23016 var c = this.z.redSqr(); 23017 c = c.redIAdd(c); 23018 var d = this.curve._mulA(a); 23019 var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); 23020 var g = d.redAdd(b); 23021 var f = g.redSub(c); 23022 var h = d.redSub(b); 23023 var nx = e.redMul(f); 23024 var ny = g.redMul(h); 23025 var nt = e.redMul(h); 23026 var nz = f.redMul(g); 23027 return this.curve.point(nx, ny, nz, nt); 23028 }; 23029 Point.prototype._projDbl = function _projDbl() { 23030 var b = this.x.redAdd(this.y).redSqr(); 23031 var c = this.x.redSqr(); 23032 var d = this.y.redSqr(); 23033 var nx; 23034 var ny; 23035 var nz; 23036 var e; 23037 var h; 23038 var j; 23039 if (this.curve.twisted) { 23040 e = this.curve._mulA(c); 23041 var f = e.redAdd(d); 23042 if (this.zOne) { 23043 nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); 23044 ny = f.redMul(e.redSub(d)); 23045 nz = f.redSqr().redSub(f).redSub(f); 23046 } else { 23047 h = this.z.redSqr(); 23048 j = f.redSub(h).redISub(h); 23049 nx = b.redSub(c).redISub(d).redMul(j); 23050 ny = f.redMul(e.redSub(d)); 23051 nz = f.redMul(j); 23052 } 23053 } else { 23054 e = c.redAdd(d); 23055 h = this.curve._mulC(this.z).redSqr(); 23056 j = e.redSub(h).redSub(h); 23057 nx = this.curve._mulC(b.redISub(e)).redMul(j); 23058 ny = this.curve._mulC(e).redMul(c.redISub(d)); 23059 nz = e.redMul(j); 23060 } 23061 return this.curve.point(nx, ny, nz); 23062 }; 23063 Point.prototype.dbl = function dbl() { 23064 if (this.isInfinity()) return this; 23065 if (this.curve.extended) return this._extDbl(); 23066 else return this._projDbl(); 23067 }; 23068 Point.prototype._extAdd = function _extAdd(p) { 23069 var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); 23070 var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); 23071 var c = this.t.redMul(this.curve.dd).redMul(p.t); 23072 var d = this.z.redMul(p.z.redAdd(p.z)); 23073 var e = b.redSub(a); 23074 var f = d.redSub(c); 23075 var g = d.redAdd(c); 23076 var h = b.redAdd(a); 23077 var nx = e.redMul(f); 23078 var ny = g.redMul(h); 23079 var nt = e.redMul(h); 23080 var nz = f.redMul(g); 23081 return this.curve.point(nx, ny, nz, nt); 23082 }; 23083 Point.prototype._projAdd = function _projAdd(p) { 23084 var a = this.z.redMul(p.z); 23085 var b = a.redSqr(); 23086 var c = this.x.redMul(p.x); 23087 var d = this.y.redMul(p.y); 23088 var e = this.curve.d.redMul(c).redMul(d); 23089 var f = b.redSub(e); 23090 var g = b.redAdd(e); 23091 var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); 23092 var nx = a.redMul(f).redMul(tmp); 23093 var ny; 23094 var nz; 23095 if (this.curve.twisted) { 23096 ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); 23097 nz = f.redMul(g); 23098 } else { 23099 ny = a.redMul(g).redMul(d.redSub(c)); 23100 nz = this.curve._mulC(f).redMul(g); 23101 } 23102 return this.curve.point(nx, ny, nz); 23103 }; 23104 Point.prototype.add = function add(p) { 23105 if (this.isInfinity()) return p; 23106 if (p.isInfinity()) return this; 23107 if (this.curve.extended) return this._extAdd(p); 23108 else return this._projAdd(p); 23109 }; 23110 Point.prototype.mul = function mul(k) { 23111 if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k); 23112 else return this.curve._wnafMul(this, k); 23113 }; 23114 Point.prototype.mulAdd = function mulAdd(k1, p, k2) { 23115 return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, false); 23116 }; 23117 Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) { 23118 return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, true); 23119 }; 23120 Point.prototype.normalize = function normalize() { 23121 if (this.zOne) return this; 23122 var zi = this.z.redInvm(); 23123 this.x = this.x.redMul(zi); 23124 this.y = this.y.redMul(zi); 23125 if (this.t) this.t = this.t.redMul(zi); 23126 this.z = this.curve.one; 23127 this.zOne = true; 23128 return this; 23129 }; 23130 Point.prototype.neg = function neg() { 23131 return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); 23132 }; 23133 Point.prototype.getX = function getX() { 23134 this.normalize(); 23135 return this.x.fromRed(); 23136 }; 23137 Point.prototype.getY = function getY() { 23138 this.normalize(); 23139 return this.y.fromRed(); 23140 }; 23141 Point.prototype.eq = function eq(other) { 23142 return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0; 23143 }; 23144 Point.prototype.eqXToP = function eqXToP(x) { 23145 var rx = x.toRed(this.curve.red).redMul(this.z); 23146 if (this.x.cmp(rx) === 0) return true; 23147 var xc = x.clone(); 23148 var t = this.curve.redN.redMul(this.z); 23149 for (;;) { 23150 xc.iadd(this.curve.n); 23151 if (xc.cmp(this.curve.p) >= 0) return false; 23152 rx.redIAdd(t); 23153 if (this.x.cmp(rx) === 0) return true; 23154 } 23155 }; 23156 Point.prototype.toP = Point.prototype.normalize; 23157 Point.prototype.mixedAdd = Point.prototype.add; 23158})); 23159//#endregion 23160//#region node_modules/elliptic/lib/elliptic/curve/index.js 23161var require_curve = /* @__PURE__ */ __commonJSMin(((exports) => { 23162 var curve = exports; 23163 curve.base = require_base$1(); 23164 curve.short = require_short(); 23165 curve.mont = require_mont(); 23166 curve.edwards = require_edwards(); 23167})); 23168//#endregion 23169//#region node_modules/hash.js/lib/hash/utils.js 23170var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => { 23171 var assert = require_minimalistic_assert(); 23172 exports.inherits = require_inherits_browser(); 23173 function isSurrogatePair(msg, i) { 23174 if ((msg.charCodeAt(i) & 64512) !== 55296) return false;
vendor: 24,970 bytes, lines 23175-24189
23175 if (i < 0 || i + 1 >= msg.length) return false; 23176 return (msg.charCodeAt(i + 1) & 64512) === 56320; 23177 } 23178 function toArray(msg, enc) { 23179 if (Array.isArray(msg)) return msg.slice(); 23180 if (!msg) return []; 23181 var res = []; 23182 if (typeof msg === "string") { 23183 if (!enc) { 23184 var p = 0; 23185 for (var i = 0; i < msg.length; i++) { 23186 var c = msg.charCodeAt(i); 23187 if (c < 128) res[p++] = c; 23188 else if (c < 2048) { 23189 res[p++] = c >> 6 | 192; 23190 res[p++] = c & 63 | 128; 23191 } else if (isSurrogatePair(msg, i)) { 23192 c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023); 23193 res[p++] = c >> 18 | 240; 23194 res[p++] = c >> 12 & 63 | 128; 23195 res[p++] = c >> 6 & 63 | 128; 23196 res[p++] = c & 63 | 128; 23197 } else { 23198 res[p++] = c >> 12 | 224; 23199 res[p++] = c >> 6 & 63 | 128; 23200 res[p++] = c & 63 | 128; 23201 } 23202 } 23203 } else if (enc === "hex") { 23204 msg = msg.replace(/[^a-z0-9]+/gi, ""); 23205 if (msg.length % 2 !== 0) msg = "0" + msg; 23206 for (i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16)); 23207 } 23208 } else for (i = 0; i < msg.length; i++) res[i] = msg[i] | 0; 23209 return res; 23210 } 23211 exports.toArray = toArray; 23212 function toHex(msg) { 23213 var res = ""; 23214 for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16)); 23215 return res; 23216 } 23217 exports.toHex = toHex; 23218 function htonl(w) { 23219 return (w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24) >>> 0; 23220 } 23221 exports.htonl = htonl; 23222 function toHex32(msg, endian) { 23223 var res = ""; 23224 for (var i = 0; i < msg.length; i++) { 23225 var w = msg[i]; 23226 if (endian === "little") w = htonl(w); 23227 res += zero8(w.toString(16)); 23228 } 23229 return res; 23230 } 23231 exports.toHex32 = toHex32; 23232 function zero2(word) { 23233 if (word.length === 1) return "0" + word; 23234 else return word; 23235 } 23236 exports.zero2 = zero2; 23237 function zero8(word) { 23238 if (word.length === 7) return "0" + word; 23239 else if (word.length === 6) return "00" + word; 23240 else if (word.length === 5) return "000" + word; 23241 else if (word.length === 4) return "0000" + word; 23242 else if (word.length === 3) return "00000" + word; 23243 else if (word.length === 2) return "000000" + word; 23244 else if (word.length === 1) return "0000000" + word; 23245 else return word; 23246 } 23247 exports.zero8 = zero8; 23248 function join32(msg, start, end, endian) { 23249 var len = end - start; 23250 assert(len % 4 === 0); 23251 var res = new Array(len / 4); 23252 for (var i = 0, k = start; i < res.length; i++, k += 4) { 23253 var w; 23254 if (endian === "big") w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3]; 23255 else w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k]; 23256 res[i] = w >>> 0; 23257 } 23258 return res; 23259 } 23260 exports.join32 = join32; 23261 function split32(msg, endian) { 23262 var res = new Array(msg.length * 4); 23263 for (var i = 0, k = 0; i < msg.length; i++, k += 4) { 23264 var m = msg[i]; 23265 if (endian === "big") { 23266 res[k] = m >>> 24; 23267 res[k + 1] = m >>> 16 & 255; 23268 res[k + 2] = m >>> 8 & 255; 23269 res[k + 3] = m & 255; 23270 } else { 23271 res[k + 3] = m >>> 24; 23272 res[k + 2] = m >>> 16 & 255; 23273 res[k + 1] = m >>> 8 & 255; 23274 res[k] = m & 255; 23275 } 23276 } 23277 return res; 23278 } 23279 exports.split32 = split32; 23280 function rotr32(w, b) { 23281 return w >>> b | w << 32 - b; 23282 } 23283 exports.rotr32 = rotr32; 23284 function rotl32(w, b) { 23285 return w << b | w >>> 32 - b; 23286 } 23287 exports.rotl32 = rotl32; 23288 function sum32(a, b) { 23289 return a + b >>> 0; 23290 } 23291 exports.sum32 = sum32; 23292 function sum32_3(a, b, c) { 23293 return a + b + c >>> 0; 23294 } 23295 exports.sum32_3 = sum32_3; 23296 function sum32_4(a, b, c, d) { 23297 return a + b + c + d >>> 0; 23298 } 23299 exports.sum32_4 = sum32_4; 23300 function sum32_5(a, b, c, d, e) { 23301 return a + b + c + d + e >>> 0; 23302 } 23303 exports.sum32_5 = sum32_5; 23304 function sum64(buf, pos, ah, al) { 23305 var bh = buf[pos]; 23306 var lo = al + buf[pos + 1] >>> 0; 23307 buf[pos] = (lo < al ? 1 : 0) + ah + bh >>> 0; 23308 buf[pos + 1] = lo; 23309 } 23310 exports.sum64 = sum64; 23311 function sum64_hi(ah, al, bh, bl) { 23312 return (al + bl >>> 0 < al ? 1 : 0) + ah + bh >>> 0; 23313 } 23314 exports.sum64_hi = sum64_hi; 23315 function sum64_lo(ah, al, bh, bl) { 23316 return al + bl >>> 0; 23317 } 23318 exports.sum64_lo = sum64_lo; 23319 function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { 23320 var carry = 0; 23321 var lo = al; 23322 lo = lo + bl >>> 0; 23323 carry += lo < al ? 1 : 0; 23324 lo = lo + cl >>> 0; 23325 carry += lo < cl ? 1 : 0; 23326 lo = lo + dl >>> 0; 23327 carry += lo < dl ? 1 : 0; 23328 return ah + bh + ch + dh + carry >>> 0; 23329 } 23330 exports.sum64_4_hi = sum64_4_hi; 23331 function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { 23332 return al + bl + cl + dl >>> 0; 23333 } 23334 exports.sum64_4_lo = sum64_4_lo; 23335 function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { 23336 var carry = 0; 23337 var lo = al; 23338 lo = lo + bl >>> 0; 23339 carry += lo < al ? 1 : 0; 23340 lo = lo + cl >>> 0; 23341 carry += lo < cl ? 1 : 0; 23342 lo = lo + dl >>> 0; 23343 carry += lo < dl ? 1 : 0; 23344 lo = lo + el >>> 0; 23345 carry += lo < el ? 1 : 0; 23346 return ah + bh + ch + dh + eh + carry >>> 0; 23347 } 23348 exports.sum64_5_hi = sum64_5_hi; 23349 function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { 23350 return al + bl + cl + dl + el >>> 0; 23351 } 23352 exports.sum64_5_lo = sum64_5_lo; 23353 function rotr64_hi(ah, al, num) { 23354 return (al << 32 - num | ah >>> num) >>> 0; 23355 } 23356 exports.rotr64_hi = rotr64_hi; 23357 function rotr64_lo(ah, al, num) { 23358 return (ah << 32 - num | al >>> num) >>> 0; 23359 } 23360 exports.rotr64_lo = rotr64_lo; 23361 function shr64_hi(ah, al, num) { 23362 return ah >>> num; 23363 } 23364 exports.shr64_hi = shr64_hi; 23365 function shr64_lo(ah, al, num) { 23366 return (ah << 32 - num | al >>> num) >>> 0; 23367 } 23368 exports.shr64_lo = shr64_lo; 23369})); 23370//#endregion 23371//#region node_modules/hash.js/lib/hash/common.js 23372var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => { 23373 var utils = require_utils$1(); 23374 var assert = require_minimalistic_assert(); 23375 function BlockHash() { 23376 this.pending = null; 23377 this.pendingTotal = 0; 23378 this.blockSize = this.constructor.blockSize; 23379 this.outSize = this.constructor.outSize; 23380 this.hmacStrength = this.constructor.hmacStrength; 23381 this.padLength = this.constructor.padLength / 8; 23382 this.endian = "big"; 23383 this._delta8 = this.blockSize / 8; 23384 this._delta32 = this.blockSize / 32; 23385 } 23386 exports.BlockHash = BlockHash; 23387 BlockHash.prototype.update = function update(msg, enc) { 23388 msg = utils.toArray(msg, enc); 23389 if (!this.pending) this.pending = msg; 23390 else this.pending = this.pending.concat(msg); 23391 this.pendingTotal += msg.length; 23392 if (this.pending.length >= this._delta8) { 23393 msg = this.pending; 23394 var r = msg.length % this._delta8; 23395 this.pending = msg.slice(msg.length - r, msg.length); 23396 if (this.pending.length === 0) this.pending = null; 23397 msg = utils.join32(msg, 0, msg.length - r, this.endian); 23398 for (var i = 0; i < msg.length; i += this._delta32) this._update(msg, i, i + this._delta32); 23399 } 23400 return this; 23401 }; 23402 BlockHash.prototype.digest = function digest(enc) { 23403 this.update(this._pad()); 23404 assert(this.pending === null); 23405 return this._digest(enc); 23406 }; 23407 BlockHash.prototype._pad = function pad() { 23408 var len = this.pendingTotal; 23409 var bytes = this._delta8; 23410 var k = bytes - (len + this.padLength) % bytes; 23411 var res = new Array(k + this.padLength); 23412 res[0] = 128; 23413 for (var i = 1; i < k; i++) res[i] = 0; 23414 len <<= 3; 23415 if (this.endian === "big") { 23416 for (var t = 8; t < this.padLength; t++) res[i++] = 0; 23417 res[i++] = 0; 23418 res[i++] = 0; 23419 res[i++] = 0; 23420 res[i++] = 0; 23421 res[i++] = len >>> 24 & 255; 23422 res[i++] = len >>> 16 & 255; 23423 res[i++] = len >>> 8 & 255; 23424 res[i++] = len & 255; 23425 } else { 23426 res[i++] = len & 255; 23427 res[i++] = len >>> 8 & 255; 23428 res[i++] = len >>> 16 & 255; 23429 res[i++] = len >>> 24 & 255; 23430 res[i++] = 0; 23431 res[i++] = 0; 23432 res[i++] = 0; 23433 res[i++] = 0; 23434 for (t = 8; t < this.padLength; t++) res[i++] = 0; 23435 } 23436 return res; 23437 }; 23438})); 23439//#endregion 23440//#region node_modules/hash.js/lib/hash/sha/common.js 23441var require_common = /* @__PURE__ */ __commonJSMin(((exports) => { 23442 var rotr32 = require_utils$1().rotr32; 23443 function ft_1(s, x, y, z) { 23444 if (s === 0) return ch32(x, y, z); 23445 if (s === 1 || s === 3) return p32(x, y, z); 23446 if (s === 2) return maj32(x, y, z); 23447 } 23448 exports.ft_1 = ft_1; 23449 function ch32(x, y, z) { 23450 return x & y ^ ~x & z; 23451 } 23452 exports.ch32 = ch32; 23453 function maj32(x, y, z) { 23454 return x & y ^ x & z ^ y & z; 23455 } 23456 exports.maj32 = maj32; 23457 function p32(x, y, z) { 23458 return x ^ y ^ z; 23459 } 23460 exports.p32 = p32; 23461 function s0_256(x) { 23462 return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); 23463 } 23464 exports.s0_256 = s0_256; 23465 function s1_256(x) { 23466 return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); 23467 } 23468 exports.s1_256 = s1_256; 23469 function g0_256(x) { 23470 return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3; 23471 } 23472 exports.g0_256 = g0_256; 23473 function g1_256(x) { 23474 return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10; 23475 } 23476 exports.g1_256 = g1_256; 23477})); 23478//#endregion 23479//#region node_modules/hash.js/lib/hash/sha/1.js 23480var require__1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 23481 var utils = require_utils$1(); 23482 var common = require_common$1(); 23483 var shaCommon = require_common(); 23484 var rotl32 = utils.rotl32; 23485 var sum32 = utils.sum32; 23486 var sum32_5 = utils.sum32_5; 23487 var ft_1 = shaCommon.ft_1; 23488 var BlockHash = common.BlockHash; 23489 var sha1_K = [ 23490 1518500249, 23491 1859775393, 23492 2400959708, 23493 3395469782 23494 ]; 23495 function SHA1() { 23496 if (!(this instanceof SHA1)) return new SHA1(); 23497 BlockHash.call(this); 23498 this.h = [ 23499 1732584193, 23500 4023233417, 23501 2562383102, 23502 271733878, 23503 3285377520 23504 ]; 23505 this.W = new Array(80); 23506 } 23507 utils.inherits(SHA1, BlockHash); 23508 module.exports = SHA1; 23509 SHA1.blockSize = 512; 23510 SHA1.outSize = 160; 23511 SHA1.hmacStrength = 80; 23512 SHA1.padLength = 64; 23513 SHA1.prototype._update = function _update(msg, start) { 23514 var W = this.W; 23515 for (var i = 0; i < 16; i++) W[i] = msg[start + i]; 23516 for (; i < W.length; i++) W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); 23517 var a = this.h[0]; 23518 var b = this.h[1]; 23519 var c = this.h[2]; 23520 var d = this.h[3]; 23521 var e = this.h[4]; 23522 for (i = 0; i < W.length; i++) { 23523 var s = ~~(i / 20); 23524 var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]); 23525 e = d; 23526 d = c; 23527 c = rotl32(b, 30); 23528 b = a; 23529 a = t; 23530 } 23531 this.h[0] = sum32(this.h[0], a); 23532 this.h[1] = sum32(this.h[1], b); 23533 this.h[2] = sum32(this.h[2], c); 23534 this.h[3] = sum32(this.h[3], d); 23535 this.h[4] = sum32(this.h[4], e); 23536 }; 23537 SHA1.prototype._digest = function digest(enc) { 23538 if (enc === "hex") return utils.toHex32(this.h, "big"); 23539 else return utils.split32(this.h, "big"); 23540 }; 23541})); 23542//#endregion 23543//#region node_modules/hash.js/lib/hash/sha/256.js 23544var require__256 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 23545 var utils = require_utils$1(); 23546 var common = require_common$1(); 23547 var shaCommon = require_common(); 23548 var assert = require_minimalistic_assert(); 23549 var sum32 = utils.sum32; 23550 var sum32_4 = utils.sum32_4; 23551 var sum32_5 = utils.sum32_5; 23552 var ch32 = shaCommon.ch32; 23553 var maj32 = shaCommon.maj32; 23554 var s0_256 = shaCommon.s0_256; 23555 var s1_256 = shaCommon.s1_256; 23556 var g0_256 = shaCommon.g0_256; 23557 var g1_256 = shaCommon.g1_256; 23558 var BlockHash = common.BlockHash; 23559 var sha256_K = [ 23560 1116352408, 23561 1899447441, 23562 3049323471, 23563 3921009573, 23564 961987163, 23565 1508970993, 23566 2453635748, 23567 2870763221, 23568 3624381080, 23569 310598401, 23570 607225278, 23571 1426881987, 23572 1925078388, 23573 2162078206, 23574 2614888103, 23575 3248222580, 23576 3835390401, 23577 4022224774, 23578 264347078, 23579 604807628, 23580 770255983, 23581 1249150122, 23582 1555081692, 23583 1996064986, 23584 2554220882, 23585 2821834349, 23586 2952996808, 23587 3210313671, 23588 3336571891, 23589 3584528711, 23590 113926993, 23591 338241895, 23592 666307205, 23593 773529912, 23594 1294757372, 23595 1396182291, 23596 1695183700, 23597 1986661051, 23598 2177026350, 23599 2456956037, 23600 2730485921, 23601 2820302411, 23602 3259730800, 23603 3345764771, 23604 3516065817, 23605 3600352804, 23606 4094571909, 23607 275423344, 23608 430227734, 23609 506948616, 23610 659060556, 23611 883997877, 23612 958139571, 23613 1322822218, 23614 1537002063, 23615 1747873779, 23616 1955562222, 23617 2024104815, 23618 2227730452, 23619 2361852424, 23620 2428436474, 23621 2756734187, 23622 3204031479, 23623 3329325298 23624 ]; 23625 function SHA256() { 23626 if (!(this instanceof SHA256)) return new SHA256(); 23627 BlockHash.call(this); 23628 this.h = [ 23629 1779033703, 23630 3144134277, 23631 1013904242, 23632 2773480762, 23633 1359893119, 23634 2600822924, 23635 528734635, 23636 1541459225 23637 ]; 23638 this.k = sha256_K; 23639 this.W = new Array(64); 23640 } 23641 utils.inherits(SHA256, BlockHash); 23642 module.exports = SHA256; 23643 SHA256.blockSize = 512; 23644 SHA256.outSize = 256; 23645 SHA256.hmacStrength = 192; 23646 SHA256.padLength = 64; 23647 SHA256.prototype._update = function _update(msg, start) { 23648 var W = this.W; 23649 for (var i = 0; i < 16; i++) W[i] = msg[start + i]; 23650 for (; i < W.length; i++) W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); 23651 var a = this.h[0]; 23652 var b = this.h[1]; 23653 var c = this.h[2]; 23654 var d = this.h[3]; 23655 var e = this.h[4]; 23656 var f = this.h[5]; 23657 var g = this.h[6]; 23658 var h = this.h[7]; 23659 assert(this.k.length === W.length); 23660 for (i = 0; i < W.length; i++) { 23661 var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]); 23662 var T2 = sum32(s0_256(a), maj32(a, b, c)); 23663 h = g; 23664 g = f; 23665 f = e; 23666 e = sum32(d, T1); 23667 d = c; 23668 c = b; 23669 b = a; 23670 a = sum32(T1, T2); 23671 } 23672 this.h[0] = sum32(this.h[0], a); 23673 this.h[1] = sum32(this.h[1], b); 23674 this.h[2] = sum32(this.h[2], c); 23675 this.h[3] = sum32(this.h[3], d); 23676 this.h[4] = sum32(this.h[4], e); 23677 this.h[5] = sum32(this.h[5], f); 23678 this.h[6] = sum32(this.h[6], g); 23679 this.h[7] = sum32(this.h[7], h); 23680 }; 23681 SHA256.prototype._digest = function digest(enc) { 23682 if (enc === "hex") return utils.toHex32(this.h, "big"); 23683 else return utils.split32(this.h, "big"); 23684 }; 23685})); 23686//#endregion 23687//#region node_modules/hash.js/lib/hash/sha/224.js 23688var require__224 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 23689 var utils = require_utils$1(); 23690 var SHA256 = require__256(); 23691 function SHA224() { 23692 if (!(this instanceof SHA224)) return new SHA224(); 23693 SHA256.call(this); 23694 this.h = [ 23695 3238371032, 23696 914150663, 23697 812702999, 23698 4144912697, 23699 4290775857, 23700 1750603025, 23701 1694076839, 23702 3204075428 23703 ]; 23704 } 23705 utils.inherits(SHA224, SHA256); 23706 module.exports = SHA224; 23707 SHA224.blockSize = 512; 23708 SHA224.outSize = 224; 23709 SHA224.hmacStrength = 192; 23710 SHA224.padLength = 64; 23711 SHA224.prototype._digest = function digest(enc) { 23712 if (enc === "hex") return utils.toHex32(this.h.slice(0, 7), "big"); 23713 else return utils.split32(this.h.slice(0, 7), "big"); 23714 }; 23715})); 23716//#endregion 23717//#region node_modules/hash.js/lib/hash/sha/512.js 23718var require__512 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 23719 var utils = require_utils$1(); 23720 var common = require_common$1(); 23721 var assert = require_minimalistic_assert(); 23722 var rotr64_hi = utils.rotr64_hi; 23723 var rotr64_lo = utils.rotr64_lo; 23724 var shr64_hi = utils.shr64_hi; 23725 var shr64_lo = utils.shr64_lo; 23726 var sum64 = utils.sum64; 23727 var sum64_hi = utils.sum64_hi; 23728 var sum64_lo = utils.sum64_lo; 23729 var sum64_4_hi = utils.sum64_4_hi; 23730 var sum64_4_lo = utils.sum64_4_lo; 23731 var sum64_5_hi = utils.sum64_5_hi; 23732 var sum64_5_lo = utils.sum64_5_lo; 23733 var BlockHash = common.BlockHash; 23734 var sha512_K = [ 23735 1116352408, 23736 3609767458, 23737 1899447441, 23738 602891725, 23739 3049323471, 23740 3964484399, 23741 3921009573, 23742 2173295548, 23743 961987163, 23744 4081628472, 23745 1508970993, 23746 3053834265, 23747 2453635748, 23748 2937671579, 23749 2870763221, 23750 3664609560, 23751 3624381080, 23752 2734883394, 23753 310598401, 23754 1164996542, 23755 607225278, 23756 1323610764, 23757 1426881987, 23758 3590304994, 23759 1925078388, 23760 4068182383, 23761 2162078206, 23762 991336113, 23763 2614888103, 23764 633803317, 23765 3248222580, 23766 3479774868, 23767 3835390401, 23768 2666613458, 23769 4022224774, 23770 944711139, 23771 264347078, 23772 2341262773, 23773 604807628, 23774 2007800933, 23775 770255983, 23776 1495990901, 23777 1249150122, 23778 1856431235, 23779 1555081692, 23780 3175218132, 23781 1996064986, 23782 2198950837, 23783 2554220882, 23784 3999719339, 23785 2821834349, 23786 766784016, 23787 2952996808, 23788 2566594879, 23789 3210313671, 23790 3203337956, 23791 3336571891, 23792 1034457026, 23793 3584528711, 23794 2466948901, 23795 113926993, 23796 3758326383, 23797 338241895, 23798 168717936, 23799 666307205, 23800 1188179964, 23801 773529912, 23802 1546045734, 23803 1294757372, 23804 1522805485, 23805 1396182291, 23806 2643833823, 23807 1695183700, 23808 2343527390, 23809 1986661051, 23810 1014477480, 23811 2177026350, 23812 1206759142, 23813 2456956037, 23814 344077627, 23815 2730485921, 23816 1290863460, 23817 2820302411, 23818 3158454273, 23819 3259730800, 23820 3505952657, 23821 3345764771, 23822 106217008, 23823 3516065817, 23824 3606008344, 23825 3600352804, 23826 1432725776, 23827 4094571909, 23828 1467031594, 23829 275423344, 23830 851169720, 23831 430227734, 23832 3100823752, 23833 506948616, 23834 1363258195, 23835 659060556, 23836 3750685593, 23837 883997877, 23838 3785050280, 23839 958139571, 23840 3318307427, 23841 1322822218, 23842 3812723403, 23843 1537002063, 23844 2003034995, 23845 1747873779, 23846 3602036899, 23847 1955562222, 23848 1575990012, 23849 2024104815, 23850 1125592928, 23851 2227730452, 23852 2716904306, 23853 2361852424, 23854 442776044, 23855 2428436474, 23856 593698344, 23857 2756734187, 23858 3733110249, 23859 3204031479, 23860 2999351573, 23861 3329325298, 23862 3815920427, 23863 3391569614, 23864 3928383900, 23865 3515267271, 23866 566280711, 23867 3940187606, 23868 3454069534, 23869 4118630271, 23870 4000239992, 23871 116418474, 23872 1914138554, 23873 174292421, 23874 2731055270, 23875 289380356, 23876 3203993006, 23877 460393269, 23878 320620315, 23879 685471733, 23880 587496836, 23881 852142971, 23882 1086792851, 23883 1017036298, 23884 365543100, 23885 1126000580, 23886 2618297676, 23887 1288033470, 23888 3409855158, 23889 1501505948, 23890 4234509866, 23891 1607167915, 23892 987167468, 23893 1816402316, 23894 1246189591 23895 ]; 23896 function SHA512() { 23897 if (!(this instanceof SHA512)) return new SHA512(); 23898 BlockHash.call(this); 23899 this.h = [ 23900 1779033703, 23901 4089235720, 23902 3144134277, 23903 2227873595, 23904 1013904242, 23905 4271175723, 23906 2773480762, 23907 1595750129, 23908 1359893119, 23909 2917565137, 23910 2600822924, 23911 725511199, 23912 528734635, 23913 4215389547, 23914 1541459225, 23915 327033209 23916 ]; 23917 this.k = sha512_K; 23918 this.W = new Array(160); 23919 } 23920 utils.inherits(SHA512, BlockHash); 23921 module.exports = SHA512; 23922 SHA512.blockSize = 1024; 23923 SHA512.outSize = 512; 23924 SHA512.hmacStrength = 192; 23925 SHA512.padLength = 128; 23926 SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { 23927 var W = this.W; 23928 for (var i = 0; i < 32; i++) W[i] = msg[start + i]; 23929 for (; i < W.length; i += 2) { 23930 var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); 23931 var c0_lo = g1_512_lo(W[i - 4], W[i - 3]); 23932 var c1_hi = W[i - 14]; 23933 var c1_lo = W[i - 13]; 23934 var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); 23935 var c2_lo = g0_512_lo(W[i - 30], W[i - 29]); 23936 var c3_hi = W[i - 32]; 23937 var c3_lo = W[i - 31]; 23938 W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo); 23939 W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo); 23940 } 23941 }; 23942 SHA512.prototype._update = function _update(msg, start) { 23943 this._prepareBlock(msg, start); 23944 var W = this.W; 23945 var ah = this.h[0]; 23946 var al = this.h[1]; 23947 var bh = this.h[2]; 23948 var bl = this.h[3]; 23949 var ch = this.h[4]; 23950 var cl = this.h[5]; 23951 var dh = this.h[6]; 23952 var dl = this.h[7]; 23953 var eh = this.h[8]; 23954 var el = this.h[9]; 23955 var fh = this.h[10]; 23956 var fl = this.h[11]; 23957 var gh = this.h[12]; 23958 var gl = this.h[13]; 23959 var hh = this.h[14]; 23960 var hl = this.h[15]; 23961 assert(this.k.length === W.length); 23962 for (var i = 0; i < W.length; i += 2) { 23963 var c0_hi = hh; 23964 var c0_lo = hl; 23965 var c1_hi = s1_512_hi(eh, el); 23966 var c1_lo = s1_512_lo(eh, el); 23967 var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); 23968 var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); 23969 var c3_hi = this.k[i]; 23970 var c3_lo = this.k[i + 1]; 23971 var c4_hi = W[i]; 23972 var c4_lo = W[i + 1]; 23973 var T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo); 23974 var T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo); 23975 c0_hi = s0_512_hi(ah, al); 23976 c0_lo = s0_512_lo(ah, al); 23977 c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); 23978 c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); 23979 var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); 23980 var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); 23981 hh = gh; 23982 hl = gl; 23983 gh = fh; 23984 gl = fl; 23985 fh = eh; 23986 fl = el; 23987 eh = sum64_hi(dh, dl, T1_hi, T1_lo); 23988 el = sum64_lo(dl, dl, T1_hi, T1_lo); 23989 dh = ch; 23990 dl = cl; 23991 ch = bh; 23992 cl = bl; 23993 bh = ah; 23994 bl = al; 23995 ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); 23996 al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); 23997 } 23998 sum64(this.h, 0, ah, al); 23999 sum64(this.h, 2, bh, bl); 24000 sum64(this.h, 4, ch, cl); 24001 sum64(this.h, 6, dh, dl); 24002 sum64(this.h, 8, eh, el); 24003 sum64(this.h, 10, fh, fl); 24004 sum64(this.h, 12, gh, gl); 24005 sum64(this.h, 14, hh, hl); 24006 }; 24007 SHA512.prototype._digest = function digest(enc) { 24008 if (enc === "hex") return utils.toHex32(this.h, "big"); 24009 else return utils.split32(this.h, "big"); 24010 }; 24011 function ch64_hi(xh, xl, yh, yl, zh) { 24012 var r = xh & yh ^ ~xh & zh; 24013 if (r < 0) r += 4294967296; 24014 return r; 24015 } 24016 function ch64_lo(xh, xl, yh, yl, zh, zl) { 24017 var r = xl & yl ^ ~xl & zl; 24018 if (r < 0) r += 4294967296; 24019 return r; 24020 } 24021 function maj64_hi(xh, xl, yh, yl, zh) { 24022 var r = xh & yh ^ xh & zh ^ yh & zh; 24023 if (r < 0) r += 4294967296; 24024 return r; 24025 } 24026 function maj64_lo(xh, xl, yh, yl, zh, zl) { 24027 var r = xl & yl ^ xl & zl ^ yl & zl; 24028 if (r < 0) r += 4294967296; 24029 return r; 24030 } 24031 function s0_512_hi(xh, xl) { 24032 var c0_hi = rotr64_hi(xh, xl, 28); 24033 var c1_hi = rotr64_hi(xl, xh, 2); 24034 var c2_hi = rotr64_hi(xl, xh, 7); 24035 var r = c0_hi ^ c1_hi ^ c2_hi; 24036 if (r < 0) r += 4294967296; 24037 return r; 24038 } 24039 function s0_512_lo(xh, xl) { 24040 var c0_lo = rotr64_lo(xh, xl, 28); 24041 var c1_lo = rotr64_lo(xl, xh, 2); 24042 var c2_lo = rotr64_lo(xl, xh, 7); 24043 var r = c0_lo ^ c1_lo ^ c2_lo; 24044 if (r < 0) r += 4294967296; 24045 return r; 24046 } 24047 function s1_512_hi(xh, xl) { 24048 var c0_hi = rotr64_hi(xh, xl, 14); 24049 var c1_hi = rotr64_hi(xh, xl, 18); 24050 var c2_hi = rotr64_hi(xl, xh, 9); 24051 var r = c0_hi ^ c1_hi ^ c2_hi; 24052 if (r < 0) r += 4294967296; 24053 return r; 24054 } 24055 function s1_512_lo(xh, xl) { 24056 var c0_lo = rotr64_lo(xh, xl, 14); 24057 var c1_lo = rotr64_lo(xh, xl, 18); 24058 var c2_lo = rotr64_lo(xl, xh, 9); 24059 var r = c0_lo ^ c1_lo ^ c2_lo; 24060 if (r < 0) r += 4294967296; 24061 return r; 24062 } 24063 function g0_512_hi(xh, xl) { 24064 var c0_hi = rotr64_hi(xh, xl, 1); 24065 var c1_hi = rotr64_hi(xh, xl, 8); 24066 var c2_hi = shr64_hi(xh, xl, 7); 24067 var r = c0_hi ^ c1_hi ^ c2_hi; 24068 if (r < 0) r += 4294967296; 24069 return r; 24070 } 24071 function g0_512_lo(xh, xl) { 24072 var c0_lo = rotr64_lo(xh, xl, 1); 24073 var c1_lo = rotr64_lo(xh, xl, 8); 24074 var c2_lo = shr64_lo(xh, xl, 7); 24075 var r = c0_lo ^ c1_lo ^ c2_lo; 24076 if (r < 0) r += 4294967296; 24077 return r; 24078 } 24079 function g1_512_hi(xh, xl) { 24080 var c0_hi = rotr64_hi(xh, xl, 19); 24081 var c1_hi = rotr64_hi(xl, xh, 29); 24082 var c2_hi = shr64_hi(xh, xl, 6); 24083 var r = c0_hi ^ c1_hi ^ c2_hi; 24084 if (r < 0) r += 4294967296; 24085 return r; 24086 } 24087 function g1_512_lo(xh, xl) { 24088 var c0_lo = rotr64_lo(xh, xl, 19); 24089 var c1_lo = rotr64_lo(xl, xh, 29); 24090 var c2_lo = shr64_lo(xh, xl, 6); 24091 var r = c0_lo ^ c1_lo ^ c2_lo; 24092 if (r < 0) r += 4294967296; 24093 return r; 24094 } 24095})); 24096//#endregion 24097//#region node_modules/hash.js/lib/hash/sha/384.js 24098var require__384 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 24099 var utils = require_utils$1(); 24100 var SHA512 = require__512(); 24101 function SHA384() { 24102 if (!(this instanceof SHA384)) return new SHA384(); 24103 SHA512.call(this); 24104 this.h = [ 24105 3418070365, 24106 3238371032, 24107 1654270250, 24108 914150663, 24109 2438529370, 24110 812702999, 24111 355462360, 24112 4144912697, 24113 1731405415, 24114 4290775857, 24115 2394180231, 24116 1750603025, 24117 3675008525, 24118 1694076839, 24119 1203062813, 24120 3204075428 24121 ]; 24122 } 24123 utils.inherits(SHA384, SHA512); 24124 module.exports = SHA384; 24125 SHA384.blockSize = 1024; 24126 SHA384.outSize = 384; 24127 SHA384.hmacStrength = 192; 24128 SHA384.padLength = 128; 24129 SHA384.prototype._digest = function digest(enc) { 24130 if (enc === "hex") return utils.toHex32(this.h.slice(0, 12), "big"); 24131 else return utils.split32(this.h.slice(0, 12), "big"); 24132 }; 24133})); 24134//#endregion 24135//#region node_modules/hash.js/lib/hash/sha.js 24136var require_sha = /* @__PURE__ */ __commonJSMin(((exports) => { 24137 exports.sha1 = require__1(); 24138 exports.sha224 = require__224(); 24139 exports.sha256 = require__256(); 24140 exports.sha384 = require__384(); 24141 exports.sha512 = require__512(); 24142})); 24143//#endregion 24144//#region node_modules/hash.js/lib/hash/ripemd.js 24145var require_ripemd = /* @__PURE__ */ __commonJSMin(((exports) => { 24146 var utils = require_utils$1(); 24147 var common = require_common$1(); 24148 var rotl32 = utils.rotl32; 24149 var sum32 = utils.sum32; 24150 var sum32_3 = utils.sum32_3; 24151 var sum32_4 = utils.sum32_4; 24152 var BlockHash = common.BlockHash; 24153 function RIPEMD160() { 24154 if (!(this instanceof RIPEMD160)) return new RIPEMD160(); 24155 BlockHash.call(this); 24156 this.h = [ 24157 1732584193, 24158 4023233417, 24159 2562383102, 24160 271733878, 24161 3285377520 24162 ]; 24163 this.endian = "little"; 24164 } 24165 utils.inherits(RIPEMD160, BlockHash); 24166 exports.ripemd160 = RIPEMD160; 24167 RIPEMD160.blockSize = 512; 24168 RIPEMD160.outSize = 160; 24169 RIPEMD160.hmacStrength = 192; 24170 RIPEMD160.padLength = 64; 24171 RIPEMD160.prototype._update = function update(msg, start) { 24172 var A = this.h[0]; 24173 var B = this.h[1]; 24174 var C = this.h[2]; 24175 var D = this.h[3]; 24176 var E = this.h[4]; 24177 var Ah = A; 24178 var Bh = B; 24179 var Ch = C; 24180 var Dh = D; 24181 var Eh = E; 24182 for (var j = 0; j < 80; j++) { 24183 var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E); 24184 A = E; 24185 E = D; 24186 D = rotl32(C, 10); 24187 C = B; 24188 B = T; 24189 T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh);
vendor: 8,361 bytes, lines 24190-24638
24190 Ah = Eh; 24191 Eh = Dh; 24192 Dh = rotl32(Ch, 10); 24193 Ch = Bh; 24194 Bh = T; 24195 } 24196 T = sum32_3(this.h[1], C, Dh); 24197 this.h[1] = sum32_3(this.h[2], D, Eh); 24198 this.h[2] = sum32_3(this.h[3], E, Ah); 24199 this.h[3] = sum32_3(this.h[4], A, Bh); 24200 this.h[4] = sum32_3(this.h[0], B, Ch); 24201 this.h[0] = T; 24202 }; 24203 RIPEMD160.prototype._digest = function digest(enc) { 24204 if (enc === "hex") return utils.toHex32(this.h, "little"); 24205 else return utils.split32(this.h, "little"); 24206 }; 24207 function f(j, x, y, z) { 24208 if (j <= 15) return x ^ y ^ z; 24209 else if (j <= 31) return x & y | ~x & z; 24210 else if (j <= 47) return (x | ~y) ^ z; 24211 else if (j <= 63) return x & z | y & ~z; 24212 else return x ^ (y | ~z); 24213 } 24214 function K(j) { 24215 if (j <= 15) return 0; 24216 else if (j <= 31) return 1518500249; 24217 else if (j <= 47) return 1859775393; 24218 else if (j <= 63) return 2400959708; 24219 else return 2840853838; 24220 } 24221 function Kh(j) { 24222 if (j <= 15) return 1352829926; 24223 else if (j <= 31) return 1548603684; 24224 else if (j <= 47) return 1836072691; 24225 else if (j <= 63) return 2053994217; 24226 else return 0; 24227 } 24228 var r = [ 24229 0, 24230 1, 24231 2, 24232 3, 24233 4, 24234 5, 24235 6, 24236 7, 24237 8, 24238 9, 24239 10, 24240 11, 24241 12, 24242 13, 24243 14, 24244 15, 24245 7, 24246 4, 24247 13, 24248 1, 24249 10, 24250 6, 24251 15, 24252 3, 24253 12, 24254 0, 24255 9, 24256 5, 24257 2, 24258 14, 24259 11, 24260 8, 24261 3, 24262 10, 24263 14, 24264 4, 24265 9, 24266 15, 24267 8, 24268 1, 24269 2, 24270 7, 24271 0, 24272 6, 24273 13, 24274 11, 24275 5, 24276 12, 24277 1, 24278 9, 24279 11, 24280 10, 24281 0, 24282 8, 24283 12, 24284 4, 24285 13, 24286 3, 24287 7, 24288 15, 24289 14, 24290 5, 24291 6, 24292 2, 24293 4, 24294 0, 24295 5, 24296 9, 24297 7, 24298 12, 24299 2, 24300 10, 24301 14, 24302 1, 24303 3, 24304 8, 24305 11, 24306 6, 24307 15, 24308 13 24309 ]; 24310 var rh = [ 24311 5, 24312 14, 24313 7, 24314 0, 24315 9, 24316 2, 24317 11, 24318 4, 24319 13, 24320 6, 24321 15, 24322 8, 24323 1, 24324 10, 24325 3, 24326 12, 24327 6, 24328 11, 24329 3, 24330 7, 24331 0, 24332 13, 24333 5, 24334 10, 24335 14, 24336 15, 24337 8, 24338 12, 24339 4, 24340 9, 24341 1, 24342 2, 24343 15, 24344 5, 24345 1, 24346 3, 24347 7, 24348 14, 24349 6, 24350 9, 24351 11, 24352 8, 24353 12, 24354 2, 24355 10, 24356 0, 24357 4, 24358 13, 24359 8, 24360 6, 24361 4, 24362 1, 24363 3, 24364 11, 24365 15, 24366 0, 24367 5, 24368 12, 24369 2, 24370 13, 24371 9, 24372 7, 24373 10, 24374 14, 24375 12, 24376 15, 24377 10, 24378 4, 24379 1, 24380 5, 24381 8, 24382 7, 24383 6, 24384 2, 24385 13, 24386 14, 24387 0, 24388 3, 24389 9, 24390 11 24391 ]; 24392 var s = [ 24393 11, 24394 14, 24395 15, 24396 12, 24397 5, 24398 8, 24399 7, 24400 9, 24401 11, 24402 13, 24403 14, 24404 15, 24405 6, 24406 7, 24407 9, 24408 8, 24409 7, 24410 6, 24411 8, 24412 13, 24413 11, 24414 9, 24415 7, 24416 15, 24417 7, 24418 12, 24419 15, 24420 9, 24421 11, 24422 7, 24423 13, 24424 12, 24425 11, 24426 13, 24427 6, 24428 7, 24429 14, 24430 9, 24431 13, 24432 15, 24433 14, 24434 8, 24435 13, 24436 6, 24437 5, 24438 12, 24439 7, 24440 5, 24441 11, 24442 12, 24443 14, 24444 15, 24445 14, 24446 15, 24447 9, 24448 8, 24449 9, 24450 14, 24451 5, 24452 6, 24453 8, 24454 6, 24455 5, 24456 12, 24457 9, 24458 15, 24459 5, 24460 11, 24461 6, 24462 8, 24463 13, 24464 12, 24465 5, 24466 12, 24467 13, 24468 14, 24469 11, 24470 8, 24471 5, 24472 6 24473 ]; 24474 var sh = [ 24475 8, 24476 9, 24477 9, 24478 11, 24479 13, 24480 15, 24481 15, 24482 5, 24483 7, 24484 7, 24485 8, 24486 11, 24487 14, 24488 14, 24489 12, 24490 6, 24491 9, 24492 13, 24493 15, 24494 7, 24495 12, 24496 8, 24497 9, 24498 11, 24499 7, 24500 7, 24501 12, 24502 7, 24503 6, 24504 15, 24505 13, 24506 11, 24507 9, 24508 7, 24509 15, 24510 11, 24511 8, 24512 6, 24513 6, 24514 14, 24515 12, 24516 13, 24517 5, 24518 14, 24519 13, 24520 13, 24521 7, 24522 5, 24523 15, 24524 5, 24525 8, 24526 11, 24527 14, 24528 14, 24529 6, 24530 14, 24531 6, 24532 9, 24533 12, 24534 9, 24535 12, 24536 5, 24537 15, 24538 8, 24539 8, 24540 5, 24541 12, 24542 9, 24543 12, 24544 5, 24545 14, 24546 6, 24547 8, 24548 13, 24549 6, 24550 5, 24551 15, 24552 13, 24553 11, 24554 11 24555 ]; 24556})); 24557//#endregion 24558//#region node_modules/hash.js/lib/hash/hmac.js 24559var require_hmac$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 24560 var utils = require_utils$1(); 24561 var assert = require_minimalistic_assert(); 24562 function Hmac(hash, key, enc) { 24563 if (!(this instanceof Hmac)) return new Hmac(hash, key, enc); 24564 this.Hash = hash; 24565 this.blockSize = hash.blockSize / 8; 24566 this.outSize = hash.outSize / 8; 24567 this.inner = null; 24568 this.outer = null; 24569 this._init(utils.toArray(key, enc)); 24570 } 24571 module.exports = Hmac; 24572 Hmac.prototype._init = function init(key) { 24573 if (key.length > this.blockSize) key = new this.Hash().update(key).digest(); 24574 assert(key.length <= this.blockSize); 24575 for (var i = key.length; i < this.blockSize; i++) key.push(0); 24576 for (i = 0; i < key.length; i++) key[i] ^= 54; 24577 this.inner = new this.Hash().update(key); 24578 for (i = 0; i < key.length; i++) key[i] ^= 106; 24579 this.outer = new this.Hash().update(key); 24580 }; 24581 Hmac.prototype.update = function update(msg, enc) { 24582 this.inner.update(msg, enc); 24583 return this; 24584 }; 24585 Hmac.prototype.digest = function digest(enc) { 24586 this.outer.update(this.inner.digest()); 24587 return this.outer.digest(enc); 24588 }; 24589})); 24590//#endregion 24591//#region node_modules/hash.js/lib/hash.js 24592var require_hash = /* @__PURE__ */ __commonJSMin(((exports) => { 24593 var hash = exports; 24594 hash.utils = require_utils$1(); 24595 hash.common = require_common$1(); 24596 hash.sha = require_sha(); 24597 hash.ripemd = require_ripemd(); 24598 hash.hmac = require_hmac$1(); 24599 hash.sha1 = hash.sha.sha1; 24600 hash.sha256 = hash.sha.sha256; 24601 hash.sha224 = hash.sha.sha224; 24602 hash.sha384 = hash.sha.sha384; 24603 hash.sha512 = hash.sha.sha512; 24604 hash.ripemd160 = hash.ripemd.ripemd160; 24605})); 24606//#endregion 24607//#region node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js 24608var require_secp256k1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 24609 module.exports = { 24610 doubles: { 24611 step: 4, 24612 points: [ 24613 ["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], 24614 ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], 24615 ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], 24616 ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], 24617 ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], 24618 ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], 24619 ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], 24620 ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], 24621 ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], 24622 ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], 24623 ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], 24624 ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], 24625 ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], 24626 ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], 24627 ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], 24628 ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], 24629 ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], 24630 ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], 24631 ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], 24632 ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], 24633 ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], 24634 ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], 24635 ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], 24636 ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], 24637 ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], 24638 ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb89
246381", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], 24639 ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], 24640 ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], 24641 ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], 24642 ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], 24643 ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], 24644 ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], 24645 ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], 24646 ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], 24647 ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], 24648 ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], 24649 ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], 24650 ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], 24651 ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], 24652 ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], 24653 ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], 24654 ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], 24655 ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], 24656 ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], 24657 ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], 24658 ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], 24659 ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], 24660 ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], 24661 ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], 24662 ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], 24663 ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], 24664 ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], 24665 ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], 24666 ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], 24667 ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], 24668 ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],
24669 ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], 24670 ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], 24671 ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], 24672 ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], 24673 ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], 24674 ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], 24675 ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], 24676 ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], 24677 ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"] 24678 ] 24679 }, 24680 naf: { 24681 wnd: 7, 24682 points: [ 24683 ["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], 24684 ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], 24685 ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], 24686 ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], 24687 ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], 24688 ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], 24689 ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], 24690 ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], 24691 ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], 24692 ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], 24693 ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], 24694 ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], 24695 ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], 24696 ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], 24697 ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], 24698 ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], 24699 ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], 24700 ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], 24701 ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], 24702 ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], 24703 ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], 24704 ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], 24705 ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], 24706 ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], 24707 ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], 24708 ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], 24709 ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], 24710 ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], 24711 ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], 24712 ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],
24713 ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], 24714 ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], 24715 ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], 24716 ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], 24717 ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], 24718 ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], 24719 ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], 24720 ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], 24721 ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], 24722 ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], 24723 ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], 24724 ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], 24725 ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], 24726 ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], 24727 ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], 24728 ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], 24729 ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], 24730 ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], 24731 ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], 24732 ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], 24733 ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], 24734 ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], 24735 ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], 24736 ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], 24737 ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], 24738 ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], 24739 ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], 24740 ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], 24741 ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], 24742 ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], 24743 ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],
24744 ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], 24745 ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], 24746 ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], 24747 ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], 24748 ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], 24749 ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], 24750 ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], 24751 ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], 24752 ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],
24753 ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], 24754 ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], 24755 ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], 24756 ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], 24757 ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], 24758 ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], 24759 ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], 24760 ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], 24761 ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], 24762 ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], 24763 ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], 24764 ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], 24765 ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], 24766 ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], 24767 ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], 24768 ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], 24769 ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], 24770 ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], 24771 ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], 24772 ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], 24773 ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], 24774 ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], 24775 ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], 24776 ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], 24777 ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], 24778 ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], 24779 ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], 24780 ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], 24781 ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], 24782 ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], 24783 ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], 24784 ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], 24785 ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], 24786 ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], 24787 ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81f
vendor: 59,870 bytes, lines 24787-26588
24787c8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], 24788 ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], 24789 ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], 24790 ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], 24791 ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], 24792 ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], 24793 ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], 24794 ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], 24795 ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], 24796 ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], 24797 ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], 24798 ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], 24799 ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], 24800 ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], 24801 ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], 24802 ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], 24803 ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], 24804 ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], 24805 ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], 24806 ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], 24807 ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], 24808 ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], 24809 ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"] 24810 ] 24811 } 24812 }; 24813})); 24814//#endregion 24815//#region node_modules/elliptic/lib/elliptic/curves.js 24816var require_curves = /* @__PURE__ */ __commonJSMin(((exports) => { 24817 var curves = exports; 24818 var hash = require_hash(); 24819 var curve = require_curve(); 24820 var assert = require_utils$2().assert; 24821 function PresetCurve(options) { 24822 if (options.type === "short") this.curve = new curve.short(options); 24823 else if (options.type === "edwards") this.curve = new curve.edwards(options); 24824 else this.curve = new curve.mont(options); 24825 this.g = this.curve.g; 24826 this.n = this.curve.n; 24827 this.hash = options.hash; 24828 assert(this.g.validate(), "Invalid curve"); 24829 assert(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); 24830 } 24831 curves.PresetCurve = PresetCurve; 24832 function defineCurve(name, options) { 24833 Object.defineProperty(curves, name, { 24834 configurable: true, 24835 enumerable: true, 24836 get: function() { 24837 var curve = new PresetCurve(options); 24838 Object.defineProperty(curves, name, { 24839 configurable: true, 24840 enumerable: true, 24841 value: curve 24842 }); 24843 return curve; 24844 } 24845 }); 24846 } 24847 defineCurve("p192", { 24848 type: "short", 24849 prime: "p192", 24850 p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", 24851 a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", 24852 b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", 24853 n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", 24854 hash: hash.sha256, 24855 gRed: false, 24856 g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] 24857 }); 24858 defineCurve("p224", { 24859 type: "short", 24860 prime: "p224", 24861 p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", 24862 a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", 24863 b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", 24864 n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", 24865 hash: hash.sha256, 24866 gRed: false, 24867 g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] 24868 }); 24869 defineCurve("p256", { 24870 type: "short", 24871 prime: null, 24872 p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", 24873 a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", 24874 b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", 24875 n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", 24876 hash: hash.sha256, 24877 gRed: false, 24878 g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] 24879 }); 24880 defineCurve("p384", { 24881 type: "short", 24882 prime: null, 24883 p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", 24884 a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", 24885 b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", 24886 n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", 24887 hash: hash.sha384, 24888 gRed: false, 24889 g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"] 24890 }); 24891 defineCurve("p521", { 24892 type: "short", 24893 prime: null, 24894 p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", 24895 a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", 24896 b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", 24897 n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", 24898 hash: hash.sha512, 24899 gRed: false, 24900 g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"] 24901 }); 24902 defineCurve("curve25519", { 24903 type: "mont", 24904 prime: "p25519", 24905 p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", 24906 a: "76d06", 24907 b: "1", 24908 n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", 24909 hash: hash.sha256, 24910 gRed: false, 24911 g: ["9"] 24912 }); 24913 defineCurve("ed25519", { 24914 type: "edwards", 24915 prime: "p25519", 24916 p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", 24917 a: "-1", 24918 c: "1", 24919 d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", 24920 n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", 24921 hash: hash.sha256, 24922 gRed: false, 24923 g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"] 24924 }); 24925 var pre; 24926 try { 24927 pre = require_secp256k1(); 24928 } catch (e) { 24929 pre = void 0; 24930 } 24931 defineCurve("secp256k1", { 24932 type: "short", 24933 prime: "k256", 24934 p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", 24935 a: "0", 24936 b: "7", 24937 n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", 24938 h: "1", 24939 hash: hash.sha256, 24940 beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", 24941 lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", 24942 basis: [{ 24943 a: "3086d221a7d46bcde86c90e49284eb15", 24944 b: "-e4437ed6010e88286f547fa90abfe4c3" 24945 }, { 24946 a: "114ca50f7a8e2f3f657c1108d9d44cfd8", 24947 b: "3086d221a7d46bcde86c90e49284eb15" 24948 }], 24949 gRed: false, 24950 g: [ 24951 "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", 24952 "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", 24953 pre 24954 ] 24955 }); 24956})); 24957//#endregion 24958//#region node_modules/hmac-drbg/lib/hmac-drbg.js 24959var require_hmac_drbg = /* @__PURE__ */ __commonJSMin(((exports, module) => { 24960 var hash = require_hash(); 24961 var utils = require_utils$3(); 24962 var assert = require_minimalistic_assert(); 24963 function HmacDRBG(options) { 24964 if (!(this instanceof HmacDRBG)) return new HmacDRBG(options); 24965 this.hash = options.hash; 24966 this.predResist = !!options.predResist; 24967 this.outLen = this.hash.outSize; 24968 this.minEntropy = options.minEntropy || this.hash.hmacStrength; 24969 this._reseed = null; 24970 this.reseedInterval = null; 24971 this.K = null; 24972 this.V = null; 24973 var entropy = utils.toArray(options.entropy, options.entropyEnc || "hex"); 24974 var nonce = utils.toArray(options.nonce, options.nonceEnc || "hex"); 24975 var pers = utils.toArray(options.pers, options.persEnc || "hex"); 24976 assert(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); 24977 this._init(entropy, nonce, pers); 24978 } 24979 module.exports = HmacDRBG; 24980 HmacDRBG.prototype._init = function init(entropy, nonce, pers) { 24981 var seed = entropy.concat(nonce).concat(pers); 24982 this.K = new Array(this.outLen / 8); 24983 this.V = new Array(this.outLen / 8); 24984 for (var i = 0; i < this.V.length; i++) { 24985 this.K[i] = 0; 24986 this.V[i] = 1; 24987 } 24988 this._update(seed); 24989 this._reseed = 1; 24990 this.reseedInterval = 281474976710656; 24991 }; 24992 HmacDRBG.prototype._hmac = function hmac() { 24993 return new hash.hmac(this.hash, this.K); 24994 }; 24995 HmacDRBG.prototype._update = function update(seed) { 24996 var kmac = this._hmac().update(this.V).update([0]); 24997 if (seed) kmac = kmac.update(seed); 24998 this.K = kmac.digest(); 24999 this.V = this._hmac().update(this.V).digest(); 25000 if (!seed) return; 25001 this.K = this._hmac().update(this.V).update([1]).update(seed).digest(); 25002 this.V = this._hmac().update(this.V).digest(); 25003 }; 25004 HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { 25005 if (typeof entropyEnc !== "string") { 25006 addEnc = add; 25007 add = entropyEnc; 25008 entropyEnc = null; 25009 } 25010 entropy = utils.toArray(entropy, entropyEnc); 25011 add = utils.toArray(add, addEnc); 25012 assert(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); 25013 this._update(entropy.concat(add || [])); 25014 this._reseed = 1; 25015 }; 25016 HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { 25017 if (this._reseed > this.reseedInterval) throw new Error("Reseed is required"); 25018 if (typeof enc !== "string") { 25019 addEnc = add; 25020 add = enc; 25021 enc = null; 25022 } 25023 if (add) { 25024 add = utils.toArray(add, addEnc || "hex"); 25025 this._update(add); 25026 } 25027 var temp = []; 25028 while (temp.length < len) { 25029 this.V = this._hmac().update(this.V).digest(); 25030 temp = temp.concat(this.V); 25031 } 25032 var res = temp.slice(0, len); 25033 this._update(add); 25034 this._reseed++; 25035 return utils.encode(res, enc); 25036 }; 25037})); 25038//#endregion 25039//#region node_modules/elliptic/lib/elliptic/ec/key.js 25040var require_key$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25041 var BN = require_bn$1(); 25042 var assert = require_utils$2().assert; 25043 function KeyPair(ec, options) { 25044 this.ec = ec; 25045 this.priv = null; 25046 this.pub = null; 25047 if (options.priv) this._importPrivate(options.priv, options.privEnc); 25048 if (options.pub) this._importPublic(options.pub, options.pubEnc); 25049 } 25050 module.exports = KeyPair; 25051 KeyPair.fromPublic = function fromPublic(ec, pub, enc) { 25052 if (pub instanceof KeyPair) return pub; 25053 return new KeyPair(ec, { 25054 pub, 25055 pubEnc: enc 25056 }); 25057 }; 25058 KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { 25059 if (priv instanceof KeyPair) return priv; 25060 return new KeyPair(ec, { 25061 priv, 25062 privEnc: enc 25063 }); 25064 }; 25065 KeyPair.prototype.validate = function validate() { 25066 var pub = this.getPublic(); 25067 if (pub.isInfinity()) return { 25068 result: false, 25069 reason: "Invalid public key" 25070 }; 25071 if (!pub.validate()) return { 25072 result: false, 25073 reason: "Public key is not a point" 25074 }; 25075 if (!pub.mul(this.ec.curve.n).isInfinity()) return { 25076 result: false, 25077 reason: "Public key * N != O" 25078 }; 25079 return { 25080 result: true, 25081 reason: null 25082 }; 25083 }; 25084 KeyPair.prototype.getPublic = function getPublic(compact, enc) { 25085 if (typeof compact === "string") { 25086 enc = compact; 25087 compact = null; 25088 } 25089 if (!this.pub) this.pub = this.ec.g.mul(this.priv); 25090 if (!enc) return this.pub; 25091 return this.pub.encode(enc, compact); 25092 }; 25093 KeyPair.prototype.getPrivate = function getPrivate(enc) { 25094 if (enc === "hex") return this.priv.toString(16, 2); 25095 else return this.priv; 25096 }; 25097 KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { 25098 this.priv = new BN(key, enc || 16); 25099 this.priv = this.priv.umod(this.ec.curve.n); 25100 }; 25101 KeyPair.prototype._importPublic = function _importPublic(key, enc) { 25102 if (key.x || key.y) { 25103 if (this.ec.curve.type === "mont") assert(key.x, "Need x coordinate"); 25104 else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") assert(key.x && key.y, "Need both x and y coordinate"); 25105 this.pub = this.ec.curve.point(key.x, key.y); 25106 return; 25107 } 25108 this.pub = this.ec.curve.decodePoint(key, enc); 25109 }; 25110 KeyPair.prototype.derive = function derive(pub) { 25111 if (!pub.validate()) assert(pub.validate(), "public point not validated"); 25112 return pub.mul(this.priv).getX(); 25113 }; 25114 KeyPair.prototype.sign = function sign(msg, enc, options) { 25115 return this.ec.sign(msg, this, enc, options); 25116 }; 25117 KeyPair.prototype.verify = function verify(msg, signature, options) { 25118 return this.ec.verify(msg, signature, this, void 0, options); 25119 }; 25120 KeyPair.prototype.inspect = function inspect() { 25121 return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >"; 25122 }; 25123})); 25124//#endregion 25125//#region node_modules/elliptic/lib/elliptic/ec/signature.js 25126var require_signature$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25127 var BN = require_bn$1(); 25128 var utils = require_utils$2(); 25129 var assert = utils.assert; 25130 function Signature(options, enc) { 25131 if (options instanceof Signature) return options; 25132 if (this._importDER(options, enc)) return; 25133 assert(options.r && options.s, "Signature without r or s"); 25134 this.r = new BN(options.r, 16); 25135 this.s = new BN(options.s, 16); 25136 if (options.recoveryParam === void 0) this.recoveryParam = null; 25137 else this.recoveryParam = options.recoveryParam; 25138 } 25139 module.exports = Signature; 25140 function Position() { 25141 this.place = 0; 25142 } 25143 function getLength(buf, p) { 25144 var initial = buf[p.place++]; 25145 if (!(initial & 128)) return initial; 25146 var octetLen = initial & 15; 25147 if (octetLen === 0 || octetLen > 4) return false; 25148 if (buf[p.place] === 0) return false; 25149 var val = 0; 25150 for (var i = 0, off = p.place; i < octetLen; i++, off++) { 25151 val <<= 8; 25152 val |= buf[off]; 25153 val >>>= 0; 25154 } 25155 if (val <= 127) return false; 25156 p.place = off; 25157 return val; 25158 } 25159 function rmPadding(buf) { 25160 var i = 0; 25161 var len = buf.length - 1; 25162 while (!buf[i] && !(buf[i + 1] & 128) && i < len) i++; 25163 if (i === 0) return buf; 25164 return buf.slice(i); 25165 } 25166 Signature.prototype._importDER = function _importDER(data, enc) { 25167 data = utils.toArray(data, enc); 25168 var p = new Position(); 25169 if (data[p.place++] !== 48) return false; 25170 var len = getLength(data, p); 25171 if (len === false) return false; 25172 if (len + p.place !== data.length) return false; 25173 if (data[p.place++] !== 2) return false; 25174 var rlen = getLength(data, p); 25175 if (rlen === false) return false; 25176 if ((data[p.place] & 128) !== 0) return false; 25177 var r = data.slice(p.place, rlen + p.place); 25178 p.place += rlen; 25179 if (data[p.place++] !== 2) return false; 25180 var slen = getLength(data, p); 25181 if (slen === false) return false; 25182 if (data.length !== slen + p.place) return false; 25183 if ((data[p.place] & 128) !== 0) return false; 25184 var s = data.slice(p.place, slen + p.place); 25185 if (r[0] === 0) if (r[1] & 128) r = r.slice(1); 25186 else return false; 25187 if (s[0] === 0) if (s[1] & 128) s = s.slice(1); 25188 else return false; 25189 this.r = new BN(r); 25190 this.s = new BN(s); 25191 this.recoveryParam = null; 25192 return true; 25193 }; 25194 function constructLength(arr, len) { 25195 if (len < 128) { 25196 arr.push(len); 25197 return; 25198 } 25199 var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); 25200 arr.push(octets | 128); 25201 while (--octets) arr.push(len >>> (octets << 3) & 255); 25202 arr.push(len); 25203 } 25204 Signature.prototype.toDER = function toDER(enc) { 25205 var r = this.r.toArray(); 25206 var s = this.s.toArray(); 25207 if (r[0] & 128) r = [0].concat(r); 25208 if (s[0] & 128) s = [0].concat(s); 25209 r = rmPadding(r); 25210 s = rmPadding(s); 25211 while (!s[0] && !(s[1] & 128)) s = s.slice(1); 25212 var arr = [2]; 25213 constructLength(arr, r.length); 25214 arr = arr.concat(r); 25215 arr.push(2); 25216 constructLength(arr, s.length); 25217 var backHalf = arr.concat(s); 25218 var res = [48]; 25219 constructLength(res, backHalf.length); 25220 res = res.concat(backHalf); 25221 return utils.encode(res, enc); 25222 }; 25223})); 25224//#endregion 25225//#region node_modules/elliptic/lib/elliptic/ec/index.js 25226var require_ec = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25227 var BN = require_bn$1(); 25228 var HmacDRBG = require_hmac_drbg(); 25229 var utils = require_utils$2(); 25230 var curves = require_curves(); 25231 var rand = require_brorand(); 25232 var assert = utils.assert; 25233 var KeyPair = require_key$1(); 25234 var Signature = require_signature$1(); 25235 function EC(options) { 25236 if (!(this instanceof EC)) return new EC(options); 25237 if (typeof options === "string") { 25238 assert(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options); 25239 options = curves[options]; 25240 } 25241 if (options instanceof curves.PresetCurve) options = { curve: options }; 25242 this.curve = options.curve.curve; 25243 this.n = this.curve.n; 25244 this.nh = this.n.ushrn(1); 25245 this.g = this.curve.g; 25246 this.g = options.curve.g; 25247 this.g.precompute(options.curve.n.bitLength() + 1); 25248 this.hash = options.hash || options.curve.hash; 25249 } 25250 module.exports = EC; 25251 EC.prototype.keyPair = function keyPair(options) { 25252 return new KeyPair(this, options); 25253 }; 25254 EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { 25255 return KeyPair.fromPrivate(this, priv, enc); 25256 }; 25257 EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { 25258 return KeyPair.fromPublic(this, pub, enc); 25259 }; 25260 EC.prototype.genKeyPair = function genKeyPair(options) { 25261 if (!options) options = {}; 25262 var drbg = new HmacDRBG({ 25263 hash: this.hash, 25264 pers: options.pers, 25265 persEnc: options.persEnc || "utf8", 25266 entropy: options.entropy || rand(this.hash.hmacStrength), 25267 entropyEnc: options.entropy && options.entropyEnc || "utf8", 25268 nonce: this.n.toArray() 25269 }); 25270 var bytes = this.n.byteLength(); 25271 var ns2 = this.n.sub(new BN(2)); 25272 for (;;) { 25273 var priv = new BN(drbg.generate(bytes)); 25274 if (priv.cmp(ns2) > 0) continue; 25275 priv.iaddn(1); 25276 return this.keyFromPrivate(priv); 25277 } 25278 }; 25279 EC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) { 25280 var byteLength; 25281 if (BN.isBN(msg) || typeof msg === "number") { 25282 msg = new BN(msg, 16); 25283 byteLength = msg.byteLength(); 25284 } else if (typeof msg === "object") { 25285 byteLength = msg.length; 25286 msg = new BN(msg, 16); 25287 } else { 25288 var str = msg.toString(); 25289 byteLength = str.length + 1 >>> 1; 25290 msg = new BN(str, 16); 25291 } 25292 if (typeof bitLength !== "number") bitLength = byteLength * 8; 25293 var delta = bitLength - this.n.bitLength(); 25294 if (delta > 0) msg = msg.ushrn(delta); 25295 if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n); 25296 else return msg; 25297 }; 25298 EC.prototype.sign = function sign(msg, key, enc, options) { 25299 if (typeof enc === "object") { 25300 options = enc; 25301 enc = null; 25302 } 25303 if (!options) options = {}; 25304 if (typeof msg !== "string" && typeof msg !== "number" && !BN.isBN(msg)) { 25305 assert(typeof msg === "object" && msg && typeof msg.length === "number", "Expected message to be an array-like, a hex string, or a BN instance"); 25306 assert(msg.length >>> 0 === msg.length); 25307 for (var i = 0; i < msg.length; i++) assert((msg[i] & 255) === msg[i]); 25308 } 25309 key = this.keyFromPrivate(key, enc); 25310 msg = this._truncateToN(msg, false, options.msgBitLength); 25311 assert(!msg.isNeg(), "Can not sign a negative message"); 25312 var bytes = this.n.byteLength(); 25313 var bkey = key.getPrivate().toArray("be", bytes); 25314 var nonce = msg.toArray("be", bytes); 25315 assert(new BN(nonce).eq(msg), "Can not sign message"); 25316 var drbg = new HmacDRBG({ 25317 hash: this.hash, 25318 entropy: bkey, 25319 nonce, 25320 pers: options.pers, 25321 persEnc: options.persEnc || "utf8" 25322 }); 25323 var ns1 = this.n.sub(new BN(1)); 25324 for (var iter = 0;; iter++) { 25325 var k = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength())); 25326 k = this._truncateToN(k, true); 25327 if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue; 25328 var kp = this.g.mul(k); 25329 if (kp.isInfinity()) continue; 25330 var kpX = kp.getX(); 25331 var r = kpX.umod(this.n); 25332 if (r.cmpn(0) === 0) continue; 25333 var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); 25334 s = s.umod(this.n); 25335 if (s.cmpn(0) === 0) continue; 25336 var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r) !== 0 ? 2 : 0); 25337 if (options.canonical && s.cmp(this.nh) > 0) { 25338 s = this.n.sub(s); 25339 recoveryParam ^= 1; 25340 } 25341 return new Signature({ 25342 r, 25343 s, 25344 recoveryParam 25345 }); 25346 } 25347 }; 25348 EC.prototype.verify = function verify(msg, signature, key, enc, options) { 25349 if (!options) options = {}; 25350 msg = this._truncateToN(msg, false, options.msgBitLength); 25351 key = this.keyFromPublic(key, enc); 25352 signature = new Signature(signature, "hex"); 25353 var r = signature.r; 25354 var s = signature.s; 25355 if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) return false; 25356 if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false; 25357 var sinv = s.invm(this.n); 25358 var u1 = sinv.mul(msg).umod(this.n); 25359 var u2 = sinv.mul(r).umod(this.n); 25360 var p; 25361 if (!this.curve._maxwellTrick) { 25362 p = this.g.mulAdd(u1, key.getPublic(), u2); 25363 if (p.isInfinity()) return false; 25364 return p.getX().umod(this.n).cmp(r) === 0; 25365 } 25366 p = this.g.jmulAdd(u1, key.getPublic(), u2); 25367 if (p.isInfinity()) return false; 25368 return p.eqXToP(r); 25369 }; 25370 EC.prototype.recoverPubKey = function(msg, signature, j, enc) { 25371 assert((3 & j) === j, "The recovery param is more than two bits"); 25372 signature = new Signature(signature, enc); 25373 var n = this.n; 25374 var e = new BN(msg); 25375 var r = signature.r; 25376 var s = signature.s; 25377 var isYOdd = j & 1; 25378 var isSecondKey = j >> 1; 25379 if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) throw new Error("Unable to find sencond key candinate"); 25380 if (isSecondKey) r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); 25381 else r = this.curve.pointFromX(r, isYOdd); 25382 var rInv = signature.r.invm(n); 25383 var s1 = n.sub(e).mul(rInv).umod(n); 25384 var s2 = s.mul(rInv).umod(n); 25385 return this.g.mulAdd(s1, r, s2); 25386 }; 25387 EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { 25388 signature = new Signature(signature, enc); 25389 if (signature.recoveryParam !== null) return signature.recoveryParam; 25390 for (var i = 0; i < 4; i++) { 25391 var Qprime; 25392 try { 25393 Qprime = this.recoverPubKey(e, signature, i); 25394 } catch (e) { 25395 continue; 25396 } 25397 if (Qprime.eq(Q)) return i; 25398 } 25399 throw new Error("Unable to find valid recovery factor"); 25400 }; 25401})); 25402//#endregion 25403//#region node_modules/elliptic/lib/elliptic/eddsa/key.js 25404var require_key = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25405 var utils = require_utils$2(); 25406 var assert = utils.assert; 25407 var parseBytes = utils.parseBytes; 25408 var cachedProperty = utils.cachedProperty; 25409 /** 25410 * @param {EDDSA} eddsa - instance 25411 * @param {Object} params - public/private key parameters 25412 * 25413 * @param {Array<Byte>} [params.secret] - secret seed bytes 25414 * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) 25415 * @param {Array<Byte>} [params.pub] - public key point encoded as bytes 25416 * 25417 */ 25418 function KeyPair(eddsa, params) { 25419 this.eddsa = eddsa; 25420 this._secret = parseBytes(params.secret); 25421 if (eddsa.isPoint(params.pub)) this._pub = params.pub; 25422 else this._pubBytes = parseBytes(params.pub); 25423 } 25424 KeyPair.fromPublic = function fromPublic(eddsa, pub) { 25425 if (pub instanceof KeyPair) return pub; 25426 return new KeyPair(eddsa, { pub }); 25427 }; 25428 KeyPair.fromSecret = function fromSecret(eddsa, secret) { 25429 if (secret instanceof KeyPair) return secret; 25430 return new KeyPair(eddsa, { secret }); 25431 }; 25432 KeyPair.prototype.secret = function secret() { 25433 return this._secret; 25434 }; 25435 cachedProperty(KeyPair, "pubBytes", function pubBytes() { 25436 return this.eddsa.encodePoint(this.pub()); 25437 }); 25438 cachedProperty(KeyPair, "pub", function pub() { 25439 if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes); 25440 return this.eddsa.g.mul(this.priv()); 25441 }); 25442 cachedProperty(KeyPair, "privBytes", function privBytes() { 25443 var eddsa = this.eddsa; 25444 var hash = this.hash(); 25445 var lastIx = eddsa.encodingLength - 1; 25446 var a = hash.slice(0, eddsa.encodingLength); 25447 a[0] &= 248; 25448 a[lastIx] &= 127; 25449 a[lastIx] |= 64; 25450 return a; 25451 }); 25452 cachedProperty(KeyPair, "priv", function priv() { 25453 return this.eddsa.decodeInt(this.privBytes()); 25454 }); 25455 cachedProperty(KeyPair, "hash", function hash() { 25456 return this.eddsa.hash().update(this.secret()).digest(); 25457 }); 25458 cachedProperty(KeyPair, "messagePrefix", function messagePrefix() { 25459 return this.hash().slice(this.eddsa.encodingLength); 25460 }); 25461 KeyPair.prototype.sign = function sign(message) { 25462 assert(this._secret, "KeyPair can only verify"); 25463 return this.eddsa.sign(message, this); 25464 }; 25465 KeyPair.prototype.verify = function verify(message, sig) { 25466 return this.eddsa.verify(message, sig, this); 25467 }; 25468 KeyPair.prototype.getSecret = function getSecret(enc) { 25469 assert(this._secret, "KeyPair is public only"); 25470 return utils.encode(this.secret(), enc); 25471 }; 25472 KeyPair.prototype.getPublic = function getPublic(enc) { 25473 return utils.encode(this.pubBytes(), enc); 25474 }; 25475 module.exports = KeyPair; 25476})); 25477//#endregion 25478//#region node_modules/elliptic/lib/elliptic/eddsa/signature.js 25479var require_signature = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25480 var BN = require_bn$1(); 25481 var utils = require_utils$2(); 25482 var assert = utils.assert; 25483 var cachedProperty = utils.cachedProperty; 25484 var parseBytes = utils.parseBytes; 25485 /** 25486 * @param {EDDSA} eddsa - eddsa instance 25487 * @param {Array<Bytes>|Object} sig - 25488 * @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes 25489 * @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes 25490 * @param {Array<Bytes>} [sig.Rencoded] - R point encoded 25491 * @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded 25492 */ 25493 function Signature(eddsa, sig) { 25494 this.eddsa = eddsa; 25495 if (typeof sig !== "object") sig = parseBytes(sig); 25496 if (Array.isArray(sig)) { 25497 assert(sig.length === eddsa.encodingLength * 2, "Signature has invalid size"); 25498 sig = { 25499 R: sig.slice(0, eddsa.encodingLength), 25500 S: sig.slice(eddsa.encodingLength) 25501 }; 25502 } 25503 assert(sig.R && sig.S, "Signature without R or S"); 25504 if (eddsa.isPoint(sig.R)) this._R = sig.R; 25505 if (sig.S instanceof BN) this._S = sig.S; 25506 this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; 25507 this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; 25508 } 25509 cachedProperty(Signature, "S", function S() { 25510 return this.eddsa.decodeInt(this.Sencoded()); 25511 }); 25512 cachedProperty(Signature, "R", function R() { 25513 return this.eddsa.decodePoint(this.Rencoded()); 25514 }); 25515 cachedProperty(Signature, "Rencoded", function Rencoded() { 25516 return this.eddsa.encodePoint(this.R()); 25517 }); 25518 cachedProperty(Signature, "Sencoded", function Sencoded() { 25519 return this.eddsa.encodeInt(this.S()); 25520 }); 25521 Signature.prototype.toBytes = function toBytes() { 25522 return this.Rencoded().concat(this.Sencoded()); 25523 }; 25524 Signature.prototype.toHex = function toHex() { 25525 return utils.encode(this.toBytes(), "hex").toUpperCase(); 25526 }; 25527 module.exports = Signature; 25528})); 25529//#endregion 25530//#region node_modules/elliptic/lib/elliptic/eddsa/index.js 25531var require_eddsa = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25532 var hash = require_hash(); 25533 var curves = require_curves(); 25534 var utils = require_utils$2(); 25535 var assert = utils.assert; 25536 var parseBytes = utils.parseBytes; 25537 var KeyPair = require_key(); 25538 var Signature = require_signature(); 25539 function EDDSA(curve) { 25540 assert(curve === "ed25519", "only tested with ed25519 so far"); 25541 if (!(this instanceof EDDSA)) return new EDDSA(curve); 25542 curve = curves[curve].curve; 25543 this.curve = curve; 25544 this.g = curve.g; 25545 this.g.precompute(curve.n.bitLength() + 1); 25546 this.pointClass = curve.point().constructor; 25547 this.encodingLength = Math.ceil(curve.n.bitLength() / 8); 25548 this.hash = hash.sha512; 25549 } 25550 module.exports = EDDSA; 25551 /** 25552 * @param {Array|String} message - message bytes 25553 * @param {Array|String|KeyPair} secret - secret bytes or a keypair 25554 * @returns {Signature} - signature 25555 */ 25556 EDDSA.prototype.sign = function sign(message, secret) { 25557 message = parseBytes(message); 25558 var key = this.keyFromSecret(secret); 25559 var r = this.hashInt(key.messagePrefix(), message); 25560 var R = this.g.mul(r); 25561 var Rencoded = this.encodePoint(R); 25562 var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()); 25563 var S = r.add(s_).umod(this.curve.n); 25564 return this.makeSignature({ 25565 R, 25566 S, 25567 Rencoded 25568 }); 25569 }; 25570 /** 25571 * @param {Array} message - message bytes 25572 * @param {Array|String|Signature} sig - sig bytes 25573 * @param {Array|String|Point|KeyPair} pub - public key 25574 * @returns {Boolean} - true if public key matches sig of message 25575 */ 25576 EDDSA.prototype.verify = function verify(message, sig, pub) { 25577 message = parseBytes(message); 25578 sig = this.makeSignature(sig); 25579 if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) return false; 25580 var key = this.keyFromPublic(pub); 25581 var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); 25582 var SG = this.g.mul(sig.S()); 25583 return sig.R().add(key.pub().mul(h)).eq(SG); 25584 }; 25585 EDDSA.prototype.hashInt = function hashInt() { 25586 var hash = this.hash(); 25587 for (var i = 0; i < arguments.length; i++) hash.update(arguments[i]); 25588 return utils.intFromLE(hash.digest()).umod(this.curve.n); 25589 }; 25590 EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { 25591 return KeyPair.fromPublic(this, pub); 25592 }; 25593 EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { 25594 return KeyPair.fromSecret(this, secret); 25595 }; 25596 EDDSA.prototype.makeSignature = function makeSignature(sig) { 25597 if (sig instanceof Signature) return sig; 25598 return new Signature(this, sig); 25599 }; 25600 /** 25601 * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 25602 * 25603 * EDDSA defines methods for encoding and decoding points and integers. These are 25604 * helper convenience methods, that pass along to utility functions implied 25605 * parameters. 25606 * 25607 */ 25608 EDDSA.prototype.encodePoint = function encodePoint(point) { 25609 var enc = point.getY().toArray("le", this.encodingLength); 25610 enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0; 25611 return enc; 25612 }; 25613 EDDSA.prototype.decodePoint = function decodePoint(bytes) { 25614 bytes = utils.parseBytes(bytes); 25615 var lastIx = bytes.length - 1; 25616 var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129); 25617 var xIsOdd = (bytes[lastIx] & 128) !== 0; 25618 var y = utils.intFromLE(normed); 25619 return this.curve.pointFromY(y, xIsOdd); 25620 }; 25621 EDDSA.prototype.encodeInt = function encodeInt(num) { 25622 return num.toArray("le", this.encodingLength); 25623 }; 25624 EDDSA.prototype.decodeInt = function decodeInt(bytes) { 25625 return utils.intFromLE(bytes); 25626 }; 25627 EDDSA.prototype.isPoint = function isPoint(val) { 25628 return val instanceof this.pointClass; 25629 }; 25630})); 25631//#endregion 25632//#region node_modules/elliptic/lib/elliptic.js 25633var require_elliptic = /* @__PURE__ */ __commonJSMin(((exports) => { 25634 var elliptic = exports; 25635 elliptic.version = (init_package(), __toCommonJS(package_exports).default).version; 25636 elliptic.utils = require_utils$2(); 25637 elliptic.rand = require_brorand(); 25638 elliptic.curve = require_curve(); 25639 elliptic.curves = require_curves(); 25640 elliptic.ec = require_ec(); 25641 elliptic.eddsa = require_eddsa(); 25642})); 25643//#endregion 25644//#region node_modules/browserify-sign/node_modules/bn.js/lib/bn.js 25645var require_bn = /* @__PURE__ */ __commonJSMin(((exports, module) => { 25646 (function(module$1, exports$5) { 25647 "use strict"; 25648 function assert(val, msg) { 25649 if (!val) throw new Error(msg || "Assertion failed"); 25650 } 25651 function inherits(ctor, superCtor) { 25652 ctor.super_ = superCtor; 25653 var TempCtor = function() {}; 25654 TempCtor.prototype = superCtor.prototype; 25655 ctor.prototype = new TempCtor(); 25656 ctor.prototype.constructor = ctor; 25657 } 25658 function BN(number, base, endian) { 25659 if (BN.isBN(number)) return number; 25660 this.negative = 0; 25661 this.words = null; 25662 this.length = 0; 25663 this.red = null; 25664 if (number !== null) { 25665 if (base === "le" || base === "be") { 25666 endian = base; 25667 base = 10; 25668 } 25669 this._init(number || 0, base || 10, endian || "be"); 25670 } 25671 } 25672 if (typeof module$1 === "object") module$1.exports = BN; 25673 else exports$5.BN = BN; 25674 BN.BN = BN; 25675 BN.wordSize = 26; 25676 var Buffer; 25677 try { 25678 if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer = window.Buffer; 25679 else Buffer = require_buffer$1().Buffer; 25680 } catch (e) {} 25681 BN.isBN = function isBN(num) { 25682 if (num instanceof BN) return true; 25683 return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); 25684 }; 25685 BN.max = function max(left, right) { 25686 if (left.cmp(right) > 0) return left; 25687 return right; 25688 }; 25689 BN.min = function min(left, right) { 25690 if (left.cmp(right) < 0) return left; 25691 return right; 25692 }; 25693 BN.prototype._init = function init(number, base, endian) { 25694 if (typeof number === "number") return this._initNumber(number, base, endian); 25695 if (typeof number === "object") return this._initArray(number, base, endian); 25696 if (base === "hex") base = 16; 25697 assert(base === (base | 0) && base >= 2 && base <= 36); 25698 number = number.toString().replace(/\s+/g, ""); 25699 var start = 0; 25700 if (number[0] === "-") { 25701 start++; 25702 this.negative = 1; 25703 } 25704 if (start < number.length) if (base === 16) this._parseHex(number, start, endian); 25705 else { 25706 this._parseBase(number, base, start); 25707 if (endian === "le") this._initArray(this.toArray(), base, endian); 25708 } 25709 }; 25710 BN.prototype._initNumber = function _initNumber(number, base, endian) { 25711 if (number < 0) { 25712 this.negative = 1; 25713 number = -number; 25714 } 25715 if (number < 67108864) { 25716 this.words = [number & 67108863]; 25717 this.length = 1; 25718 } else if (number < 4503599627370496) { 25719 this.words = [number & 67108863, number / 67108864 & 67108863]; 25720 this.length = 2; 25721 } else { 25722 assert(number < 9007199254740992); 25723 this.words = [ 25724 number & 67108863, 25725 number / 67108864 & 67108863, 25726 1 25727 ]; 25728 this.length = 3; 25729 } 25730 if (endian !== "le") return; 25731 this._initArray(this.toArray(), base, endian); 25732 }; 25733 BN.prototype._initArray = function _initArray(number, base, endian) { 25734 assert(typeof number.length === "number"); 25735 if (number.length <= 0) { 25736 this.words = [0]; 25737 this.length = 1; 25738 return this; 25739 } 25740 this.length = Math.ceil(number.length / 3); 25741 this.words = new Array(this.length); 25742 for (var i = 0; i < this.length; i++) this.words[i] = 0; 25743 var j, w; 25744 var off = 0; 25745 if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) { 25746 w = number[i] | number[i - 1] << 8 | number[i - 2] << 16; 25747 this.words[j] |= w << off & 67108863; 25748 this.words[j + 1] = w >>> 26 - off & 67108863; 25749 off += 24; 25750 if (off >= 26) { 25751 off -= 26; 25752 j++; 25753 } 25754 } 25755 else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) { 25756 w = number[i] | number[i + 1] << 8 | number[i + 2] << 16; 25757 this.words[j] |= w << off & 67108863; 25758 this.words[j + 1] = w >>> 26 - off & 67108863; 25759 off += 24; 25760 if (off >= 26) { 25761 off -= 26; 25762 j++; 25763 } 25764 } 25765 return this._strip(); 25766 }; 25767 function parseHex4Bits(string, index) { 25768 var c = string.charCodeAt(index); 25769 if (c >= 48 && c <= 57) return c - 48; 25770 else if (c >= 65 && c <= 70) return c - 55; 25771 else if (c >= 97 && c <= 102) return c - 87; 25772 else assert(false, "Invalid character in " + string); 25773 } 25774 function parseHexByte(string, lowerBound, index) { 25775 var r = parseHex4Bits(string, index); 25776 if (index - 1 >= lowerBound) r |= parseHex4Bits(string, index - 1) << 4; 25777 return r; 25778 } 25779 BN.prototype._parseHex = function _parseHex(number, start, endian) { 25780 this.length = Math.ceil((number.length - start) / 6); 25781 this.words = new Array(this.length); 25782 for (var i = 0; i < this.length; i++) this.words[i] = 0; 25783 var off = 0; 25784 var j = 0; 25785 var w; 25786 if (endian === "be") for (i = number.length - 1; i >= start; i -= 2) { 25787 w = parseHexByte(number, start, i) << off; 25788 this.words[j] |= w & 67108863; 25789 if (off >= 18) { 25790 off -= 18; 25791 j += 1; 25792 this.words[j] |= w >>> 26; 25793 } else off += 8; 25794 } 25795 else for (i = (number.length - start) % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { 25796 w = parseHexByte(number, start, i) << off; 25797 this.words[j] |= w & 67108863; 25798 if (off >= 18) { 25799 off -= 18; 25800 j += 1; 25801 this.words[j] |= w >>> 26; 25802 } else off += 8; 25803 } 25804 this._strip(); 25805 }; 25806 function parseBase(str, start, end, mul) { 25807 var r = 0; 25808 var b = 0; 25809 var len = Math.min(str.length, end); 25810 for (var i = start; i < len; i++) { 25811 var c = str.charCodeAt(i) - 48; 25812 r *= mul; 25813 if (c >= 49) b = c - 49 + 10; 25814 else if (c >= 17) b = c - 17 + 10; 25815 else b = c; 25816 assert(c >= 0 && b < mul, "Invalid character"); 25817 r += b; 25818 } 25819 return r; 25820 } 25821 BN.prototype._parseBase = function _parseBase(number, base, start) { 25822 this.words = [0]; 25823 this.length = 1; 25824 for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++; 25825 limbLen--; 25826 limbPow = limbPow / base | 0; 25827 var total = number.length - start; 25828 var mod = total % limbLen; 25829 var end = Math.min(total, total - mod) + start; 25830 var word = 0; 25831 for (var i = start; i < end; i += limbLen) { 25832 word = parseBase(number, i, i + limbLen, base); 25833 this.imuln(limbPow); 25834 if (this.words[0] + word < 67108864) this.words[0] += word; 25835 else this._iaddn(word); 25836 } 25837 if (mod !== 0) { 25838 var pow = 1; 25839 word = parseBase(number, i, number.length, base); 25840 for (i = 0; i < mod; i++) pow *= base; 25841 this.imuln(pow); 25842 if (this.words[0] + word < 67108864) this.words[0] += word; 25843 else this._iaddn(word); 25844 } 25845 this._strip(); 25846 }; 25847 BN.prototype.copy = function copy(dest) { 25848 dest.words = new Array(this.length); 25849 for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i]; 25850 dest.length = this.length; 25851 dest.negative = this.negative; 25852 dest.red = this.red; 25853 }; 25854 function move(dest, src) { 25855 dest.words = src.words; 25856 dest.length = src.length; 25857 dest.negative = src.negative; 25858 dest.red = src.red; 25859 } 25860 BN.prototype._move = function _move(dest) { 25861 move(dest, this); 25862 }; 25863 BN.prototype.clone = function clone() { 25864 var r = new BN(null); 25865 this.copy(r); 25866 return r; 25867 }; 25868 BN.prototype._expand = function _expand(size) { 25869 while (this.length < size) this.words[this.length++] = 0; 25870 return this; 25871 }; 25872 BN.prototype._strip = function strip() { 25873 while (this.length > 1 && this.words[this.length - 1] === 0) this.length--; 25874 return this._normSign(); 25875 }; 25876 BN.prototype._normSign = function _normSign() { 25877 if (this.length === 1 && this.words[0] === 0) this.negative = 0; 25878 return this; 25879 }; 25880 if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") try { 25881 BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect; 25882 } catch (e) { 25883 BN.prototype.inspect = inspect; 25884 } 25885 else BN.prototype.inspect = inspect; 25886 function inspect() { 25887 return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"; 25888 } 25889 var zeros = [ 25890 "", 25891 "0", 25892 "00", 25893 "000", 25894 "0000", 25895 "00000", 25896 "000000", 25897 "0000000", 25898 "00000000", 25899 "000000000", 25900 "0000000000", 25901 "00000000000", 25902 "000000000000", 25903 "0000000000000", 25904 "00000000000000", 25905 "000000000000000", 25906 "0000000000000000", 25907 "00000000000000000", 25908 "000000000000000000", 25909 "0000000000000000000", 25910 "00000000000000000000", 25911 "000000000000000000000", 25912 "0000000000000000000000", 25913 "00000000000000000000000", 25914 "000000000000000000000000", 25915 "0000000000000000000000000" 25916 ]; 25917 var groupSizes = [ 25918 0, 25919 0, 25920 25, 25921 16, 25922 12, 25923 11, 25924 10, 25925 9, 25926 8, 25927 8, 25928 7, 25929 7, 25930 7, 25931 7, 25932 6, 25933 6, 25934 6, 25935 6, 25936 6, 25937 6, 25938 6, 25939 5, 25940 5, 25941 5, 25942 5, 25943 5, 25944 5, 25945 5, 25946 5, 25947 5, 25948 5, 25949 5, 25950 5, 25951 5, 25952 5, 25953 5, 25954 5 25955 ]; 25956 var groupBases = [ 25957 0, 25958 0, 25959 33554432, 25960 43046721, 25961 16777216, 25962 48828125, 25963 60466176, 25964 40353607, 25965 16777216, 25966 43046721, 25967 1e7, 25968 19487171, 25969 35831808, 25970 62748517, 25971 7529536, 25972 11390625, 25973 16777216, 25974 24137569, 25975 34012224, 25976 47045881, 25977 64e6, 25978 4084101, 25979 5153632, 25980 6436343, 25981 7962624, 25982 9765625, 25983 11881376, 25984 14348907, 25985 17210368, 25986 20511149, 25987 243e5, 25988 28629151, 25989 33554432, 25990 39135393, 25991 45435424, 25992 52521875, 25993 60466176 25994 ]; 25995 BN.prototype.toString = function toString(base, padding) { 25996 base = base || 10; 25997 padding = padding | 0 || 1; 25998 var out; 25999 if (base === 16 || base === "hex") { 26000 out = ""; 26001 var off = 0; 26002 var carry = 0; 26003 for (var i = 0; i < this.length; i++) { 26004 var w = this.words[i]; 26005 var word = ((w << off | carry) & 16777215).toString(16); 26006 carry = w >>> 24 - off & 16777215; 26007 off += 2; 26008 if (off >= 26) { 26009 off -= 26; 26010 i--; 26011 } 26012 if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out; 26013 else out = word + out; 26014 } 26015 if (carry !== 0) out = carry.toString(16) + out; 26016 while (out.length % padding !== 0) out = "0" + out; 26017 if (this.negative !== 0) out = "-" + out; 26018 return out; 26019 } 26020 if (base === (base | 0) && base >= 2 && base <= 36) { 26021 var groupSize = groupSizes[base]; 26022 var groupBase = groupBases[base]; 26023 out = ""; 26024 var c = this.clone(); 26025 c.negative = 0; 26026 while (!c.isZero()) { 26027 var r = c.modrn(groupBase).toString(base); 26028 c = c.idivn(groupBase); 26029 if (!c.isZero()) out = zeros[groupSize - r.length] + r + out; 26030 else out = r + out; 26031 } 26032 if (this.isZero()) out = "0" + out; 26033 while (out.length % padding !== 0) out = "0" + out; 26034 if (this.negative !== 0) out = "-" + out; 26035 return out; 26036 } 26037 assert(false, "Base should be between 2 and 36"); 26038 }; 26039 BN.prototype.toNumber = function toNumber() { 26040 var ret = this.words[0]; 26041 if (this.length === 2) ret += this.words[1] * 67108864; 26042 else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864; 26043 else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits"); 26044 return this.negative !== 0 ? -ret : ret; 26045 }; 26046 BN.prototype.toJSON = function toJSON() { 26047 return this.toString(16, 2); 26048 }; 26049 if (Buffer) BN.prototype.toBuffer = function toBuffer(endian, length) { 26050 return this.toArrayLike(Buffer, endian, length); 26051 }; 26052 BN.prototype.toArray = function toArray(endian, length) { 26053 return this.toArrayLike(Array, endian, length); 26054 }; 26055 var allocate = function allocate(ArrayType, size) { 26056 if (ArrayType.allocUnsafe) return ArrayType.allocUnsafe(size); 26057 return new ArrayType(size); 26058 }; 26059 BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { 26060 this._strip(); 26061 var byteLength = this.byteLength(); 26062 var reqLength = length || Math.max(1, byteLength); 26063 assert(byteLength <= reqLength, "byte array longer than desired length"); 26064 assert(reqLength > 0, "Requested array length <= 0"); 26065 var res = allocate(ArrayType, reqLength); 26066 var postfix = endian === "le" ? "LE" : "BE"; 26067 this["_toArrayLike" + postfix](res, byteLength); 26068 return res; 26069 }; 26070 BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { 26071 var position = 0; 26072 var carry = 0; 26073 for (var i = 0, shift = 0; i < this.length; i++) { 26074 var word = this.words[i] << shift | carry; 26075 res[position++] = word & 255; 26076 if (position < res.length) res[position++] = word >> 8 & 255; 26077 if (position < res.length) res[position++] = word >> 16 & 255; 26078 if (shift === 6) { 26079 if (position < res.length) res[position++] = word >> 24 & 255; 26080 carry = 0; 26081 shift = 0; 26082 } else { 26083 carry = word >>> 24; 26084 shift += 2; 26085 } 26086 } 26087 if (position < res.length) { 26088 res[position++] = carry; 26089 while (position < res.length) res[position++] = 0; 26090 } 26091 }; 26092 BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { 26093 var position = res.length - 1; 26094 var carry = 0; 26095 for (var i = 0, shift = 0; i < this.length; i++) { 26096 var word = this.words[i] << shift | carry; 26097 res[position--] = word & 255; 26098 if (position >= 0) res[position--] = word >> 8 & 255; 26099 if (position >= 0) res[position--] = word >> 16 & 255; 26100 if (shift === 6) { 26101 if (position >= 0) res[position--] = word >> 24 & 255; 26102 carry = 0; 26103 shift = 0; 26104 } else { 26105 carry = word >>> 24; 26106 shift += 2; 26107 } 26108 } 26109 if (position >= 0) { 26110 res[position--] = carry; 26111 while (position >= 0) res[position--] = 0; 26112 } 26113 }; 26114 if (Math.clz32) BN.prototype._countBits = function _countBits(w) { 26115 return 32 - Math.clz32(w); 26116 }; 26117 else BN.prototype._countBits = function _countBits(w) { 26118 var t = w; 26119 var r = 0; 26120 if (t >= 4096) { 26121 r += 13; 26122 t >>>= 13; 26123 } 26124 if (t >= 64) { 26125 r += 7; 26126 t >>>= 7; 26127 } 26128 if (t >= 8) { 26129 r += 4; 26130 t >>>= 4; 26131 } 26132 if (t >= 2) { 26133 r += 2; 26134 t >>>= 2; 26135 } 26136 return r + t; 26137 }; 26138 BN.prototype._zeroBits = function _zeroBits(w) { 26139 if (w === 0) return 26; 26140 var t = w; 26141 var r = 0; 26142 if ((t & 8191) === 0) { 26143 r += 13; 26144 t >>>= 13; 26145 } 26146 if ((t & 127) === 0) { 26147 r += 7; 26148 t >>>= 7; 26149 } 26150 if ((t & 15) === 0) { 26151 r += 4; 26152 t >>>= 4; 26153 } 26154 if ((t & 3) === 0) { 26155 r += 2; 26156 t >>>= 2; 26157 } 26158 if ((t & 1) === 0) r++; 26159 return r; 26160 }; 26161 BN.prototype.bitLength = function bitLength() { 26162 var w = this.words[this.length - 1]; 26163 var hi = this._countBits(w); 26164 return (this.length - 1) * 26 + hi; 26165 }; 26166 function toBitArray(num) { 26167 var w = new Array(num.bitLength()); 26168 for (var bit = 0; bit < w.length; bit++) { 26169 var off = bit / 26 | 0; 26170 var wbit = bit % 26; 26171 w[bit] = num.words[off] >>> wbit & 1; 26172 } 26173 return w; 26174 } 26175 BN.prototype.zeroBits = function zeroBits() { 26176 if (this.isZero()) return 0; 26177 var r = 0; 26178 for (var i = 0; i < this.length; i++) { 26179 var b = this._zeroBits(this.words[i]); 26180 r += b; 26181 if (b !== 26) break; 26182 } 26183 return r; 26184 }; 26185 BN.prototype.byteLength = function byteLength() { 26186 return Math.ceil(this.bitLength() / 8); 26187 }; 26188 BN.prototype.toTwos = function toTwos(width) { 26189 if (this.negative !== 0) return this.abs().inotn(width).iaddn(1); 26190 return this.clone(); 26191 }; 26192 BN.prototype.fromTwos = function fromTwos(width) { 26193 if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg(); 26194 return this.clone(); 26195 }; 26196 BN.prototype.isNeg = function isNeg() { 26197 return this.negative !== 0; 26198 }; 26199 BN.prototype.neg = function neg() { 26200 return this.clone().ineg(); 26201 }; 26202 BN.prototype.ineg = function ineg() { 26203 if (!this.isZero()) this.negative ^= 1; 26204 return this; 26205 }; 26206 BN.prototype.iuor = function iuor(num) { 26207 while (this.length < num.length) this.words[this.length++] = 0; 26208 for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i]; 26209 return this._strip(); 26210 }; 26211 BN.prototype.ior = function ior(num) { 26212 assert((this.negative | num.negative) === 0); 26213 return this.iuor(num); 26214 }; 26215 BN.prototype.or = function or(num) { 26216 if (this.length > num.length) return this.clone().ior(num); 26217 return num.clone().ior(this); 26218 }; 26219 BN.prototype.uor = function uor(num) { 26220 if (this.length > num.length) return this.clone().iuor(num); 26221 return num.clone().iuor(this); 26222 }; 26223 BN.prototype.iuand = function iuand(num) { 26224 var b; 26225 if (this.length > num.length) b = num; 26226 else b = this; 26227 for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i]; 26228 this.length = b.length; 26229 return this._strip(); 26230 }; 26231 BN.prototype.iand = function iand(num) { 26232 assert((this.negative | num.negative) === 0); 26233 return this.iuand(num); 26234 }; 26235 BN.prototype.and = function and(num) { 26236 if (this.length > num.length) return this.clone().iand(num); 26237 return num.clone().iand(this); 26238 }; 26239 BN.prototype.uand = function uand(num) { 26240 if (this.length > num.length) return this.clone().iuand(num); 26241 return num.clone().iuand(this); 26242 }; 26243 BN.prototype.iuxor = function iuxor(num) { 26244 var a; 26245 var b; 26246 if (this.length > num.length) { 26247 a = this; 26248 b = num; 26249 } else { 26250 a = num; 26251 b = this; 26252 } 26253 for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i]; 26254 if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i]; 26255 this.length = a.length; 26256 return this._strip(); 26257 }; 26258 BN.prototype.ixor = function ixor(num) { 26259 assert((this.negative | num.negative) === 0); 26260 return this.iuxor(num); 26261 }; 26262 BN.prototype.xor = function xor(num) { 26263 if (this.length > num.length) return this.clone().ixor(num); 26264 return num.clone().ixor(this); 26265 }; 26266 BN.prototype.uxor = function uxor(num) { 26267 if (this.length > num.length) return this.clone().iuxor(num); 26268 return num.clone().iuxor(this); 26269 }; 26270 BN.prototype.inotn = function inotn(width) { 26271 assert(typeof width === "number" && width >= 0); 26272 var bytesNeeded = Math.ceil(width / 26) | 0; 26273 var bitsLeft = width % 26; 26274 this._expand(bytesNeeded); 26275 if (bitsLeft > 0) bytesNeeded--; 26276 for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863; 26277 if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft; 26278 return this._strip(); 26279 }; 26280 BN.prototype.notn = function notn(width) { 26281 return this.clone().inotn(width); 26282 }; 26283 BN.prototype.setn = function setn(bit, val) { 26284 assert(typeof bit === "number" && bit >= 0); 26285 var off = bit / 26 | 0; 26286 var wbit = bit % 26; 26287 this._expand(off + 1); 26288 if (val) this.words[off] = this.words[off] | 1 << wbit; 26289 else this.words[off] = this.words[off] & ~(1 << wbit); 26290 return this._strip(); 26291 }; 26292 BN.prototype.iadd = function iadd(num) { 26293 var r; 26294 if (this.negative !== 0 && num.negative === 0) { 26295 this.negative = 0; 26296 r = this.isub(num); 26297 this.negative ^= 1; 26298 return this._normSign(); 26299 } else if (this.negative === 0 && num.negative !== 0) { 26300 num.negative = 0; 26301 r = this.isub(num); 26302 num.negative = 1; 26303 return r._normSign(); 26304 } 26305 var a, b; 26306 if (this.length > num.length) { 26307 a = this; 26308 b = num; 26309 } else { 26310 a = num; 26311 b = this; 26312 } 26313 var carry = 0; 26314 for (var i = 0; i < b.length; i++) { 26315 r = (a.words[i] | 0) + (b.words[i] | 0) + carry; 26316 this.words[i] = r & 67108863; 26317 carry = r >>> 26; 26318 } 26319 for (; carry !== 0 && i < a.length; i++) { 26320 r = (a.words[i] | 0) + carry; 26321 this.words[i] = r & 67108863; 26322 carry = r >>> 26; 26323 } 26324 this.length = a.length; 26325 if (carry !== 0) { 26326 this.words[this.length] = carry; 26327 this.length++; 26328 } else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 26329 return this; 26330 }; 26331 BN.prototype.add = function add(num) { 26332 var res; 26333 if (num.negative !== 0 && this.negative === 0) { 26334 num.negative = 0; 26335 res = this.sub(num); 26336 num.negative ^= 1; 26337 return res; 26338 } else if (num.negative === 0 && this.negative !== 0) { 26339 this.negative = 0; 26340 res = num.sub(this); 26341 this.negative = 1; 26342 return res; 26343 } 26344 if (this.length > num.length) return this.clone().iadd(num); 26345 return num.clone().iadd(this); 26346 }; 26347 BN.prototype.isub = function isub(num) { 26348 if (num.negative !== 0) { 26349 num.negative = 0; 26350 var r = this.iadd(num); 26351 num.negative = 1; 26352 return r._normSign(); 26353 } else if (this.negative !== 0) { 26354 this.negative = 0; 26355 this.iadd(num); 26356 this.negative = 1; 26357 return this._normSign(); 26358 } 26359 var cmp = this.cmp(num); 26360 if (cmp === 0) { 26361 this.negative = 0; 26362 this.length = 1; 26363 this.words[0] = 0; 26364 return this; 26365 } 26366 var a, b; 26367 if (cmp > 0) { 26368 a = this; 26369 b = num; 26370 } else { 26371 a = num; 26372 b = this; 26373 } 26374 var carry = 0; 26375 for (var i = 0; i < b.length; i++) { 26376 r = (a.words[i] | 0) - (b.words[i] | 0) + carry; 26377 carry = r >> 26; 26378 this.words[i] = r & 67108863; 26379 } 26380 for (; carry !== 0 && i < a.length; i++) { 26381 r = (a.words[i] | 0) + carry; 26382 carry = r >> 26; 26383 this.words[i] = r & 67108863; 26384 } 26385 if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i]; 26386 this.length = Math.max(this.length, i); 26387 if (a !== this) this.negative = 1; 26388 return this._strip(); 26389 }; 26390 BN.prototype.sub = function sub(num) { 26391 return this.clone().isub(num); 26392 }; 26393 function smallMulTo(self, num, out) { 26394 out.negative = num.negative ^ self.negative; 26395 var len = self.length + num.length | 0; 26396 out.length = len; 26397 len = len - 1 | 0; 26398 var a = self.words[0] | 0; 26399 var b = num.words[0] | 0; 26400 var r = a * b; 26401 var lo = r & 67108863; 26402 var carry = r / 67108864 | 0; 26403 out.words[0] = lo; 26404 for (var k = 1; k < len; k++) { 26405 var ncarry = carry >>> 26; 26406 var rword = carry & 67108863; 26407 var maxJ = Math.min(k, num.length - 1); 26408 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 26409 var i = k - j | 0; 26410 a = self.words[i] | 0; 26411 b = num.words[j] | 0; 26412 r = a * b + rword; 26413 ncarry += r / 67108864 | 0; 26414 rword = r & 67108863; 26415 } 26416 out.words[k] = rword | 0; 26417 carry = ncarry | 0; 26418 } 26419 if (carry !== 0) out.words[k] = carry | 0; 26420 else out.length--; 26421 return out._strip(); 26422 } 26423 var comb10MulTo = function comb10MulTo(self, num, out) { 26424 var a = self.words; 26425 var b = num.words; 26426 var o = out.words; 26427 var c = 0; 26428 var lo; 26429 var mid; 26430 var hi; 26431 var a0 = a[0] | 0; 26432 var al0 = a0 & 8191; 26433 var ah0 = a0 >>> 13; 26434 var a1 = a[1] | 0; 26435 var al1 = a1 & 8191; 26436 var ah1 = a1 >>> 13; 26437 var a2 = a[2] | 0; 26438 var al2 = a2 & 8191; 26439 var ah2 = a2 >>> 13; 26440 var a3 = a[3] | 0; 26441 var al3 = a3 & 8191; 26442 var ah3 = a3 >>> 13; 26443 var a4 = a[4] | 0; 26444 var al4 = a4 & 8191; 26445 var ah4 = a4 >>> 13; 26446 var a5 = a[5] | 0; 26447 var al5 = a5 & 8191; 26448 var ah5 = a5 >>> 13; 26449 var a6 = a[6] | 0; 26450 var al6 = a6 & 8191; 26451 var ah6 = a6 >>> 13; 26452 var a7 = a[7] | 0; 26453 var al7 = a7 & 8191; 26454 var ah7 = a7 >>> 13; 26455 var a8 = a[8] | 0; 26456 var al8 = a8 & 8191; 26457 var ah8 = a8 >>> 13; 26458 var a9 = a[9] | 0; 26459 var al9 = a9 & 8191; 26460 var ah9 = a9 >>> 13; 26461 var b0 = b[0] | 0; 26462 var bl0 = b0 & 8191; 26463 var bh0 = b0 >>> 13; 26464 var b1 = b[1] | 0; 26465 var bl1 = b1 & 8191; 26466 var bh1 = b1 >>> 13; 26467 var b2 = b[2] | 0; 26468 var bl2 = b2 & 8191; 26469 var bh2 = b2 >>> 13; 26470 var b3 = b[3] | 0; 26471 var bl3 = b3 & 8191; 26472 var bh3 = b3 >>> 13; 26473 var b4 = b[4] | 0; 26474 var bl4 = b4 & 8191; 26475 var bh4 = b4 >>> 13; 26476 var b5 = b[5] | 0; 26477 var bl5 = b5 & 8191; 26478 var bh5 = b5 >>> 13; 26479 var b6 = b[6] | 0; 26480 var bl6 = b6 & 8191; 26481 var bh6 = b6 >>> 13; 26482 var b7 = b[7] | 0; 26483 var bl7 = b7 & 8191; 26484 var bh7 = b7 >>> 13; 26485 var b8 = b[8] | 0; 26486 var bl8 = b8 & 8191; 26487 var bh8 = b8 >>> 13; 26488 var b9 = b[9] | 0; 26489 var bl9 = b9 & 8191; 26490 var bh9 = b9 >>> 13; 26491 out.negative = self.negative ^ num.negative; 26492 out.length = 19; 26493 lo = Math.imul(al0, bl0); 26494 mid = Math.imul(al0, bh0); 26495 mid = mid + Math.imul(ah0, bl0) | 0; 26496 hi = Math.imul(ah0, bh0); 26497 var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26498 c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; 26499 w0 &= 67108863; 26500 lo = Math.imul(al1, bl0); 26501 mid = Math.imul(al1, bh0); 26502 mid = mid + Math.imul(ah1, bl0) | 0; 26503 hi = Math.imul(ah1, bh0); 26504 lo = lo + Math.imul(al0, bl1) | 0; 26505 mid = mid + Math.imul(al0, bh1) | 0; 26506 mid = mid + Math.imul(ah0, bl1) | 0; 26507 hi = hi + Math.imul(ah0, bh1) | 0; 26508 var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26509 c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; 26510 w1 &= 67108863; 26511 lo = Math.imul(al2, bl0); 26512 mid = Math.imul(al2, bh0); 26513 mid = mid + Math.imul(ah2, bl0) | 0; 26514 hi = Math.imul(ah2, bh0); 26515 lo = lo + Math.imul(al1, bl1) | 0; 26516 mid = mid + Math.imul(al1, bh1) | 0; 26517 mid = mid + Math.imul(ah1, bl1) | 0; 26518 hi = hi + Math.imul(ah1, bh1) | 0; 26519 lo = lo + Math.imul(al0, bl2) | 0; 26520 mid = mid + Math.imul(al0, bh2) | 0; 26521 mid = mid + Math.imul(ah0, bl2) | 0; 26522 hi = hi + Math.imul(ah0, bh2) | 0; 26523 var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26524 c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0; 26525 w2 &= 67108863; 26526 lo = Math.imul(al3, bl0); 26527 mid = Math.imul(al3, bh0); 26528 mid = mid + Math.imul(ah3, bl0) | 0; 26529 hi = Math.imul(ah3, bh0); 26530 lo = lo + Math.imul(al2, bl1) | 0; 26531 mid = mid + Math.imul(al2, bh1) | 0; 26532 mid = mid + Math.imul(ah2, bl1) | 0; 26533 hi = hi + Math.imul(ah2, bh1) | 0; 26534 lo = lo + Math.imul(al1, bl2) | 0; 26535 mid = mid + Math.imul(al1, bh2) | 0; 26536 mid = mid + Math.imul(ah1, bl2) | 0; 26537 hi = hi + Math.imul(ah1, bh2) | 0; 26538 lo = lo + Math.imul(al0, bl3) | 0; 26539 mid = mid + Math.imul(al0, bh3) | 0; 26540 mid = mid + Math.imul(ah0, bl3) | 0; 26541 hi = hi + Math.imul(ah0, bh3) | 0; 26542 var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26543 c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0; 26544 w3 &= 67108863; 26545 lo = Math.imul(al4, bl0); 26546 mid = Math.imul(al4, bh0); 26547 mid = mid + Math.imul(ah4, bl0) | 0; 26548 hi = Math.imul(ah4, bh0); 26549 lo = lo + Math.imul(al3, bl1) | 0; 26550 mid = mid + Math.imul(al3, bh1) | 0; 26551 mid = mid + Math.imul(ah3, bl1) | 0; 26552 hi = hi + Math.imul(ah3, bh1) | 0; 26553 lo = lo + Math.imul(al2, bl2) | 0; 26554 mid = mid + Math.imul(al2, bh2) | 0; 26555 mid = mid + Math.imul(ah2, bl2) | 0; 26556 hi = hi + Math.imul(ah2, bh2) | 0; 26557 lo = lo + Math.imul(al1, bl3) | 0; 26558 mid = mid + Math.imul(al1, bh3) | 0; 26559 mid = mid + Math.imul(ah1, bl3) | 0; 26560 hi = hi + Math.imul(ah1, bh3) | 0; 26561 lo = lo + Math.imul(al0, bl4) | 0; 26562 mid = mid + Math.imul(al0, bh4) | 0; 26563 mid = mid + Math.imul(ah0, bl4) | 0; 26564 hi = hi + Math.imul(ah0, bh4) | 0; 26565 var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26566 c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0; 26567 w4 &= 67108863; 26568 lo = Math.imul(al5, bl0); 26569 mid = Math.imul(al5, bh0); 26570 mid = mid + Math.imul(ah5, bl0) | 0; 26571 hi = Math.imul(ah5, bh0); 26572 lo = lo + Math.imul(al4, bl1) | 0; 26573 mid = mid + Math.imul(al4, bh1) | 0; 26574 mid = mid + Math.imul(ah4, bl1) | 0; 26575 hi = hi + Math.imul(ah4, bh1) | 0; 26576 lo = lo + Math.imul(al3, bl2) | 0; 26577 mid = mid + Math.imul(al3, bh2) | 0; 26578 mid = mid + Math.imul(ah3, bl2) | 0; 26579 hi = hi + Math.imul(ah3, bh2) | 0; 26580 lo = lo + Math.imul(al2, bl3) | 0; 26581 mid = mid + Math.imul(al2, bh3) | 0; 26582 mid = mid + Math.imul(ah2, bl3) | 0; 26583 hi = hi + Math.imul(ah2, bh3) | 0; 26584 lo = lo + Math.imul(al1, bl4) | 0; 26585 mid = mid + Math.imul(al1, bh4) | 0; 26586 mid = mid + Math.imul(ah1, bl4) | 0; 26587 hi = hi + Math.imul(ah1, bh4) | 0; 26588 lo = lo + Math.imul(al0, bl5) | 0;
vendor: 5,979 bytes, lines 26589-26744
26589 mid = mid + Math.imul(al0, bh5) | 0; 26590 mid = mid + Math.imul(ah0, bl5) | 0; 26591 hi = hi + Math.imul(ah0, bh5) | 0; 26592 var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26593 c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0; 26594 w5 &= 67108863; 26595 lo = Math.imul(al6, bl0); 26596 mid = Math.imul(al6, bh0); 26597 mid = mid + Math.imul(ah6, bl0) | 0; 26598 hi = Math.imul(ah6, bh0); 26599 lo = lo + Math.imul(al5, bl1) | 0; 26600 mid = mid + Math.imul(al5, bh1) | 0; 26601 mid = mid + Math.imul(ah5, bl1) | 0; 26602 hi = hi + Math.imul(ah5, bh1) | 0; 26603 lo = lo + Math.imul(al4, bl2) | 0; 26604 mid = mid + Math.imul(al4, bh2) | 0; 26605 mid = mid + Math.imul(ah4, bl2) | 0; 26606 hi = hi + Math.imul(ah4, bh2) | 0; 26607 lo = lo + Math.imul(al3, bl3) | 0; 26608 mid = mid + Math.imul(al3, bh3) | 0; 26609 mid = mid + Math.imul(ah3, bl3) | 0; 26610 hi = hi + Math.imul(ah3, bh3) | 0; 26611 lo = lo + Math.imul(al2, bl4) | 0; 26612 mid = mid + Math.imul(al2, bh4) | 0; 26613 mid = mid + Math.imul(ah2, bl4) | 0; 26614 hi = hi + Math.imul(ah2, bh4) | 0; 26615 lo = lo + Math.imul(al1, bl5) | 0; 26616 mid = mid + Math.imul(al1, bh5) | 0; 26617 mid = mid + Math.imul(ah1, bl5) | 0; 26618 hi = hi + Math.imul(ah1, bh5) | 0; 26619 lo = lo + Math.imul(al0, bl6) | 0; 26620 mid = mid + Math.imul(al0, bh6) | 0; 26621 mid = mid + Math.imul(ah0, bl6) | 0; 26622 hi = hi + Math.imul(ah0, bh6) | 0; 26623 var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26624 c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; 26625 w6 &= 67108863; 26626 lo = Math.imul(al7, bl0); 26627 mid = Math.imul(al7, bh0); 26628 mid = mid + Math.imul(ah7, bl0) | 0; 26629 hi = Math.imul(ah7, bh0); 26630 lo = lo + Math.imul(al6, bl1) | 0; 26631 mid = mid + Math.imul(al6, bh1) | 0; 26632 mid = mid + Math.imul(ah6, bl1) | 0; 26633 hi = hi + Math.imul(ah6, bh1) | 0; 26634 lo = lo + Math.imul(al5, bl2) | 0; 26635 mid = mid + Math.imul(al5, bh2) | 0; 26636 mid = mid + Math.imul(ah5, bl2) | 0; 26637 hi = hi + Math.imul(ah5, bh2) | 0; 26638 lo = lo + Math.imul(al4, bl3) | 0; 26639 mid = mid + Math.imul(al4, bh3) | 0; 26640 mid = mid + Math.imul(ah4, bl3) | 0; 26641 hi = hi + Math.imul(ah4, bh3) | 0; 26642 lo = lo + Math.imul(al3, bl4) | 0; 26643 mid = mid + Math.imul(al3, bh4) | 0; 26644 mid = mid + Math.imul(ah3, bl4) | 0; 26645 hi = hi + Math.imul(ah3, bh4) | 0; 26646 lo = lo + Math.imul(al2, bl5) | 0; 26647 mid = mid + Math.imul(al2, bh5) | 0; 26648 mid = mid + Math.imul(ah2, bl5) | 0; 26649 hi = hi + Math.imul(ah2, bh5) | 0; 26650 lo = lo + Math.imul(al1, bl6) | 0; 26651 mid = mid + Math.imul(al1, bh6) | 0; 26652 mid = mid + Math.imul(ah1, bl6) | 0; 26653 hi = hi + Math.imul(ah1, bh6) | 0; 26654 lo = lo + Math.imul(al0, bl7) | 0; 26655 mid = mid + Math.imul(al0, bh7) | 0; 26656 mid = mid + Math.imul(ah0, bl7) | 0; 26657 hi = hi + Math.imul(ah0, bh7) | 0; 26658 var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26659 c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; 26660 w7 &= 67108863; 26661 lo = Math.imul(al8, bl0); 26662 mid = Math.imul(al8, bh0); 26663 mid = mid + Math.imul(ah8, bl0) | 0; 26664 hi = Math.imul(ah8, bh0); 26665 lo = lo + Math.imul(al7, bl1) | 0; 26666 mid = mid + Math.imul(al7, bh1) | 0; 26667 mid = mid + Math.imul(ah7, bl1) | 0; 26668 hi = hi + Math.imul(ah7, bh1) | 0; 26669 lo = lo + Math.imul(al6, bl2) | 0; 26670 mid = mid + Math.imul(al6, bh2) | 0; 26671 mid = mid + Math.imul(ah6, bl2) | 0; 26672 hi = hi + Math.imul(ah6, bh2) | 0; 26673 lo = lo + Math.imul(al5, bl3) | 0; 26674 mid = mid + Math.imul(al5, bh3) | 0; 26675 mid = mid + Math.imul(ah5, bl3) | 0; 26676 hi = hi + Math.imul(ah5, bh3) | 0; 26677 lo = lo + Math.imul(al4, bl4) | 0; 26678 mid = mid + Math.imul(al4, bh4) | 0; 26679 mid = mid + Math.imul(ah4, bl4) | 0; 26680 hi = hi + Math.imul(ah4, bh4) | 0; 26681 lo = lo + Math.imul(al3, bl5) | 0; 26682 mid = mid + Math.imul(al3, bh5) | 0; 26683 mid = mid + Math.imul(ah3, bl5) | 0; 26684 hi = hi + Math.imul(ah3, bh5) | 0; 26685 lo = lo + Math.imul(al2, bl6) | 0; 26686 mid = mid + Math.imul(al2, bh6) | 0; 26687 mid = mid + Math.imul(ah2, bl6) | 0; 26688 hi = hi + Math.imul(ah2, bh6) | 0; 26689 lo = lo + Math.imul(al1, bl7) | 0; 26690 mid = mid + Math.imul(al1, bh7) | 0; 26691 mid = mid + Math.imul(ah1, bl7) | 0; 26692 hi = hi + Math.imul(ah1, bh7) | 0; 26693 lo = lo + Math.imul(al0, bl8) | 0; 26694 mid = mid + Math.imul(al0, bh8) | 0; 26695 mid = mid + Math.imul(ah0, bl8) | 0; 26696 hi = hi + Math.imul(ah0, bh8) | 0; 26697 var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26698 c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; 26699 w8 &= 67108863; 26700 lo = Math.imul(al9, bl0); 26701 mid = Math.imul(al9, bh0); 26702 mid = mid + Math.imul(ah9, bl0) | 0; 26703 hi = Math.imul(ah9, bh0); 26704 lo = lo + Math.imul(al8, bl1) | 0; 26705 mid = mid + Math.imul(al8, bh1) | 0; 26706 mid = mid + Math.imul(ah8, bl1) | 0; 26707 hi = hi + Math.imul(ah8, bh1) | 0; 26708 lo = lo + Math.imul(al7, bl2) | 0; 26709 mid = mid + Math.imul(al7, bh2) | 0; 26710 mid = mid + Math.imul(ah7, bl2) | 0; 26711 hi = hi + Math.imul(ah7, bh2) | 0; 26712 lo = lo + Math.imul(al6, bl3) | 0; 26713 mid = mid + Math.imul(al6, bh3) | 0; 26714 mid = mid + Math.imul(ah6, bl3) | 0; 26715 hi = hi + Math.imul(ah6, bh3) | 0; 26716 lo = lo + Math.imul(al5, bl4) | 0; 26717 mid = mid + Math.imul(al5, bh4) | 0; 26718 mid = mid + Math.imul(ah5, bl4) | 0; 26719 hi = hi + Math.imul(ah5, bh4) | 0; 26720 lo = lo + Math.imul(al4, bl5) | 0; 26721 mid = mid + Math.imul(al4, bh5) | 0; 26722 mid = mid + Math.imul(ah4, bl5) | 0; 26723 hi = hi + Math.imul(ah4, bh5) | 0; 26724 lo = lo + Math.imul(al3, bl6) | 0; 26725 mid = mid + Math.imul(al3, bh6) | 0; 26726 mid = mid + Math.imul(ah3, bl6) | 0; 26727 hi = hi + Math.imul(ah3, bh6) | 0; 26728 lo = lo + Math.imul(al2, bl7) | 0; 26729 mid = mid + Math.imul(al2, bh7) | 0; 26730 mid = mid + Math.imul(ah2, bl7) | 0; 26731 hi = hi + Math.imul(ah2, bh7) | 0; 26732 lo = lo + Math.imul(al1, bl8) | 0; 26733 mid = mid + Math.imul(al1, bh8) | 0; 26734 mid = mid + Math.imul(ah1, bl8) | 0; 26735 hi = hi + Math.imul(ah1, bh8) | 0; 26736 lo = lo + Math.imul(al0, bl9) | 0; 26737 mid = mid + Math.imul(al0, bh9) | 0; 26738 mid = mid + Math.imul(ah0, bl9) | 0; 26739 hi = hi + Math.imul(ah0, bh9) | 0; 26740 var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26741 c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; 26742 w9 &= 67108863; 26743 lo = Math.imul(al9, bl1); 26744 mid = Math.imul(al9, bh1);
vendor: 51,852 bytes, lines 26745-28495
26745 mid = mid + Math.imul(ah9, bl1) | 0; 26746 hi = Math.imul(ah9, bh1); 26747 lo = lo + Math.imul(al8, bl2) | 0; 26748 mid = mid + Math.imul(al8, bh2) | 0; 26749 mid = mid + Math.imul(ah8, bl2) | 0; 26750 hi = hi + Math.imul(ah8, bh2) | 0; 26751 lo = lo + Math.imul(al7, bl3) | 0; 26752 mid = mid + Math.imul(al7, bh3) | 0; 26753 mid = mid + Math.imul(ah7, bl3) | 0; 26754 hi = hi + Math.imul(ah7, bh3) | 0; 26755 lo = lo + Math.imul(al6, bl4) | 0; 26756 mid = mid + Math.imul(al6, bh4) | 0; 26757 mid = mid + Math.imul(ah6, bl4) | 0; 26758 hi = hi + Math.imul(ah6, bh4) | 0; 26759 lo = lo + Math.imul(al5, bl5) | 0; 26760 mid = mid + Math.imul(al5, bh5) | 0; 26761 mid = mid + Math.imul(ah5, bl5) | 0; 26762 hi = hi + Math.imul(ah5, bh5) | 0; 26763 lo = lo + Math.imul(al4, bl6) | 0; 26764 mid = mid + Math.imul(al4, bh6) | 0; 26765 mid = mid + Math.imul(ah4, bl6) | 0; 26766 hi = hi + Math.imul(ah4, bh6) | 0; 26767 lo = lo + Math.imul(al3, bl7) | 0; 26768 mid = mid + Math.imul(al3, bh7) | 0; 26769 mid = mid + Math.imul(ah3, bl7) | 0; 26770 hi = hi + Math.imul(ah3, bh7) | 0; 26771 lo = lo + Math.imul(al2, bl8) | 0; 26772 mid = mid + Math.imul(al2, bh8) | 0; 26773 mid = mid + Math.imul(ah2, bl8) | 0; 26774 hi = hi + Math.imul(ah2, bh8) | 0; 26775 lo = lo + Math.imul(al1, bl9) | 0; 26776 mid = mid + Math.imul(al1, bh9) | 0; 26777 mid = mid + Math.imul(ah1, bl9) | 0; 26778 hi = hi + Math.imul(ah1, bh9) | 0; 26779 var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26780 c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; 26781 w10 &= 67108863; 26782 lo = Math.imul(al9, bl2); 26783 mid = Math.imul(al9, bh2); 26784 mid = mid + Math.imul(ah9, bl2) | 0; 26785 hi = Math.imul(ah9, bh2); 26786 lo = lo + Math.imul(al8, bl3) | 0; 26787 mid = mid + Math.imul(al8, bh3) | 0; 26788 mid = mid + Math.imul(ah8, bl3) | 0; 26789 hi = hi + Math.imul(ah8, bh3) | 0; 26790 lo = lo + Math.imul(al7, bl4) | 0; 26791 mid = mid + Math.imul(al7, bh4) | 0; 26792 mid = mid + Math.imul(ah7, bl4) | 0; 26793 hi = hi + Math.imul(ah7, bh4) | 0; 26794 lo = lo + Math.imul(al6, bl5) | 0; 26795 mid = mid + Math.imul(al6, bh5) | 0; 26796 mid = mid + Math.imul(ah6, bl5) | 0; 26797 hi = hi + Math.imul(ah6, bh5) | 0; 26798 lo = lo + Math.imul(al5, bl6) | 0; 26799 mid = mid + Math.imul(al5, bh6) | 0; 26800 mid = mid + Math.imul(ah5, bl6) | 0; 26801 hi = hi + Math.imul(ah5, bh6) | 0; 26802 lo = lo + Math.imul(al4, bl7) | 0; 26803 mid = mid + Math.imul(al4, bh7) | 0; 26804 mid = mid + Math.imul(ah4, bl7) | 0; 26805 hi = hi + Math.imul(ah4, bh7) | 0; 26806 lo = lo + Math.imul(al3, bl8) | 0; 26807 mid = mid + Math.imul(al3, bh8) | 0; 26808 mid = mid + Math.imul(ah3, bl8) | 0; 26809 hi = hi + Math.imul(ah3, bh8) | 0; 26810 lo = lo + Math.imul(al2, bl9) | 0; 26811 mid = mid + Math.imul(al2, bh9) | 0; 26812 mid = mid + Math.imul(ah2, bl9) | 0; 26813 hi = hi + Math.imul(ah2, bh9) | 0; 26814 var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26815 c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; 26816 w11 &= 67108863; 26817 lo = Math.imul(al9, bl3); 26818 mid = Math.imul(al9, bh3); 26819 mid = mid + Math.imul(ah9, bl3) | 0; 26820 hi = Math.imul(ah9, bh3); 26821 lo = lo + Math.imul(al8, bl4) | 0; 26822 mid = mid + Math.imul(al8, bh4) | 0; 26823 mid = mid + Math.imul(ah8, bl4) | 0; 26824 hi = hi + Math.imul(ah8, bh4) | 0; 26825 lo = lo + Math.imul(al7, bl5) | 0; 26826 mid = mid + Math.imul(al7, bh5) | 0; 26827 mid = mid + Math.imul(ah7, bl5) | 0; 26828 hi = hi + Math.imul(ah7, bh5) | 0; 26829 lo = lo + Math.imul(al6, bl6) | 0; 26830 mid = mid + Math.imul(al6, bh6) | 0; 26831 mid = mid + Math.imul(ah6, bl6) | 0; 26832 hi = hi + Math.imul(ah6, bh6) | 0; 26833 lo = lo + Math.imul(al5, bl7) | 0; 26834 mid = mid + Math.imul(al5, bh7) | 0; 26835 mid = mid + Math.imul(ah5, bl7) | 0; 26836 hi = hi + Math.imul(ah5, bh7) | 0; 26837 lo = lo + Math.imul(al4, bl8) | 0; 26838 mid = mid + Math.imul(al4, bh8) | 0; 26839 mid = mid + Math.imul(ah4, bl8) | 0; 26840 hi = hi + Math.imul(ah4, bh8) | 0; 26841 lo = lo + Math.imul(al3, bl9) | 0; 26842 mid = mid + Math.imul(al3, bh9) | 0; 26843 mid = mid + Math.imul(ah3, bl9) | 0; 26844 hi = hi + Math.imul(ah3, bh9) | 0; 26845 var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26846 c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; 26847 w12 &= 67108863; 26848 lo = Math.imul(al9, bl4); 26849 mid = Math.imul(al9, bh4); 26850 mid = mid + Math.imul(ah9, bl4) | 0; 26851 hi = Math.imul(ah9, bh4); 26852 lo = lo + Math.imul(al8, bl5) | 0; 26853 mid = mid + Math.imul(al8, bh5) | 0; 26854 mid = mid + Math.imul(ah8, bl5) | 0; 26855 hi = hi + Math.imul(ah8, bh5) | 0; 26856 lo = lo + Math.imul(al7, bl6) | 0; 26857 mid = mid + Math.imul(al7, bh6) | 0; 26858 mid = mid + Math.imul(ah7, bl6) | 0; 26859 hi = hi + Math.imul(ah7, bh6) | 0; 26860 lo = lo + Math.imul(al6, bl7) | 0; 26861 mid = mid + Math.imul(al6, bh7) | 0; 26862 mid = mid + Math.imul(ah6, bl7) | 0; 26863 hi = hi + Math.imul(ah6, bh7) | 0; 26864 lo = lo + Math.imul(al5, bl8) | 0; 26865 mid = mid + Math.imul(al5, bh8) | 0; 26866 mid = mid + Math.imul(ah5, bl8) | 0; 26867 hi = hi + Math.imul(ah5, bh8) | 0; 26868 lo = lo + Math.imul(al4, bl9) | 0; 26869 mid = mid + Math.imul(al4, bh9) | 0; 26870 mid = mid + Math.imul(ah4, bl9) | 0; 26871 hi = hi + Math.imul(ah4, bh9) | 0; 26872 var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26873 c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; 26874 w13 &= 67108863; 26875 lo = Math.imul(al9, bl5); 26876 mid = Math.imul(al9, bh5); 26877 mid = mid + Math.imul(ah9, bl5) | 0; 26878 hi = Math.imul(ah9, bh5); 26879 lo = lo + Math.imul(al8, bl6) | 0; 26880 mid = mid + Math.imul(al8, bh6) | 0; 26881 mid = mid + Math.imul(ah8, bl6) | 0; 26882 hi = hi + Math.imul(ah8, bh6) | 0; 26883 lo = lo + Math.imul(al7, bl7) | 0; 26884 mid = mid + Math.imul(al7, bh7) | 0; 26885 mid = mid + Math.imul(ah7, bl7) | 0; 26886 hi = hi + Math.imul(ah7, bh7) | 0; 26887 lo = lo + Math.imul(al6, bl8) | 0; 26888 mid = mid + Math.imul(al6, bh8) | 0; 26889 mid = mid + Math.imul(ah6, bl8) | 0; 26890 hi = hi + Math.imul(ah6, bh8) | 0; 26891 lo = lo + Math.imul(al5, bl9) | 0; 26892 mid = mid + Math.imul(al5, bh9) | 0; 26893 mid = mid + Math.imul(ah5, bl9) | 0; 26894 hi = hi + Math.imul(ah5, bh9) | 0; 26895 var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26896 c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; 26897 w14 &= 67108863; 26898 lo = Math.imul(al9, bl6); 26899 mid = Math.imul(al9, bh6); 26900 mid = mid + Math.imul(ah9, bl6) | 0; 26901 hi = Math.imul(ah9, bh6); 26902 lo = lo + Math.imul(al8, bl7) | 0; 26903 mid = mid + Math.imul(al8, bh7) | 0; 26904 mid = mid + Math.imul(ah8, bl7) | 0; 26905 hi = hi + Math.imul(ah8, bh7) | 0; 26906 lo = lo + Math.imul(al7, bl8) | 0; 26907 mid = mid + Math.imul(al7, bh8) | 0; 26908 mid = mid + Math.imul(ah7, bl8) | 0; 26909 hi = hi + Math.imul(ah7, bh8) | 0; 26910 lo = lo + Math.imul(al6, bl9) | 0; 26911 mid = mid + Math.imul(al6, bh9) | 0; 26912 mid = mid + Math.imul(ah6, bl9) | 0; 26913 hi = hi + Math.imul(ah6, bh9) | 0; 26914 var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26915 c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; 26916 w15 &= 67108863; 26917 lo = Math.imul(al9, bl7); 26918 mid = Math.imul(al9, bh7); 26919 mid = mid + Math.imul(ah9, bl7) | 0; 26920 hi = Math.imul(ah9, bh7); 26921 lo = lo + Math.imul(al8, bl8) | 0; 26922 mid = mid + Math.imul(al8, bh8) | 0; 26923 mid = mid + Math.imul(ah8, bl8) | 0; 26924 hi = hi + Math.imul(ah8, bh8) | 0; 26925 lo = lo + Math.imul(al7, bl9) | 0; 26926 mid = mid + Math.imul(al7, bh9) | 0; 26927 mid = mid + Math.imul(ah7, bl9) | 0; 26928 hi = hi + Math.imul(ah7, bh9) | 0; 26929 var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26930 c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; 26931 w16 &= 67108863; 26932 lo = Math.imul(al9, bl8); 26933 mid = Math.imul(al9, bh8); 26934 mid = mid + Math.imul(ah9, bl8) | 0; 26935 hi = Math.imul(ah9, bh8); 26936 lo = lo + Math.imul(al8, bl9) | 0; 26937 mid = mid + Math.imul(al8, bh9) | 0; 26938 mid = mid + Math.imul(ah8, bl9) | 0; 26939 hi = hi + Math.imul(ah8, bh9) | 0; 26940 var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26941 c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; 26942 w17 &= 67108863; 26943 lo = Math.imul(al9, bl9); 26944 mid = Math.imul(al9, bh9); 26945 mid = mid + Math.imul(ah9, bl9) | 0; 26946 hi = Math.imul(ah9, bh9); 26947 var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0; 26948 c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; 26949 w18 &= 67108863; 26950 o[0] = w0; 26951 o[1] = w1; 26952 o[2] = w2; 26953 o[3] = w3; 26954 o[4] = w4; 26955 o[5] = w5; 26956 o[6] = w6; 26957 o[7] = w7; 26958 o[8] = w8; 26959 o[9] = w9; 26960 o[10] = w10; 26961 o[11] = w11; 26962 o[12] = w12; 26963 o[13] = w13; 26964 o[14] = w14; 26965 o[15] = w15; 26966 o[16] = w16; 26967 o[17] = w17; 26968 o[18] = w18; 26969 if (c !== 0) { 26970 o[19] = c; 26971 out.length++; 26972 } 26973 return out; 26974 }; 26975 if (!Math.imul) comb10MulTo = smallMulTo; 26976 function bigMulTo(self, num, out) { 26977 out.negative = num.negative ^ self.negative; 26978 out.length = self.length + num.length; 26979 var carry = 0; 26980 var hncarry = 0; 26981 for (var k = 0; k < out.length - 1; k++) { 26982 var ncarry = hncarry; 26983 hncarry = 0; 26984 var rword = carry & 67108863; 26985 var maxJ = Math.min(k, num.length - 1); 26986 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { 26987 var i = k - j; 26988 var r = (self.words[i] | 0) * (num.words[j] | 0); 26989 var lo = r & 67108863; 26990 ncarry = ncarry + (r / 67108864 | 0) | 0; 26991 lo = lo + rword | 0; 26992 rword = lo & 67108863; 26993 ncarry = ncarry + (lo >>> 26) | 0; 26994 hncarry += ncarry >>> 26; 26995 ncarry &= 67108863; 26996 } 26997 out.words[k] = rword; 26998 carry = ncarry; 26999 ncarry = hncarry; 27000 } 27001 if (carry !== 0) out.words[k] = carry; 27002 else out.length--; 27003 return out._strip(); 27004 } 27005 function jumboMulTo(self, num, out) { 27006 return bigMulTo(self, num, out); 27007 } 27008 BN.prototype.mulTo = function mulTo(num, out) { 27009 var res; 27010 var len = this.length + num.length; 27011 if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out); 27012 else if (len < 63) res = smallMulTo(this, num, out); 27013 else if (len < 1024) res = bigMulTo(this, num, out); 27014 else res = jumboMulTo(this, num, out); 27015 return res; 27016 }; 27017 function FFTM(x, y) { 27018 this.x = x; 27019 this.y = y; 27020 } 27021 FFTM.prototype.makeRBT = function makeRBT(N) { 27022 var t = new Array(N); 27023 var l = BN.prototype._countBits(N) - 1; 27024 for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N); 27025 return t; 27026 }; 27027 FFTM.prototype.revBin = function revBin(x, l, N) { 27028 if (x === 0 || x === N - 1) return x; 27029 var rb = 0; 27030 for (var i = 0; i < l; i++) { 27031 rb |= (x & 1) << l - i - 1; 27032 x >>= 1; 27033 } 27034 return rb; 27035 }; 27036 FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) { 27037 for (var i = 0; i < N; i++) { 27038 rtws[i] = rws[rbt[i]]; 27039 itws[i] = iws[rbt[i]]; 27040 } 27041 }; 27042 FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) { 27043 this.permute(rbt, rws, iws, rtws, itws, N); 27044 for (var s = 1; s < N; s <<= 1) { 27045 var l = s << 1; 27046 var rtwdf = Math.cos(2 * Math.PI / l); 27047 var itwdf = Math.sin(2 * Math.PI / l); 27048 for (var p = 0; p < N; p += l) { 27049 var rtwdf_ = rtwdf; 27050 var itwdf_ = itwdf; 27051 for (var j = 0; j < s; j++) { 27052 var re = rtws[p + j]; 27053 var ie = itws[p + j]; 27054 var ro = rtws[p + j + s]; 27055 var io = itws[p + j + s]; 27056 var rx = rtwdf_ * ro - itwdf_ * io; 27057 io = rtwdf_ * io + itwdf_ * ro; 27058 ro = rx; 27059 rtws[p + j] = re + ro; 27060 itws[p + j] = ie + io; 27061 rtws[p + j + s] = re - ro; 27062 itws[p + j + s] = ie - io; 27063 if (j !== l) { 27064 rx = rtwdf * rtwdf_ - itwdf * itwdf_; 27065 itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; 27066 rtwdf_ = rx; 27067 } 27068 } 27069 } 27070 } 27071 }; 27072 FFTM.prototype.guessLen13b = function guessLen13b(n, m) { 27073 var N = Math.max(m, n) | 1; 27074 var odd = N & 1; 27075 var i = 0; 27076 for (N = N / 2 | 0; N; N = N >>> 1) i++; 27077 return 1 << i + 1 + odd; 27078 }; 27079 FFTM.prototype.conjugate = function conjugate(rws, iws, N) { 27080 if (N <= 1) return; 27081 for (var i = 0; i < N / 2; i++) { 27082 var t = rws[i]; 27083 rws[i] = rws[N - i - 1]; 27084 rws[N - i - 1] = t; 27085 t = iws[i]; 27086 iws[i] = -iws[N - i - 1]; 27087 iws[N - i - 1] = -t; 27088 } 27089 }; 27090 FFTM.prototype.normalize13b = function normalize13b(ws, N) { 27091 var carry = 0; 27092 for (var i = 0; i < N / 2; i++) { 27093 var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry; 27094 ws[i] = w & 67108863; 27095 if (w < 67108864) carry = 0; 27096 else carry = w / 67108864 | 0; 27097 } 27098 return ws; 27099 }; 27100 FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) { 27101 var carry = 0; 27102 for (var i = 0; i < len; i++) { 27103 carry = carry + (ws[i] | 0); 27104 rws[2 * i] = carry & 8191; 27105 carry = carry >>> 13; 27106 rws[2 * i + 1] = carry & 8191; 27107 carry = carry >>> 13; 27108 } 27109 for (i = 2 * len; i < N; ++i) rws[i] = 0; 27110 assert(carry === 0); 27111 assert((carry & -8192) === 0); 27112 }; 27113 FFTM.prototype.stub = function stub(N) { 27114 var ph = new Array(N); 27115 for (var i = 0; i < N; i++) ph[i] = 0; 27116 return ph; 27117 }; 27118 FFTM.prototype.mulp = function mulp(x, y, out) { 27119 var N = 2 * this.guessLen13b(x.length, y.length); 27120 var rbt = this.makeRBT(N); 27121 var _ = this.stub(N); 27122 var rws = new Array(N); 27123 var rwst = new Array(N); 27124 var iwst = new Array(N); 27125 var nrws = new Array(N); 27126 var nrwst = new Array(N); 27127 var niwst = new Array(N); 27128 var rmws = out.words; 27129 rmws.length = N; 27130 this.convert13b(x.words, x.length, rws, N); 27131 this.convert13b(y.words, y.length, nrws, N); 27132 this.transform(rws, _, rwst, iwst, N, rbt); 27133 this.transform(nrws, _, nrwst, niwst, N, rbt); 27134 for (var i = 0; i < N; i++) { 27135 var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; 27136 iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; 27137 rwst[i] = rx; 27138 } 27139 this.conjugate(rwst, iwst, N); 27140 this.transform(rwst, iwst, rmws, _, N, rbt); 27141 this.conjugate(rmws, _, N); 27142 this.normalize13b(rmws, N); 27143 out.negative = x.negative ^ y.negative; 27144 out.length = x.length + y.length; 27145 return out._strip(); 27146 }; 27147 BN.prototype.mul = function mul(num) { 27148 var out = new BN(null); 27149 out.words = new Array(this.length + num.length); 27150 return this.mulTo(num, out); 27151 }; 27152 BN.prototype.mulf = function mulf(num) { 27153 var out = new BN(null); 27154 out.words = new Array(this.length + num.length); 27155 return jumboMulTo(this, num, out); 27156 }; 27157 BN.prototype.imul = function imul(num) { 27158 return this.clone().mulTo(num, this); 27159 }; 27160 BN.prototype.imuln = function imuln(num) { 27161 var isNegNum = num < 0; 27162 if (isNegNum) num = -num; 27163 assert(typeof num === "number"); 27164 assert(num < 67108864); 27165 var carry = 0; 27166 for (var i = 0; i < this.length; i++) { 27167 var w = (this.words[i] | 0) * num; 27168 var lo = (w & 67108863) + (carry & 67108863); 27169 carry >>= 26; 27170 carry += w / 67108864 | 0; 27171 carry += lo >>> 26; 27172 this.words[i] = lo & 67108863; 27173 } 27174 if (carry !== 0) { 27175 this.words[i] = carry; 27176 this.length++; 27177 } 27178 this.length = num === 0 ? 1 : this.length; 27179 return isNegNum ? this.ineg() : this; 27180 }; 27181 BN.prototype.muln = function muln(num) { 27182 return this.clone().imuln(num); 27183 }; 27184 BN.prototype.sqr = function sqr() { 27185 return this.mul(this); 27186 }; 27187 BN.prototype.isqr = function isqr() { 27188 return this.imul(this.clone()); 27189 }; 27190 BN.prototype.pow = function pow(num) { 27191 var w = toBitArray(num); 27192 if (w.length === 0) return new BN(1); 27193 var res = this; 27194 for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break; 27195 if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { 27196 if (w[i] === 0) continue; 27197 res = res.mul(q); 27198 } 27199 return res; 27200 }; 27201 BN.prototype.iushln = function iushln(bits) { 27202 assert(typeof bits === "number" && bits >= 0); 27203 var r = bits % 26; 27204 var s = (bits - r) / 26; 27205 var carryMask = 67108863 >>> 26 - r << 26 - r; 27206 var i; 27207 if (r !== 0) { 27208 var carry = 0; 27209 for (i = 0; i < this.length; i++) { 27210 var newCarry = this.words[i] & carryMask; 27211 var c = (this.words[i] | 0) - newCarry << r; 27212 this.words[i] = c | carry; 27213 carry = newCarry >>> 26 - r; 27214 } 27215 if (carry) { 27216 this.words[i] = carry; 27217 this.length++; 27218 } 27219 } 27220 if (s !== 0) { 27221 for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i]; 27222 for (i = 0; i < s; i++) this.words[i] = 0; 27223 this.length += s; 27224 } 27225 return this._strip(); 27226 }; 27227 BN.prototype.ishln = function ishln(bits) { 27228 assert(this.negative === 0); 27229 return this.iushln(bits); 27230 }; 27231 BN.prototype.iushrn = function iushrn(bits, hint, extended) { 27232 assert(typeof bits === "number" && bits >= 0); 27233 var h; 27234 if (hint) h = (hint - hint % 26) / 26; 27235 else h = 0; 27236 var r = bits % 26; 27237 var s = Math.min((bits - r) / 26, this.length); 27238 var mask = 67108863 ^ 67108863 >>> r << r; 27239 var maskedWords = extended; 27240 h -= s; 27241 h = Math.max(0, h); 27242 if (maskedWords) { 27243 for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i]; 27244 maskedWords.length = s; 27245 } 27246 if (s === 0) {} else if (this.length > s) { 27247 this.length -= s; 27248 for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s]; 27249 } else { 27250 this.words[0] = 0; 27251 this.length = 1; 27252 } 27253 var carry = 0; 27254 for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { 27255 var word = this.words[i] | 0; 27256 this.words[i] = carry << 26 - r | word >>> r; 27257 carry = word & mask; 27258 } 27259 if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry; 27260 if (this.length === 0) { 27261 this.words[0] = 0; 27262 this.length = 1; 27263 } 27264 return this._strip(); 27265 }; 27266 BN.prototype.ishrn = function ishrn(bits, hint, extended) { 27267 assert(this.negative === 0); 27268 return this.iushrn(bits, hint, extended); 27269 }; 27270 BN.prototype.shln = function shln(bits) { 27271 return this.clone().ishln(bits); 27272 }; 27273 BN.prototype.ushln = function ushln(bits) { 27274 return this.clone().iushln(bits); 27275 }; 27276 BN.prototype.shrn = function shrn(bits) { 27277 return this.clone().ishrn(bits); 27278 }; 27279 BN.prototype.ushrn = function ushrn(bits) { 27280 return this.clone().iushrn(bits); 27281 }; 27282 BN.prototype.testn = function testn(bit) { 27283 assert(typeof bit === "number" && bit >= 0); 27284 var r = bit % 26; 27285 var s = (bit - r) / 26; 27286 var q = 1 << r; 27287 if (this.length <= s) return false; 27288 return !!(this.words[s] & q); 27289 }; 27290 BN.prototype.imaskn = function imaskn(bits) { 27291 assert(typeof bits === "number" && bits >= 0); 27292 var r = bits % 26; 27293 var s = (bits - r) / 26; 27294 assert(this.negative === 0, "imaskn works only with positive numbers"); 27295 if (this.length <= s) return this; 27296 if (r !== 0) s++; 27297 this.length = Math.min(s, this.length); 27298 if (r !== 0) { 27299 var mask = 67108863 ^ 67108863 >>> r << r; 27300 this.words[this.length - 1] &= mask; 27301 } 27302 return this._strip(); 27303 }; 27304 BN.prototype.maskn = function maskn(bits) { 27305 return this.clone().imaskn(bits); 27306 }; 27307 BN.prototype.iaddn = function iaddn(num) { 27308 assert(typeof num === "number"); 27309 assert(num < 67108864); 27310 if (num < 0) return this.isubn(-num); 27311 if (this.negative !== 0) { 27312 if (this.length === 1 && (this.words[0] | 0) <= num) { 27313 this.words[0] = num - (this.words[0] | 0); 27314 this.negative = 0; 27315 return this; 27316 } 27317 this.negative = 0; 27318 this.isubn(num); 27319 this.negative = 1; 27320 return this; 27321 } 27322 return this._iaddn(num); 27323 }; 27324 BN.prototype._iaddn = function _iaddn(num) { 27325 this.words[0] += num; 27326 for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) { 27327 this.words[i] -= 67108864; 27328 if (i === this.length - 1) this.words[i + 1] = 1; 27329 else this.words[i + 1]++; 27330 } 27331 this.length = Math.max(this.length, i + 1); 27332 return this; 27333 }; 27334 BN.prototype.isubn = function isubn(num) { 27335 assert(typeof num === "number"); 27336 assert(num < 67108864); 27337 if (num < 0) return this.iaddn(-num); 27338 if (this.negative !== 0) { 27339 this.negative = 0; 27340 this.iaddn(num); 27341 this.negative = 1; 27342 return this; 27343 } 27344 this.words[0] -= num; 27345 if (this.length === 1 && this.words[0] < 0) { 27346 this.words[0] = -this.words[0]; 27347 this.negative = 1; 27348 } else for (var i = 0; i < this.length && this.words[i] < 0; i++) { 27349 this.words[i] += 67108864; 27350 this.words[i + 1] -= 1; 27351 } 27352 return this._strip(); 27353 }; 27354 BN.prototype.addn = function addn(num) { 27355 return this.clone().iaddn(num); 27356 }; 27357 BN.prototype.subn = function subn(num) { 27358 return this.clone().isubn(num); 27359 }; 27360 BN.prototype.iabs = function iabs() { 27361 this.negative = 0; 27362 return this; 27363 }; 27364 BN.prototype.abs = function abs() { 27365 return this.clone().iabs(); 27366 }; 27367 BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { 27368 var len = num.length + shift; 27369 var i; 27370 this._expand(len); 27371 var w; 27372 var carry = 0; 27373 for (i = 0; i < num.length; i++) { 27374 w = (this.words[i + shift] | 0) + carry; 27375 var right = (num.words[i] | 0) * mul; 27376 w -= right & 67108863; 27377 carry = (w >> 26) - (right / 67108864 | 0); 27378 this.words[i + shift] = w & 67108863; 27379 } 27380 for (; i < this.length - shift; i++) { 27381 w = (this.words[i + shift] | 0) + carry; 27382 carry = w >> 26; 27383 this.words[i + shift] = w & 67108863; 27384 } 27385 if (carry === 0) return this._strip(); 27386 assert(carry === -1); 27387 carry = 0; 27388 for (i = 0; i < this.length; i++) { 27389 w = -(this.words[i] | 0) + carry; 27390 carry = w >> 26; 27391 this.words[i] = w & 67108863; 27392 } 27393 this.negative = 1; 27394 return this._strip(); 27395 }; 27396 BN.prototype._wordDiv = function _wordDiv(num, mode) { 27397 var shift = this.length - num.length; 27398 var a = this.clone(); 27399 var b = num; 27400 var bhi = b.words[b.length - 1] | 0; 27401 shift = 26 - this._countBits(bhi); 27402 if (shift !== 0) { 27403 b = b.ushln(shift); 27404 a.iushln(shift); 27405 bhi = b.words[b.length - 1] | 0; 27406 } 27407 var m = a.length - b.length; 27408 var q; 27409 if (mode !== "mod") { 27410 q = new BN(null); 27411 q.length = m + 1; 27412 q.words = new Array(q.length); 27413 for (var i = 0; i < q.length; i++) q.words[i] = 0; 27414 } 27415 var diff = a.clone()._ishlnsubmul(b, 1, m); 27416 if (diff.negative === 0) { 27417 a = diff; 27418 if (q) q.words[m] = 1; 27419 } 27420 for (var j = m - 1; j >= 0; j--) { 27421 var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0); 27422 qj = Math.min(qj / bhi | 0, 67108863); 27423 a._ishlnsubmul(b, qj, j); 27424 while (a.negative !== 0) { 27425 qj--; 27426 a.negative = 0; 27427 a._ishlnsubmul(b, 1, j); 27428 if (!a.isZero()) a.negative ^= 1; 27429 } 27430 if (q) q.words[j] = qj; 27431 } 27432 if (q) q._strip(); 27433 a._strip(); 27434 if (mode !== "div" && shift !== 0) a.iushrn(shift); 27435 return { 27436 div: q || null, 27437 mod: a 27438 }; 27439 }; 27440 BN.prototype.divmod = function divmod(num, mode, positive) { 27441 assert(!num.isZero()); 27442 if (this.isZero()) return { 27443 div: new BN(0), 27444 mod: new BN(0) 27445 }; 27446 var div, mod, res; 27447 if (this.negative !== 0 && num.negative === 0) { 27448 res = this.neg().divmod(num, mode); 27449 if (mode !== "mod") div = res.div.neg(); 27450 if (mode !== "div") { 27451 mod = res.mod.neg(); 27452 if (positive && mod.negative !== 0) mod.iadd(num); 27453 } 27454 return { 27455 div, 27456 mod 27457 }; 27458 } 27459 if (this.negative === 0 && num.negative !== 0) { 27460 res = this.divmod(num.neg(), mode); 27461 if (mode !== "mod") div = res.div.neg(); 27462 return { 27463 div, 27464 mod: res.mod 27465 }; 27466 } 27467 if ((this.negative & num.negative) !== 0) { 27468 res = this.neg().divmod(num.neg(), mode); 27469 if (mode !== "div") { 27470 mod = res.mod.neg(); 27471 if (positive && mod.negative !== 0) mod.isub(num); 27472 } 27473 return { 27474 div: res.div, 27475 mod 27476 }; 27477 } 27478 if (num.length > this.length || this.cmp(num) < 0) return { 27479 div: new BN(0), 27480 mod: this 27481 }; 27482 if (num.length === 1) { 27483 if (mode === "div") return { 27484 div: this.divn(num.words[0]), 27485 mod: null 27486 }; 27487 if (mode === "mod") return { 27488 div: null, 27489 mod: new BN(this.modrn(num.words[0])) 27490 }; 27491 return { 27492 div: this.divn(num.words[0]), 27493 mod: new BN(this.modrn(num.words[0])) 27494 }; 27495 } 27496 return this._wordDiv(num, mode); 27497 }; 27498 BN.prototype.div = function div(num) { 27499 return this.divmod(num, "div", false).div; 27500 }; 27501 BN.prototype.mod = function mod(num) { 27502 return this.divmod(num, "mod", false).mod; 27503 }; 27504 BN.prototype.umod = function umod(num) { 27505 return this.divmod(num, "mod", true).mod; 27506 }; 27507 BN.prototype.divRound = function divRound(num) { 27508 var dm = this.divmod(num); 27509 if (dm.mod.isZero()) return dm.div; 27510 var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; 27511 var half = num.ushrn(1); 27512 var r2 = num.andln(1); 27513 var cmp = mod.cmp(half); 27514 if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; 27515 return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); 27516 }; 27517 BN.prototype.modrn = function modrn(num) { 27518 var isNegNum = num < 0; 27519 if (isNegNum) num = -num; 27520 assert(num <= 67108863); 27521 var p = (1 << 26) % num; 27522 var acc = 0; 27523 for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num; 27524 return isNegNum ? -acc : acc; 27525 }; 27526 BN.prototype.modn = function modn(num) { 27527 return this.modrn(num); 27528 }; 27529 BN.prototype.idivn = function idivn(num) { 27530 var isNegNum = num < 0; 27531 if (isNegNum) num = -num; 27532 assert(num <= 67108863); 27533 var carry = 0; 27534 for (var i = this.length - 1; i >= 0; i--) { 27535 var w = (this.words[i] | 0) + carry * 67108864; 27536 this.words[i] = w / num | 0; 27537 carry = w % num; 27538 } 27539 this._strip(); 27540 return isNegNum ? this.ineg() : this; 27541 }; 27542 BN.prototype.divn = function divn(num) { 27543 return this.clone().idivn(num); 27544 }; 27545 BN.prototype.egcd = function egcd(p) { 27546 assert(p.negative === 0); 27547 assert(!p.isZero()); 27548 var x = this; 27549 var y = p.clone(); 27550 if (x.negative !== 0) x = x.umod(p); 27551 else x = x.clone(); 27552 var A = new BN(1); 27553 var B = new BN(0); 27554 var C = new BN(0); 27555 var D = new BN(1); 27556 var g = 0; 27557 while (x.isEven() && y.isEven()) { 27558 x.iushrn(1); 27559 y.iushrn(1); 27560 ++g; 27561 } 27562 var yp = y.clone(); 27563 var xp = x.clone(); 27564 while (!x.isZero()) { 27565 for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 27566 if (i > 0) { 27567 x.iushrn(i); 27568 while (i-- > 0) { 27569 if (A.isOdd() || B.isOdd()) { 27570 A.iadd(yp); 27571 B.isub(xp); 27572 } 27573 A.iushrn(1); 27574 B.iushrn(1); 27575 } 27576 } 27577 for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 27578 if (j > 0) { 27579 y.iushrn(j); 27580 while (j-- > 0) { 27581 if (C.isOdd() || D.isOdd()) { 27582 C.iadd(yp); 27583 D.isub(xp); 27584 } 27585 C.iushrn(1); 27586 D.iushrn(1); 27587 } 27588 } 27589 if (x.cmp(y) >= 0) { 27590 x.isub(y); 27591 A.isub(C); 27592 B.isub(D); 27593 } else { 27594 y.isub(x); 27595 C.isub(A); 27596 D.isub(B); 27597 } 27598 } 27599 return { 27600 a: C, 27601 b: D, 27602 gcd: y.iushln(g) 27603 }; 27604 }; 27605 BN.prototype._invmp = function _invmp(p) { 27606 assert(p.negative === 0); 27607 assert(!p.isZero()); 27608 var a = this; 27609 var b = p.clone(); 27610 if (a.negative !== 0) a = a.umod(p); 27611 else a = a.clone(); 27612 var x1 = new BN(1); 27613 var x2 = new BN(0); 27614 var delta = b.clone(); 27615 while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { 27616 for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); 27617 if (i > 0) { 27618 a.iushrn(i); 27619 while (i-- > 0) { 27620 if (x1.isOdd()) x1.iadd(delta); 27621 x1.iushrn(1); 27622 } 27623 } 27624 for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); 27625 if (j > 0) { 27626 b.iushrn(j); 27627 while (j-- > 0) { 27628 if (x2.isOdd()) x2.iadd(delta); 27629 x2.iushrn(1); 27630 } 27631 } 27632 if (a.cmp(b) >= 0) { 27633 a.isub(b); 27634 x1.isub(x2); 27635 } else { 27636 b.isub(a); 27637 x2.isub(x1); 27638 } 27639 } 27640 var res; 27641 if (a.cmpn(1) === 0) res = x1; 27642 else res = x2; 27643 if (res.cmpn(0) < 0) res.iadd(p); 27644 return res; 27645 }; 27646 BN.prototype.gcd = function gcd(num) { 27647 if (this.isZero()) return num.abs(); 27648 if (num.isZero()) return this.abs(); 27649 var a = this.clone(); 27650 var b = num.clone(); 27651 a.negative = 0; 27652 b.negative = 0; 27653 for (var shift = 0; a.isEven() && b.isEven(); shift++) { 27654 a.iushrn(1); 27655 b.iushrn(1); 27656 } 27657 do { 27658 while (a.isEven()) a.iushrn(1); 27659 while (b.isEven()) b.iushrn(1); 27660 var r = a.cmp(b); 27661 if (r < 0) { 27662 var t = a; 27663 a = b; 27664 b = t; 27665 } else if (r === 0 || b.cmpn(1) === 0) break; 27666 a.isub(b); 27667 } while (true); 27668 return b.iushln(shift); 27669 }; 27670 BN.prototype.invm = function invm(num) { 27671 return this.egcd(num).a.umod(num); 27672 }; 27673 BN.prototype.isEven = function isEven() { 27674 return (this.words[0] & 1) === 0; 27675 }; 27676 BN.prototype.isOdd = function isOdd() { 27677 return (this.words[0] & 1) === 1; 27678 }; 27679 BN.prototype.andln = function andln(num) { 27680 return this.words[0] & num; 27681 }; 27682 BN.prototype.bincn = function bincn(bit) { 27683 assert(typeof bit === "number"); 27684 var r = bit % 26; 27685 var s = (bit - r) / 26; 27686 var q = 1 << r; 27687 if (this.length <= s) { 27688 this._expand(s + 1); 27689 this.words[s] |= q; 27690 return this; 27691 } 27692 var carry = q; 27693 for (var i = s; carry !== 0 && i < this.length; i++) { 27694 var w = this.words[i] | 0; 27695 w += carry; 27696 carry = w >>> 26; 27697 w &= 67108863; 27698 this.words[i] = w; 27699 } 27700 if (carry !== 0) { 27701 this.words[i] = carry; 27702 this.length++; 27703 } 27704 return this; 27705 }; 27706 BN.prototype.isZero = function isZero() { 27707 return this.length === 1 && this.words[0] === 0; 27708 }; 27709 BN.prototype.cmpn = function cmpn(num) { 27710 var negative = num < 0; 27711 if (this.negative !== 0 && !negative) return -1; 27712 if (this.negative === 0 && negative) return 1; 27713 this._strip(); 27714 var res; 27715 if (this.length > 1) res = 1; 27716 else { 27717 if (negative) num = -num; 27718 assert(num <= 67108863, "Number is too big"); 27719 var w = this.words[0] | 0; 27720 res = w === num ? 0 : w < num ? -1 : 1; 27721 } 27722 if (this.negative !== 0) return -res | 0; 27723 return res; 27724 }; 27725 BN.prototype.cmp = function cmp(num) { 27726 if (this.negative !== 0 && num.negative === 0) return -1; 27727 if (this.negative === 0 && num.negative !== 0) return 1; 27728 var res = this.ucmp(num); 27729 if (this.negative !== 0) return -res | 0; 27730 return res; 27731 }; 27732 BN.prototype.ucmp = function ucmp(num) { 27733 if (this.length > num.length) return 1; 27734 if (this.length < num.length) return -1; 27735 var res = 0; 27736 for (var i = this.length - 1; i >= 0; i--) { 27737 var a = this.words[i] | 0; 27738 var b = num.words[i] | 0; 27739 if (a === b) continue; 27740 if (a < b) res = -1; 27741 else if (a > b) res = 1; 27742 break; 27743 } 27744 return res; 27745 }; 27746 BN.prototype.gtn = function gtn(num) { 27747 return this.cmpn(num) === 1; 27748 }; 27749 BN.prototype.gt = function gt(num) { 27750 return this.cmp(num) === 1; 27751 }; 27752 BN.prototype.gten = function gten(num) { 27753 return this.cmpn(num) >= 0; 27754 }; 27755 BN.prototype.gte = function gte(num) { 27756 return this.cmp(num) >= 0; 27757 }; 27758 BN.prototype.ltn = function ltn(num) { 27759 return this.cmpn(num) === -1; 27760 }; 27761 BN.prototype.lt = function lt(num) { 27762 return this.cmp(num) === -1; 27763 }; 27764 BN.prototype.lten = function lten(num) { 27765 return this.cmpn(num) <= 0; 27766 }; 27767 BN.prototype.lte = function lte(num) { 27768 return this.cmp(num) <= 0; 27769 }; 27770 BN.prototype.eqn = function eqn(num) { 27771 return this.cmpn(num) === 0; 27772 }; 27773 BN.prototype.eq = function eq(num) { 27774 return this.cmp(num) === 0; 27775 }; 27776 BN.red = function red(num) { 27777 return new Red(num); 27778 }; 27779 BN.prototype.toRed = function toRed(ctx) { 27780 assert(!this.red, "Already a number in reduction context"); 27781 assert(this.negative === 0, "red works only with positives"); 27782 return ctx.convertTo(this)._forceRed(ctx); 27783 }; 27784 BN.prototype.fromRed = function fromRed() { 27785 assert(this.red, "fromRed works only with numbers in reduction context"); 27786 return this.red.convertFrom(this); 27787 }; 27788 BN.prototype._forceRed = function _forceRed(ctx) { 27789 this.red = ctx; 27790 return this; 27791 }; 27792 BN.prototype.forceRed = function forceRed(ctx) { 27793 assert(!this.red, "Already a number in reduction context"); 27794 return this._forceRed(ctx); 27795 }; 27796 BN.prototype.redAdd = function redAdd(num) { 27797 assert(this.red, "redAdd works only with red numbers"); 27798 return this.red.add(this, num); 27799 }; 27800 BN.prototype.redIAdd = function redIAdd(num) { 27801 assert(this.red, "redIAdd works only with red numbers"); 27802 return this.red.iadd(this, num); 27803 }; 27804 BN.prototype.redSub = function redSub(num) { 27805 assert(this.red, "redSub works only with red numbers"); 27806 return this.red.sub(this, num); 27807 }; 27808 BN.prototype.redISub = function redISub(num) { 27809 assert(this.red, "redISub works only with red numbers"); 27810 return this.red.isub(this, num); 27811 }; 27812 BN.prototype.redShl = function redShl(num) { 27813 assert(this.red, "redShl works only with red numbers"); 27814 return this.red.shl(this, num); 27815 }; 27816 BN.prototype.redMul = function redMul(num) { 27817 assert(this.red, "redMul works only with red numbers"); 27818 this.red._verify2(this, num); 27819 return this.red.mul(this, num); 27820 }; 27821 BN.prototype.redIMul = function redIMul(num) { 27822 assert(this.red, "redMul works only with red numbers"); 27823 this.red._verify2(this, num); 27824 return this.red.imul(this, num); 27825 }; 27826 BN.prototype.redSqr = function redSqr() { 27827 assert(this.red, "redSqr works only with red numbers"); 27828 this.red._verify1(this); 27829 return this.red.sqr(this); 27830 }; 27831 BN.prototype.redISqr = function redISqr() { 27832 assert(this.red, "redISqr works only with red numbers"); 27833 this.red._verify1(this); 27834 return this.red.isqr(this); 27835 }; 27836 BN.prototype.redSqrt = function redSqrt() { 27837 assert(this.red, "redSqrt works only with red numbers"); 27838 this.red._verify1(this); 27839 return this.red.sqrt(this); 27840 }; 27841 BN.prototype.redInvm = function redInvm() { 27842 assert(this.red, "redInvm works only with red numbers"); 27843 this.red._verify1(this); 27844 return this.red.invm(this); 27845 }; 27846 BN.prototype.redNeg = function redNeg() { 27847 assert(this.red, "redNeg works only with red numbers"); 27848 this.red._verify1(this); 27849 return this.red.neg(this); 27850 }; 27851 BN.prototype.redPow = function redPow(num) { 27852 assert(this.red && !num.red, "redPow(normalNum)"); 27853 this.red._verify1(this); 27854 return this.red.pow(this, num); 27855 }; 27856 var primes = { 27857 k256: null, 27858 p224: null, 27859 p192: null, 27860 p25519: null 27861 }; 27862 function MPrime(name, p) { 27863 this.name = name; 27864 this.p = new BN(p, 16); 27865 this.n = this.p.bitLength(); 27866 this.k = new BN(1).iushln(this.n).isub(this.p); 27867 this.tmp = this._tmp(); 27868 } 27869 MPrime.prototype._tmp = function _tmp() { 27870 var tmp = new BN(null); 27871 tmp.words = new Array(Math.ceil(this.n / 13)); 27872 return tmp; 27873 }; 27874 MPrime.prototype.ireduce = function ireduce(num) { 27875 var r = num; 27876 var rlen; 27877 do { 27878 this.split(r, this.tmp); 27879 r = this.imulK(r); 27880 r = r.iadd(this.tmp); 27881 rlen = r.bitLength(); 27882 } while (rlen > this.n); 27883 var cmp = rlen < this.n ? -1 : r.ucmp(this.p); 27884 if (cmp === 0) { 27885 r.words[0] = 0; 27886 r.length = 1; 27887 } else if (cmp > 0) r.isub(this.p); 27888 else if (r.strip !== void 0) r.strip(); 27889 else r._strip(); 27890 return r; 27891 }; 27892 MPrime.prototype.split = function split(input, out) { 27893 input.iushrn(this.n, 0, out); 27894 }; 27895 MPrime.prototype.imulK = function imulK(num) { 27896 return num.imul(this.k); 27897 }; 27898 function K256() { 27899 MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); 27900 } 27901 inherits(K256, MPrime); 27902 K256.prototype.split = function split(input, output) { 27903 var mask = 4194303; 27904 var outLen = Math.min(input.length, 9); 27905 for (var i = 0; i < outLen; i++) output.words[i] = input.words[i]; 27906 output.length = outLen; 27907 if (input.length <= 9) { 27908 input.words[0] = 0; 27909 input.length = 1; 27910 return; 27911 } 27912 var prev = input.words[9]; 27913 output.words[output.length++] = prev & mask; 27914 for (i = 10; i < input.length; i++) { 27915 var next = input.words[i] | 0; 27916 input.words[i - 10] = (next & mask) << 4 | prev >>> 22; 27917 prev = next; 27918 } 27919 prev >>>= 22; 27920 input.words[i - 10] = prev; 27921 if (prev === 0 && input.length > 10) input.length -= 10; 27922 else input.length -= 9; 27923 }; 27924 K256.prototype.imulK = function imulK(num) { 27925 num.words[num.length] = 0; 27926 num.words[num.length + 1] = 0; 27927 num.length += 2; 27928 var lo = 0; 27929 for (var i = 0; i < num.length; i++) { 27930 var w = num.words[i] | 0; 27931 lo += w * 977; 27932 num.words[i] = lo & 67108863; 27933 lo = w * 64 + (lo / 67108864 | 0); 27934 } 27935 if (num.words[num.length - 1] === 0) { 27936 num.length--; 27937 if (num.words[num.length - 1] === 0) num.length--; 27938 } 27939 return num; 27940 }; 27941 function P224() { 27942 MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); 27943 } 27944 inherits(P224, MPrime); 27945 function P192() { 27946 MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); 27947 } 27948 inherits(P192, MPrime); 27949 function P25519() { 27950 MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); 27951 } 27952 inherits(P25519, MPrime); 27953 P25519.prototype.imulK = function imulK(num) { 27954 var carry = 0; 27955 for (var i = 0; i < num.length; i++) { 27956 var hi = (num.words[i] | 0) * 19 + carry; 27957 var lo = hi & 67108863; 27958 hi >>>= 26; 27959 num.words[i] = lo; 27960 carry = hi; 27961 } 27962 if (carry !== 0) num.words[num.length++] = carry; 27963 return num; 27964 }; 27965 BN._prime = function prime(name) { 27966 if (primes[name]) return primes[name]; 27967 var prime; 27968 if (name === "k256") prime = new K256(); 27969 else if (name === "p224") prime = new P224(); 27970 else if (name === "p192") prime = new P192(); 27971 else if (name === "p25519") prime = new P25519(); 27972 else throw new Error("Unknown prime " + name); 27973 primes[name] = prime; 27974 return prime; 27975 }; 27976 function Red(m) { 27977 if (typeof m === "string") { 27978 var prime = BN._prime(m); 27979 this.m = prime.p; 27980 this.prime = prime; 27981 } else { 27982 assert(m.gtn(1), "modulus must be greater than 1"); 27983 this.m = m; 27984 this.prime = null; 27985 } 27986 } 27987 Red.prototype._verify1 = function _verify1(a) { 27988 assert(a.negative === 0, "red works only with positives"); 27989 assert(a.red, "red works only with red numbers"); 27990 }; 27991 Red.prototype._verify2 = function _verify2(a, b) { 27992 assert((a.negative | b.negative) === 0, "red works only with positives"); 27993 assert(a.red && a.red === b.red, "red works only with red numbers"); 27994 }; 27995 Red.prototype.imod = function imod(a) { 27996 if (this.prime) return this.prime.ireduce(a)._forceRed(this); 27997 move(a, a.umod(this.m)._forceRed(this)); 27998 return a; 27999 }; 28000 Red.prototype.neg = function neg(a) { 28001 if (a.isZero()) return a.clone(); 28002 return this.m.sub(a)._forceRed(this); 28003 }; 28004 Red.prototype.add = function add(a, b) { 28005 this._verify2(a, b); 28006 var res = a.add(b); 28007 if (res.cmp(this.m) >= 0) res.isub(this.m); 28008 return res._forceRed(this); 28009 }; 28010 Red.prototype.iadd = function iadd(a, b) { 28011 this._verify2(a, b); 28012 var res = a.iadd(b); 28013 if (res.cmp(this.m) >= 0) res.isub(this.m); 28014 return res; 28015 }; 28016 Red.prototype.sub = function sub(a, b) { 28017 this._verify2(a, b); 28018 var res = a.sub(b); 28019 if (res.cmpn(0) < 0) res.iadd(this.m); 28020 return res._forceRed(this); 28021 }; 28022 Red.prototype.isub = function isub(a, b) { 28023 this._verify2(a, b); 28024 var res = a.isub(b); 28025 if (res.cmpn(0) < 0) res.iadd(this.m); 28026 return res; 28027 }; 28028 Red.prototype.shl = function shl(a, num) { 28029 this._verify1(a); 28030 return this.imod(a.ushln(num)); 28031 }; 28032 Red.prototype.imul = function imul(a, b) { 28033 this._verify2(a, b); 28034 return this.imod(a.imul(b)); 28035 }; 28036 Red.prototype.mul = function mul(a, b) { 28037 this._verify2(a, b); 28038 return this.imod(a.mul(b)); 28039 }; 28040 Red.prototype.isqr = function isqr(a) { 28041 return this.imul(a, a.clone()); 28042 }; 28043 Red.prototype.sqr = function sqr(a) { 28044 return this.mul(a, a); 28045 }; 28046 Red.prototype.sqrt = function sqrt(a) { 28047 if (a.isZero()) return a.clone(); 28048 var mod3 = this.m.andln(3); 28049 assert(mod3 % 2 === 1); 28050 if (mod3 === 3) { 28051 var pow = this.m.add(new BN(1)).iushrn(2); 28052 return this.pow(a, pow); 28053 } 28054 var q = this.m.subn(1); 28055 var s = 0; 28056 while (!q.isZero() && q.andln(1) === 0) { 28057 s++; 28058 q.iushrn(1); 28059 } 28060 assert(!q.isZero()); 28061 var one = new BN(1).toRed(this); 28062 var nOne = one.redNeg(); 28063 var lpow = this.m.subn(1).iushrn(1); 28064 var z = this.m.bitLength(); 28065 z = new BN(2 * z * z).toRed(this); 28066 while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne); 28067 var c = this.pow(z, q); 28068 var r = this.pow(a, q.addn(1).iushrn(1)); 28069 var t = this.pow(a, q); 28070 var m = s; 28071 while (t.cmp(one) !== 0) { 28072 var tmp = t; 28073 for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr(); 28074 assert(i < m); 28075 var b = this.pow(c, new BN(1).iushln(m - i - 1)); 28076 r = r.redMul(b); 28077 c = b.redSqr(); 28078 t = t.redMul(c); 28079 m = i; 28080 } 28081 return r; 28082 }; 28083 Red.prototype.invm = function invm(a) { 28084 var inv = a._invmp(this.m); 28085 if (inv.negative !== 0) { 28086 inv.negative = 0; 28087 return this.imod(inv).redNeg(); 28088 } else return this.imod(inv); 28089 }; 28090 Red.prototype.pow = function pow(a, num) { 28091 if (num.isZero()) return new BN(1).toRed(this); 28092 if (num.cmpn(1) === 0) return a.clone(); 28093 var windowSize = 4; 28094 var wnd = new Array(1 << windowSize); 28095 wnd[0] = new BN(1).toRed(this); 28096 wnd[1] = a; 28097 for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a); 28098 var res = wnd[0]; 28099 var current = 0; 28100 var currentLen = 0; 28101 var start = num.bitLength() % 26; 28102 if (start === 0) start = 26; 28103 for (i = num.length - 1; i >= 0; i--) { 28104 var word = num.words[i]; 28105 for (var j = start - 1; j >= 0; j--) { 28106 var bit = word >> j & 1; 28107 if (res !== wnd[0]) res = this.sqr(res); 28108 if (bit === 0 && current === 0) { 28109 currentLen = 0; 28110 continue; 28111 } 28112 current <<= 1; 28113 current |= bit; 28114 currentLen++; 28115 if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; 28116 res = this.mul(res, wnd[current]); 28117 currentLen = 0; 28118 current = 0; 28119 } 28120 start = 26; 28121 } 28122 return res; 28123 }; 28124 Red.prototype.convertTo = function convertTo(num) { 28125 var r = num.umod(this.m); 28126 return r === num ? r.clone() : r; 28127 }; 28128 Red.prototype.convertFrom = function convertFrom(num) { 28129 var res = num.clone(); 28130 res.red = null; 28131 return res; 28132 }; 28133 BN.mont = function mont(num) { 28134 return new Mont(num); 28135 }; 28136 function Mont(m) { 28137 Red.call(this, m); 28138 this.shift = this.m.bitLength(); 28139 if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26; 28140 this.r = new BN(1).iushln(this.shift); 28141 this.r2 = this.imod(this.r.sqr()); 28142 this.rinv = this.r._invmp(this.m); 28143 this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); 28144 this.minv = this.minv.umod(this.r); 28145 this.minv = this.r.sub(this.minv); 28146 } 28147 inherits(Mont, Red); 28148 Mont.prototype.convertTo = function convertTo(num) { 28149 return this.imod(num.ushln(this.shift)); 28150 }; 28151 Mont.prototype.convertFrom = function convertFrom(num) { 28152 var r = this.imod(num.mul(this.rinv)); 28153 r.red = null; 28154 return r; 28155 }; 28156 Mont.prototype.imul = function imul(a, b) { 28157 if (a.isZero() || b.isZero()) { 28158 a.words[0] = 0; 28159 a.length = 1; 28160 return a; 28161 } 28162 var t = a.imul(b); 28163 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 28164 var u = t.isub(c).iushrn(this.shift); 28165 var res = u; 28166 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 28167 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 28168 return res._forceRed(this); 28169 }; 28170 Mont.prototype.mul = function mul(a, b) { 28171 if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); 28172 var t = a.mul(b); 28173 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); 28174 var u = t.isub(c).iushrn(this.shift); 28175 var res = u; 28176 if (u.cmp(this.m) >= 0) res = u.isub(this.m); 28177 else if (u.cmpn(0) < 0) res = u.iadd(this.m); 28178 return res._forceRed(this); 28179 }; 28180 Mont.prototype.invm = function invm(a) { 28181 return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this); 28182 }; 28183 })(typeof module === "undefined" || module, exports); 28184})); 28185//#endregion 28186//#region vite/emptyModule.js 28187var emptyModule_exports = /* @__PURE__ */ __exportAll({ default: () => emptyModule_default }); 28188var emptyModule_default; 28189var init_emptyModule = __esmMin((() => { 28190 emptyModule_default = {}; 28191})); 28192//#endregion 28193//#region node_modules/asn1.js/lib/asn1/api.js 28194var require_api = /* @__PURE__ */ __commonJSMin(((exports) => { 28195 var asn1 = require_asn1$1(); 28196 var inherits = require_inherits_browser(); 28197 var api = exports; 28198 api.define = function define(name, body) { 28199 return new Entity(name, body); 28200 }; 28201 function Entity(name, body) { 28202 this.name = name; 28203 this.body = body; 28204 this.decoders = {}; 28205 this.encoders = {}; 28206 } 28207 Entity.prototype._createNamed = function createNamed(base) { 28208 var named; 28209 try { 28210 named = (init_emptyModule(), __toCommonJS(emptyModule_exports)).runInThisContext("(function " + this.name + "(entity) {\n this._initNamed(entity);\n})"); 28211 } catch (e) { 28212 named = function(entity) { 28213 this._initNamed(entity); 28214 }; 28215 } 28216 inherits(named, base); 28217 named.prototype._initNamed = function initnamed(entity) { 28218 base.call(this, entity); 28219 }; 28220 return new named(this); 28221 }; 28222 Entity.prototype._getDecoder = function _getDecoder(enc) { 28223 enc = enc || "der"; 28224 if (!this.decoders.hasOwnProperty(enc)) this.decoders[enc] = this._createNamed(asn1.decoders[enc]); 28225 return this.decoders[enc]; 28226 }; 28227 Entity.prototype.decode = function decode(data, enc, options) { 28228 return this._getDecoder(enc).decode(data, options); 28229 }; 28230 Entity.prototype._getEncoder = function _getEncoder(enc) { 28231 enc = enc || "der"; 28232 if (!this.encoders.hasOwnProperty(enc)) this.encoders[enc] = this._createNamed(asn1.encoders[enc]); 28233 return this.encoders[enc]; 28234 }; 28235 Entity.prototype.encode = function encode(data, enc, reporter) { 28236 return this._getEncoder(enc).encode(data, reporter); 28237 }; 28238})); 28239//#endregion 28240//#region node_modules/asn1.js/lib/asn1/base/reporter.js 28241var require_reporter = /* @__PURE__ */ __commonJSMin(((exports) => { 28242 var inherits = require_inherits_browser(); 28243 function Reporter(options) { 28244 this._reporterState = { 28245 obj: null, 28246 path: [], 28247 options: options || {}, 28248 errors: [] 28249 }; 28250 } 28251 exports.Reporter = Reporter; 28252 Reporter.prototype.isError = function isError(obj) { 28253 return obj instanceof ReporterError; 28254 }; 28255 Reporter.prototype.save = function save() { 28256 var state = this._reporterState; 28257 return { 28258 obj: state.obj, 28259 pathLen: state.path.length 28260 }; 28261 }; 28262 Reporter.prototype.restore = function restore(data) { 28263 var state = this._reporterState; 28264 state.obj = data.obj; 28265 state.path = state.path.slice(0, data.pathLen); 28266 }; 28267 Reporter.prototype.enterKey = function enterKey(key) { 28268 return this._reporterState.path.push(key); 28269 }; 28270 Reporter.prototype.exitKey = function exitKey(index) { 28271 var state = this._reporterState; 28272 state.path = state.path.slice(0, index - 1); 28273 }; 28274 Reporter.prototype.leaveKey = function leaveKey(index, key, value) { 28275 var state = this._reporterState; 28276 this.exitKey(index); 28277 if (state.obj !== null) state.obj[key] = value; 28278 }; 28279 Reporter.prototype.path = function path() { 28280 return this._reporterState.path.join("/"); 28281 }; 28282 Reporter.prototype.enterObject = function enterObject() { 28283 var state = this._reporterState; 28284 var prev = state.obj; 28285 state.obj = {}; 28286 return prev; 28287 }; 28288 Reporter.prototype.leaveObject = function leaveObject(prev) { 28289 var state = this._reporterState; 28290 var now = state.obj; 28291 state.obj = prev; 28292 return now; 28293 }; 28294 Reporter.prototype.error = function error(msg) { 28295 var err; 28296 var state = this._reporterState; 28297 var inherited = msg instanceof ReporterError; 28298 if (inherited) err = msg; 28299 else err = new ReporterError(state.path.map(function(elem) { 28300 return "[" + JSON.stringify(elem) + "]"; 28301 }).join(""), msg.message || msg, msg.stack); 28302 if (!state.options.partial) throw err; 28303 if (!inherited) state.errors.push(err); 28304 return err; 28305 }; 28306 Reporter.prototype.wrapResult = function wrapResult(result) { 28307 var state = this._reporterState; 28308 if (!state.options.partial) return result; 28309 return { 28310 result: this.isError(result) ? null : result, 28311 errors: state.errors 28312 }; 28313 }; 28314 function ReporterError(path, msg) { 28315 this.path = path; 28316 this.rethrow(msg); 28317 } 28318 inherits(ReporterError, Error); 28319 ReporterError.prototype.rethrow = function rethrow(msg) { 28320 this.message = msg + " at: " + (this.path || "(shallow)"); 28321 if (Error.captureStackTrace) Error.captureStackTrace(this, ReporterError); 28322 if (!this.stack) try { 28323 throw new Error(this.message); 28324 } catch (e) { 28325 this.stack = e.stack; 28326 } 28327 return this; 28328 }; 28329})); 28330//#endregion 28331//#region node_modules/asn1.js/lib/asn1/base/buffer.js 28332var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => { 28333 var inherits = require_inherits_browser(); 28334 var Reporter = require_base().Reporter; 28335 var Buffer = require_buffer$1().Buffer; 28336 function DecoderBuffer(base, options) { 28337 Reporter.call(this, options); 28338 if (!Buffer.isBuffer(base)) { 28339 this.error("Input not Buffer"); 28340 return; 28341 } 28342 this.base = base; 28343 this.offset = 0; 28344 this.length = base.length; 28345 } 28346 inherits(DecoderBuffer, Reporter); 28347 exports.DecoderBuffer = DecoderBuffer; 28348 DecoderBuffer.prototype.save = function save() { 28349 return { 28350 offset: this.offset, 28351 reporter: Reporter.prototype.save.call(this) 28352 }; 28353 }; 28354 DecoderBuffer.prototype.restore = function restore(save) { 28355 var res = new DecoderBuffer(this.base); 28356 res.offset = save.offset; 28357 res.length = this.offset; 28358 this.offset = save.offset; 28359 Reporter.prototype.restore.call(this, save.reporter); 28360 return res; 28361 }; 28362 DecoderBuffer.prototype.isEmpty = function isEmpty() { 28363 return this.offset === this.length; 28364 }; 28365 DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) { 28366 if (this.offset + 1 <= this.length) return this.base.readUInt8(this.offset++, true); 28367 else return this.error(fail || "DecoderBuffer overrun"); 28368 }; 28369 DecoderBuffer.prototype.skip = function skip(bytes, fail) { 28370 if (!(this.offset + bytes <= this.length)) return this.error(fail || "DecoderBuffer overrun"); 28371 var res = new DecoderBuffer(this.base); 28372 res._reporterState = this._reporterState; 28373 res.offset = this.offset; 28374 res.length = this.offset + bytes; 28375 this.offset += bytes; 28376 return res; 28377 }; 28378 DecoderBuffer.prototype.raw = function raw(save) { 28379 return this.base.slice(save ? save.offset : this.offset, this.length); 28380 }; 28381 function EncoderBuffer(value, reporter) { 28382 if (Array.isArray(value)) { 28383 this.length = 0; 28384 this.value = value.map(function(item) { 28385 if (!(item instanceof EncoderBuffer)) item = new EncoderBuffer(item, reporter); 28386 this.length += item.length; 28387 return item; 28388 }, this); 28389 } else if (typeof value === "number") { 28390 if (!(0 <= value && value <= 255)) return reporter.error("non-byte EncoderBuffer value"); 28391 this.value = value; 28392 this.length = 1; 28393 } else if (typeof value === "string") { 28394 this.value = value; 28395 this.length = Buffer.byteLength(value); 28396 } else if (Buffer.isBuffer(value)) { 28397 this.value = value; 28398 this.length = value.length; 28399 } else return reporter.error("Unsupported type: " + typeof value); 28400 } 28401 exports.EncoderBuffer = EncoderBuffer; 28402 EncoderBuffer.prototype.join = function join(out, offset) { 28403 if (!out) out = new Buffer(this.length); 28404 if (!offset) offset = 0; 28405 if (this.length === 0) return out; 28406 if (Array.isArray(this.value)) this.value.forEach(function(item) { 28407 item.join(out, offset); 28408 offset += item.length; 28409 }); 28410 else { 28411 if (typeof this.value === "number") out[offset] = this.value; 28412 else if (typeof this.value === "string") out.write(this.value, offset); 28413 else if (Buffer.isBuffer(this.value)) this.value.copy(out, offset); 28414 offset += this.length; 28415 } 28416 return out; 28417 }; 28418})); 28419//#endregion 28420//#region node_modules/asn1.js/lib/asn1/base/node.js 28421var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => { 28422 var Reporter = require_base().Reporter; 28423 var EncoderBuffer = require_base().EncoderBuffer; 28424 var DecoderBuffer = require_base().DecoderBuffer; 28425 var assert = require_minimalistic_assert(); 28426 var tags = [ 28427 "seq", 28428 "seqof", 28429 "set", 28430 "setof", 28431 "objid", 28432 "bool", 28433 "gentime", 28434 "utctime", 28435 "null_", 28436 "enum", 28437 "int", 28438 "objDesc", 28439 "bitstr", 28440 "bmpstr", 28441 "charstr", 28442 "genstr", 28443 "graphstr", 28444 "ia5str", 28445 "iso646str", 28446 "numstr", 28447 "octstr", 28448 "printstr", 28449 "t61str", 28450 "unistr", 28451 "utf8str", 28452 "videostr" 28453 ]; 28454 var methods = [ 28455 "key", 28456 "obj", 28457 "use", 28458 "optional", 28459 "explicit", 28460 "implicit", 28461 "def", 28462 "choice", 28463 "any", 28464 "contains" 28465 ].concat(tags); 28466 var overrided = [ 28467 "_peekTag", 28468 "_decodeTag", 28469 "_use", 28470 "_decodeStr", 28471 "_decodeObjid", 28472 "_decodeTime", 28473 "_decodeNull", 28474 "_decodeInt", 28475 "_decodeBool", 28476 "_decodeList", 28477 "_encodeComposite", 28478 "_encodeStr", 28479 "_encodeObjid", 28480 "_encodeTime", 28481 "_encodeNull", 28482 "_encodeInt", 28483 "_encodeBool" 28484 ]; 28485 function Node(enc, parent) { 28486 var state = {}; 28487 this._baseState = state; 28488 state.enc = enc; 28489 state.parent = parent || null; 28490 state.children = null; 28491 state.tag = null; 28492 state.args = null; 28493 state.reverseArgs = null; 28494 state.choice = null; 28495 state.optional = false;
vendor: 5,048 bytes, lines 28496-28682
28496 state.any = false; 28497 state.obj = false; 28498 state.use = null; 28499 state.useDecoder = null; 28500 state.key = null; 28501 state["default"] = null; 28502 state.explicit = null; 28503 state.implicit = null; 28504 state.contains = null; 28505 if (!state.parent) { 28506 state.children = []; 28507 this._wrap(); 28508 } 28509 } 28510 module.exports = Node; 28511 var stateProps = [ 28512 "enc", 28513 "parent", 28514 "children", 28515 "tag", 28516 "args", 28517 "reverseArgs", 28518 "choice", 28519 "optional", 28520 "any", 28521 "obj", 28522 "use", 28523 "alteredUse", 28524 "key", 28525 "default", 28526 "explicit", 28527 "implicit", 28528 "contains" 28529 ]; 28530 Node.prototype.clone = function clone() { 28531 var state = this._baseState; 28532 var cstate = {}; 28533 stateProps.forEach(function(prop) { 28534 cstate[prop] = state[prop]; 28535 }); 28536 var res = new this.constructor(cstate.parent); 28537 res._baseState = cstate; 28538 return res; 28539 }; 28540 Node.prototype._wrap = function wrap() { 28541 var state = this._baseState; 28542 methods.forEach(function(method) { 28543 this[method] = function _wrappedMethod() { 28544 var clone = new this.constructor(this); 28545 state.children.push(clone); 28546 return clone[method].apply(clone, arguments); 28547 }; 28548 }, this); 28549 }; 28550 Node.prototype._init = function init(body) { 28551 var state = this._baseState; 28552 assert(state.parent === null); 28553 body.call(this); 28554 state.children = state.children.filter(function(child) { 28555 return child._baseState.parent === this; 28556 }, this); 28557 assert.equal(state.children.length, 1, "Root node can have only one child"); 28558 }; 28559 Node.prototype._useArgs = function useArgs(args) { 28560 var state = this._baseState; 28561 var children = args.filter(function(arg) { 28562 return arg instanceof this.constructor; 28563 }, this); 28564 args = args.filter(function(arg) { 28565 return !(arg instanceof this.constructor); 28566 }, this); 28567 if (children.length !== 0) { 28568 assert(state.children === null); 28569 state.children = children; 28570 children.forEach(function(child) { 28571 child._baseState.parent = this; 28572 }, this); 28573 } 28574 if (args.length !== 0) { 28575 assert(state.args === null); 28576 state.args = args; 28577 state.reverseArgs = args.map(function(arg) { 28578 if (typeof arg !== "object" || arg.constructor !== Object) return arg; 28579 var res = {}; 28580 Object.keys(arg).forEach(function(key) { 28581 if (key == (key | 0)) key |= 0; 28582 var value = arg[key]; 28583 res[value] = key; 28584 }); 28585 return res; 28586 }); 28587 } 28588 }; 28589 overrided.forEach(function(method) { 28590 Node.prototype[method] = function _overrided() { 28591 var state = this._baseState; 28592 throw new Error(method + " not implemented for encoding: " + state.enc); 28593 }; 28594 }); 28595 tags.forEach(function(tag) { 28596 Node.prototype[tag] = function _tagMethod() { 28597 var state = this._baseState; 28598 var args = Array.prototype.slice.call(arguments); 28599 assert(state.tag === null); 28600 state.tag = tag; 28601 this._useArgs(args); 28602 return this; 28603 }; 28604 }); 28605 Node.prototype.use = function use(item) { 28606 assert(item); 28607 var state = this._baseState; 28608 assert(state.use === null); 28609 state.use = item; 28610 return this; 28611 }; 28612 Node.prototype.optional = function optional() { 28613 var state = this._baseState; 28614 state.optional = true; 28615 return this; 28616 }; 28617 Node.prototype.def = function def(val) { 28618 var state = this._baseState; 28619 assert(state["default"] === null); 28620 state["default"] = val; 28621 state.optional = true; 28622 return this; 28623 }; 28624 Node.prototype.explicit = function explicit(num) { 28625 var state = this._baseState; 28626 assert(state.explicit === null && state.implicit === null); 28627 state.explicit = num; 28628 return this; 28629 }; 28630 Node.prototype.implicit = function implicit(num) { 28631 var state = this._baseState; 28632 assert(state.explicit === null && state.implicit === null); 28633 state.implicit = num; 28634 return this; 28635 }; 28636 Node.prototype.obj = function obj() { 28637 var state = this._baseState; 28638 var args = Array.prototype.slice.call(arguments); 28639 state.obj = true; 28640 if (args.length !== 0) this._useArgs(args); 28641 return this; 28642 }; 28643 Node.prototype.key = function key(newKey) { 28644 var state = this._baseState; 28645 assert(state.key === null); 28646 state.key = newKey; 28647 return this; 28648 }; 28649 Node.prototype.any = function any() { 28650 var state = this._baseState; 28651 state.any = true; 28652 return this; 28653 }; 28654 Node.prototype.choice = function choice(obj) { 28655 var state = this._baseState; 28656 assert(state.choice === null); 28657 state.choice = obj; 28658 this._useArgs(Object.keys(obj).map(function(key) { 28659 return obj[key]; 28660 })); 28661 return this; 28662 }; 28663 Node.prototype.contains = function contains(item) { 28664 var state = this._baseState; 28665 assert(state.use === null); 28666 state.contains = item; 28667 return this; 28668 }; 28669 Node.prototype._decode = function decode(input, options) { 28670 var state = this._baseState; 28671 if (state.parent === null) return input.wrapResult(state.children[0]._decode(input, options)); 28672 var result = state["default"]; 28673 var present = true; 28674 var prevKey = null; 28675 if (state.key !== null) prevKey = input.enterKey(state.key); 28676 if (state.optional) { 28677 var tag = null; 28678 if (state.explicit !== null) tag = state.explicit; 28679 else if (state.implicit !== null) tag = state.implicit; 28680 else if (state.tag !== null) tag = state.tag; 28681 if (tag === null && !state.any) { 28682 var save = input.save();
vendor: 63,247 bytes, lines 28683-30381
28683 try { 28684 if (state.choice === null) this._decodeGeneric(state.tag, input, options); 28685 else this._decodeChoice(input, options); 28686 present = true; 28687 } catch (e) { 28688 present = false; 28689 } 28690 input.restore(save); 28691 } else { 28692 present = this._peekTag(input, tag, state.any); 28693 if (input.isError(present)) return present; 28694 } 28695 } 28696 var prevObj; 28697 if (state.obj && present) prevObj = input.enterObject(); 28698 if (present) { 28699 if (state.explicit !== null) { 28700 var explicit = this._decodeTag(input, state.explicit); 28701 if (input.isError(explicit)) return explicit; 28702 input = explicit; 28703 } 28704 var start = input.offset; 28705 if (state.use === null && state.choice === null) { 28706 if (state.any) var save = input.save(); 28707 var body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any); 28708 if (input.isError(body)) return body; 28709 if (state.any) result = input.raw(save); 28710 else input = body; 28711 } 28712 if (options && options.track && state.tag !== null) options.track(input.path(), start, input.length, "tagged"); 28713 if (options && options.track && state.tag !== null) options.track(input.path(), input.offset, input.length, "content"); 28714 if (state.any) result = result; 28715 else if (state.choice === null) result = this._decodeGeneric(state.tag, input, options); 28716 else result = this._decodeChoice(input, options); 28717 if (input.isError(result)) return result; 28718 if (!state.any && state.choice === null && state.children !== null) state.children.forEach(function decodeChildren(child) { 28719 child._decode(input, options); 28720 }); 28721 if (state.contains && (state.tag === "octstr" || state.tag === "bitstr")) { 28722 var data = new DecoderBuffer(result); 28723 result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options); 28724 } 28725 } 28726 if (state.obj && present) result = input.leaveObject(prevObj); 28727 if (state.key !== null && (result !== null || present === true)) input.leaveKey(prevKey, state.key, result); 28728 else if (prevKey !== null) input.exitKey(prevKey); 28729 return result; 28730 }; 28731 Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { 28732 var state = this._baseState; 28733 if (tag === "seq" || tag === "set") return null; 28734 if (tag === "seqof" || tag === "setof") return this._decodeList(input, tag, state.args[0], options); 28735 else if (/str$/.test(tag)) return this._decodeStr(input, tag, options); 28736 else if (tag === "objid" && state.args) return this._decodeObjid(input, state.args[0], state.args[1], options); 28737 else if (tag === "objid") return this._decodeObjid(input, null, null, options); 28738 else if (tag === "gentime" || tag === "utctime") return this._decodeTime(input, tag, options); 28739 else if (tag === "null_") return this._decodeNull(input, options); 28740 else if (tag === "bool") return this._decodeBool(input, options); 28741 else if (tag === "objDesc") return this._decodeStr(input, tag, options); 28742 else if (tag === "int" || tag === "enum") return this._decodeInt(input, state.args && state.args[0], options); 28743 if (state.use !== null) return this._getUse(state.use, input._reporterState.obj)._decode(input, options); 28744 else return input.error("unknown tag: " + tag); 28745 }; 28746 Node.prototype._getUse = function _getUse(entity, obj) { 28747 var state = this._baseState; 28748 state.useDecoder = this._use(entity, obj); 28749 assert(state.useDecoder._baseState.parent === null); 28750 state.useDecoder = state.useDecoder._baseState.children[0]; 28751 if (state.implicit !== state.useDecoder._baseState.implicit) { 28752 state.useDecoder = state.useDecoder.clone(); 28753 state.useDecoder._baseState.implicit = state.implicit; 28754 } 28755 return state.useDecoder; 28756 }; 28757 Node.prototype._decodeChoice = function decodeChoice(input, options) { 28758 var state = this._baseState; 28759 var result = null; 28760 var match = false; 28761 Object.keys(state.choice).some(function(key) { 28762 var save = input.save(); 28763 var node = state.choice[key]; 28764 try { 28765 var value = node._decode(input, options); 28766 if (input.isError(value)) return false; 28767 result = { 28768 type: key, 28769 value 28770 }; 28771 match = true; 28772 } catch (e) { 28773 input.restore(save); 28774 return false; 28775 } 28776 return true; 28777 }, this); 28778 if (!match) return input.error("Choice not matched"); 28779 return result; 28780 }; 28781 Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { 28782 return new EncoderBuffer(data, this.reporter); 28783 }; 28784 Node.prototype._encode = function encode(data, reporter, parent) { 28785 var state = this._baseState; 28786 if (state["default"] !== null && state["default"] === data) return; 28787 var result = this._encodeValue(data, reporter, parent); 28788 if (result === void 0) return; 28789 if (this._skipDefault(result, reporter, parent)) return; 28790 return result; 28791 }; 28792 Node.prototype._encodeValue = function encode(data, reporter, parent) { 28793 var state = this._baseState; 28794 if (state.parent === null) return state.children[0]._encode(data, reporter || new Reporter()); 28795 var result = null; 28796 this.reporter = reporter; 28797 if (state.optional && data === void 0) if (state["default"] !== null) data = state["default"]; 28798 else return; 28799 var content = null; 28800 var primitive = false; 28801 if (state.any) result = this._createEncoderBuffer(data); 28802 else if (state.choice) result = this._encodeChoice(data, reporter); 28803 else if (state.contains) { 28804 content = this._getUse(state.contains, parent)._encode(data, reporter); 28805 primitive = true; 28806 } else if (state.children) { 28807 content = state.children.map(function(child) { 28808 if (child._baseState.tag === "null_") return child._encode(null, reporter, data); 28809 if (child._baseState.key === null) return reporter.error("Child should have a key"); 28810 var prevKey = reporter.enterKey(child._baseState.key); 28811 if (typeof data !== "object") return reporter.error("Child expected, but input is not object"); 28812 var res = child._encode(data[child._baseState.key], reporter, data); 28813 reporter.leaveKey(prevKey); 28814 return res; 28815 }, this).filter(function(child) { 28816 return child; 28817 }); 28818 content = this._createEncoderBuffer(content); 28819 } else if (state.tag === "seqof" || state.tag === "setof") { 28820 if (!(state.args && state.args.length === 1)) return reporter.error("Too many args for : " + state.tag); 28821 if (!Array.isArray(data)) return reporter.error("seqof/setof, but data is not Array"); 28822 var child = this.clone(); 28823 child._baseState.implicit = null; 28824 content = this._createEncoderBuffer(data.map(function(item) { 28825 var state = this._baseState; 28826 return this._getUse(state.args[0], data)._encode(item, reporter); 28827 }, child)); 28828 } else if (state.use !== null) result = this._getUse(state.use, parent)._encode(data, reporter); 28829 else { 28830 content = this._encodePrimitive(state.tag, data); 28831 primitive = true; 28832 } 28833 var result; 28834 if (!state.any && state.choice === null) { 28835 var tag = state.implicit !== null ? state.implicit : state.tag; 28836 var cls = state.implicit === null ? "universal" : "context"; 28837 if (tag === null) { 28838 if (state.use === null) reporter.error("Tag could be omitted only for .use()"); 28839 } else if (state.use === null) result = this._encodeComposite(tag, primitive, cls, content); 28840 } 28841 if (state.explicit !== null) result = this._encodeComposite(state.explicit, false, "context", result); 28842 return result; 28843 }; 28844 Node.prototype._encodeChoice = function encodeChoice(data, reporter) { 28845 var state = this._baseState; 28846 var node = state.choice[data.type]; 28847 if (!node) assert(false, data.type + " not found in " + JSON.stringify(Object.keys(state.choice))); 28848 return node._encode(data.value, reporter); 28849 }; 28850 Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { 28851 var state = this._baseState; 28852 if (/str$/.test(tag)) return this._encodeStr(data, tag); 28853 else if (tag === "objid" && state.args) return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); 28854 else if (tag === "objid") return this._encodeObjid(data, null, null); 28855 else if (tag === "gentime" || tag === "utctime") return this._encodeTime(data, tag); 28856 else if (tag === "null_") return this._encodeNull(); 28857 else if (tag === "int" || tag === "enum") return this._encodeInt(data, state.args && state.reverseArgs[0]); 28858 else if (tag === "bool") return this._encodeBool(data); 28859 else if (tag === "objDesc") return this._encodeStr(data, tag); 28860 else throw new Error("Unsupported tag: " + tag); 28861 }; 28862 Node.prototype._isNumstr = function isNumstr(str) { 28863 return /^[0-9 ]*$/.test(str); 28864 }; 28865 Node.prototype._isPrintstr = function isPrintstr(str) { 28866 return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); 28867 }; 28868})); 28869//#endregion 28870//#region node_modules/asn1.js/lib/asn1/base/index.js 28871var require_base = /* @__PURE__ */ __commonJSMin(((exports) => { 28872 var base = exports; 28873 base.Reporter = require_reporter().Reporter; 28874 base.DecoderBuffer = require_buffer().DecoderBuffer; 28875 base.EncoderBuffer = require_buffer().EncoderBuffer; 28876 base.Node = require_node(); 28877})); 28878//#endregion 28879//#region node_modules/asn1.js/lib/asn1/constants/der.js 28880var require_der$2 = /* @__PURE__ */ __commonJSMin(((exports) => { 28881 var constants = require_constants(); 28882 exports.tagClass = { 28883 0: "universal", 28884 1: "application", 28885 2: "context", 28886 3: "private" 28887 }; 28888 exports.tagClassByName = constants._reverse(exports.tagClass); 28889 exports.tag = { 28890 0: "end", 28891 1: "bool", 28892 2: "int", 28893 3: "bitstr", 28894 4: "octstr", 28895 5: "null_", 28896 6: "objid", 28897 7: "objDesc", 28898 8: "external", 28899 9: "real", 28900 10: "enum", 28901 11: "embed", 28902 12: "utf8str", 28903 13: "relativeOid", 28904 16: "seq", 28905 17: "set", 28906 18: "numstr", 28907 19: "printstr", 28908 20: "t61str", 28909 21: "videostr", 28910 22: "ia5str", 28911 23: "utctime", 28912 24: "gentime", 28913 25: "graphstr", 28914 26: "iso646str", 28915 27: "genstr", 28916 28: "unistr", 28917 29: "charstr", 28918 30: "bmpstr" 28919 }; 28920 exports.tagByName = constants._reverse(exports.tag); 28921})); 28922//#endregion 28923//#region node_modules/asn1.js/lib/asn1/constants/index.js 28924var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => { 28925 var constants = exports; 28926 constants._reverse = function reverse(map) { 28927 var res = {}; 28928 Object.keys(map).forEach(function(key) { 28929 if ((key | 0) == key) key = key | 0; 28930 var value = map[key]; 28931 res[value] = key; 28932 }); 28933 return res; 28934 }; 28935 constants.der = require_der$2(); 28936})); 28937//#endregion 28938//#region node_modules/asn1.js/lib/asn1/decoders/der.js 28939var require_der$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 28940 var inherits = require_inherits_browser(); 28941 var asn1 = require_asn1$1(); 28942 var base = asn1.base; 28943 var bignum = asn1.bignum; 28944 var der = asn1.constants.der; 28945 function DERDecoder(entity) { 28946 this.enc = "der"; 28947 this.name = entity.name; 28948 this.entity = entity; 28949 this.tree = new DERNode(); 28950 this.tree._init(entity.body); 28951 } 28952 module.exports = DERDecoder; 28953 DERDecoder.prototype.decode = function decode(data, options) { 28954 if (!(data instanceof base.DecoderBuffer)) data = new base.DecoderBuffer(data, options); 28955 return this.tree._decode(data, options); 28956 }; 28957 function DERNode(parent) { 28958 base.Node.call(this, "der", parent); 28959 } 28960 inherits(DERNode, base.Node); 28961 DERNode.prototype._peekTag = function peekTag(buffer, tag, any) { 28962 if (buffer.isEmpty()) return false; 28963 var state = buffer.save(); 28964 var decodedTag = derDecodeTag(buffer, "Failed to peek tag: \"" + tag + "\""); 28965 if (buffer.isError(decodedTag)) return decodedTag; 28966 buffer.restore(state); 28967 return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + "of" === tag || any; 28968 }; 28969 DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) { 28970 var decodedTag = derDecodeTag(buffer, "Failed to decode tag of \"" + tag + "\""); 28971 if (buffer.isError(decodedTag)) return decodedTag; 28972 var len = derDecodeLen(buffer, decodedTag.primitive, "Failed to get length of \"" + tag + "\""); 28973 if (buffer.isError(len)) return len; 28974 if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + "of" !== tag) return buffer.error("Failed to match tag: \"" + tag + "\""); 28975 if (decodedTag.primitive || len !== null) return buffer.skip(len, "Failed to match body of: \"" + tag + "\""); 28976 var state = buffer.save(); 28977 var res = this._skipUntilEnd(buffer, "Failed to skip indefinite length body: \"" + this.tag + "\""); 28978 if (buffer.isError(res)) return res; 28979 len = buffer.offset - state.offset; 28980 buffer.restore(state); 28981 return buffer.skip(len, "Failed to match body of: \"" + tag + "\""); 28982 }; 28983 DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) { 28984 while (true) { 28985 var tag = derDecodeTag(buffer, fail); 28986 if (buffer.isError(tag)) return tag; 28987 var len = derDecodeLen(buffer, tag.primitive, fail); 28988 if (buffer.isError(len)) return len; 28989 var res; 28990 if (tag.primitive || len !== null) res = buffer.skip(len); 28991 else res = this._skipUntilEnd(buffer, fail); 28992 if (buffer.isError(res)) return res; 28993 if (tag.tagStr === "end") break; 28994 } 28995 }; 28996 DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, options) { 28997 var result = []; 28998 while (!buffer.isEmpty()) { 28999 var possibleEnd = this._peekTag(buffer, "end"); 29000 if (buffer.isError(possibleEnd)) return possibleEnd; 29001 var res = decoder.decode(buffer, "der", options); 29002 if (buffer.isError(res) && possibleEnd) break; 29003 result.push(res); 29004 } 29005 return result; 29006 }; 29007 DERNode.prototype._decodeStr = function decodeStr(buffer, tag) { 29008 if (tag === "bitstr") { 29009 var unused = buffer.readUInt8(); 29010 if (buffer.isError(unused)) return unused; 29011 return { 29012 unused, 29013 data: buffer.raw() 29014 }; 29015 } else if (tag === "bmpstr") { 29016 var raw = buffer.raw(); 29017 if (raw.length % 2 === 1) return buffer.error("Decoding of string type: bmpstr length mismatch"); 29018 var str = ""; 29019 for (var i = 0; i < raw.length / 2; i++) str += String.fromCharCode(raw.readUInt16BE(i * 2)); 29020 return str; 29021 } else if (tag === "numstr") { 29022 var numstr = buffer.raw().toString("ascii"); 29023 if (!this._isNumstr(numstr)) return buffer.error("Decoding of string type: numstr unsupported characters"); 29024 return numstr; 29025 } else if (tag === "octstr") return buffer.raw(); 29026 else if (tag === "objDesc") return buffer.raw(); 29027 else if (tag === "printstr") { 29028 var printstr = buffer.raw().toString("ascii"); 29029 if (!this._isPrintstr(printstr)) return buffer.error("Decoding of string type: printstr unsupported characters"); 29030 return printstr; 29031 } else if (/str$/.test(tag)) return buffer.raw().toString(); 29032 else return buffer.error("Decoding of string type: " + tag + " unsupported"); 29033 }; 29034 DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) { 29035 var result; 29036 var identifiers = []; 29037 var ident = 0; 29038 while (!buffer.isEmpty()) { 29039 var subident = buffer.readUInt8(); 29040 ident <<= 7; 29041 ident |= subident & 127; 29042 if ((subident & 128) === 0) { 29043 identifiers.push(ident); 29044 ident = 0; 29045 } 29046 } 29047 if (subident & 128) identifiers.push(ident); 29048 var first = identifiers[0] / 40 | 0; 29049 var second = identifiers[0] % 40; 29050 if (relative) result = identifiers; 29051 else result = [first, second].concat(identifiers.slice(1)); 29052 if (values) { 29053 var tmp = values[result.join(" ")]; 29054 if (tmp === void 0) tmp = values[result.join(".")]; 29055 if (tmp !== void 0) result = tmp; 29056 } 29057 return result; 29058 }; 29059 DERNode.prototype._decodeTime = function decodeTime(buffer, tag) { 29060 var str = buffer.raw().toString(); 29061 if (tag === "gentime") { 29062 var year = str.slice(0, 4) | 0; 29063 var mon = str.slice(4, 6) | 0; 29064 var day = str.slice(6, 8) | 0; 29065 var hour = str.slice(8, 10) | 0; 29066 var min = str.slice(10, 12) | 0; 29067 var sec = str.slice(12, 14) | 0; 29068 } else if (tag === "utctime") { 29069 var year = str.slice(0, 2) | 0; 29070 var mon = str.slice(2, 4) | 0; 29071 var day = str.slice(4, 6) | 0; 29072 var hour = str.slice(6, 8) | 0; 29073 var min = str.slice(8, 10) | 0; 29074 var sec = str.slice(10, 12) | 0; 29075 if (year < 70) year = 2e3 + year; 29076 else year = 1900 + year; 29077 } else return buffer.error("Decoding " + tag + " time is not supported yet"); 29078 return Date.UTC(year, mon - 1, day, hour, min, sec, 0); 29079 }; 29080 DERNode.prototype._decodeNull = function decodeNull(buffer) { 29081 return null; 29082 }; 29083 DERNode.prototype._decodeBool = function decodeBool(buffer) { 29084 var res = buffer.readUInt8(); 29085 if (buffer.isError(res)) return res; 29086 else return res !== 0; 29087 }; 29088 DERNode.prototype._decodeInt = function decodeInt(buffer, values) { 29089 var res = new bignum(buffer.raw()); 29090 if (values) res = values[res.toString(10)] || res; 29091 return res; 29092 }; 29093 DERNode.prototype._use = function use(entity, obj) { 29094 if (typeof entity === "function") entity = entity(obj); 29095 return entity._getDecoder("der").tree; 29096 }; 29097 function derDecodeTag(buf, fail) { 29098 var tag = buf.readUInt8(fail); 29099 if (buf.isError(tag)) return tag; 29100 var cls = der.tagClass[tag >> 6]; 29101 var primitive = (tag & 32) === 0; 29102 if ((tag & 31) === 31) { 29103 var oct = tag; 29104 tag = 0; 29105 while ((oct & 128) === 128) { 29106 oct = buf.readUInt8(fail); 29107 if (buf.isError(oct)) return oct; 29108 tag <<= 7; 29109 tag |= oct & 127; 29110 } 29111 } else tag &= 31; 29112 var tagStr = der.tag[tag]; 29113 return { 29114 cls, 29115 primitive, 29116 tag, 29117 tagStr 29118 }; 29119 } 29120 function derDecodeLen(buf, primitive, fail) { 29121 var len = buf.readUInt8(fail); 29122 if (buf.isError(len)) return len; 29123 if (!primitive && len === 128) return null; 29124 if ((len & 128) === 0) return len; 29125 var num = len & 127; 29126 if (num > 4) return buf.error("length octect is too long"); 29127 len = 0; 29128 for (var i = 0; i < num; i++) { 29129 len <<= 8; 29130 var j = buf.readUInt8(fail); 29131 if (buf.isError(j)) return j; 29132 len |= j; 29133 } 29134 return len; 29135 } 29136})); 29137//#endregion 29138//#region node_modules/asn1.js/lib/asn1/decoders/pem.js 29139var require_pem$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29140 var inherits = require_inherits_browser(); 29141 var Buffer = require_buffer$1().Buffer; 29142 var DERDecoder = require_der$1(); 29143 function PEMDecoder(entity) { 29144 DERDecoder.call(this, entity); 29145 this.enc = "pem"; 29146 } 29147 inherits(PEMDecoder, DERDecoder); 29148 module.exports = PEMDecoder; 29149 PEMDecoder.prototype.decode = function decode(data, options) { 29150 var lines = data.toString().split(/[\r\n]+/g); 29151 var label = options.label.toUpperCase(); 29152 var re = /^-----(BEGIN|END) ([^-]+)-----$/; 29153 var start = -1; 29154 var end = -1; 29155 for (var i = 0; i < lines.length; i++) { 29156 var match = lines[i].match(re); 29157 if (match === null) continue; 29158 if (match[2] !== label) continue; 29159 if (start === -1) { 29160 if (match[1] !== "BEGIN") break; 29161 start = i; 29162 } else { 29163 if (match[1] !== "END") break; 29164 end = i; 29165 break; 29166 } 29167 } 29168 if (start === -1 || end === -1) throw new Error("PEM section not found for: " + label); 29169 var base64 = lines.slice(start + 1, end).join(""); 29170 base64.replace(/[^a-z0-9\+\/=]+/gi, ""); 29171 var input = new Buffer(base64, "base64"); 29172 return DERDecoder.prototype.decode.call(this, input, options); 29173 }; 29174})); 29175//#endregion 29176//#region node_modules/asn1.js/lib/asn1/decoders/index.js 29177var require_decoders = /* @__PURE__ */ __commonJSMin(((exports) => { 29178 var decoders = exports; 29179 decoders.der = require_der$1(); 29180 decoders.pem = require_pem$1(); 29181})); 29182//#endregion 29183//#region node_modules/asn1.js/lib/asn1/encoders/der.js 29184var require_der = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29185 var inherits = require_inherits_browser(); 29186 var Buffer = require_buffer$1().Buffer; 29187 var asn1 = require_asn1$1(); 29188 var base = asn1.base; 29189 var der = asn1.constants.der; 29190 function DEREncoder(entity) { 29191 this.enc = "der"; 29192 this.name = entity.name; 29193 this.entity = entity; 29194 this.tree = new DERNode(); 29195 this.tree._init(entity.body); 29196 } 29197 module.exports = DEREncoder; 29198 DEREncoder.prototype.encode = function encode(data, reporter) { 29199 return this.tree._encode(data, reporter).join(); 29200 }; 29201 function DERNode(parent) { 29202 base.Node.call(this, "der", parent); 29203 } 29204 inherits(DERNode, base.Node); 29205 DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) { 29206 var encodedTag = encodeTag(tag, primitive, cls, this.reporter); 29207 if (content.length < 128) { 29208 var header = new Buffer(2); 29209 header[0] = encodedTag; 29210 header[1] = content.length; 29211 return this._createEncoderBuffer([header, content]); 29212 } 29213 var lenOctets = 1; 29214 for (var i = content.length; i >= 256; i >>= 8) lenOctets++; 29215 var header = new Buffer(2 + lenOctets); 29216 header[0] = encodedTag; 29217 header[1] = 128 | lenOctets; 29218 for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) header[i] = j & 255; 29219 return this._createEncoderBuffer([header, content]); 29220 }; 29221 DERNode.prototype._encodeStr = function encodeStr(str, tag) { 29222 if (tag === "bitstr") return this._createEncoderBuffer([str.unused | 0, str.data]); 29223 else if (tag === "bmpstr") { 29224 var buf = new Buffer(str.length * 2); 29225 for (var i = 0; i < str.length; i++) buf.writeUInt16BE(str.charCodeAt(i), i * 2); 29226 return this._createEncoderBuffer(buf); 29227 } else if (tag === "numstr") { 29228 if (!this._isNumstr(str)) return this.reporter.error("Encoding of string type: numstr supports only digits and space"); 29229 return this._createEncoderBuffer(str); 29230 } else if (tag === "printstr") { 29231 if (!this._isPrintstr(str)) return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"); 29232 return this._createEncoderBuffer(str); 29233 } else if (/str$/.test(tag)) return this._createEncoderBuffer(str); 29234 else if (tag === "objDesc") return this._createEncoderBuffer(str); 29235 else return this.reporter.error("Encoding of string type: " + tag + " unsupported"); 29236 }; 29237 DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) { 29238 if (typeof id === "string") { 29239 if (!values) return this.reporter.error("string objid given, but no values map found"); 29240 if (!values.hasOwnProperty(id)) return this.reporter.error("objid not found in values map"); 29241 id = values[id].split(/[\s\.]+/g); 29242 for (var i = 0; i < id.length; i++) id[i] |= 0; 29243 } else if (Array.isArray(id)) { 29244 id = id.slice(); 29245 for (var i = 0; i < id.length; i++) id[i] |= 0; 29246 } 29247 if (!Array.isArray(id)) return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(id)); 29248 if (!relative) { 29249 if (id[1] >= 40) return this.reporter.error("Second objid identifier OOB"); 29250 id.splice(0, 2, id[0] * 40 + id[1]); 29251 } 29252 var size = 0; 29253 for (var i = 0; i < id.length; i++) { 29254 var ident = id[i]; 29255 for (size++; ident >= 128; ident >>= 7) size++; 29256 } 29257 var objid = new Buffer(size); 29258 var offset = objid.length - 1; 29259 for (var i = id.length - 1; i >= 0; i--) { 29260 var ident = id[i]; 29261 objid[offset--] = ident & 127; 29262 while ((ident >>= 7) > 0) objid[offset--] = 128 | ident & 127; 29263 } 29264 return this._createEncoderBuffer(objid); 29265 }; 29266 function two(num) { 29267 if (num < 10) return "0" + num; 29268 else return num; 29269 } 29270 DERNode.prototype._encodeTime = function encodeTime(time, tag) { 29271 var str; 29272 var date = new Date(time); 29273 if (tag === "gentime") str = [ 29274 two(date.getFullYear()), 29275 two(date.getUTCMonth() + 1), 29276 two(date.getUTCDate()), 29277 two(date.getUTCHours()), 29278 two(date.getUTCMinutes()), 29279 two(date.getUTCSeconds()), 29280 "Z" 29281 ].join(""); 29282 else if (tag === "utctime") str = [ 29283 two(date.getFullYear() % 100), 29284 two(date.getUTCMonth() + 1), 29285 two(date.getUTCDate()), 29286 two(date.getUTCHours()), 29287 two(date.getUTCMinutes()), 29288 two(date.getUTCSeconds()), 29289 "Z" 29290 ].join(""); 29291 else this.reporter.error("Encoding " + tag + " time is not supported yet"); 29292 return this._encodeStr(str, "octstr"); 29293 }; 29294 DERNode.prototype._encodeNull = function encodeNull() { 29295 return this._createEncoderBuffer(""); 29296 }; 29297 DERNode.prototype._encodeInt = function encodeInt(num, values) { 29298 if (typeof num === "string") { 29299 if (!values) return this.reporter.error("String int or enum given, but no values map"); 29300 if (!values.hasOwnProperty(num)) return this.reporter.error("Values map doesn't contain: " + JSON.stringify(num)); 29301 num = values[num]; 29302 } 29303 if (typeof num !== "number" && !Buffer.isBuffer(num)) { 29304 var numArray = num.toArray(); 29305 if (!num.sign && numArray[0] & 128) numArray.unshift(0); 29306 num = new Buffer(numArray); 29307 } 29308 if (Buffer.isBuffer(num)) { 29309 var size = num.length; 29310 if (num.length === 0) size++; 29311 var out = new Buffer(size); 29312 num.copy(out); 29313 if (num.length === 0) out[0] = 0; 29314 return this._createEncoderBuffer(out); 29315 } 29316 if (num < 128) return this._createEncoderBuffer(num); 29317 if (num < 256) return this._createEncoderBuffer([0, num]); 29318 var size = 1; 29319 for (var i = num; i >= 256; i >>= 8) size++; 29320 var out = new Array(size); 29321 for (var i = out.length - 1; i >= 0; i--) { 29322 out[i] = num & 255; 29323 num >>= 8; 29324 } 29325 if (out[0] & 128) out.unshift(0); 29326 return this._createEncoderBuffer(new Buffer(out)); 29327 }; 29328 DERNode.prototype._encodeBool = function encodeBool(value) { 29329 return this._createEncoderBuffer(value ? 255 : 0); 29330 }; 29331 DERNode.prototype._use = function use(entity, obj) { 29332 if (typeof entity === "function") entity = entity(obj); 29333 return entity._getEncoder("der").tree; 29334 }; 29335 DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) { 29336 var state = this._baseState; 29337 var i; 29338 if (state["default"] === null) return false; 29339 var data = dataBuffer.join(); 29340 if (state.defaultBuffer === void 0) state.defaultBuffer = this._encodeValue(state["default"], reporter, parent).join(); 29341 if (data.length !== state.defaultBuffer.length) return false; 29342 for (i = 0; i < data.length; i++) if (data[i] !== state.defaultBuffer[i]) return false; 29343 return true; 29344 }; 29345 function encodeTag(tag, primitive, cls, reporter) { 29346 var res; 29347 if (tag === "seqof") tag = "seq"; 29348 else if (tag === "setof") tag = "set"; 29349 if (der.tagByName.hasOwnProperty(tag)) res = der.tagByName[tag]; 29350 else if (typeof tag === "number" && (tag | 0) === tag) res = tag; 29351 else return reporter.error("Unknown tag: " + tag); 29352 if (res >= 31) return reporter.error("Multi-octet tag encoding unsupported"); 29353 if (!primitive) res |= 32; 29354 res |= der.tagClassByName[cls || "universal"] << 6; 29355 return res; 29356 } 29357})); 29358//#endregion 29359//#region node_modules/asn1.js/lib/asn1/encoders/pem.js 29360var require_pem = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29361 var inherits = require_inherits_browser(); 29362 var DEREncoder = require_der(); 29363 function PEMEncoder(entity) { 29364 DEREncoder.call(this, entity); 29365 this.enc = "pem"; 29366 } 29367 inherits(PEMEncoder, DEREncoder); 29368 module.exports = PEMEncoder; 29369 PEMEncoder.prototype.encode = function encode(data, options) { 29370 var p = DEREncoder.prototype.encode.call(this, data).toString("base64"); 29371 var out = ["-----BEGIN " + options.label + "-----"]; 29372 for (var i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64)); 29373 out.push("-----END " + options.label + "-----"); 29374 return out.join("\n"); 29375 }; 29376})); 29377//#endregion 29378//#region node_modules/asn1.js/lib/asn1/encoders/index.js 29379var require_encoders = /* @__PURE__ */ __commonJSMin(((exports) => { 29380 var encoders = exports; 29381 encoders.der = require_der(); 29382 encoders.pem = require_pem(); 29383})); 29384//#endregion 29385//#region node_modules/asn1.js/lib/asn1.js 29386var require_asn1$1 = /* @__PURE__ */ __commonJSMin(((exports) => { 29387 var asn1 = exports; 29388 asn1.bignum = require_bn$3(); 29389 asn1.define = require_api().define; 29390 asn1.base = require_base(); 29391 asn1.constants = require_constants(); 29392 asn1.decoders = require_decoders(); 29393 asn1.encoders = require_encoders(); 29394})); 29395//#endregion 29396//#region node_modules/parse-asn1/certificate.js 29397var require_certificate = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29398 var asn = require_asn1$1(); 29399 var Time = asn.define("Time", function() { 29400 this.choice({ 29401 utcTime: this.utctime(), 29402 generalTime: this.gentime() 29403 }); 29404 }); 29405 var AttributeTypeValue = asn.define("AttributeTypeValue", function() { 29406 this.seq().obj(this.key("type").objid(), this.key("value").any()); 29407 }); 29408 var AlgorithmIdentifier = asn.define("AlgorithmIdentifier", function() { 29409 this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); 29410 }); 29411 var SubjectPublicKeyInfo = asn.define("SubjectPublicKeyInfo", function() { 29412 this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); 29413 }); 29414 var RelativeDistinguishedName = asn.define("RelativeDistinguishedName", function() { 29415 this.setof(AttributeTypeValue); 29416 }); 29417 var RDNSequence = asn.define("RDNSequence", function() { 29418 this.seqof(RelativeDistinguishedName); 29419 }); 29420 var Name = asn.define("Name", function() { 29421 this.choice({ rdnSequence: this.use(RDNSequence) }); 29422 }); 29423 var Validity = asn.define("Validity", function() { 29424 this.seq().obj(this.key("notBefore").use(Time), this.key("notAfter").use(Time)); 29425 }); 29426 var Extension = asn.define("Extension", function() { 29427 this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); 29428 }); 29429 var TBSCertificate = asn.define("TBSCertificate", function() { 29430 this.seq().obj(this.key("version").explicit(0)["int"]().optional(), this.key("serialNumber")["int"](), this.key("signature").use(AlgorithmIdentifier), this.key("issuer").use(Name), this.key("validity").use(Validity), this.key("subject").use(Name), this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(Extension).optional()); 29431 }); 29432 module.exports = asn.define("X509Certificate", function() { 29433 this.seq().obj(this.key("tbsCertificate").use(TBSCertificate), this.key("signatureAlgorithm").use(AlgorithmIdentifier), this.key("signatureValue").bitstr()); 29434 }); 29435})); 29436//#endregion 29437//#region node_modules/parse-asn1/asn1.js 29438var require_asn1 = /* @__PURE__ */ __commonJSMin(((exports) => { 29439 var asn1 = require_asn1$1(); 29440 exports.certificate = require_certificate(); 29441 exports.RSAPrivateKey = asn1.define("RSAPrivateKey", function() { 29442 this.seq().obj(this.key("version")["int"](), this.key("modulus")["int"](), this.key("publicExponent")["int"](), this.key("privateExponent")["int"](), this.key("prime1")["int"](), this.key("prime2")["int"](), this.key("exponent1")["int"](), this.key("exponent2")["int"](), this.key("coefficient")["int"]()); 29443 }); 29444 exports.RSAPublicKey = asn1.define("RSAPublicKey", function() { 29445 this.seq().obj(this.key("modulus")["int"](), this.key("publicExponent")["int"]()); 29446 }); 29447 var AlgorithmIdentifier = asn1.define("AlgorithmIdentifier", function() { 29448 this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"]()).optional()); 29449 }); 29450 exports.PublicKey = asn1.define("SubjectPublicKeyInfo", function() { 29451 this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); 29452 }); 29453 exports.PrivateKey = asn1.define("PrivateKeyInfo", function() { 29454 this.seq().obj(this.key("version")["int"](), this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPrivateKey").octstr()); 29455 }); 29456 exports.EncryptedPrivateKey = asn1.define("EncryptedPrivateKeyInfo", function() { 29457 this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters")["int"]())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); 29458 }); 29459 exports.DSAPrivateKey = asn1.define("DSAPrivateKey", function() { 29460 this.seq().obj(this.key("version")["int"](), this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"](), this.key("pub_key")["int"](), this.key("priv_key")["int"]()); 29461 }); 29462 exports.DSAparam = asn1.define("DSAparam", function() { 29463 this["int"](); 29464 }); 29465 var ECParameters = asn1.define("ECParameters", function() { 29466 this.choice({ namedCurve: this.objid() }); 29467 }); 29468 exports.ECPrivateKey = asn1.define("ECPrivateKey", function() { 29469 this.seq().obj(this.key("version")["int"](), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(ECParameters), this.key("publicKey").optional().explicit(1).bitstr()); 29470 }); 29471 exports.signature = asn1.define("signature", function() { 29472 this.seq().obj(this.key("r")["int"](), this.key("s")["int"]()); 29473 }); 29474})); 29475//#endregion 29476//#region node_modules/parse-asn1/aesid.json 29477var aesid_exports = /* @__PURE__ */ __exportAll({ default: () => aesid_default }); 29478var aesid_default; 29479var init_aesid = __esmMin((() => { 29480 aesid_default = { 29481 "2.16.840.1.101.3.4.1.1": "aes-128-ecb", 29482 "2.16.840.1.101.3.4.1.2": "aes-128-cbc", 29483 "2.16.840.1.101.3.4.1.3": "aes-128-ofb", 29484 "2.16.840.1.101.3.4.1.4": "aes-128-cfb", 29485 "2.16.840.1.101.3.4.1.21": "aes-192-ecb", 29486 "2.16.840.1.101.3.4.1.22": "aes-192-cbc", 29487 "2.16.840.1.101.3.4.1.23": "aes-192-ofb", 29488 "2.16.840.1.101.3.4.1.24": "aes-192-cfb", 29489 "2.16.840.1.101.3.4.1.41": "aes-256-ecb", 29490 "2.16.840.1.101.3.4.1.42": "aes-256-cbc", 29491 "2.16.840.1.101.3.4.1.43": "aes-256-ofb", 29492 "2.16.840.1.101.3.4.1.44": "aes-256-cfb" 29493 }; 29494})); 29495//#endregion 29496//#region node_modules/parse-asn1/fixProc.js 29497var require_fixProc = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29498 var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m; 29499 var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m; 29500 var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m; 29501 var evp = require_evp_bytestokey(); 29502 var ciphers = require_browser$7(); 29503 var Buffer = require_safe_buffer$2().Buffer; 29504 module.exports = function(okey, password) { 29505 var key = okey.toString(); 29506 var match = key.match(findProc); 29507 var decrypted; 29508 if (!match) { 29509 var match2 = key.match(fullRegex); 29510 decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ""), "base64"); 29511 } else { 29512 var suite = "aes" + match[1]; 29513 var iv = Buffer.from(match[2], "hex"); 29514 var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ""), "base64"); 29515 var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key; 29516 var out = []; 29517 var cipher = ciphers.createDecipheriv(suite, cipherKey, iv); 29518 out.push(cipher.update(cipherText)); 29519 out.push(cipher["final"]()); 29520 decrypted = Buffer.concat(out); 29521 } 29522 return { 29523 tag: key.match(startRegex)[1], 29524 data: decrypted 29525 }; 29526 }; 29527})); 29528//#endregion 29529//#region node_modules/parse-asn1/index.js 29530var require_parse_asn1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29531 var asn1 = require_asn1(); 29532 var aesid = (init_aesid(), __toCommonJS(aesid_exports).default); 29533 var fixProc = require_fixProc(); 29534 var ciphers = require_browser$7(); 29535 var compat = require_browser$8(); 29536 var Buffer = require_safe_buffer$2().Buffer; 29537 function decrypt(data, password) { 29538 var salt = data.algorithm.decrypt.kde.kdeparams.salt; 29539 var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10); 29540 var algo = aesid[data.algorithm.decrypt.cipher.algo.join(".")]; 29541 var iv = data.algorithm.decrypt.cipher.iv; 29542 var cipherText = data.subjectPrivateKey; 29543 var keylen = parseInt(algo.split("-")[1], 10) / 8; 29544 var key = compat.pbkdf2Sync(password, salt, iters, keylen, "sha1"); 29545 var cipher = ciphers.createDecipheriv(algo, key, iv); 29546 var out = []; 29547 out.push(cipher.update(cipherText)); 29548 out.push(cipher["final"]()); 29549 return Buffer.concat(out); 29550 } 29551 function parseKeys(buffer) { 29552 var password; 29553 if (typeof buffer === "object" && !Buffer.isBuffer(buffer)) { 29554 password = buffer.passphrase; 29555 buffer = buffer.key; 29556 } 29557 if (typeof buffer === "string") buffer = Buffer.from(buffer); 29558 var stripped = fixProc(buffer, password); 29559 var type = stripped.tag; 29560 var data = stripped.data; 29561 var subtype, ndata; 29562 switch (type) { 29563 case "CERTIFICATE": ndata = asn1.certificate.decode(data, "der").tbsCertificate.subjectPublicKeyInfo; 29564 case "PUBLIC KEY": 29565 if (!ndata) ndata = asn1.PublicKey.decode(data, "der"); 29566 subtype = ndata.algorithm.algorithm.join("."); 29567 switch (subtype) { 29568 case "1.2.840.113549.1.1.1": return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, "der"); 29569 case "1.2.840.10045.2.1": 29570 ndata.subjectPrivateKey = ndata.subjectPublicKey; 29571 return { 29572 type: "ec", 29573 data: ndata 29574 }; 29575 case "1.2.840.10040.4.1": 29576 ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, "der"); 29577 return { 29578 type: "dsa", 29579 data: ndata.algorithm.params 29580 }; 29581 default: throw new Error("unknown key id " + subtype); 29582 } 29583 case "ENCRYPTED PRIVATE KEY": 29584 data = asn1.EncryptedPrivateKey.decode(data, "der"); 29585 data = decrypt(data, password); 29586 case "PRIVATE KEY": 29587 ndata = asn1.PrivateKey.decode(data, "der"); 29588 subtype = ndata.algorithm.algorithm.join("."); 29589 switch (subtype) { 29590 case "1.2.840.113549.1.1.1": return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, "der"); 29591 case "1.2.840.10045.2.1": return { 29592 curve: ndata.algorithm.curve, 29593 privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, "der").privateKey 29594 }; 29595 case "1.2.840.10040.4.1": 29596 ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, "der"); 29597 return { 29598 type: "dsa", 29599 params: ndata.algorithm.params 29600 }; 29601 default: throw new Error("unknown key id " + subtype); 29602 } 29603 case "RSA PUBLIC KEY": return asn1.RSAPublicKey.decode(data, "der"); 29604 case "RSA PRIVATE KEY": return asn1.RSAPrivateKey.decode(data, "der"); 29605 case "DSA PRIVATE KEY": return { 29606 type: "dsa", 29607 params: asn1.DSAPrivateKey.decode(data, "der") 29608 }; 29609 case "EC PRIVATE KEY": 29610 data = asn1.ECPrivateKey.decode(data, "der"); 29611 return { 29612 curve: data.parameters.value, 29613 privateKey: data.privateKey 29614 }; 29615 default: throw new Error("unknown key type " + type); 29616 } 29617 } 29618 parseKeys.signature = asn1.signature; 29619 module.exports = parseKeys; 29620})); 29621//#endregion 29622//#region node_modules/browserify-sign/browser/curves.json 29623var curves_exports = /* @__PURE__ */ __exportAll({ default: () => curves_default }); 29624var curves_default; 29625var init_curves = __esmMin((() => { 29626 curves_default = { 29627 "1.3.132.0.10": "secp256k1", 29628 "1.3.132.0.33": "p224", 29629 "1.2.840.10045.3.1.1": "p192", 29630 "1.2.840.10045.3.1.7": "p256", 29631 "1.3.132.0.34": "p384", 29632 "1.3.132.0.35": "p521" 29633 }; 29634})); 29635//#endregion 29636//#region node_modules/browserify-sign/browser/sign.js 29637var require_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29638 var Buffer = require_safe_buffer$2().Buffer; 29639 var createHmac = require_browser$9(); 29640 var crt = require_browserify_rsa(); 29641 var EC = require_elliptic().ec; 29642 var BN = require_bn(); 29643 var parseKeys = require_parse_asn1(); 29644 var curves = (init_curves(), __toCommonJS(curves_exports).default); 29645 var RSA_PKCS1_PADDING = 1; 29646 function sign(hash, key, hashType, signType, tag) { 29647 var priv = parseKeys(key); 29648 if (priv.curve) { 29649 if (signType !== "ecdsa" && signType !== "ecdsa/rsa") throw new Error("wrong private key type"); 29650 return ecSign(hash, priv); 29651 } else if (priv.type === "dsa") { 29652 if (signType !== "dsa") throw new Error("wrong private key type"); 29653 return dsaSign(hash, priv, hashType); 29654 } 29655 if (signType !== "rsa" && signType !== "ecdsa/rsa") throw new Error("wrong private key type"); 29656 if (key.padding !== void 0 && key.padding !== RSA_PKCS1_PADDING) throw new Error("illegal or unsupported padding mode"); 29657 hash = Buffer.concat([tag, hash]); 29658 var len = priv.modulus.byteLength(); 29659 var pad = [0, 1]; 29660 while (hash.length + pad.length + 1 < len) pad.push(255); 29661 pad.push(0); 29662 var i = -1; 29663 while (++i < hash.length) pad.push(hash[i]); 29664 return crt(pad, priv); 29665 } 29666 function ecSign(hash, priv) { 29667 var curveId = curves[priv.curve.join(".")]; 29668 if (!curveId) throw new Error("unknown curve " + priv.curve.join(".")); 29669 var out = new EC(curveId).keyFromPrivate(priv.privateKey).sign(hash); 29670 return Buffer.from(out.toDER()); 29671 } 29672 function dsaSign(hash, priv, algo) { 29673 var x = priv.params.priv_key; 29674 var p = priv.params.p; 29675 var q = priv.params.q; 29676 var g = priv.params.g; 29677 var r = new BN(0); 29678 var k; 29679 var H = bits2int(hash, q).mod(q); 29680 var s = false; 29681 var kv = getKey(x, q, hash, algo); 29682 while (s === false) { 29683 k = makeKey(q, kv, algo); 29684 r = makeR(g, k, p, q); 29685 s = k.invm(q).imul(H.add(x.mul(r))).mod(q); 29686 if (s.cmpn(0) === 0) { 29687 s = false; 29688 r = new BN(0); 29689 } 29690 } 29691 return toDER(r, s); 29692 } 29693 function toDER(r, s) { 29694 r = r.toArray(); 29695 s = s.toArray(); 29696 if (r[0] & 128) r = [0].concat(r); 29697 if (s[0] & 128) s = [0].concat(s); 29698 var res = [ 29699 48, 29700 r.length + s.length + 4, 29701 2, 29702 r.length 29703 ]; 29704 res = res.concat(r, [2, s.length], s); 29705 return Buffer.from(res); 29706 } 29707 function getKey(x, q, hash, algo) { 29708 x = Buffer.from(x.toArray()); 29709 if (x.length < q.byteLength()) { 29710 var zeros = Buffer.alloc(q.byteLength() - x.length); 29711 x = Buffer.concat([zeros, x]); 29712 } 29713 var hlen = hash.length; 29714 var hbits = bits2octets(hash, q); 29715 var v = Buffer.alloc(hlen); 29716 v.fill(1); 29717 var k = Buffer.alloc(hlen); 29718 k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest(); 29719 v = createHmac(algo, k).update(v).digest(); 29720 k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest(); 29721 v = createHmac(algo, k).update(v).digest(); 29722 return { 29723 k, 29724 v 29725 }; 29726 } 29727 function bits2int(obits, q) { 29728 var bits = new BN(obits); 29729 var shift = (obits.length << 3) - q.bitLength(); 29730 if (shift > 0) bits.ishrn(shift); 29731 return bits; 29732 } 29733 function bits2octets(bits, q) { 29734 bits = bits2int(bits, q); 29735 bits = bits.mod(q); 29736 var out = Buffer.from(bits.toArray()); 29737 if (out.length < q.byteLength()) { 29738 var zeros = Buffer.alloc(q.byteLength() - out.length); 29739 out = Buffer.concat([zeros, out]); 29740 } 29741 return out; 29742 } 29743 function makeKey(q, kv, algo) { 29744 var t; 29745 var k; 29746 do { 29747 t = Buffer.alloc(0); 29748 while (t.length * 8 < q.bitLength()) { 29749 kv.v = createHmac(algo, kv.k).update(kv.v).digest(); 29750 t = Buffer.concat([t, kv.v]); 29751 } 29752 k = bits2int(t, q); 29753 kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest(); 29754 kv.v = createHmac(algo, kv.k).update(kv.v).digest(); 29755 } while (k.cmp(q) !== -1); 29756 return k; 29757 } 29758 function makeR(g, k, p, q) { 29759 return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q); 29760 } 29761 module.exports = sign; 29762 module.exports.getKey = getKey; 29763 module.exports.makeKey = makeKey; 29764})); 29765//#endregion 29766//#region node_modules/browserify-sign/browser/verify.js 29767var require_verify = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29768 var Buffer = require_safe_buffer$2().Buffer; 29769 var BN = require_bn(); 29770 var EC = require_elliptic().ec; 29771 var parseKeys = require_parse_asn1(); 29772 var curves = (init_curves(), __toCommonJS(curves_exports).default); 29773 function verify(sig, hash, key, signType, tag) { 29774 var pub = parseKeys(key); 29775 if (pub.type === "ec") { 29776 if (signType !== "ecdsa" && signType !== "ecdsa/rsa") throw new Error("wrong public key type"); 29777 return ecVerify(sig, hash, pub); 29778 } else if (pub.type === "dsa") { 29779 if (signType !== "dsa") throw new Error("wrong public key type"); 29780 return dsaVerify(sig, hash, pub); 29781 } 29782 if (signType !== "rsa" && signType !== "ecdsa/rsa") throw new Error("wrong public key type"); 29783 hash = Buffer.concat([tag, hash]); 29784 var len = pub.modulus.byteLength(); 29785 var pad = [1]; 29786 var padNum = 0; 29787 while (hash.length + pad.length + 2 < len) { 29788 pad.push(255); 29789 padNum += 1; 29790 } 29791 pad.push(0); 29792 var i = -1; 29793 while (++i < hash.length) pad.push(hash[i]); 29794 pad = Buffer.from(pad); 29795 var red = BN.mont(pub.modulus); 29796 sig = new BN(sig).toRed(red); 29797 sig = sig.redPow(new BN(pub.publicExponent)); 29798 sig = Buffer.from(sig.fromRed().toArray()); 29799 var out = padNum < 8 ? 1 : 0; 29800 len = Math.min(sig.length, pad.length); 29801 if (sig.length !== pad.length) out = 1; 29802 i = -1; 29803 while (++i < len) out |= sig[i] ^ pad[i]; 29804 return out === 0; 29805 } 29806 function ecVerify(sig, hash, pub) { 29807 var curveId = curves[pub.data.algorithm.curve.join(".")]; 29808 if (!curveId) throw new Error("unknown curve " + pub.data.algorithm.curve.join(".")); 29809 var curve = new EC(curveId); 29810 var pubkey = pub.data.subjectPrivateKey.data; 29811 return curve.verify(hash, sig, pubkey); 29812 } 29813 function dsaVerify(sig, hash, pub) { 29814 var p = pub.data.p; 29815 var q = pub.data.q; 29816 var g = pub.data.g; 29817 var y = pub.data.pub_key; 29818 var unpacked = parseKeys.signature.decode(sig, "der"); 29819 var s = unpacked.s; 29820 var r = unpacked.r; 29821 checkValue(s, q); 29822 checkValue(r, q); 29823 var montp = BN.mont(p); 29824 var w = s.invm(q); 29825 return g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q).cmp(r) === 0; 29826 } 29827 function checkValue(b, q) { 29828 if (b.cmpn(0) <= 0) throw new Error("invalid sig"); 29829 if (b.cmp(q) >= 0) throw new Error("invalid sig"); 29830 } 29831 module.exports = verify; 29832})); 29833//#endregion 29834//#region node_modules/browserify-sign/browser/index.js 29835var require_browser$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29836 var Buffer = require_safe_buffer$2().Buffer; 29837 var createHash = require_browser$10(); 29838 var stream = require_readable_browser(); 29839 var inherits = require_inherits_browser(); 29840 var sign = require_sign(); 29841 var verify = require_verify(); 29842 var algorithms = (init_algorithms(), __toCommonJS(algorithms_exports).default); 29843 Object.keys(algorithms).forEach(function(key) { 29844 algorithms[key].id = Buffer.from(algorithms[key].id, "hex"); 29845 algorithms[key.toLowerCase()] = algorithms[key]; 29846 }); 29847 function Sign(algorithm) { 29848 stream.Writable.call(this); 29849 var data = algorithms[algorithm]; 29850 if (!data) throw new Error("Unknown message digest"); 29851 this._hashType = data.hash; 29852 this._hash = createHash(data.hash); 29853 this._tag = data.id; 29854 this._signType = data.sign; 29855 } 29856 inherits(Sign, stream.Writable); 29857 Sign.prototype._write = function _write(data, _, done) { 29858 this._hash.update(data); 29859 done(); 29860 }; 29861 Sign.prototype.update = function update(data, enc) { 29862 this._hash.update(typeof data === "string" ? Buffer.from(data, enc) : data); 29863 return this; 29864 }; 29865 Sign.prototype.sign = function signMethod(key, enc) { 29866 this.end(); 29867 var sig = sign(this._hash.digest(), key, this._hashType, this._signType, this._tag); 29868 return enc ? sig.toString(enc) : sig; 29869 }; 29870 function Verify(algorithm) { 29871 stream.Writable.call(this); 29872 var data = algorithms[algorithm]; 29873 if (!data) throw new Error("Unknown message digest"); 29874 this._hash = createHash(data.hash); 29875 this._tag = data.id; 29876 this._signType = data.sign; 29877 } 29878 inherits(Verify, stream.Writable); 29879 Verify.prototype._write = function _write(data, _, done) { 29880 this._hash.update(data); 29881 done(); 29882 }; 29883 Verify.prototype.update = function update(data, enc) { 29884 this._hash.update(typeof data === "string" ? Buffer.from(data, enc) : data); 29885 return this; 29886 }; 29887 Verify.prototype.verify = function verifyMethod(key, sig, enc) { 29888 var sigBuffer = typeof sig === "string" ? Buffer.from(sig, enc) : sig; 29889 this.end(); 29890 return verify(sigBuffer, this._hash.digest(), key, this._signType, this._tag); 29891 }; 29892 function createSign(algorithm) { 29893 return new Sign(algorithm); 29894 } 29895 function createVerify(algorithm) { 29896 return new Verify(algorithm); 29897 } 29898 module.exports = { 29899 Sign: createSign, 29900 Verify: createVerify, 29901 createSign, 29902 createVerify 29903 }; 29904})); 29905//#endregion 29906//#region node_modules/create-ecdh/browser.js 29907var require_browser$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 29908 var Buffer = require_buffer$1().Buffer; 29909 var elliptic = require_elliptic(); 29910 var BN = require_bn$3(); 29911 module.exports = function createECDH(curve) { 29912 return new ECDH(curve); 29913 }; 29914 var aliases = { 29915 secp256k1: { 29916 name: "secp256k1", 29917 byteLength: 32 29918 }, 29919 secp224r1: { 29920 name: "p224", 29921 byteLength: 28 29922 }, 29923 prime256v1: { 29924 name: "p256", 29925 byteLength: 32 29926 }, 29927 prime192v1: { 29928 name: "p192", 29929 byteLength: 24 29930 }, 29931 ed25519: { 29932 name: "ed25519", 29933 byteLength: 32 29934 }, 29935 secp384r1: { 29936 name: "p384", 29937 byteLength: 48 29938 }, 29939 secp521r1: { 29940 name: "p521", 29941 byteLength: 66 29942 } 29943 }; 29944 aliases.p224 = aliases.secp224r1; 29945 aliases.p256 = aliases.secp256r1 = aliases.prime256v1; 29946 aliases.p192 = aliases.secp192r1 = aliases.prime192v1; 29947 aliases.p384 = aliases.secp384r1; 29948 aliases.p521 = aliases.secp521r1; 29949 function ECDH(curve) { 29950 this.curveType = aliases[curve]; 29951 if (!this.curveType) this.curveType = { name: curve }; 29952 this.curve = new elliptic.ec(this.curveType.name); 29953 this.keys = void 0; 29954 } 29955 ECDH.prototype.generateKeys = function(enc, format) { 29956 this.keys = this.curve.genKeyPair(); 29957 return this.getPublicKey(enc, format); 29958 }; 29959 ECDH.prototype.computeSecret = function(other, inenc, enc) { 29960 inenc = inenc || "utf8"; 29961 if (!Buffer.isBuffer(other)) other = new Buffer(other, inenc); 29962 return formatReturnValue(this.curve.keyFromPublic(other).getPublic().mul(this.keys.getPrivate()).getX(), enc, this.curveType.byteLength); 29963 }; 29964 ECDH.prototype.getPublicKey = function(enc, format) { 29965 var key = this.keys.getPublic(format === "compressed", true); 29966 if (format === "hybrid") if (key[key.length - 1] % 2) key[0] = 7; 29967 else key[0] = 6; 29968 return formatReturnValue(key, enc); 29969 }; 29970 ECDH.prototype.getPrivateKey = function(enc) { 29971 return formatReturnValue(this.keys.getPrivate(), enc); 29972 }; 29973 ECDH.prototype.setPublicKey = function(pub, enc) { 29974 enc = enc || "utf8"; 29975 if (!Buffer.isBuffer(pub)) pub = new Buffer(pub, enc); 29976 this.keys._importPublic(pub); 29977 return this; 29978 }; 29979 ECDH.prototype.setPrivateKey = function(priv, enc) { 29980 enc = enc || "utf8"; 29981 if (!Buffer.isBuffer(priv)) priv = new Buffer(priv, enc); 29982 var _priv = new BN(priv); 29983 _priv = _priv.toString(16); 29984 this.keys = this.curve.genKeyPair(); 29985 this.keys._importPrivate(_priv); 29986 return this; 29987 }; 29988 function formatReturnValue(bn, enc, len) { 29989 if (!Array.isArray(bn)) bn = bn.toArray(); 29990 var buf = new Buffer(bn); 29991 if (len && buf.length < len) { 29992 var zeros = new Buffer(len - buf.length); 29993 zeros.fill(0); 29994 buf = Buffer.concat([zeros, buf]); 29995 } 29996 if (!enc) return buf; 29997 else return buf.toString(enc); 29998 } 29999})); 30000//#endregion 30001//#region node_modules/public-encrypt/mgf.js 30002var require_mgf = /* @__PURE__ */ __commonJSMin(((exports, module) => { 30003 var createHash = require_browser$10(); 30004 var Buffer = require_safe_buffer$2().Buffer; 30005 module.exports = function(seed, len) { 30006 var t = Buffer.alloc(0); 30007 var i = 0; 30008 var c; 30009 while (t.length < len) { 30010 c = i2ops(i++); 30011 t = Buffer.concat([t, createHash("sha1").update(seed).update(c).digest()]); 30012 } 30013 return t.slice(0, len); 30014 }; 30015 function i2ops(c) { 30016 var out = Buffer.allocUnsafe(4); 30017 out.writeUInt32BE(c, 0); 30018 return out; 30019 } 30020})); 30021//#endregion 30022//#region node_modules/public-encrypt/xor.js 30023var require_xor = /* @__PURE__ */ __commonJSMin(((exports, module) => { 30024 module.exports = function xor(a, b) { 30025 var len = a.length; 30026 var i = -1; 30027 while (++i < len) a[i] ^= b[i]; 30028 return a; 30029 }; 30030})); 30031//#endregion 30032//#region node_modules/public-encrypt/withPublic.js 30033var require_withPublic = /* @__PURE__ */ __commonJSMin(((exports, module) => { 30034 var BN = require_bn$3(); 30035 var Buffer = require_safe_buffer$2().Buffer; 30036 function withPublic(paddedMsg, key) { 30037 return Buffer.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray()); 30038 } 30039 module.exports = withPublic; 30040})); 30041//#endregion 30042//#region node_modules/public-encrypt/publicEncrypt.js 30043var require_publicEncrypt = /* @__PURE__ */ __commonJSMin(((exports, module) => { 30044 var parseKeys = require_parse_asn1(); 30045 var randomBytes = require_browser$12(); 30046 var createHash = require_browser$10(); 30047 var mgf = require_mgf(); 30048 var xor = require_xor(); 30049 var BN = require_bn$3(); 30050 var withPublic = require_withPublic(); 30051 var crt = require_browserify_rsa(); 30052 var Buffer = require_safe_buffer$2().Buffer; 30053 module.exports = function publicEncrypt(publicKey, msg, reverse) { 30054 var padding; 30055 if (publicKey.padding) padding = publicKey.padding; 30056 else if (reverse) padding = 1; 30057 else padding = 4; 30058 var key = parseKeys(publicKey); 30059 var paddedMsg; 30060 if (padding === 4) paddedMsg = oaep(key, msg); 30061 else if (padding === 1) paddedMsg = pkcs1(key, msg, reverse); 30062 else if (padding === 3) { 30063 paddedMsg = new BN(msg); 30064 if (paddedMsg.cmp(key.modulus) >= 0) throw new Error("data too long for modulus"); 30065 } else throw new Error("unknown padding"); 30066 if (reverse) return crt(paddedMsg, key); 30067 else return withPublic(paddedMsg, key); 30068 }; 30069 function oaep(key, msg) { 30070 var k = key.modulus.byteLength(); 30071 var mLen = msg.length; 30072 var iHash = createHash("sha1").update(Buffer.alloc(0)).digest(); 30073 var hLen = iHash.length; 30074 var hLen2 = 2 * hLen; 30075 if (mLen > k - hLen2 - 2) throw new Error("message too long"); 30076 var ps = Buffer.alloc(k - mLen - hLen2 - 2); 30077 var dblen = k - hLen - 1; 30078 var seed = randomBytes(hLen); 30079 var maskedDb = xor(Buffer.concat([ 30080 iHash, 30081 ps, 30082 Buffer.alloc(1, 1), 30083 msg 30084 ], dblen), mgf(seed, dblen)); 30085 var maskedSeed = xor(seed, mgf(maskedDb, hLen)); 30086 return new BN(Buffer.concat([ 30087 Buffer.alloc(1), 30088 maskedSeed, 30089 maskedDb 30090 ], k)); 30091 } 30092 function pkcs1(key, msg, reverse) { 30093 var mLen = msg.length; 30094 var k = key.modulus.byteLength(); 30095 if (mLen > k - 11) throw new Error("message too long"); 30096 var ps; 30097 if (reverse) ps = Buffer.alloc(k - mLen - 3, 255); 30098 else ps = nonZero(k - mLen - 3); 30099 return new BN(Buffer.concat([ 30100 Buffer.from([0, reverse ? 1 : 2]), 30101 ps, 30102 Buffer.alloc(1), 30103 msg 30104 ], k)); 30105 } 30106 function nonZero(len) { 30107 var out = Buffer.allocUnsafe(len); 30108 var i = 0; 30109 var cache = randomBytes(len * 2); 30110 var cur = 0; 30111 var num; 30112 while (i < len) { 30113 if (cur === cache.length) { 30114 cache = randomBytes(len * 2); 30115 cur = 0; 30116 } 30117 num = cache[cur++]; 30118 if (num) out[i++] = num; 30119 } 30120 return out; 30121 } 30122})); 30123//#endregion 30124//#region node_modules/public-encrypt/privateDecrypt.js 30125var require_privateDecrypt = /* @__PURE__ */ __commonJSMin(((exports, module) => { 30126 var parseKeys = require_parse_asn1(); 30127 var mgf = require_mgf(); 30128 var xor = require_xor(); 30129 var BN = require_bn$3(); 30130 var crt = require_browserify_rsa(); 30131 var createHash = require_browser$10(); 30132 var withPublic = require_withPublic(); 30133 var Buffer = require_safe_buffer$2().Buffer; 30134 module.exports = function privateDecrypt(privateKey, enc, reverse) { 30135 var padding; 30136 if (privateKey.padding) padding = privateKey.padding; 30137 else if (reverse) padding = 1; 30138 else padding = 4; 30139 var key = parseKeys(privateKey); 30140 var k = key.modulus.byteLength(); 30141 if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) throw new Error("decryption error"); 30142 var msg; 30143 if (reverse) msg = withPublic(new BN(enc), key); 30144 else msg = crt(enc, key); 30145 var zBuffer = Buffer.alloc(k - msg.length); 30146 msg = Buffer.concat([zBuffer, msg], k); 30147 if (padding === 4) return oaep(key, msg); 30148 else if (padding === 1) return pkcs1(key, msg, reverse); 30149 else if (padding === 3) return msg; 30150 else throw new Error("unknown padding"); 30151 }; 30152 function oaep(key, msg) { 30153 var k = key.modulus.byteLength(); 30154 var iHash = createHash("sha1").update(Buffer.alloc(0)).digest(); 30155 var hLen = iHash.length; 30156 if (msg[0] !== 0) throw new Error("decryption error"); 30157 var maskedSeed = msg.slice(1, hLen + 1); 30158 var maskedDb = msg.slice(hLen + 1); 30159 var db = xor(maskedDb, mgf(xor(maskedSeed, mgf(maskedDb, hLen)), k - hLen - 1)); 30160 if (compare(iHash, db.slice(0, hLen))) throw new Error("decryption error"); 30161 var i = hLen; 30162 while (db[i] === 0) i++; 30163 if (db[i++] !== 1) throw new Error("decryption error"); 30164 return db.slice(i); 30165 } 30166 function pkcs1(key, msg, reverse) { 30167 var p1 = msg.slice(0, 2); 30168 var i = 2; 30169 var status = 0; 30170 while (msg[i++] !== 0) if (i >= msg.length) { 30171 status++; 30172 break; 30173 } 30174 var ps = msg.slice(2, i - 1); 30175 if (p1.toString("hex") !== "0002" && !reverse || p1.toString("hex") !== "0001" && reverse) status++; 30176 if (ps.length < 8) status++; 30177 if (status) throw new Error("decryption error"); 30178 return msg.slice(i); 30179 } 30180 function compare(a, b) { 30181 a = Buffer.from(a); 30182 b = Buffer.from(b); 30183 var dif = 0; 30184 var len = a.length; 30185 if (a.length !== b.length) { 30186 dif++; 30187 len = Math.min(a.length, b.length); 30188 } 30189 var i = -1; 30190 while (++i < len) dif += a[i] ^ b[i]; 30191 return dif; 30192 } 30193})); 30194//#endregion 30195//#region node_modules/public-encrypt/browser.js 30196var require_browser$2 = /* @__PURE__ */ __commonJSMin(((exports) => { 30197 exports.publicEncrypt = require_publicEncrypt(); 30198 exports.privateDecrypt = require_privateDecrypt(); 30199 exports.privateEncrypt = function privateEncrypt(key, buf) { 30200 return exports.publicEncrypt(key, buf, true); 30201 }; 30202 exports.publicDecrypt = function publicDecrypt(key, buf) { 30203 return exports.privateDecrypt(key, buf, true); 30204 }; 30205})); 30206//#endregion 30207//#region node_modules/randomfill/browser.js 30208var require_browser$1 = /* @__PURE__ */ __commonJSMin(((exports) => { 30209 var process = require_browser$15(); 30210 function oldBrowser() { 30211 throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); 30212 } 30213 var safeBuffer = require_safe_buffer$2(); 30214 var randombytes = require_browser$12(); 30215 var Buffer = safeBuffer.Buffer; 30216 var kBufferMaxLength = safeBuffer.kMaxLength; 30217 var crypto = globalThis.crypto || globalThis.msCrypto; 30218 var kMaxUint32 = Math.pow(2, 32) - 1; 30219 function assertOffset(offset, length) { 30220 if (typeof offset !== "number" || offset !== offset) throw new TypeError("offset must be a number"); 30221 if (offset > kMaxUint32 || offset < 0) throw new TypeError("offset must be a uint32"); 30222 if (offset > kBufferMaxLength || offset > length) throw new RangeError("offset out of range"); 30223 } 30224 function assertSize(size, offset, length) { 30225 if (typeof size !== "number" || size !== size) throw new TypeError("size must be a number"); 30226 if (size > kMaxUint32 || size < 0) throw new TypeError("size must be a uint32"); 30227 if (size + offset > length || size > kBufferMaxLength) throw new RangeError("buffer too small"); 30228 } 30229 if (crypto && crypto.getRandomValues || !process.browser) { 30230 exports.randomFill = randomFill; 30231 exports.randomFillSync = randomFillSync; 30232 } else { 30233 exports.randomFill = oldBrowser; 30234 exports.randomFillSync = oldBrowser; 30235 } 30236 function randomFill(buf, offset, size, cb) { 30237 if (!Buffer.isBuffer(buf) && !(buf instanceof globalThis.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array"); 30238 if (typeof offset === "function") { 30239 cb = offset; 30240 offset = 0; 30241 size = buf.length; 30242 } else if (typeof size === "function") { 30243 cb = size; 30244 size = buf.length - offset; 30245 } else if (typeof cb !== "function") throw new TypeError("\"cb\" argument must be a function"); 30246 assertOffset(offset, buf.length); 30247 assertSize(size, offset, buf.length); 30248 return actualFill(buf, offset, size, cb); 30249 } 30250 function actualFill(buf, offset, size, cb) { 30251 if (process.browser) { 30252 var ourBuf = buf.buffer; 30253 var uint = new Uint8Array(ourBuf, offset, size); 30254 crypto.getRandomValues(uint); 30255 if (cb) { 30256 process.nextTick(function() { 30257 cb(null, buf); 30258 }); 30259 return; 30260 } 30261 return buf; 30262 } 30263 if (cb) { 30264 randombytes(size, function(err, bytes) { 30265 if (err) return cb(err); 30266 bytes.copy(buf, offset); 30267 cb(null, buf); 30268 }); 30269 return; 30270 } 30271 randombytes(size).copy(buf, offset); 30272 return buf; 30273 } 30274 function randomFillSync(buf, offset, size) { 30275 if (typeof offset === "undefined") offset = 0; 30276 if (!Buffer.isBuffer(buf) && !(buf instanceof globalThis.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array"); 30277 assertOffset(offset, buf.length); 30278 if (size === void 0) size = buf.length - offset; 30279 assertSize(size, offset, buf.length); 30280 return actualFill(buf, offset, size); 30281 } 30282})); 30283//#endregion 30284//#region node_modules/crypto-browserify/index.js 30285var require_crypto_browserify = /* @__PURE__ */ __commonJSMin(((exports) => { 30286 exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser$12(); 30287 exports.createHash = exports.Hash = require_browser$10(); 30288 exports.createHmac = exports.Hmac = require_browser$9(); 30289 var algos = require_algos(); 30290 var algoKeys = Object.keys(algos); 30291 var hashes = [ 30292 "sha1", 30293 "sha224", 30294 "sha256", 30295 "sha384", 30296 "sha512", 30297 "md5", 30298 "rmd160" 30299 ].concat(algoKeys); 30300 exports.getHashes = function() { 30301 return hashes; 30302 }; 30303 var p = require_browser$8(); 30304 exports.pbkdf2 = p.pbkdf2; 30305 exports.pbkdf2Sync = p.pbkdf2Sync; 30306 var aes = require_browser$6(); 30307 exports.Cipher = aes.Cipher; 30308 exports.createCipher = aes.createCipher; 30309 exports.Cipheriv = aes.Cipheriv; 30310 exports.createCipheriv = aes.createCipheriv; 30311 exports.Decipher = aes.Decipher; 30312 exports.createDecipher = aes.createDecipher; 30313 exports.Decipheriv = aes.Decipheriv; 30314 exports.createDecipheriv = aes.createDecipheriv; 30315 exports.getCiphers = aes.getCiphers; 30316 exports.listCiphers = aes.listCiphers; 30317 var dh = require_browser$5(); 30318 exports.DiffieHellmanGroup = dh.DiffieHellmanGroup; 30319 exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup; 30320 exports.getDiffieHellman = dh.getDiffieHellman; 30321 exports.createDiffieHellman = dh.createDiffieHellman; 30322 exports.DiffieHellman = dh.DiffieHellman; 30323 var sign = require_browser$4(); 30324 exports.createSign = sign.createSign; 30325 exports.Sign = sign.Sign; 30326 exports.createVerify = sign.createVerify; 30327 exports.Verify = sign.Verify; 30328 exports.createECDH = require_browser$3(); 30329 var publicEncrypt = require_browser$2(); 30330 exports.publicEncrypt = publicEncrypt.publicEncrypt; 30331 exports.privateEncrypt = publicEncrypt.privateEncrypt; 30332 exports.publicDecrypt = publicEncrypt.publicDecrypt; 30333 exports.privateDecrypt = publicEncrypt.privateDecrypt; 30334 var rf = require_browser$1(); 30335 exports.randomFill = rf.randomFill; 30336 exports.randomFillSync = rf.randomFillSync; 30337 exports.createCredentials = function() { 30338 throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify"); 30339 }; 30340 exports.constants = { 30341 DH_CHECK_P_NOT_SAFE_PRIME: 2, 30342 DH_CHECK_P_NOT_PRIME: 1, 30343 DH_UNABLE_TO_CHECK_GENERATOR: 4, 30344 DH_NOT_SUITABLE_GENERATOR: 8, 30345 NPN_ENABLED: 1, 30346 ALPN_ENABLED: 1, 30347 RSA_PKCS1_PADDING: 1, 30348 RSA_SSLV23_PADDING: 2, 30349 RSA_NO_PADDING: 3, 30350 RSA_PKCS1_OAEP_PADDING: 4, 30351 RSA_X931_PADDING: 5, 30352 RSA_PKCS1_PSS_PADDING: 6, 30353 POINT_CONVERSION_COMPRESSED: 2, 30354 POINT_CONVERSION_UNCOMPRESSED: 4, 30355 POINT_CONVERSION_HYBRID: 6 30356 }; 30357})); 30358//#endregion 30359//#region node_modules/ua-parser-js/src/ua-parser.js 30360var require_ua_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 30361 /*! 30362 * UAParser.js v0.7.24 30363 * Lightweight JavaScript-based User-Agent string parser 30364 * https://github.com/faisalman/ua-parser-js 30365 * 30366 * Copyright © 2012-2021 Faisal Salman <[email protected]> 30367 * Licensed under MIT License 30368 */ 30369 (function(window, undefined) { 30370 "use strict"; 30371 var LIBVERSION = "0.7.24", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded"; 30372 var util = { 30373 extend: function(regexes, extensions) { 30374 var mergedRegexes = {}; 30375 for (var i in regexes) if (extensions[i] && extensions[i].length % 2 === 0) mergedRegexes[i] = extensions[i].concat(regexes[i]); 30376 else mergedRegexes[i] = regexes[i]; 30377 return mergedRegexes; 30378 }, 30379 has: function(str1, str2) { 30380 if (typeof str1 === "string") return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; 30381 else return false;
30382 }, 30383 lowerize: function(str) { 30384 return str.toLowerCase(); 30385 }, 30386 major: function(version) { 30387 return typeof version === STR_TYPE ? version.replace(/[^\d\.]/g, "").split(".")[0] : undefined; 30388 }, 30389 trim: function(str) { 30390 return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); 30391 } 30392 }; 30393 var mapper = { 30394 rgx: function(ua, arrays) { 30395 var i = 0, j, k, p, q, matches, match; 30396 while (i < arrays.length && !matches) { 30397 var regex = arrays[i], props = arrays[i + 1]; 30398 j = k = 0; 30399 while (j < regex.length && !matches) { 30400 matches = regex[j++].exec(ua); 30401 if (!!matches) for (p = 0; p < props.length; p++) { 30402 match = matches[++k]; 30403 q = props[p]; 30404 if (typeof q === OBJ_TYPE && q.length > 0) { 30405 if (q.length == 2) if (typeof q[1] == FUNC_TYPE) this[q[0]] = q[1].call(this, match); 30406 else this[q[0]] = q[1]; 30407 else if (q.length == 3) if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; 30408 else this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; 30409 else if (q.length == 4) this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; 30410 } else this[q] = match ? match : undefined; 30411 } 30412 } 30413 i += 2; 30414 } 30415 }, 30416 str: function(str, map) { 30417 for (var i in map) if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { 30418 for (var j = 0; j < map[i].length; j++) if (util.has(map[i][j], str)) return i === UNKNOWN ? undefined : i; 30419 } else if (util.has(map[i], str)) return i === UNKNOWN ? undefined : i; 30420 return str; 30421 } 30422 }; 30423 var maps = { 30424 browser: { oldsafari: { version: { 30425 "1.0": "/8", 30426 "1.2": "/1", 30427 "1.3": "/3", 30428 "2.0": "/412", 30429 "2.0.2": "/416", 30430 "2.0.3": "/417", 30431 "2.0.4": "/419", 30432 "?": "/" 30433 } } }, 30434 device: { 30435 amazon: { model: { "Fire Phone": ["SD", "KF"] } }, 30436 sprint: { 30437 model: { "Evo Shift 4G": "7373KT" }, 30438 vendor: { 30439 "HTC": "APA", 30440 "Sprint": "Sprint" 30441 } 30442 } 30443 }, 30444 os: { windows: { version: { 30445 "ME": "4.90", 30446 "NT 3.11": "NT3.51", 30447 "NT 4.0": "NT4.0", 30448 "2000": "NT 5.0", 30449 "XP": ["NT 5.1", "NT 5.2"], 30450 "Vista": "NT 6.0", 30451 "7": "NT 6.1", 30452 "8": "NT 6.2", 30453 "8.1": "NT 6.3", 30454 "10": ["NT 6.4", "NT 10.0"], 30455 "RT": "ARM" 30456 } } } 30457 }; 30458 var regexes = { 30459 browser: [ 30460 [ 30461 /(opera\smini)\/([\w\.-]+)/i, 30462 /(opera\s[mobiletab]{3,6}).+version\/([\w\.-]+)/i, 30463 /(opera).+version\/([\w\.]+)/i, 30464 /(opera)[\/\s]+([\w\.]+)/i 30465 ], 30466 [NAME, VERSION], 30467 [/(opios)[\/\s]+([\w\.]+)/i], 30468 [[NAME, "Opera Mini"], VERSION], 30469 [/\s(opr)\/([\w\.]+)/i], 30470 [[NAME, "Opera"], VERSION], 30471 [ 30472 /(kindle)\/([\w\.]+)/i, 30473 /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i, 30474 /(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i, 30475 /(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i, 30476 /(?:ms|\()(ie)\s([\w\.]+)/i, 30477 /(rekonq)\/([\w\.]*)/i, 30478 /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i 30479 ], 30480 [NAME, VERSION], 30481 [/(konqueror)\/([\w\.]+)/i], 30482 [[NAME, "Konqueror"], VERSION], 30483 [/(trident).+rv[:\s]([\w\.]{1,9}).+like\sgecko/i], 30484 [[NAME, "IE"], VERSION], 30485 [/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i], 30486 [[NAME, "Edge"], VERSION], 30487 [/(yabrowser)\/([\w\.]+)/i], 30488 [[NAME, "Yandex"], VERSION], 30489 [/(Avast)\/([\w\.]+)/i], 30490 [[NAME, "Avast Secure Browser"], VERSION], 30491 [/(AVG)\/([\w\.]+)/i], 30492 [[NAME, "AVG Secure Browser"], VERSION], 30493 [/(puffin)\/([\w\.]+)/i], 30494 [[NAME, "Puffin"], VERSION], 30495 [/(focus)\/([\w\.]+)/i], 30496 [[NAME, "Firefox Focus"], VERSION], 30497 [/(opt)\/([\w\.]+)/i], 30498 [[NAME, "Opera Touch"], VERSION], 30499 [/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i], 30500 [[NAME, "UCBrowser"], VERSION], 30501 [/(comodo_dragon)\/([\w\.]+)/i], 30502 [[ 30503 NAME, 30504 /_/g, 30505 " " 30506 ], VERSION], 30507 [/(windowswechat qbcore)\/([\w\.]+)/i], 30508 [[NAME, "WeChat(Win) Desktop"], VERSION], 30509 [/(micromessenger)\/([\w\.]+)/i], 30510 [[NAME, "WeChat"], VERSION], 30511 [/(brave)\/([\w\.]+)/i], 30512 [[NAME, "Brave"], VERSION], 30513 [/(whale)\/([\w\.]+)/i], 30514 [[NAME, "Whale"], VERSION], 30515 [/(qqbrowserlite)\/([\w\.]+)/i], 30516 [NAME, VERSION], 30517 [/(QQ)\/([\d\.]+)/i], 30518 [NAME, VERSION], 30519 [/m?(qqbrowser)[\/\s]?([\w\.]+)/i], 30520 [NAME, VERSION], 30521 [/(baiduboxapp)[\/\s]?([\w\.]+)/i], 30522 [NAME, VERSION], 30523 [/(2345Explorer)[\/\s]?([\w\.]+)/i], 30524 [NAME, VERSION], 30525 [/(MetaSr)[\/\s]?([\w\.]+)/i], 30526 [NAME], 30527 [/(LBBROWSER)/i], 30528 [NAME], 30529 [/xiaomi\/miuibrowser\/([\w\.]+)/i], 30530 [VERSION, [NAME, "MIUI Browser"]], 30531 [/;fbav\/([\w\.]+);/i], 30532 [VERSION, [NAME, "Facebook"]], 30533 [/FBAN\/FBIOS|FB_IAB\/FB4A/i], 30534 [[NAME, "Facebook"]], 30535 [/safari\s(line)\/([\w\.]+)/i, /android.+(line)\/([\w\.]+)\/iab/i], 30536 [NAME, VERSION], 30537 [/headlesschrome(?:\/([\w\.]+)|\s)/i], 30538 [VERSION, [NAME, "Chrome Headless"]], 30539 [/\swv\).+(chrome)\/([\w\.]+)/i], 30540 [[ 30541 NAME,
vendor: 14,533 bytes, lines 30542-31196
30542 /(.+)/, 30543 "$1 WebView" 30544 ], VERSION], 30545 [/((?:oculus|samsung)browser)\/([\w\.]+)/i], 30546 [[ 30547 NAME, 30548 /(.+(?:g|us))(.+)/, 30549 "$1 $2" 30550 ], VERSION], 30551 [/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i], 30552 [VERSION, [NAME, "Android Browser"]], 30553 [/(coc_coc_browser)\/([\w\.]+)/i], 30554 [[NAME, "Coc Coc"], VERSION], 30555 [/(sailfishbrowser)\/([\w\.]+)/i], 30556 [[NAME, "Sailfish Browser"], VERSION], 30557 [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i], 30558 [NAME, VERSION], 30559 [/(dolfin)\/([\w\.]+)/i], 30560 [[NAME, "Dolphin"], VERSION], 30561 [/(qihu|qhbrowser|qihoobrowser|360browser)/i], 30562 [[NAME, "360 Browser"]], 30563 [/((?:android.+)crmo|crios)\/([\w\.]+)/i], 30564 [[NAME, "Chrome"], VERSION], 30565 [/(coast)\/([\w\.]+)/i], 30566 [[NAME, "Opera Coast"], VERSION], 30567 [/fxios\/([\w\.-]+)/i], 30568 [VERSION, [NAME, "Firefox"]], 30569 [/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i], 30570 [VERSION, [NAME, "Mobile Safari"]], 30571 [/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i], 30572 [VERSION, NAME], 30573 [/webkit.+?(gsa)\/([\w\.]+)\s.*(mobile\s?safari|safari)(\/[\w\.]+)/i], 30574 [[NAME, "GSA"], VERSION], 30575 [/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i], 30576 [NAME, [ 30577 VERSION, 30578 mapper.str, 30579 maps.browser.oldsafari.version 30580 ]], 30581 [/(webkit|khtml)\/([\w\.]+)/i], 30582 [NAME, VERSION], 30583 [/(navigator|netscape)\/([\w\.-]+)/i], 30584 [[NAME, "Netscape"], VERSION], 30585 [ 30586 /(swiftfox)/i, 30587 /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, 30588 /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, 30589 /(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i, 30590 /(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i, 30591 /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, 30592 /(links)\s\(([\w\.]+)/i, 30593 /(gobrowser)\/?([\w\.]*)/i, 30594 /(ice\s?browser)\/v?([\w\._]+)/i, 30595 /(mosaic)[\/\s]([\w\.]+)/i 30596 ], 30597 [NAME, VERSION] 30598 ], 30599 cpu: [ 30600 [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], 30601 [[ARCHITECTURE, "amd64"]], 30602 [/(ia32(?=;))/i], 30603 [[ARCHITECTURE, util.lowerize]], 30604 [/((?:i[346]|x)86)[;\)]/i], 30605 [[ARCHITECTURE, "ia32"]], 30606 [/windows\s(ce|mobile);\sppc;/i], 30607 [[ARCHITECTURE, "arm"]], 30608 [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], 30609 [[ 30610 ARCHITECTURE, 30611 /ower/, 30612 "", 30613 util.lowerize 30614 ]], 30615 [/(sun4\w)[;\)]/i], 30616 [[ARCHITECTURE, "sparc"]], 30617 [/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], 30618 [[ARCHITECTURE, util.lowerize]] 30619 ], 30620 device: [ 30621 [/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i], 30622 [ 30623 MODEL, 30624 VENDOR, 30625 [TYPE, TABLET] 30626 ], 30627 [/applecoremedia\/[\w\.]+ \((ipad)/], 30628 [ 30629 MODEL, 30630 [VENDOR, "Apple"], 30631 [TYPE, TABLET] 30632 ], 30633 [/(apple\s{0,1}tv)/i], 30634 [ 30635 [MODEL, "Apple TV"], 30636 [VENDOR, "Apple"], 30637 [TYPE, SMARTTV] 30638 ], 30639 [ 30640 /(archos)\s(gamepad2?)/i, 30641 /(hp).+(touchpad)/i, 30642 /(hp).+(tablet)/i, 30643 /(kindle)\/([\w\.]+)/i, 30644 /\s(nook)[\w\s]+build\/(\w+)/i, 30645 /(dell)\s(strea[kpr\s\d]*[\dko])/i 30646 ], 30647 [ 30648 VENDOR, 30649 MODEL, 30650 [TYPE, TABLET] 30651 ], 30652 [/(kf[A-z]+)(\sbuild\/|\)).+silk\//i], 30653 [ 30654 MODEL, 30655 [VENDOR, "Amazon"], 30656 [TYPE, TABLET] 30657 ], 30658 [/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i], 30659 [ 30660 [ 30661 MODEL, 30662 mapper.str, 30663 maps.device.amazon.model 30664 ], 30665 [VENDOR, "Amazon"], 30666 [TYPE, MOBILE] 30667 ], 30668 [/android.+aft([\w])(\sbuild\/|\))/i], 30669 [ 30670 MODEL, 30671 [VENDOR, "Amazon"], 30672 [TYPE, SMARTTV] 30673 ], 30674 [/\((ip[honed|\s\w*]+);.+(apple)/i], 30675 [ 30676 MODEL, 30677 VENDOR, 30678 [TYPE, MOBILE] 30679 ], 30680 [/\((ip[honed|\s\w*]+);/i], 30681 [ 30682 MODEL, 30683 [VENDOR, "Apple"], 30684 [TYPE, MOBILE] 30685 ], 30686 [ 30687 /(blackberry)[\s-]?(\w+)/i, 30688 /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i, 30689 /(hp)\s([\w\s]+\w)/i, 30690 /(asus)-?(\w+)/i 30691 ], 30692 [ 30693 VENDOR, 30694 MODEL, 30695 [TYPE, MOBILE] 30696 ], 30697 [/\(bb10;\s(\w+)/i], 30698 [ 30699 MODEL, 30700 [VENDOR, "BlackBerry"], 30701 [TYPE, MOBILE] 30702 ], 30703 [/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i], 30704 [ 30705 MODEL, 30706 [VENDOR, "Asus"], 30707 [TYPE, TABLET] 30708 ], 30709 [/(sony)\s(tablet\s[ps])\sbuild\//i, /(sony)?(?:sgp.+)\sbuild\//i], 30710 [ 30711 [VENDOR, "Sony"], 30712 [MODEL, "Xperia Tablet"], 30713 [TYPE, TABLET] 30714 ], 30715 [/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i], 30716 [ 30717 MODEL, 30718 [VENDOR, "Sony"], 30719 [TYPE, MOBILE] 30720 ], 30721 [/\s(ouya)\s/i, /(nintendo)\s([wids3u]+)/i], 30722 [ 30723 VENDOR, 30724 MODEL, 30725 [TYPE, CONSOLE] 30726 ], 30727 [/android.+;\s(shield)\sbuild/i], 30728 [ 30729 MODEL, 30730 [VENDOR, "Nvidia"], 30731 [TYPE, CONSOLE] 30732 ], 30733 [/(playstation\s[34portablevi]+)/i], 30734 [ 30735 MODEL, 30736 [VENDOR, "Sony"], 30737 [TYPE, CONSOLE] 30738 ], 30739 [/(sprint\s(\w+))/i], 30740 [ 30741 [ 30742 VENDOR, 30743 mapper.str, 30744 maps.device.sprint.vendor 30745 ], 30746 [ 30747 MODEL, 30748 mapper.str, 30749 maps.device.sprint.model 30750 ], 30751 [TYPE, MOBILE] 30752 ], 30753 [ 30754 /(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i, 30755 /(zte)-(\w*)/i, 30756 /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i 30757 ], 30758 [ 30759 VENDOR, 30760 [ 30761 MODEL, 30762 /_/g, 30763 " " 30764 ], 30765 [TYPE, MOBILE] 30766 ], 30767 [/(nexus\s9)/i], 30768 [ 30769 MODEL, 30770 [VENDOR, "HTC"], 30771 [TYPE, TABLET] 30772 ], 30773 [/d\/huawei([\w\s-]+)[;\)]/i, /android.+\s(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?)/i], 30774 [ 30775 MODEL, 30776 [VENDOR, "Huawei"], 30777 [TYPE, MOBILE] 30778 ], 30779 [/android.+(bah2?-a?[lw]\d{2})/i], 30780 [ 30781 MODEL, 30782 [VENDOR, "Huawei"], 30783 [TYPE, TABLET] 30784 ], 30785 [/(microsoft);\s(lumia[\s\w]+)/i], 30786 [ 30787 VENDOR, 30788 MODEL, 30789 [TYPE, MOBILE] 30790 ], 30791 [/[\s\(;](xbox(?:\sone)?)[\s\);]/i], 30792 [ 30793 MODEL, 30794 [VENDOR, "Microsoft"], 30795 [TYPE, CONSOLE] 30796 ], 30797 [/(kin\.[onetw]{3})/i], 30798 [ 30799 [ 30800 MODEL, 30801 /\./g, 30802 " " 30803 ], 30804 [VENDOR, "Microsoft"], 30805 [TYPE, MOBILE] 30806 ], 30807 [ 30808 /\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i, 30809 /mot[\s-]?(\w*)/i, 30810 /(XT\d{3,4}) build\//i, 30811 /(nexus\s6)/i 30812 ], 30813 [ 30814 MODEL, 30815 [VENDOR, "Motorola"], 30816 [TYPE, MOBILE] 30817 ], 30818 [/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i], 30819 [ 30820 MODEL, 30821 [VENDOR, "Motorola"], 30822 [TYPE, TABLET] 30823 ], 30824 [/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i], 30825 [ 30826 [VENDOR, util.trim], 30827 [MODEL, util.trim], 30828 [TYPE, SMARTTV] 30829 ], 30830 [/hbbtv.+maple;(\d+)/i], 30831 [ 30832 [ 30833 MODEL, 30834 /^/, 30835 "SmartTV" 30836 ], 30837 [VENDOR, "Samsung"], 30838 [TYPE, SMARTTV] 30839 ], 30840 [/\(dtv[\);].+(aquos)/i], 30841 [ 30842 MODEL, 30843 [VENDOR, "Sharp"], 30844 [TYPE, SMARTTV] 30845 ], 30846 [/android.+((sch-i[89]0\d|shw-m380s|SM-P605|SM-P610|SM-P587|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i, /((SM-T\w+))/i], 30847 [ 30848 [VENDOR, "Samsung"], 30849 MODEL, 30850 [TYPE, TABLET] 30851 ], 30852 [/smart-tv.+(samsung)/i], 30853 [ 30854 VENDOR, 30855 [TYPE, SMARTTV], 30856 MODEL 30857 ], 30858 [ 30859 /((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i, 30860 /(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i, 30861 /sec-((sgh\w+))/i 30862 ], 30863 [ 30864 [VENDOR, "Samsung"], 30865 MODEL, 30866 [TYPE, MOBILE] 30867 ], 30868 [/sie-(\w*)/i], 30869 [ 30870 MODEL, 30871 [VENDOR, "Siemens"], 30872 [TYPE, MOBILE] 30873 ], 30874 [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]*)/i], 30875 [ 30876 [VENDOR, "Nokia"], 30877 MODEL, 30878 [TYPE, MOBILE] 30879 ], 30880 [/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i], 30881 [ 30882 MODEL, 30883 [VENDOR, "Acer"], 30884 [TYPE, TABLET] 30885 ], 30886 [/android.+([vl]k\-?\d{3})\s+build/i], 30887 [ 30888 MODEL, 30889 [VENDOR, "LG"], 30890 [TYPE, TABLET] 30891 ], 30892 [/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i], 30893 [ 30894 [VENDOR, "LG"], 30895 MODEL, 30896 [TYPE, TABLET] 30897 ], 30898 [/linux;\snetcast.+smarttv/i, /lg\snetcast\.tv-201\d/i], 30899 [ 30900 [VENDOR, "LG"], 30901 MODEL, 30902 [TYPE, SMARTTV] 30903 ], 30904 [ 30905 /(nexus\s[45])/i, 30906 /lg[e;\s\/-]+(\w*)/i, 30907 /android.+lg(\-?[\d\w]+)\s+build/i 30908 ], 30909 [ 30910 MODEL, 30911 [VENDOR, "LG"], 30912 [TYPE, MOBILE] 30913 ], 30914 [/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i], 30915 [ 30916 VENDOR, 30917 MODEL, 30918 [TYPE, TABLET] 30919 ], 30920 [/android.+(ideatab[a-z0-9\-\s]+)/i], 30921 [ 30922 MODEL, 30923 [VENDOR, "Lenovo"], 30924 [TYPE, TABLET] 30925 ], 30926 [/(lenovo)[_\s-]?([\w-]+)/i], 30927 [ 30928 VENDOR, 30929 MODEL, 30930 [TYPE, MOBILE] 30931 ], 30932 [/linux;.+((jolla));/i], 30933 [ 30934 VENDOR, 30935 MODEL, 30936 [TYPE, MOBILE] 30937 ], 30938 [/((pebble))app\/[\d\.]+\s/i], 30939 [ 30940 VENDOR, 30941 MODEL, 30942 [TYPE, WEARABLE] 30943 ], 30944 [/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i], 30945 [ 30946 VENDOR, 30947 MODEL, 30948 [TYPE, MOBILE] 30949 ], 30950 [/crkey/i], 30951 [ 30952 [MODEL, "Chromecast"], 30953 [VENDOR, "Google"], 30954 [TYPE, SMARTTV] 30955 ], 30956 [/android.+;\s(glass)\s\d/i], 30957 [ 30958 MODEL, 30959 [VENDOR, "Google"], 30960 [TYPE, WEARABLE] 30961 ], 30962 [/android.+;\s(pixel c)[\s)]/i], 30963 [ 30964 MODEL, 30965 [VENDOR, "Google"], 30966 [TYPE, TABLET] 30967 ], 30968 [/android.+;\s(pixel( [2-9]a?)?( xl)?)[\s)]/i], 30969 [ 30970 MODEL, 30971 [VENDOR, "Google"], 30972 [TYPE, MOBILE] 30973 ], 30974 [ 30975 /android.+;\s(\w+)\s+build\/hm\1/i, 30976 /android.+(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i, 30977 /android.+(redmi[\s\-_]?(?:note|k)?(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i, 30978 /android.+(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i 30979 ], 30980 [ 30981 [ 30982 MODEL, 30983 /_/g, 30984 " " 30985 ], 30986 [VENDOR, "Xiaomi"], 30987 [TYPE, MOBILE] 30988 ], 30989 [/android.+(mi[\s\-_]?(?:pad)(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i], 30990 [ 30991 [ 30992 MODEL, 30993 /_/g, 30994 " " 30995 ], 30996 [VENDOR, "Xiaomi"], 30997 [TYPE, TABLET] 30998 ], 30999 [/android.+;\s(m[1-5]\snote)\sbuild/i], 31000 [ 31001 MODEL, 31002 [VENDOR, "Meizu"], 31003 [TYPE, MOBILE] 31004 ], 31005 [/(mz)-([\w-]{2,})/i], 31006 [ 31007 [VENDOR, "Meizu"], 31008 MODEL, 31009 [TYPE, MOBILE] 31010 ], 31011 [/android.+a000(1)\s+build/i, /android.+oneplus\s(a\d{4})[\s)]/i], 31012 [ 31013 MODEL, 31014 [VENDOR, "OnePlus"], 31015 [TYPE, MOBILE] 31016 ], 31017 [/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i], 31018 [ 31019 MODEL, 31020 [VENDOR, "RCA"], 31021 [TYPE, TABLET] 31022 ], 31023 [/android.+[;\/\s](Venue[\d\s]{2,7})\s+build/i], 31024 [ 31025 MODEL, 31026 [VENDOR, "Dell"], 31027 [TYPE, TABLET] 31028 ], 31029 [/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i], 31030 [ 31031 MODEL, 31032 [VENDOR, "Verizon"], 31033 [TYPE, TABLET] 31034 ], 31035 [/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(\S(?:.*\S)?)\s+build/i], 31036 [ 31037 [VENDOR, "Barnes & Noble"], 31038 MODEL, 31039 [TYPE, TABLET] 31040 ], 31041 [/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i], 31042 [ 31043 MODEL, 31044 [VENDOR, "NuVision"], 31045 [TYPE, TABLET] 31046 ], 31047 [/android.+;\s(k88)\sbuild/i], 31048 [ 31049 MODEL, 31050 [VENDOR, "ZTE"], 31051 [TYPE, TABLET] 31052 ], 31053 [/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i], 31054 [ 31055 MODEL, 31056 [VENDOR, "Swiss"], 31057 [TYPE, MOBILE] 31058 ], 31059 [/android.+[;\/]\s*(zur\d{3})\s+build/i], 31060 [ 31061 MODEL, 31062 [VENDOR, "Swiss"], 31063 [TYPE, TABLET] 31064 ], 31065 [/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i], 31066 [ 31067 MODEL, 31068 [VENDOR, "Zeki"], 31069 [TYPE, TABLET] 31070 ], 31071 [/(android).+[;\/]\s+([YR]\d{2})\s+build/i, /android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i], 31072 [ 31073 [VENDOR, "Dragon Touch"], 31074 MODEL, 31075 [TYPE, TABLET] 31076 ], 31077 [/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i], 31078 [ 31079 MODEL, 31080 [VENDOR, "Insignia"], 31081 [TYPE, TABLET] 31082 ], 31083 [/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i], 31084 [ 31085 MODEL, 31086 [VENDOR, "NextBook"], 31087 [TYPE, TABLET] 31088 ], 31089 [/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i], 31090 [ 31091 [VENDOR, "Voice"], 31092 MODEL, 31093 [TYPE, MOBILE] 31094 ], 31095 [/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i], 31096 [ 31097 [VENDOR, "LvTel"], 31098 MODEL, 31099 [TYPE, MOBILE] 31100 ], 31101 [/android.+;\s(PH-1)\s/i], 31102 [ 31103 MODEL, 31104 [VENDOR, "Essential"], 31105 [TYPE, MOBILE] 31106 ], 31107 [/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i], 31108 [ 31109 MODEL, 31110 [VENDOR, "Envizen"], 31111 [TYPE, TABLET] 31112 ], 31113 [/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i], 31114 [ 31115 VENDOR, 31116 MODEL, 31117 [TYPE, TABLET] 31118 ], 31119 [/android.+[;\/]\s*(Trio[\s\w\-\.]+)\s+build/i], 31120 [ 31121 MODEL, 31122 [VENDOR, "MachSpeed"], 31123 [TYPE, TABLET] 31124 ], 31125 [/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i], 31126 [ 31127 VENDOR, 31128 MODEL, 31129 [TYPE, TABLET] 31130 ], 31131 [/android.+[;\/]\s*TU_(1491)\s+build/i], 31132 [ 31133 MODEL, 31134 [VENDOR, "Rotor"], 31135 [TYPE, TABLET] 31136 ], 31137 [/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i], 31138 [ 31139 VENDOR, 31140 MODEL, 31141 [TYPE, TABLET] 31142 ], 31143 [/android .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i], 31144 [MODEL, [TYPE, MOBILE]], 31145 [/android .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i], 31146 [MODEL, [TYPE, TABLET]], 31147 [/\s(tablet|tab)[;\/]/i, /\s(mobile)(?:[;\/]|\ssafari)/i], 31148 [ 31149 [TYPE, util.lowerize], 31150 VENDOR, 31151 MODEL 31152 ], 31153 [/[\s\/\(](smart-?tv)[;\)]/i], 31154 [[TYPE, SMARTTV]], 31155 [/(android[\w\.\s\-]{0,9});.+build/i], 31156 [MODEL, [VENDOR, "Generic"]], 31157 [/(phone)/i], 31158 [[TYPE, MOBILE]] 31159 ], 31160 engine: [ 31161 [/windows.+\sedge\/([\w\.]+)/i], 31162 [VERSION, [NAME, "EdgeHTML"]], 31163 [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], 31164 [VERSION, [NAME, "Blink"]], 31165 [ 31166 /(presto)\/([\w\.]+)/i, 31167 /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, 31168 /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, 31169 /(icab)[\/\s]([23]\.[\d\.]+)/i 31170 ], 31171 [NAME, VERSION], 31172 [/rv\:([\w\.]{1,9}).+(gecko)/i], 31173 [VERSION, NAME] 31174 ], 31175 os: [ 31176 [/(xbox);\s+xbox\s([^\);]+)/i, /microsoft\s(windows)\s(vista|xp)/i], 31177 [NAME, VERSION], 31178 [ 31179 /(windows)\snt\s6\.2;\s(arm)/i, 31180 /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, 31181 /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i 31182 ], 31183 [NAME, [ 31184 VERSION, 31185 mapper.str, 31186 maps.os.windows.version 31187 ]], 31188 [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], 31189 [[NAME, "Windows"], [ 31190 VERSION, 31191 mapper.str, 31192 maps.os.windows.version 31193 ]], 31194 [/\((bb)(10);/i], 31195 [[NAME, "BlackBerry"], VERSION], 31196 [
31197 /(blackberry)\w*\/?([\w\.]*)/i, 31198 /(tizen|kaios)[\/\s]([\w\.]+)/i, 31199 /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i 31200 ], 31201 [NAME, VERSION], 31202 [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i], 31203 [[NAME, "Symbian"], VERSION], 31204 [/\((series40);/i], 31205 [NAME], 31206 [/mozilla.+\(mobile;.+gecko.+firefox/i], 31207 [[NAME, "Firefox OS"], VERSION], 31208 [/crkey\/([\d\.]+)/i], 31209 [VERSION, [NAME, "Chromecast"]], 31210 [ 31211 /(nintendo|playstation)\s([wids34portablevu]+)/i, 31212 /(mint)[\/\s\(]?(\w*)/i, 31213 /(mageia|vectorlinux)[;\s]/i, 31214 /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i, 31215 /(hurd|linux)\s?([\w\.]*)/i, 31216 /(gnu)\s?([\w\.]*)/i 31217 ], 31218 [NAME, VERSION], 31219 [/(cros)\s[\w]+\s([\w\.]+\w)/i], 31220 [[NAME, "Chromium OS"], VERSION], 31221 [/(sunos)\s?([\w\.\d]*)/i], 31222 [[NAME, "Solaris"], VERSION], 31223 [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i], 31224 [NAME, VERSION], 31225 [/(haiku)\s(\w+)/i], 31226 [NAME, VERSION], 31227 [/cfnetwork\/.+darwin/i, /ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i], 31228 [[ 31229 VERSION, 31230 /_/g, 31231 "." 31232 ], [NAME, "iOS"]], 31233 [/(mac\sos\sx)\s?([\w\s\.]*)/i, /(macintosh|mac(?=_powerpc)\s)/i], 31234 [[NAME, "Mac OS"], [ 31235 VERSION, 31236 /_/g, 31237 "." 31238 ]], 31239 [ 31240 /((?:open)?solaris)[\/\s-]?([\w\.]*)/i, 31241 /(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, 31242 /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i, 31243 /(unix)\s?([\w\.]*)/i 31244 ], 31245 [NAME, VERSION] 31246 ] 31247 }; 31248 var UAParser = function(uastring, extensions) { 31249 if (typeof uastring === "object") { 31250 extensions = uastring; 31251 uastring = undefined; 31252 } 31253 if (!(this instanceof UAParser)) return new UAParser(uastring, extensions).getResult(); 31254 var ua = uastring || (window && window.navigator && window.navigator.userAgent ? window.navigator.userAgent : EMPTY); 31255 var rgxmap = extensions ? util.extend(regexes, extensions) : regexes; 31256 this.getBrowser = function() { 31257 var browser = { 31258 name: undefined, 31259 version: undefined 31260 }; 31261 mapper.rgx.call(browser, ua, rgxmap.browser); 31262 browser.major = util.major(browser.version); 31263 return browser; 31264 }; 31265 this.getCPU = function() { 31266 var cpu = { architecture: undefined }; 31267 mapper.rgx.call(cpu, ua, rgxmap.cpu); 31268 return cpu; 31269 }; 31270 this.getDevice = function() { 31271 var device = { 31272 vendor: undefined, 31273 model: undefined, 31274 type: undefined 31275 }; 31276 mapper.rgx.call(device, ua, rgxmap.device); 31277 return device; 31278 }; 31279 this.getEngine = function() { 31280 var engine = { 31281 name: undefined, 31282 version: undefined 31283 }; 31284 mapper.rgx.call(engine, ua, rgxmap.engine); 31285 return engine; 31286 }; 31287 this.getOS = function() { 31288 var os = { 31289 name: undefined, 31290 version: undefined 31291 }; 31292 mapper.rgx.call(os, ua, rgxmap.os); 31293 return os; 31294 }; 31295 this.getResult = function() { 31296 return { 31297 ua: this.getUA(), 31298 browser: this.getBrowser(), 31299 engine: this.getEngine(), 31300 os: this.getOS(), 31301 device: this.getDevice(), 31302 cpu: this.getCPU() 31303 }; 31304 }; 31305 this.getUA = function() { 31306 return ua; 31307 }; 31308 this.setUA = function(uastring) { 31309 ua = uastring; 31310 return this; 31311 }; 31312 return this; 31313 }; 31314 UAParser.VERSION = LIBVERSION; 31315 UAParser.BROWSER = { 31316 NAME, 31317 MAJOR, 31318 VERSION 31319 }; 31320 UAParser.CPU = { ARCHITECTURE }; 31321 UAParser.DEVICE = { 31322 MODEL, 31323 VENDOR, 31324 TYPE, 31325 CONSOLE, 31326 MOBILE, 31327 SMARTTV, 31328 TABLET, 31329 WEARABLE, 31330 EMBEDDED 31331 }; 31332 UAParser.ENGINE = { 31333 NAME, 31334 VERSION 31335 }; 31336 UAParser.OS = { 31337 NAME, 31338 VERSION 31339 }; 31340 if (typeof exports !== UNDEF_TYPE) { 31341 if (typeof module !== UNDEF_TYPE && module.exports) exports = module.exports = UAParser; 31342 exports.UAParser = UAParser; 31343 } else if (typeof define === "function" && define.amd) define(function() { 31344 return UAParser; 31345 }); 31346 else if (window) window.UAParser = UAParser; 31347 var $ = window && (window.jQuery || window.Zepto); 31348 if ($ && !$.ua) { 31349 var parser = new UAParser(); 31350 $.ua = parser.getResult(); 31351 $.ua.get = function() { 31352 return parser.getUA(); 31353 }; 31354 $.ua.set = function(uastring) { 31355 parser.setUA(uastring); 31356 var result = parser.getResult(); 31357 for (var prop in result) $.ua[prop] = result[prop]; 31358 }; 31359 } 31360 })(typeof window === "object" ? window : exports); 31361})); 31362//#endregion 31363//#region node_modules/history/PathUtils.js 31364var require_PathUtils = /* @__PURE__ */ __commonJSMin(((exports) => { 31365 exports.__esModule = true; 31366 exports.addLeadingSlash = function addLeadingSlash(path) { 31367 return path.charAt(0) === "/" ? path : "/" + path; 31368 }; 31369 exports.stripLeadingSlash = function stripLeadingSlash(path) { 31370 return path.charAt(0) === "/" ? path.substr(1) : path; 31371 }; 31372 var hasBasename = exports.hasBasename = function hasBasename(path, prefix) { 31373 return new RegExp("^" + prefix + "(\\/|\\?|#|$)", "i").test(path); 31374 }; 31375 exports.stripBasename = function stripBasename(path, prefix) { 31376 return hasBasename(path, prefix) ? path.substr(prefix.length) : path; 31377 }; 31378 exports.stripTrailingSlash = function stripTrailingSlash(path) { 31379 return path.charAt(path.length - 1) === "/" ? path.slice(0, -1) : path; 31380 }; 31381 exports.parsePath = function parsePath(path) { 31382 var pathname = path || "/"; 31383 var search = ""; 31384 var hash = ""; 31385 var hashIndex = pathname.indexOf("#"); 31386 if (hashIndex !== -1) { 31387 hash = pathname.substr(hashIndex); 31388 pathname = pathname.substr(0, hashIndex); 31389 } 31390 var searchIndex = pathname.indexOf("?"); 31391 if (searchIndex !== -1) { 31392 search = pathname.substr(searchIndex); 31393 pathname = pathname.substr(0, searchIndex); 31394 } 31395 return { 31396 pathname, 31397 search: search === "?" ? "" : search, 31398 hash: hash === "#" ? "" : hash 31399 }; 31400 }; 31401 exports.createPath = function createPath(location) { 31402 var pathname = location.pathname, search = location.search, hash = location.hash; 31403 var path = pathname || "/"; 31404 if (search && search !== "?") path += search.charAt(0) === "?" ? search : "?" + search; 31405 if (hash && hash !== "#") path += hash.charAt(0) === "#" ? hash : "#" + hash; 31406 return path; 31407 }; 31408})); 31409//#endregion 31410//#region node_modules/history/LocationUtils.js 31411var require_LocationUtils = /* @__PURE__ */ __commonJSMin(((exports) => { 31412 exports.__esModule = true; 31413 exports.locationsAreEqual = exports.createLocation = void 0; 31414 var _extends = Object.assign || function(target) { 31415 for (var i = 1; i < arguments.length; i++) { 31416 var source = arguments[i]; 31417 for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; 31418 } 31419 return target; 31420 }; 31421 var _resolvePathname2 = _interopRequireDefault((init_resolve_pathname(), __toCommonJS(resolve_pathname_exports
31421))); 31422 var _valueEqual2 = _interopRequireDefault((init_value_equal(), __toCommonJS(value_equal_exports))); 31423 var _PathUtils = require_PathUtils(); 31424 function _interopRequireDefault(obj) { 31425 return obj && obj.__esModule ? obj : { default: obj }; 31426 } 31427 exports.createLocation = function createLocation(path, state, key, currentLocation) { 31428 var location = void 0; 31429 if (typeof path === "string") { 31430 location = (0, _PathUtils.parsePath)(path); 31431 location.state = state; 31432 } else { 31433 location = _extends({}, path); 31434 if (location.pathname === void 0) location.pathname = ""; 31435 if (location.search) { 31436 if (location.search.charAt(0) !== "?") location.search = "?" + location.search; 31437 } else location.search = ""; 31438 if (location.hash) { 31439 if (location.hash.charAt(0) !== "#") location.hash = "#" + location.hash; 31440 } else location.hash = ""; 31441 if (state !== void 0 && location.state === void 0) location.state = state; 31442 } 31443 try { 31444 location.pathname = decodeURI(location.pathname); 31445 } catch (e) { 31446 if (e instanceof URIError) throw new URIError("Pathname \"" + location.pathname + "\" could not be decoded. This is likely caused by an invalid percent-encoding."); 31447 else throw e; 31448 } 31449 if (key) location.key = key; 31450 if (currentLocation) { 31451 if (!location.pathname) location.pathname = currentLocation.pathname; 31452 else if (location.pathname.charAt(0) !== "/") location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname); 31453 } else if (!location.pathname) location.pathname = "/"; 31454 return location; 31455 }; 31456 exports.locationsAreEqual = function locationsAreEqual(a, b) { 31457 return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state); 31458 }; 31459})); 31460//#endregion 31461//#region node_modules/history/createTransitionManager.js 31462var require_createTransitionManager = /* @__PURE__ */ __commonJSMin(((exports) => { 31463 exports.__esModule = true; 31464 var _warning2 = _interopRequireDefault(require_browser$14()); 31465 function _interopRequireDefault(obj) { 31466 return obj && obj.__esModule ? obj : { default: obj }; 31467 } 31468 exports.default = function createTransitionManager() { 31469 var prompt = null; 31470 var setPrompt = function setPrompt(nextPrompt) { 31471 (0, _warning2.default)(prompt == null, "A history supports only one prompt at a time"); 31472 prompt = nextPrompt; 31473 return function() { 31474 if (prompt === nextPrompt) prompt = null; 31475 }; 31476 }; 31477 var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) { 31478 if (prompt != null) { 31479 var result = typeof prompt === "function" ? prompt(location, action) : prompt; 31480 if (typeof result === "string") if (typeof getUserConfirmation === "function") getUserConfirmation(result, callback); 31481 else { 31482 (0, _warning2.default)(false, "A history needs a getUserConfirmation function in order to use a prompt message"); 31483 callback(true); 31484 } 31485 else callback(result !== false); 31486 } else callback(true); 31487 }; 31488 var listeners = []; 31489 return { 31490 setPrompt, 31491 confirmTransitionTo, 31492 appendListener: function appendListener(fn) { 31493 var isActive = true; 31494 var listener = function listener() { 31495 if (isActive) fn.apply(void 0, arguments); 31496 }; 31497 listeners.push(listener); 31498 return function() { 31499 isActive = false; 31500 listeners = listeners.filter(function(item) { 31501 return item !== listener; 31502 }); 31503 }; 31504 }, 31505 notifyListeners: function notifyListeners() { 31506 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; 31507 listeners.forEach(function(listener) { 31508 return listener.apply(void 0, args); 31509 }); 31510 } 31511 }; 31512 }; 31513})); 31514//#endregion 31515//#region node_modules/history/DOMUtils.js 31516var require_DOMUtils = /* @__PURE__ */ __commonJSMin(((exports) => { 31517 exports.__esModule = true; 31518 exports.canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); 31519 exports.addEventListener = function addEventListener(node, event, listener) { 31520 return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent("on" + event, listener); 31521 }; 31522 exports.removeEventListener = function removeEventListener(node, event, listener) { 31523 return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent("on" + event, listener); 31524 }; 31525 exports.getConfirmation = function getConfirmation(message, callback) { 31526 return callback(window.confirm(message)); 31527 }; 31528 exports.supportsHistory = function supportsHistory() { 31529 var ua = window.navigator.userAgent; 31530 if ((ua.indexOf("Android 2.") !== -1 || ua.indexOf("Android 4.0") !== -1) && ua.indexOf("Mobile Safari") !== -1 && ua.indexOf("Chrome") === -1 && ua.indexOf("Windows Phone") === -1) return false;
31531 return window.history && "pushState" in window.history; 31532 }; 31533 exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() { 31534 return window.navigator.userAgent.indexOf("Trident") === -1; 31535 }; 31536 exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() { 31537 return window.navigator.userAgent.indexOf("Firefox") === -1; 31538 }; 31539 exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { 31540 return event.state === void 0 && navigator.userAgent.indexOf("CriOS") === -1; 31541 }; 31542})); 31543//#endregion 31544//#region node_modules/history/createBrowserHistory.js 31545var require_createBrowserHistory = /* @__PURE__ */ __commonJSMin(((exports) => { 31546 exports.__esModule = true; 31547 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 31548 return typeof obj; 31549 } : function(obj) { 31550 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 31551 }; 31552 var _extends = Object.assign || function(target) { 31553 for (var i = 1; i < arguments.length; i++) { 31554 var source = arguments[i]; 31555 for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; 31556 } 31557 return target; 31558 }; 31559 var _warning2 = _interopRequireDefault(require_browser$14()); 31560 var _invariant2 = _interopRequireDefault(require_browser$13()); 31561 var _LocationUtils = require_LocationUtils(); 31562 var _PathUtils = require_PathUtils(); 31563 var _createTransitionManager2 = _interopRequireDefault(require_createTransitionManager()); 31564 var _DOMUtils = require_DOMUtils(); 31565 function _interopRequireDefault(obj) { 31566 return obj && obj.__esModule ? obj : { default: obj }; 31567 } 31568 var PopStateEvent = "popstate"; 31569 var HashChangeEvent = "hashchange"; 31570 var getHistoryState = function getHistoryState() { 31571 try { 31572 return window.history.state || {}; 31573 } catch (e) { 31574 return {}; 31575 } 31576 }; 31577 exports.default = function createBrowserHistory() { 31578 var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 31579 (0, _invariant2.default)(_DOMUtils.canUseDOM, "Browser history needs a DOM"); 31580 var globalHistory = window.history; 31581 var canUseHistory = (0, _DOMUtils.supportsHistory)(); 31582 var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)(); 31583 var _props$forceRefresh = props.forceRefresh, forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, _props$getUserConfirm = props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? _DOMUtils.getConfirmation : _props$getUserConfirm, _props$keyLength = props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; 31584 var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ""; 31585 var getDOMLocation = function getDOMLocation(historyState) { 31586 var _ref = historyState || {}, key = _ref.key, state = _ref.state; 31587 var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash; 31588 var path = pathname + search + hash; 31589 (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), "You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path \"" + path + "\" to begin with \"" + basename + "\"."); 31590 if (basename) path = (0, _PathUtils.stripBasename)(path, basename); 31591 return (0, _LocationUtils.createLocation)(path, state, key); 31592 }; 31593 var createKey = function createKey() { 31594 return Math.random().toString(36).substr(2, keyLength); 31595 }; 31596 var transitionManager = (0, _createTransitionManager2.default)(); 31597 var setState = function setState(nextState) { 31598 _extends(history, nextState); 31599 history.length = globalHistory.length; 31600 transitionManager.notifyListeners(history.location, history.action); 31601 }; 31602 var handlePopState = function handlePopState(event) { 31603 if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return; 31604 handlePop(getDOMLocation(event.state)); 31605 }; 31606 var handleHashChange = function handleHashChange() { 31607 handlePop(getDOMLocation(getHistoryState())); 31608 }; 31609 var forceNextPop = false;
31610 var handlePop = function handlePop(location) { 31611 if (forceNextPop) { 31612 forceNextPop = false; 31613 setState(); 31614 } else { 31615 var action = "POP"; 31616 transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function(ok) { 31617 if (ok) setState({ 31618 action, 31619 location 31620 }); 31621 else revertPop(location); 31622 }); 31623 } 31624 }; 31625 var revertPop = function revertPop(fromLocation) { 31626 var toLocation = history.location; 31627 var toIndex = allKeys.indexOf(toLocation.key); 31628 if (toIndex === -1) toIndex = 0; 31629 var fromIndex = allKeys.indexOf(fromLocation.key); 31630 if (fromIndex === -1) fromIndex = 0; 31631 var delta = toIndex - fromIndex; 31632 if (delta) { 31633 forceNextPop = true; 31634 go(delta); 31635 } 31636 }; 31637 var initialLocation = getDOMLocation(getHistoryState()); 31638 var allKeys = [initialLocation.key]; 31639 var createHref = function createHref(location) { 31640 return basename + (0, _PathUtils.createPath)(location); 31641 }; 31642 var push = function push(path, state) { 31643 (0, _warning2.default)(!((typeof path === "undefined" ? "undefined" : _typeof(path)) === "object" && path.state !== void 0 && state !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored"); 31644 var action = "PUSH"; 31645 var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); 31646 transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function(ok) { 31647 if (!ok) return; 31648 var href = createHref(location); 31649 var key = location.key, state = location.state; 31650 if (canUseHistory) { 31651 globalHistory.pushState({ 31652 key, 31653 state 31654 }, null, href); 31655 if (forceRefresh) window.location.href = href; 31656 else { 31657 var prevIndex = allKeys.indexOf(history.location.key); 31658 var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); 31659 nextKeys.push(location.key); 31660 allKeys = nextKeys; 31661 setState({ 31662 action, 31663 location 31664 }); 31665 } 31666 } else { 31667 (0, _warning2.default)(state === void 0, "Browser history cannot push state in browsers that do not support HTML5 history"); 31668 window.location.href = href; 31669 } 31670 }); 31671 }; 31672 var replace = function replace(path, state) { 31673 (0, _warning2.default)(!((typeof path === "undefined" ? "undefined" : _typeof(path)) === "object" && path.state !== void 0 && state !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored"); 31674 var action = "REPLACE"; 31675 var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); 31676 transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function(ok) { 31677 if (!ok) return; 31678 var href = createHref(location); 31679 var key = location.key, state = location.state; 31680 if (canUseHistory) { 31681 globalHistory.replaceState({ 31682 key, 31683 state 31684 }, null, href); 31685 if (forceRefresh) window.location.replace(href); 31686 else { 31687 var prevIndex = allKeys.indexOf(history.location.key); 31688 if (prevIndex !== -1) allKeys[prevIndex] = location.key; 31689 setState({ 31690 action, 31691 location 31692 }); 31693 } 31694 } else { 31695 (0, _warning2.default)(state === void 0, "Browser history cannot replace state in browsers that do not support HTML5 history"); 31696 window.location.replace(href); 31697 } 31698 }); 31699 }; 31700 var go = function go(n) { 31701 globalHistory.go(n); 31702 }; 31703 var goBack = function goBack() { 31704 return go(-1); 31705 }; 31706 var goForward = function goForward() { 31707 return go(1); 31708 }; 31709 var listenerCount = 0; 31710 var checkDOMListeners = function checkDOMListeners(delta) { 31711 listenerCount += delta; 31712 if (listenerCount === 1) { 31713 (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState); 31714 if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); 31715 } else if (listenerCount === 0) { 31716 (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState); 31717 if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); 31718 } 31719 }; 31720 var isBlocked = false;
31721 var history = { 31722 length: globalHistory.length, 31723 action: "POP", 31724 location: initialLocation, 31725 createHref, 31726 push, 31727 replace, 31728 go, 31729 goBack, 31730 goForward, 31731 block: function block() { 31732 var prompt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; 31733 var unblock = transitionManager.setPrompt(prompt); 31734 if (!isBlocked) { 31735 checkDOMListeners(1); 31736 isBlocked = true; 31737 } 31738 return function() { 31739 if (isBlocked) { 31740 isBlocked = false; 31741 checkDOMListeners(-1); 31742 } 31743 return unblock(); 31744 }; 31745 }, 31746 listen: function listen(listener) { 31747 var unlisten = transitionManager.appendListener(listener); 31748 checkDOMListeners(1); 31749 return function() { 31750 checkDOMListeners(-1); 31751 unlisten(); 31752 }; 31753 } 31754 }; 31755 return history; 31756 }; 31757})); 31758//#endregion 31759//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/authServiceInterface.js 31760var require_authServiceInterface = /* @__PURE__ */ __commonJSMin(((exports) => { 31761 Object.defineProperty(exports, "__esModule", { value: true }); 31762})); 31763//#endregion 31764//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/utils.js 31765var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { 31766 Object.defineProperty(exports, "__esModule", { value: true }); 31767 exports.normalizeUsername = normalizeUsername; 31768 function normalizeUsername(userName) { 31769 return userName === null || userName === void 0 ? void 0 : userName.trim().toLowerCase(); 31770 } 31771})); 31772//#endregion 31773//#region node_modules/auth0-js/dist/auth0.min.esm.js 31774var auth0_min_esm_exports = /* @__PURE__ */ __exportAll({ 31775 Authentication: () => Authentication, 31776 Management: () => Management, 31777 WebAuth: () => WebAuth, 31778 default: () => index, 31779 version: () => version 31780}); 31781function createCommonjsModule(fn, module) { 31782 return fn(module = { exports: {} }, module.exports), module.exports; 31783} 31784function addNumericSeparator(num, str) { 31785 if (num === Infinity || num === -Infinity || num != num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) return str; 31786 var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; 31787 if ("number" == typeof num) { 31788 var int = num < 0 ? -$floor$1(-num) : $floor$1(num); 31789 if (int !== num) { 31790 var intStr = String(int), dec = $slice.call(str, intStr.length + 1); 31791 return $replace$1.call(intStr, sepRegex, "$&_") + "." + $replace$1.call($replace$1.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); 31792 } 31793 } 31794 return $replace$1.call(str, sepRegex, "$&_"); 31795} 31796function wrapQuotes(s, defaultStyle, opts) { 31797 var quoteChar = "double" === (opts.quoteStyle || defaultStyle) ? "\"" : "'"; 31798 return quoteChar + s + quoteChar; 31799} 31800function quote(s) { 31801 return $replace$1.call(String(s), /"/g, """); 31802} 31803function isArray(obj) { 31804 return !("[object Array]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 31805} 31806function isRegExp(obj) { 31807 return !("[object RegExp]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 31808} 31809function isSymbol(obj) { 31810 if (hasShammedSymbols) return obj && "object" == typeof obj && obj instanceof Symbol; 31811 if ("symbol" == typeof obj) return !0; 31812 if (!obj || "object" != typeof obj || !symToString) return !1; 31813 try { 31814 return symToString.call(obj), !0; 31815 } catch (e) {} 31816 return !1; 31817} 31818function has(obj, key) { 31819 return hasOwn.call(obj, key); 31820} 31821function toStr$1(obj) { 31822 return objectToString.call(obj); 31823} 31824function indexOf(xs, x) { 31825 if (xs.indexOf) return xs.indexOf(x); 31826 for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i; 31827 return -1; 31828} 31829function lowbyte(c) { 31830 var n = c.charCodeAt(0), x = { 31831 8: "b", 31832 9: "t", 31833 10: "n", 31834 12: "f", 31835 13: "r" 31836 }[n]; 31837 return x ? "\\" + x : "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16)); 31838} 31839function markBoxed(str) { 31840 return "Object(" + str + ")"; 31841} 31842function weakCollectionOf(type) { 31843 return type + " { ? }"; 31844} 31845function collectionOf(type, size, entries, indent) { 31846 return type + " (" + size + ") {" + (indent ? indentedJoin(entries, indent) : $join.call(entries, ", ")) + "}"; 31847} 31848function indentedJoin(xs, indent) { 31849 if (0 === xs.length) return ""; 31850 var lineJoiner = "\n" + indent.prev + indent.base; 31851 return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev; 31852} 31853function arrObjKeys(obj, inspect) { 31854 var isArr = isArray(obj), xs = []; 31855 if (isArr) { 31856 xs.length = obj.length; 31857 for (var i = 0; i < obj.length; i++) xs[i] = has(obj, i) ? inspect(obj[i], obj) : ""; 31858 } 31859 var symMap, syms = "function" == typeof gOPS ? gOPS(obj) : []; 31860 if (hasShammedSymbols) { 31861 symMap = {}; 31862 for (var k = 0; k < syms.length; k++) symMap["$" + syms[k]] = syms[k]; 31863 } 31864 for (var key in obj) has(obj, key) && (isArr && String(Number(key)) === key && key < obj.length || hasShammedSymbols && symMap["$" + key] instanceof Symbol || ($test.call(/[^\w$]/, key) ? xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj)) : xs.push(key + ": " + inspect(obj[key], obj)))); 31865 if ("function" == typeof gOPS) for (var j = 0; j < syms.length; j++) isEnumerable.call(obj, syms[j]) && xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj)); 31866 return xs; 31867} 31868function defaultOptions() { 31869 return { 31870 depthLimit: Number.MAX_SAFE_INTEGER, 31871 edgesLimit: Number.MAX_SAFE_INTEGER 31872 }; 31873} 31874function stringify$1(obj, replacer, spacer, options) { 31875 var res; 31876 void 0 === options && (options = defaultOptions()), function decirc(val, k, edgeIndex, stack, parent, depth, options) { 31877 var i; 31878 if (depth += 1, "object" == typeof val && null !== val) { 31879 for (i = 0; i < stack.length; i++) if (stack[i] === val) return void setReplace("[Circular]", val, k, parent); 31880 if (void 0 !== options.depthLimit && depth > options.depthLimit) return void setReplace("[...]", val, k, parent); 31881 if (void 0 !== options.edgesLimit && edgeIndex + 1 > options.edgesLimit) return void setReplace("[...]", val, k, parent); 31882 if (stack.push(val), Array.isArray(val)) for (i = 0; i < val.length;
31882 i++) decirc(val[i], i, i, stack, val, depth, options); 31883 else { 31884 var keys = Object.keys(val); 31885 for (i = 0; i < keys.length; i++) { 31886 var key = keys[i]; 31887 decirc(val[key], key, i, stack, val, depth, options); 31888 } 31889 } 31890 stack.pop(); 31891 } 31892 }(obj, "", 0, [], void 0, 0, options); 31893 try { 31894 res = 0 === replacerStack.length ? JSON.stringify(obj, replacer, spacer) : JSON.stringify(obj, replaceGetterValues(replacer), spacer); 31895 } catch (_) { 31896 return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]"); 31897 } finally { 31898 for (; 0 !== arr.length;) { 31899 var part = arr.pop(); 31900 4 === part.length ? Object.defineProperty(part[0], part[1], part[3]) : part[0][part[1]] = part[2]; 31901 } 31902 } 31903 return res; 31904} 31905function setReplace(replace, val, k, parent) { 31906 var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k); 31907 void 0 !== propertyDescriptor.get ? propertyDescriptor.configurable ? (Object.defineProperty(parent, k, { value: replace }), arr.push([ 31908 parent, 31909 k, 31910 val, 31911 propertyDescriptor 31912 ])) : replacerStack.push([ 31913 val, 31914 k, 31915 replace 31916 ]) : (parent[k] = replace, arr.push([ 31917 parent, 31918 k, 31919 val 31920 ])); 31921} 31922function compareFunction(a, b) { 31923 return a < b ? -1 : a > b ? 1 : 0; 31924} 31925function deterministicStringify(obj, replacer, spacer, options) { 31926 void 0 === options && (options = defaultOptions()); 31927 var res, tmp = function deterministicDecirc(val, k, edgeIndex, stack, parent, depth, options) { 31928 var i; 31929 if (depth += 1, "object" == typeof val && null !== val) { 31930 for (i = 0; i < stack.length; i++) if (stack[i] === val) return void setReplace("[Circular]", val, k, parent); 31931 try { 31932 if ("function" == typeof val.toJSON) return; 31933 } catch (_) { 31934 return; 31935 } 31936 if (void 0 !== options.depthLimit && depth > options.depthLimit) return void setReplace("[...]", val, k, parent); 31937 if (void 0 !== options.edgesLimit && edgeIndex + 1 > options.edgesLimit) return void setReplace("[...]", val, k, parent); 31938 if (stack.push(val), Array.isArray(val)) for (i = 0; i < val.length; i++) deterministicDecirc(val[i], i, i, stack, val, depth, options); 31939 else { 31940 var tmp = {}, keys = Object.keys(val).sort(compareFunction); 31941 for (i = 0; i < keys.length; i++) { 31942 var key = keys[i]; 31943 deterministicDecirc(val[key], key, i, stack, val, depth, options), tmp[key] = val[key]; 31944 } 31945 if (void 0 === parent) return tmp; 31946 arr.push([ 31947 parent, 31948 k, 31949 val 31950 ]), parent[k] = tmp; 31951 } 31952 stack.pop(); 31953 } 31954 }(obj, "", 0, [], void 0, 0, options) || obj; 31955 try { 31956 res = 0 === replacerStack.length ? JSON.stringify(tmp, replacer, spacer) : JSON.stringify(tmp, replaceGetterValues(replacer), spacer); 31957 } catch (_) { 31958 return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]"); 31959 } finally { 31960 for (; 0 !== arr.length;) { 31961 var part = arr.pop(); 31962 4 === part.length ? Object.defineProperty(part[0], part[1], part[3]) : part[0][part[1]] = part[2]; 31963 } 31964 } 31965 return res; 31966} 31967function replaceGetterValues(replacer) { 31968 return replacer = void 0 !== replacer ? replacer : function(k, v) { 31969 return v; 31970 }, function(key, val) { 31971 if (replacerStack.length > 0) for (var i = 0; i < replacerStack.length; i++) { 31972 var part = replacerStack[i]; 31973 if (part[1] === key && part[0] === val) { 31974 val = part[2], replacerStack.splice(i, 1); 31975 break; 31976 } 31977 } 31978 return replacer.call(this, key, val); 31979 }; 31980} 31981function _typeof(obj) { 31982 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 31983 return typeof obj; 31984 } : function(obj) { 31985 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 31986 })(obj); 31987} 31988function RequestBase() {} 31989function ResponseBase() {} 31990function _toConsumableArray(arr) { 31991 return function(arr) { 31992 if (Array.isArray(arr)) return _arrayLikeToArray(arr); 31993 }(arr) || function(iter) { 31994 if ("undefined" != typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) return Array.from(iter); 31995 }(arr) || _unsupportedIterableToArray(arr) || function() { 31996 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 31997 }(); 31998} 31999function _unsupportedIterableToArray(o, minLen) { 32000 if (o) { 32001 if ("string" == typeof o) return _arrayLikeToArray(o, minLen); 32002 var n = Object.prototype.toString.call(o).slice(8, -1); 32003 return "Object" === n && o.constructor && (n = o.constructor.name), "Map" === n || "Set" === n ? Array.from(o) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0; 32004 } 32005} 32006function _arrayLikeToArray(arr, len) { 32007 (null == len || len > arr.length) && (len = arr.length); 32008 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 32009 return arr2; 32010} 32011function Agent() { 32012 this._defaults = []; 32013} 32014function getLens(b64) { 32015 var len = b64.length; 32016 if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); 32017 var validLen = b64.indexOf("="); 32018 return -1 === validLen && (validLen = len), [validLen, validLen === len ? 0 : 4 - validLen % 4]; 32019} 32020function encodeChunk(uint8, start, end) { 32021 for (var tmp, num, output = [], i = start; i < end; i += 3) tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (255 & uint8[i + 2]), output.push(lookup[(num = tmp) >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[63 & num]); 32022 return output.join(""); 32023} 32024function attribute(o, attr, type, text) { 32025 if (type = "array" === type ? "object" : type, o && typeof o[attr] !== type) throw new Error(text); 32026} 32027function variable(o, type, text) { 32028 if (typeof o !== type) throw new Error(text); 32029} 32030function value(o, values, text) { 32031 if (-1 === values.indexOf(o)) throw new Error(text); 32032} 32033function objectAssignPolyfill(target) { 32034 if (null == target) throw new TypeError("Cannot convert first argument to object"); 32035 for (var to = Object(target), i = 1; i < arguments.length; i++) { 32036 var nextSource = arguments[i]; 32037 if (null != nextSource) for (var keysArray = Object.keys(Object(nextSource)), nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { 32038 var nextKey = keysArray[nextIndex], desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
32039 void 0 !== desc && desc.enumerable && (to[nextKey] = nextSource[nextKey]); 32040 } 32041 } 32042 return to; 32043} 32044function pick(object, keys) { 32045 return keys.reduce((function(prev, key) { 32046 return object[key] && (prev[key] = object[key]), prev; 32047 }), {}); 32048} 32049function objectValues(obj) { 32050 var values = []; 32051 for (var key in obj) values.push(obj[key]); 32052 return values; 32053} 32054function extend() { 32055 var params = objectValues(arguments); 32056 return params.unshift({}), objectAssign.get().apply(void 0, params); 32057} 32058function getLocationFromUrl(href) { 32059 var match = href.match(/^(https?:|file:|chrome-extension:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/); 32060 return match && { 32061 href, 32062 protocol: match[1], 32063 host: match[2], 32064 hostname: match[3], 32065 port: match[4], 32066 pathname: match[5], 32067 search: match[6], 32068 hash: match[7] 32069 }; 32070} 32071function trim(options, key) { 32072 var trimmed = extend(options); 32073 return options[key] && (trimmed[key] = options[key].trim()), trimmed; 32074} 32075function RequestWrapper(req) { 32076 this.request = req, this.method = req.method, this.url = req.url, this.body = req._data, this.headers = req._header; 32077} 32078function RequestObj(req) { 32079 this.request = req; 32080} 32081function RequestBuilder(options) { 32082 this._sendTelemetry = !1 !== options._sendTelemetry || options._sendTelemetry, this._telemetryInfo = options._telemetryInfo || null, this._timesToRetryFailedRequests = options._timesToRetryFailedRequests, this.headers = options.headers || {}, this._universalLoginPage = options.universalLoginPage; 32083} 32084function getWindow() { 32085 return window; 32086} 32087function DummyStorage() {} 32088function buildCompatCookieKey(key) { 32089 return "_" + key + "_compat"; 32090} 32091function CookieStorage$1(options) { 32092 this._options = options || {}; 32093} 32094function Warn(options) { 32095 this.disableWarnings = options.disableWarnings; 32096} 32097function StorageHandler(options) { 32098 if (this.warn = new Warn({}), this.storage = new CookieStorage$1(options), !0 === options.__tryLocalStorageFirst) try { 32099 var localStorage = windowHelper.getWindow().localStorage; 32100 localStorage && (this.storage = localStorage); 32101 } catch (e) { 32102 this.warn.warning(e), this.warn.warning("Can't use localStorage. Using CookieStorage instead."); 32103 } 32104} 32105function Storage(options) { 32106 this.handler = new StorageHandler(options); 32107} 32108function SSODataStorage(options) { 32109 this.storage = new Storage(options); 32110} 32111function buildResponse(error, description) { 32112 return { 32113 error, 32114 errorDescription: description 32115 }; 32116} 32117function wrapCallback(cb, options) { 32118 return (options = options || {}).ignoreCasing = !!options.ignoreCasing && options.ignoreCasing, function(err, data) { 32119 var errObj; 32120 return err || data ? (!err && data.err && (err = data.err, data = null), !err && data.error && (err = data, data = null), err ? (errObj = { original: err }, objectHelper.updatePropertyOn(errObj, "original.response.req._data.password", "*****"), err.response && err.response.statusCode && (errObj.statusCode = err.response.statusCode), err.response && err.response.statusText && (errObj.statusText = err.response.statusText), err.response && err.response.body && (err = err.response.body), err.err && (err = err.err), errObj.code = err.code || err.error || err.error_code || err.status || null, errObj.description = err.errorDescription || err.error_description || err.description || err.error || err.details || err.err || null, options.forceLegacyError && (errObj.error = errObj.code, errObj.error_description = errObj.description), err.error_codes && err.error_details && (errObj.errorDetails = { 32121 codes: err.error_codes, 32122 details: err.error_details 32123 }), err.name && (errObj.name = err.name), err.policy && (errObj.policy = err.policy), cb(errObj)) : !data.type || "text/html" !== data.type && "text/plain" !== data.type ? options.ignoreCasing ? cb(null, data.body || data) : cb(null, objectHelper.toCamelCase(data.body || data, [], { keepOriginal: options.keepOriginalCasing })) : cb(null, data.text)) : cb(error.buildResponse("generic_error", "Something went wrong")); 32124 }; 32125} 32126function e(t) { 32127 var e = { exports: {} }; 32128 return t(e, e.exports), e.exports; 32129} 32130function c(t, e) { 32131 if (this.n = null, this.e = 0, !(null != t && null != e && t.length > 0 && e.length > 0)) throw new Error("Invalid key data"); 32132 this.n = new u.BigInteger(t, 16), this.e = parseInt(e, 16); 32133} 32134function g(t) { 32135 var e = t.length % 4; 32136 return 0 === e ? t : t + new Array(4 - e + 1).join("="); 32137} 32138function w(t) { 32139 return t = g(t).replace(/\-/g, "+").replace(/_/g, "/"), decodeURIComponent(function(t) { 32140 for (var e = "", r = 0; r < t.length; r++) e += String.fromCharCode(t[r]); 32141 return e; 32142 }(y(t)).split("").map((function(t) { 32143 return "%" + ("00" + t.charCodeAt(0).toString(16)).slice(-2); 32144 })).join("")); 32145} 32146function T(t) { 32147 return function(t) { 32148 for (var e = "", r = 0; r < t.length; r++) { 32149 var i = t[r].toString(16); 32150 e += 2 === i.length ? i : "0" + i; 32151 } 32152 return e; 32153 }(y(g(t))); 32154} 32155function _(t, e) { 32156 return e = e || {}, new Promise((function(r, i) { 32157 var n = new XMLHttpRequest(), o = [], s = [], h = {}, u = function() { 32158 return { 32159 ok: 2 == (n.status / 100 | 0), 32160 statusText: n.statusText, 32161 status: n.status, 32162 url: n.responseURL, 32163 text: function() { 32164 return Promise.resolve(n.responseText); 32165 }, 32166 json: function() { 32167 return Promise.resolve(n.responseText).then(JSON.parse); 32168 }, 32169 blob: function() { 32170 return Promise.resolve(new Blob([n.response])); 32171 }, 32172 clone: u, 32173 headers: { 32174 keys: function() { 32175 return o; 32176 }, 32177 entries: function() { 32178 return s; 32179 }, 32180 get: function(t) { 32181 return h[t.toLowerCase()]; 32182 }, 32183 has: function(t) { 32184 return t.toLowerCase() in h; 32185 } 32186 } 32187 }; 32188 }; 32189 for (var a in n.open(e.method || "get", t, !0), n.onload = function() { 32190 n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, (function(t, e, r) { 32191 o.push(e = e.toLowerCase()), s.push([e, r]), h[e] = h[e] ? h[e] + "," + r : r; 32192 })), r(u()); 32193 }, n.onerror = i, n.withCredentials = "include" == e.credentials, e.headers) n.setRequestHeader(a, e.headers[a]); 32194 n.send(e.body || null); 32195 })); 32196} 32197function S(t) { 32198 if (t.ok) return t.json(); 32199 var e = new Error(t.statusText); 32200 return e.response = t, Promise.reject(e); 32201} 32202function A(t) { 32203 this.name = "ConfigurationError", this.message = t || ""; 32204} 32205function D(t) { 32206 this.name = "TokenValidationError", this.message = t || ""; 32207} 32208function I(t) { 32209 var e = t || {}; 32210 if (this.jwksCache = e.jwksCache || new B(), this.expectedAlg = e.expectedAlg || "RS256", this.issuer = e.issuer, this.audience = e.audie
32210nce, this.leeway = 0 === e.leeway ? 0 : e.leeway || 60, this.jwksURI = e.jwksURI, this.maxAge = e.maxAge, this.__clock = "function" == typeof e.__clock ? e.__clock : k, this.leeway < 0 || this.leeway > 300) throw new A("The leeway should be positive and lower than five minutes."); 32211 if (x !== this.expectedAlg) throw new A("Signature algorithm of \"" + this.expectedAlg + "\" is not supported. Expected the ID token to be signed with \"" + x + "\"."); 32212} 32213function PluginHandler(webAuth, plugins) { 32214 this.plugins = plugins; 32215 for (var a = 0; a < this.plugins.length; a++) { 32216 if (this.plugins[a].version !== version.raw) { 32217 var pluginName = ""; 32218 throw this.plugins[a].constructor && this.plugins[a].constructor.name && (pluginName = this.plugins[a].constructor.name), /* @__PURE__ */ new Error("Plugin " + pluginName + " version (" + this.plugins[a].version + ") is not compatible with the SDK version (" + version.raw + ")"); 32219 } 32220 this.plugins[a].setWebAuth(webAuth); 32221 } 32222} 32223function TransactionManager(options) { 32224 var transaction = options.transaction || {}; 32225 this.namespace = transaction.namespace || "com.auth0.auth.", this.keyLength = transaction.keyLength || 32, this.stateExpiration = options.stateExpiration ? options.stateExpiration / 60 / 24 : 1 / 48, this.storage = new Storage(options), this.options = options; 32226} 32227function IframeHandler(options) { 32228 if (this.url = options.url, this.callback = options.callback, this.timeout = options.timeout || 6e4, this.timeoutCallback = options.timeoutCallback || null, this.eventListenerType = options.eventListenerType || "message", this.iframe = null, this.timeoutHandle = null, this._destroyTimeout = null, this.transientMessageEventListener = null, this.proxyEventListener = null, this.eventValidator = options.eventValidator || { isValid: function() { 32229 return !0; 32230 } }, "function" != typeof this.callback) throw new Error("options.callback must be a function"); 32231} 32232function WebMessageHandler(webAuth) { 32233 this.webAuth = webAuth, this.warn = new Warn(webAuth.baseOptions); 32234} 32235function CrossOriginAuthentication(webAuth, options) { 32236 this.webAuth = webAuth, this.baseOptions = options, this.request = new RequestBuilder(options), this.webMessageHandler = new WebMessageHandler(webAuth), this.storage = new Storage(options); 32237} 32238function createKey(origin, coId) { 32239 return [ 32240 "co/verifier", 32241 encodeURIComponent(origin), 32242 encodeURIComponent(coId) 32243 ].join("/"); 32244} 32245function Redirect(auth0, options) { 32246 this.webAuth = auth0, this.baseOptions = options, this.crossOriginAuthentication = new CrossOriginAuthentication(auth0, this.baseOptions), this.warn = new Warn({ disableWarnings: !!options._disableDeprecationWarnings }); 32247} 32248function PopupHandler() { 32249 this._current_popup = null; 32250} 32251function Popup(webAuth, options) { 32252 this.baseOptions = options, this.baseOptions.popupOrigin = options.popupOrigin, this.client = webAuth.client, this.webAuth = webAuth, this.transactionManager = new TransactionManager(this.baseOptions), this.crossOriginAuthentication = new CrossOriginAuthentication(webAuth, this.baseOptions), this.warn = new Warn({ disableWarnings: !!options._disableDeprecationWarnings }); 32253} 32254function SilentAuthenticationHandler(options) { 32255 this.authenticationUrl = options.authenticationUrl, this.timeout = options.timeout || 6e4, this.handler = null, this.postMessageDataType = options.postMessageDataType || !1, this.postMessageOrigin = options.postMessageOrigin || windowHelper.getWindow().location.origin || windowHelper.getWindow().location.protocol + "//" + windowHelper.getWindow().location.hostname + (windowHelper.getWindow().location.port ? ":" + windowHelper.getWindow().location.port : ""); 32256} 32257function UsernamePassword(options) { 32258 this.baseOptions = options, this.request = new RequestBuilder(options), this.transactionManager = new TransactionManager(this.baseOptions); 32259} 32260function HostedPages(client, options) { 32261 this.baseOptions = options, this.client = client, this.baseOptions.universalLoginPage = !0, this.request = new RequestBuilder(this.baseOptions), this.warn = new Warn({ disableWarnings: !!options._disableDeprecationWarnings }); 32262} 32263function globalForCaptchaProvider(provider) { 32264 switch (provider) { 32265 case "recaptcha_v2": return window.grecaptcha; 32266 case "recaptcha_enterprise": return window.grecaptcha.enterprise; 32267 case "hcaptcha": return window.hcaptcha; 32268 case "friendly_captcha": return window.friendlyChallenge; 32269 case "arkose": return window.arkose; 32270 case "auth0_v2": return window.turnstile; 32271 default: throw new Error("Unknown captcha provider"); 32272 } 32273} 32274function loadScript(url, attributes) { 32275 var script = window.document.createElement("script"); 32276 for (var attr in attributes) attr.startsWith("data-") ? script.dataset[attr.replace("data-", "")] = attributes[attr] : script[attr] = attributes[attr]; 32277 script.src = url, window.document.body.appendChild(script); 32278} 32279function removeScript(url) { 32280 window.document.querySelectorAll("script[src=\"" + url + "\"]").forEach((function(script) { 32281 script.remove(); 32282 })); 32283} 32284function injectCaptchaScript(opts, callback, setValue, done) { 32285 var callbackName = opts.provider + "Callback_" + Math.floor(1000001 * Math.random()), attributes = { 32286 async: !0, 32287 defer: !0 32288 }, scriptSrc = function(provider, lang, callback, clientSubdomain, siteKey) { 32289 switch (provider) { 32290 case "recaptcha_v2": return "https://www.recaptcha.net/recaptcha/api.js?hl=" + lang + "&onload=" + callback; 32291 case "recaptcha_enterprise": return "https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit&hl=" + lang + "&onload=" + callback; 32292 case "hcaptcha": return "https://js.hcaptcha.com/1/api.js?hl=" + lang + "&onload=" + callback; 32293 case "friendly_captcha": return "https://cdn.jsdelivr.net/npm/[email protected]/widget.min.js"; 32294 case "arkose": return "https://" + clientSubdomain + ".arkoselabs.com/v2/" + siteKey + "/api.js"; 32295 case "auth0_v2": return "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=" + callback; 32296 default: throw new Error("Unknown captcha provider"); 32297 } 32298 }(opts.provider, opts.lang, callbackName, opts.clientSubdomain, opts.siteKey); 32299 if ("arkose" === opts.provider || "auth0_v2" === opts.provider) { 32300 var retryCount = 0; 32301 attributes["data-callback"] = callbackName, attributes.onerror = function() { 32302 if (retryCount < 3) return removeScript(scriptSrc), loadScript(scriptSrc, attributes), void retryCount++; 32303 removeScript(scriptSrc), done(/* @__PURE__ */ new Error(opts.provider + " failed to load")), setValue("BYPASS_CAPTCHA"); 32304 }, window[callbackName] = function(arkose) { 32305 window.arkose = arkose, callback(arkose); 32306 }; 32307 } else window[callbackName] = function() { 32308 delete window[callbackName], callback(); 32309 }, "friendly_captcha" === opts.provider && (attributes.onload = window[callbackName]); 32310 loadScript(scriptSrc, attributes); 32311} 32312function defaultClock() { 32313 return /* @__PURE__ */ new Date(); 32314} 32315function WebAuth(options) { 32316 assert.check(options, { 32317 type: "object",
vendor: 4,117 bytes, lines 32318-32445
32318 message: "options parameter is not valid" 32319 }, { 32320 domain: { 32321 type: "string", 32322 message: "domain option is required" 32323 }, 32324 clientID: { 32325 type: "string", 32326 message: "clientID option is required" 32327 }, 32328 responseType: { 32329 optional: !0, 32330 type: "string", 32331 message: "responseType is not valid" 32332 }, 32333 responseMode: { 32334 optional: !0, 32335 type: "string", 32336 message: "responseMode is not valid" 32337 }, 32338 redirectUri: { 32339 optional: !0, 32340 type: "string", 32341 message: "redirectUri is not valid" 32342 }, 32343 scope: { 32344 optional: !0, 32345 type: "string", 32346 message: "scope is not valid" 32347 }, 32348 audience: { 32349 optional: !0, 32350 type: "string", 32351 message: "audience is not valid" 32352 }, 32353 popupOrigin: { 32354 optional: !0, 32355 type: "string", 32356 message: "popupOrigin is not valid" 32357 }, 32358 leeway: { 32359 optional: !0, 32360 type: "number", 32361 message: "leeway is not valid" 32362 }, 32363 plugins: { 32364 optional: !0, 32365 type: "array", 32366 message: "plugins is not valid" 32367 }, 32368 maxAge: { 32369 optional: !0, 32370 type: "number", 32371 message: "maxAge is not valid" 32372 }, 32373 stateExpiration: { 32374 optional: !0, 32375 type: "number", 32376 message: "stateExpiration is not valid" 32377 }, 32378 legacySameSiteCookie: { 32379 optional: !0, 32380 type: "boolean", 32381 message: "legacySameSiteCookie option is not valid" 32382 }, 32383 _disableDeprecationWarnings: { 32384 optional: !0, 32385 type: "boolean", 32386 message: "_disableDeprecationWarnings option is not valid" 32387 }, 32388 _sendTelemetry: { 32389 optional: !0, 32390 type: "boolean", 32391 message: "_sendTelemetry option is not valid" 32392 }, 32393 _telemetryInfo: { 32394 optional: !0, 32395 type: "object", 32396 message: "_telemetryInfo option is not valid" 32397 }, 32398 _timesToRetryFailedRequests: { 32399 optional: !0, 32400 type: "number", 32401 message: "_timesToRetryFailedRequests option is not valid" 32402 } 32403 }), options.overrides && assert.check(options.overrides, { 32404 type: "object", 32405 message: "overrides option is not valid" 32406 }, { 32407 __tenant: { 32408 optional: !0, 32409 type: "string", 32410 message: "__tenant option is required" 32411 }, 32412 __token_issuer: { 32413 optional: !0, 32414 type: "string", 32415 message: "__token_issuer option is required" 32416 }, 32417 __jwks_uri: { 32418 optional: !0, 32419 type: "string", 32420 message: "__jwks_uri is required" 32421 } 32422 }), this.baseOptions = options, this.baseOptions.plugins = new PluginHandler(this, this.baseOptions.plugins || []), this.baseOptions._sendTelemetry = !1 !== this.baseOptions._sendTelemetry || this.baseOptions._sendTelemetry, this.baseOptions._timesToRetryFailedRequests = options._timesToRetryFailedRequests ? parseInt(options._timesToRetryFailedRequests) : 0, this.baseOptions.tenant = this.baseOptions.overrides && this.baseOptions.overrides.__tenant || this.baseOptions.domain.split(".")[0], this.baseOptions.token_issuer = this.baseOptions.overrides && this.baseOptions.overrides.__token_issuer || "https://" + this.baseOptions.domain + "/", this.baseOptions.jwksURI = this.baseOptions.overrides && this.baseOptions.overrides.__jwks_uri, !1 !== options.legacySameSiteCookie && (this.baseOptions.legacySameSiteCookie = !0), this.transactionManager = new TransactionManager(this.baseOptions), this.client = new Authentication(this.baseOptions), this.redirect = new Redirect(this, this.baseOptions), this.popup = new Popup(this, this.baseOptions), this.crossOriginAuthentication = new CrossOriginAuthentication(this, this.baseOptions), this.webMessageHandler = new WebMessageHandler(this), this._universalLogin = new HostedPages(this, this.baseOptions), this.ssodataStorage = new SSODataStorage(this.baseOptions); 32423} 32424function PasswordlessAuthentication(request, options) { 32425 this.baseOptions = options, this.request = request; 32426} 32427function DBConnection(request, options) { 32428 this.baseOptions = options, this.request = request; 32429} 32430function Authentication(auth0, options) { 32431 2 === arguments.length ? this.auth0 = auth0 : options = auth0, assert.check(options, { 32432 type: "object", 32433 message: "options parameter is not valid" 32434 }, { 32435 domain: { 32436 type: "string", 32437 message: "domain option is required" 32438 }, 32439 clientID: { 32440 type: "string", 32441 message: "clientID option is required" 32442 }, 32443 responseType: { 32444 optional: !0, 32445 type: "string",
32446 message: "responseType is not valid" 32447 }, 32448 responseMode: { 32449 optional: !0, 32450 type: "string", 32451 message: "responseMode is not valid" 32452 }, 32453 redirectUri: { 32454 optional: !0, 32455 type: "string", 32456 message: "redirectUri is not valid" 32457 }, 32458 scope: { 32459 optional: !0, 32460 type: "string", 32461 message: "scope is not valid" 32462 }, 32463 audience: { 32464 optional: !0, 32465 type: "string", 32466 message: "audience is not valid" 32467 }, 32468 _disableDeprecationWarnings: { 32469 optional: !0, 32470 type: "boolean", 32471 message: "_disableDeprecationWarnings option is not valid" 32472 }, 32473 _sendTelemetry: { 32474 optional: !0, 32475 type: "boolean", 32476 message: "_sendTelemetry option is not valid" 32477 }, 32478 _telemetryInfo: { 32479 optional: !0, 32480 type: "object", 32481 message: "_telemetryInfo option is not valid" 32482 } 32483 }), this.baseOptions = options, this.baseOptions._sendTelemetry = !1 !== this.baseOptions._sendTelemetry || this.baseOptions._sendTelemetry, this.baseOptions.rootUrl = this.baseOptions.domain && 0 === this.baseOptions.domain.toLowerCase().indexOf("http") ? this.baseOptions.domain : "https://" + this.baseOptions.domain, this.request = new RequestBuilder(this.baseOptions), this.passwordless = new PasswordlessAuthentication(this.request, this.baseOptions), this.dbConnection = new DBConnection(this.request, this.baseOptions), this.warn = new Warn({ disableWarnings: !!options._disableDeprecationWarnings }), this.ssodataStorage = new SSODataStorage(this.baseOptions); 32484} 32485function Management(options) { 32486 assert.check(options, { 32487 type: "object", 32488 message: "options parameter is not valid" 32489 }, { 32490 domain: { 32491 type: "string", 32492 message: "domain option is required" 32493 }, 32494 token: { 32495 type: "string", 32496 message: "token option is required" 32497 }, 32498 _sendTelemetry: { 32499 optional: !0, 32500 type: "boolean", 32501 message: "_sendTelemetry option is not valid" 32502 }, 32503 _telemetryInfo: { 32504 optional: !0, 32505 type: "object", 32506 message: "_telemetryInfo option is not valid" 32507 } 32508 }), this.baseOptions = options, this.baseOptions.headers = { Authorization: "Bearer " + this.baseOptions.token }, this.request = new RequestBuilder(this.baseOptions), this.baseOptions.rootUrl = urlJoin("https://" + this.baseOptions.domain, "api", "v2"); 32509} 32510var commonjsGlobal, urlJoin, esErrors, _eval, range, ref, syntax, type, uri, origSymbol, test, $Object, ERROR_MESSAGE, toStr, max, concatty, slicy, joiny, functionBind, call, $hasOwn, hasown, $Function, getEvalledConstructor, $gOPD, throwTypeError, ThrowTypeError, hasSymbols$1, hasProto$1, getProto, needsEval, TypedArray, INTRINSICS, LEGACY_ALIASES, $concat, $spliceApply, $replace, $strSlice, $exec, rePropName, reEscapeChar, stringToPath, getBaseIntrinsic, getIntrinsic, $defineProperty, esDefineProperty, $gOPD$1, gopd, defineDataProperty, hasPropertyDescriptors, hasDescriptors, $floor, setFunctionLength, callBind, $indexOf, callBound, semver, hasMap, mapSizeDescriptor, mapSize, mapForEach, hasSet, setSizeDescriptor, setSize, setForEach, weakMapHas, weakSetHas, weakRefDeref, booleanValueOf, objectToString, functionToString, $match, $slice, $replace$1, $toUpperCase, $toLowerCase, $test, $concat$1, $join, $arrSlice, $floor$1, bigIntValueOf, gOPS, symToString, hasShammedSymbols, toStringTag, isEnumerable, gPO, inspectCustom, inspectSymbol, objectInspect, hasOwn, $WeakMap, $Map, $weakMapGet, $weakMapSet, $weakMapHas, $mapGet, $mapSet, $mapHas, listGetNode, sideChannel, replace, percentTwenties, Format_RFC3986, formats, has$1, isArray$1, hexTable, arrayToObject, utils, has$2, arrayPrefixGenerators, isArray$2, push, pushToArray, toISO, defaultFormat, defaults, sentinel, stringify, has$3, isArray$3, defaults$1, interpretNumericEntities, parseArrayValue, parseKeys, lib, componentEmitter, fastSafeStringify, arr, replacerStack, utils$1, isObject, hasOwn$1, requestBase, ERROR_CODES, STATUS_CODES, responseBase, _loop, _i, _arr, agentBase, client, byteLength_1, toByteArray_1, fromByteArray_1, lookup, revLookup, Arr, code, i, len, base64Js, base64Url, version, toString, assert, objectAssign, objectHelper, windowHelper, js_cookie, error, tokenParams, authorizeParams, parametersWhitelist, t, r, i$1, n, o, s, h, u, a, f, p, l, d, m, v, y, b, B, x, E, k, random, winchan, urlHelper, noop, captchaSolved, Flow, defaults$2, captcha, index; 32511var init_auth0_min_esm = __esmMin((() => { 32512 commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; 32513 urlJoin = createCommonjsModule((function(module) { 32514 var context = commonjsGlobal, definition = function() { 32515 function normalize(strArray) { 32516 var resultArray = []; 32517 if (0 === strArray.length) return ""; 32518 if ("string" != typeof strArray[0]) throw new TypeError("Url must be a string. Received " + strArray[0]); 32519 if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) strArray[0] = strArray.shift() + strArray[0]; 32520 strArray[0].match(/^file:\/\/\//) ? strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, "$1:///") : strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, "$1://"); 32521 for (var i = 0; i < strArray.length; i++) { 32522 var component = strArray[i]; 32523 if ("string" != typeof component) throw new TypeError("Url must be a string. Received " + component); 32524 "" !== component && (i > 0 && (component = component.replace(/^[\/]+/, "")), component = i < strArray.length - 1 ? component.replace(/[\/]+$/, "") : component.replace(/[\/]+$/, "/"), resultArray.push(component)); 32525 } 32526 var str = resultArray.join("/"), parts = (str = str.replace(/\/(\?|&|#[^!])/g, "$1")).split("?"); 32527 return str = parts.shift() + (parts.length > 0 ? "?" : "") + parts.join("&"); 32528 } 32529 return function() { 32530 return normalize("object" == typeof arguments[0] ? arguments[0] : [].slice.call(arguments)); 32531 }; 32532 }; 32533 module.exports ? module.exports = definition() : context.urljoin = definition(); 32534 })); 32535 esErrors = Error; 32536 _eval = EvalError; 32537 range = RangeError; 32538 ref = ReferenceError; 32539 syntax = SyntaxError; 32540 type = TypeError; 32541 uri = URIError; 32542 origSymbol = "undefined" != typeof Symbol && Symbol; 32543 test = { foo: {} }; 32544 $Object = Object; 32545 ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; 32546 toStr = Object.prototype.toString; 32547 max = Math.max; 32548 concatty = function(a, b) { 32549 for (var arr = [], i = 0; i < a.length; i += 1) arr[i] = a[i]; 32550 for (var j = 0; j < b.length; j += 1) arr[j + a.length] = b[j]; 32551 return arr; 32552 }; 32553 slicy = function(arrLike, offset) { 32554 for (var arr = [], i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) arr[j] = arrLike[i]; 32555 return arr; 32556 }; 32557 joiny = function(arr, joiner) { 32558 for (var str = "", i = 0; i < arr.length; i += 1) str += arr[i], i + 1 < arr.length && (str += joiner); 32559 return str; 32560 }; 32561 functionBind = Function.prototype.bind || function(that) { 32562 var target = this; 32563 if ("function" != typeof target || "[object Function]" !== toStr.apply(target)) throw new TypeError(ERROR_MESSAGE + target); 32564 for (var bound, args = slicy(arguments, 1), binder = function() { 32565 if (this instanceof bound) { 32566 var result = target.apply(this, concatty(args, arguments)); 32567 return Object(result) === result ? result : this; 32568 } 32569 return target.apply(that, concatty(args, arguments)); 32570 }, boundLength = max(0, target.length - args.length), boundArgs = [], i = 0; i < boundLength; i++) boundArgs[i] = "$" + i; 32571 if (bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder), target.prototype) { 32572 var Empty = function() {}; 32573 Empty.prototype = target.prototype, bound.prototype = new Empty(), Empty.prototype = null; 32574 } 32575 return bound; 32576 }; 32577 call = Function.prototype.call; 32578 $hasOwn = Object.prototype.hasOwnProperty; 32579 hasown = functionBind.call(call, $hasOwn); 32580 $Function = Function; 32581 getEvalledConstructor = function(expressionSyntax) { 32582 try { 32583 return $Function("\"use strict\"; return (" + expressionSyntax + ").constructor;")(); 32584 } catch (e) {} 32585 }; 32586 $gOPD = Object.getOwnPropertyDescriptor; 32587 if ($gOPD) try { 32588 $gOPD({}, ""); 32589 } catch (e) { 32590 $gOPD = null; 32591 } 32592 throwTypeError = function() { 32593 throw new type(); 32594 }; 32595 ThrowTypeError = $gOPD ? function() { 32596 try { 32597 return throwTypeError; 32598 } catch (calleeThrows) { 32599 try { 32600 return $gOPD(arguments, "callee").get; 32601 } catch (gOPDthrows) { 32602 return throwTypeError; 32603 } 32604 } 32605 }() : throwTypeError; 32606 hasSymbols$1 = "function" == typeof origSymbol && "function" == typeof Symbol && "symbol" == typeof origSymbol("foo") && "symbol" == typeof Symbol("bar") && function() { 32607 if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) return !1; 32608 if ("symbol" == typeof Symbol.iterator) return !0; 32609 var obj = {}, sym = Symbol("test"), symObj = Object(sym); 32610 if ("string" == typeof sym) return !1; 32611 if ("[object Symbol]" !== Object.prototype.toString.call(sym)) return !1; 32612 if ("[object Symbol]" !== Object.prototype.toString.call(symObj)) return !1; 32613 for (sym in obj[sym] = 42, obj) return !1; 32614 if ("function" == typeof Object.keys && 0 !== Object.keys(obj).length) return !1; 32615 if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(obj).length) return !1; 32616 var syms = Object.getOwnPropertySymbols(obj); 32617 if (1 !== syms.length || syms[0] !== sym) return !1; 32618 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return !1; 32619 if ("function" == typeof Object.getOwnPropertyDescriptor) { 32620 var descriptor = Object.getOwnPropertyDescriptor(obj, sym); 32621 if (42 !== descriptor.value || !0 !== descriptor.enumerable) return !1; 32622 } 32623 return !0; 32624 }(); 32625 hasProto$1 = { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); 32626 getProto = Object.getPrototypeOf || (hasProto$1 ? function(x) { 32627 return x.__proto__; 32628 } : null); 32629 needsEval = {}; 32630 TypedArray = "undefined" != typeof Uint8Array && getProto ? getProto(Uint8Array) : void 0; 32631 INTRINSICS = { 32632 __proto__: null, 32633 "%AggregateError%": "undefined" == typeof AggregateError ? void 0 : AggregateError, 32634 "%Array%": Array, 32635 "%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? void 0 : ArrayBuffer, 32636 "%ArrayIteratorPrototype%": hasSymbols$1 && getProto ? getProto([][Symbol.iterator]()) : void 0, 32637 "%AsyncFromSyncIteratorPrototype%": void 0, 32638 "%AsyncFunction%": needsEval, 32639 "%AsyncGenerator%": needsEval, 32640 "%AsyncGeneratorFunction%": needsEval, 32641 "%AsyncIteratorPrototype%": needsEval, 32642 "%Atomics%": "undefined" == typeof Atomics ? void 0 : Atomics, 32643 "%BigInt%": "undefined" == typeof BigInt ? void 0 : BigInt, 32644 "%BigInt64Array%": "undefined" == typeof BigInt64Array ? void 0 : BigInt64Array, 32645 "%BigUint64Array%": "undefined" == typeof BigUint64Array ? void 0 : BigUint64Array, 32646 "%Boolean%": Boolean, 32647 "%DataView%": "undefined" == typeof DataView ? void 0 : DataView, 32648 "%Date%": Date, 32649 "%decodeURI%": decodeURI, 32650 "%decodeURIComponent%": decodeURIComponent, 32651 "%encodeURI%": encodeURI, 32652 "%encodeURIComponent%": encodeURIComponent, 32653 "%Error%": esErrors, 32654 "%eval%": eval, 32655 "%EvalError%": _eval, 32656 "%Float32Array%": "undefined" == typeof Float32Array ? void 0 : Float32Array, 32657 "%Float64Array%": "undefined" == typeof Float64Array ? void 0 : Float64Array, 32658 "%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ? void 0 : FinalizationRegistry, 32659 "%Function%": $Function, 32660 "%GeneratorFunction%": needsEval, 32661 "%Int8Array%": "undefined" == typeof Int8Array ? void 0 : Int8Array, 32662 "%Int16Array%": "undefined" == typeof Int16Array ? void 0 : Int16Array, 32663 "%Int32Array%": "undefined" == typeof Int32Array ? void 0 : Int32Array, 32664 "%isFinite%": isFinite, 32665 "%isNaN%": isNaN, 32666 "%IteratorPrototype%": hasSymbols$1 && getProto ? getProto(getProto([][Symbol.iterator]())) : void 0, 32667 "%JSON%": "object" == typeof JSON ? JSON : void 0, 32668 "%Map%": "undefined" == typeof Map ? void 0 : Map, 32669 "%MapIteratorPrototype%": "undefined" != typeof Map && hasSymbols$1 && getProto ? getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()) : void 0, 32670 "%Math%": Math, 32671 "%Number%": Number, 32672 "%Object%": Object, 32673 "%parseFloat%": parseFloat, 32674 "%parseInt%": parseInt, 32675 "%Promise%": "undefined" == typeof Promise ? void 0 : Promise, 32676 "%Proxy%": "undefined" == typeof Proxy ? void 0 : Proxy, 32677 "%RangeError%": range, 32678 "%ReferenceError%": ref, 32679 "%Reflect%": "undefined" == typeof Reflect ? void 0 : Reflect, 32680 "%RegExp%": RegExp, 32681 "%Set%": "undefined" == typeof Set ? void 0 : Set, 32682 "%SetIteratorPrototype%": "undefined" != typeof Set && hasSymbols$1 && getProto ? getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()) : void 0, 32683 "%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? void 0 : SharedArrayBuffer, 32684 "%String%": String, 32685 "%StringIteratorPrototype%": hasSymbols$1 && getProto ? getProto(""[Symbol.iterator]()) : void 0, 32686 "%Symbol%": hasSymbols$1 ? Symbol : void 0, 32687 "%SyntaxError%": syntax, 32688 "%ThrowTypeError%": ThrowTypeError, 32689 "%TypedArray%": TypedArray, 32690 "%TypeError%": type, 32691 "%Uint8Array%": "undefined" == typeof Uint8Array ? void 0 : Uint8Array, 32692 "%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? void 0 : Uint8ClampedArray, 32693 "%Uint16Array%": "undefined" == typeof Uint16Array ? void 0 : Uint16Array, 32694 "%Uint32Array%": "undefined" == typeof Uint32Array ? void 0 : Uint32Array, 32695 "%URIError%": uri, 32696 "%WeakMap%": "undefined" == typeof WeakMap ? void 0 : WeakMap, 32697 "%WeakRef%": "undefined" == typeof WeakRef ? void 0 : WeakRef, 32698 "%WeakSet%": "undefined" == typeof WeakSet ? void 0 : WeakSet 32699 }; 32700 if (getProto) try { 32701 null.error; 32702 } catch (e) { 32703 INTRINSICS["%Error.prototype%"] = getProto(getProto(e)); 32704 } 32705 LEGACY_ALIASES = { 32706 __proto__: null, 32707 "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], 32708 "%ArrayPrototype%": ["Array", "prototype"], 32709 "%ArrayProto_entries%": [ 32710 "Array", 32711 "prototype", 32712 "entries" 32713 ], 32714 "%ArrayProto_forEach%": [ 32715 "Array", 32716 "prototype", 32717 "forEach" 32718 ], 32719 "%ArrayProto_keys%": [ 32720 "Array", 32721 "prototype", 32722 "keys" 32723 ], 32724 "%ArrayProto_values%": [ 32725 "Array", 32726 "prototype", 32727 "values" 32728 ], 32729 "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], 32730 "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], 32731 "%AsyncGeneratorPrototype%": [ 32732 "AsyncGeneratorFunction", 32733 "prototype", 32734 "prototype" 32735 ], 32736 "%BooleanPrototype%": ["Boolean", "prototype"], 32737 "%DataViewPrototype%": ["DataView", "prototype"], 32738 "%DatePrototype%": ["Date", "prototype"], 32739 "%ErrorPrototype%": ["Error", "prototype"], 32740 "%EvalErrorPrototype%": ["EvalError", "prototype"], 32741 "%Float32ArrayPrototype%": ["Float32Array", "prototype"], 32742 "%Float64ArrayPrototype%": ["Float64Array", "prototype"], 32743 "%FunctionPrototype%": ["Function", "prototype"], 32744 "%Generator%": ["GeneratorFunction", "prototype"], 32745 "%GeneratorPrototype%": [ 32746 "GeneratorFunction", 32747 "prototype", 32748 "prototype" 32749 ], 32750 "%Int8ArrayPrototype%": ["Int8Array", "prototype"], 32751 "%Int16ArrayPrototype%": ["Int16Array", "prototype"], 32752 "%Int32ArrayPrototype%": ["Int32Array", "prototype"], 32753 "%JSONParse%": ["JSON", "parse"], 32754 "%JSONStringify%": ["JSON", "stringify"], 32755 "%MapPrototype%": ["Map", "prototype"], 32756 "%NumberPrototype%": ["Number", "prototype"], 32757 "%ObjectPrototype%": ["Object", "prototype"], 32758 "%ObjProto_toString%": [ 32759 "Object", 32760 "prototype", 32761 "toString" 32762 ], 32763 "%ObjProto_valueOf%": [ 32764 "Object", 32765 "prototype", 32766 "valueOf" 32767 ], 32768 "%PromisePrototype%": ["Promise", "prototype"], 32769 "%PromiseProto_then%": [ 32770 "Promise", 32771 "prototype", 32772 "then" 32773 ], 32774 "%Promise_all%": ["Promise", "all"], 32775 "%Promise_reject%": ["Promise", "reject"],
vendor: 8,643 bytes, lines 32776-32918
32776 "%Promise_resolve%": ["Promise", "resolve"], 32777 "%RangeErrorPrototype%": ["RangeError", "prototype"], 32778 "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], 32779 "%RegExpPrototype%": ["RegExp", "prototype"], 32780 "%SetPrototype%": ["Set", "prototype"], 32781 "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], 32782 "%StringPrototype%": ["String", "prototype"], 32783 "%SymbolPrototype%": ["Symbol", "prototype"], 32784 "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], 32785 "%TypedArrayPrototype%": ["TypedArray", "prototype"], 32786 "%TypeErrorPrototype%": ["TypeError", "prototype"], 32787 "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], 32788 "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], 32789 "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], 32790 "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], 32791 "%URIErrorPrototype%": ["URIError", "prototype"], 32792 "%WeakMapPrototype%": ["WeakMap", "prototype"], 32793 "%WeakSetPrototype%": ["WeakSet", "prototype"] 32794 }; 32795 $concat = functionBind.call(Function.call, Array.prototype.concat); 32796 $spliceApply = functionBind.call(Function.apply, Array.prototype.splice); 32797 $replace = functionBind.call(Function.call, String.prototype.replace); 32798 $strSlice = functionBind.call(Function.call, String.prototype.slice); 32799 $exec = functionBind.call(Function.call, RegExp.prototype.exec); 32800 rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 32801 reEscapeChar = /\\(\\)?/g; 32802 stringToPath = function(string) { 32803 var first = $strSlice(string, 0, 1), last = $strSlice(string, -1); 32804 if ("%" === first && "%" !== last) throw new syntax("invalid intrinsic syntax, expected closing `%`"); 32805 if ("%" === last && "%" !== first) throw new syntax("invalid intrinsic syntax, expected opening `%`"); 32806 var result = []; 32807 return $replace(string, rePropName, (function(match, number, quote, subString) { 32808 result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; 32809 })), result; 32810 }; 32811 getBaseIntrinsic = function(name, allowMissing) { 32812 var alias, intrinsicName = name; 32813 if (hasown(LEGACY_ALIASES, intrinsicName) && (intrinsicName = "%" + (alias = LEGACY_ALIASES[intrinsicName])[0] + "%"), hasown(INTRINSICS, intrinsicName)) { 32814 var value = INTRINSICS[intrinsicName]; 32815 if (value === needsEval && (value = function doEval(name) { 32816 var value; 32817 if ("%AsyncFunction%" === name) value = getEvalledConstructor("async function () {}"); 32818 else if ("%GeneratorFunction%" === name) value = getEvalledConstructor("function* () {}"); 32819 else if ("%AsyncGeneratorFunction%" === name) value = getEvalledConstructor("async function* () {}"); 32820 else if ("%AsyncGenerator%" === name) { 32821 var fn = doEval("%AsyncGeneratorFunction%"); 32822 fn && (value = fn.prototype); 32823 } else if ("%AsyncIteratorPrototype%" === name) { 32824 var gen = doEval("%AsyncGenerator%"); 32825 gen && getProto && (value = getProto(gen.prototype)); 32826 } 32827 return INTRINSICS[name] = value, value; 32828 }(intrinsicName)), void 0 === value && !allowMissing) throw new type("intrinsic " + name + " exists, but is not available. Please file an issue!"); 32829 return { 32830 alias, 32831 name: intrinsicName, 32832 value 32833 }; 32834 } 32835 throw new syntax("intrinsic " + name + " does not exist!"); 32836 }; 32837 getIntrinsic = function(name, allowMissing) { 32838 if ("string" != typeof name || 0 === name.length) throw new type("intrinsic name must be a non-empty string"); 32839 if (arguments.length > 1 && "boolean" != typeof allowMissing) throw new type("\"allowMissing\" argument must be a boolean"); 32840 if (null === $exec(/^%?[^%]*%?$/, name)) throw new syntax("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); 32841 var parts = stringToPath(name), intrinsicBaseName = parts.length > 0 ? parts[0] : "", intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing), intrinsicRealName = intrinsic.name, value = intrinsic.value, skipFurtherCaching = !1, alias = intrinsic.alias; 32842 alias && (intrinsicBaseName = alias[0], $spliceApply(parts, $concat([0, 1], alias))); 32843 for (var i = 1, isOwn = !0; i < parts.length; i += 1) { 32844 var part = parts[i], first = $strSlice(part, 0, 1), last = $strSlice(part, -1); 32845 if (("\"" === first || "'" === first || "`" === first || "\"" === last || "'" === last || "`" === last) && first !== last) throw new syntax("property names with quotes must have matching quotes"); 32846 if ("constructor" !== part && isOwn || (skipFurtherCaching = !0), hasown(INTRINSICS, intrinsicRealName = "%" + (intrinsicBaseName += "." + part) + "%")) value = INTRINSICS[intrinsicRealName]; 32847 else if (null != value) { 32848 if (!(part in value)) { 32849 if (!allowMissing) throw new type("base intrinsic for " + name + " exists, but the property is not available."); 32850 return; 32851 } 32852 if ($gOPD && i + 1 >= parts.length) { 32853 var desc = $gOPD(value, part); 32854 value = (isOwn = !!desc) && "get" in desc && !("originalValue" in desc.get) ? desc.get : value[part]; 32855 } else isOwn = hasown(value, part), value = value[part]; 32856 isOwn && !skipFurtherCaching && (INTRINSICS[intrinsicRealName] = value); 32857 } 32858 } 32859 return value; 32860 }; 32861 $defineProperty = getIntrinsic("%Object.defineProperty%", !0) || !1; 32862 if ($defineProperty) try { 32863 $defineProperty({}, "a", { value: 1 }); 32864 } catch (e) { 32865 $defineProperty = !1; 32866 } 32867 esDefineProperty = $defineProperty; 32868 $gOPD$1 = getIntrinsic("%Object.getOwnPropertyDescriptor%", !0); 32869 if ($gOPD$1) try { 32870 $gOPD$1([], "length"); 32871 } catch (e) { 32872 $gOPD$1 = null; 32873 } 32874 gopd = $gOPD$1; 32875 defineDataProperty = function(obj, property, value) { 32876 if (!obj || "object" != typeof obj && "function" != typeof obj) throw new type("`obj` must be an object or a function`"); 32877 if ("string" != typeof property && "symbol" != typeof property) throw new type("`property` must be a string or a symbol`"); 32878 if (arguments.length > 3 && "boolean" != typeof arguments[3] && null !== arguments[3]) throw new type("`nonEnumerable`, if provided, must be a boolean or null"); 32879 if (arguments.length > 4 && "boolean" != typeof arguments[4] && null !== arguments[4]) throw new type("`nonWritable`, if provided, must be a boolean or null"); 32880 if (arguments.length > 5 && "boolean" != typeof arguments[5] && null !== arguments[5]) throw new type("`nonConfigurable`, if provided, must be a boolean or null"); 32881 if (arguments.length > 6 && "boolean" != typeof arguments[6]) throw new type("`loose`, if provided, must be a boolean"); 32882 var nonEnumerable = arguments.length > 3 ? arguments[3] : null, nonWritable = arguments.length > 4 ? arguments[4] : null, nonConfigurable = arguments.length > 5 ? arguments[5] : null, loose = arguments.length > 6 && arguments[6], desc = !!gopd && gopd(obj, property); 32883 if (esDefineProperty) esDefineProperty(obj, property, { 32884 configurable: null === nonConfigurable && desc ? desc.configurable : !nonConfigurable, 32885 enumerable: null === nonEnumerable && desc ? desc.enumerable : !nonEnumerable, 32886 value, 32887 writable: null === nonWritable && desc ? desc.writable : !nonWritable 32888 }); 32889 else { 32890 if (!loose && (nonEnumerable || nonWritable || nonConfigurable)) throw new syntax("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); 32891 obj[property] = value; 32892 } 32893 }; 32894 hasPropertyDescriptors = function() { 32895 return !!esDefineProperty; 32896 }; 32897 hasPropertyDescriptors.hasArrayLengthDefineBug = function() { 32898 if (!esDefineProperty) return null; 32899 try { 32900 return 1 !== esDefineProperty([], "length", { value: 1 }).length; 32901 } catch (e) { 32902 return !0; 32903 } 32904 }; 32905 hasDescriptors = hasPropertyDescriptors(); 32906 $floor = getIntrinsic("%Math.floor%"); 32907 setFunctionLength = function(fn, length) { 32908 if ("function" != typeof fn) throw new type("`fn` is not a function"); 32909 if ("number" != typeof length || length < 0 || length > 4294967295 || $floor(length) !== length) throw new type("`length` must be a positive 32-bit integer"); 32910 var loose = arguments.length > 2 && !!arguments[2], functionLengthIsConfigurable = !0, functionLengthIsWritable = !0; 32911 if ("length" in fn && gopd) { 32912 var desc = gopd(fn, "length"); 32913 desc && !desc.configurable && (functionLengthIsConfigurable = !1), desc && !desc.writable && (functionLengthIsWritable = !1); 32914 } 32915 return (functionLengthIsConfigurable || functionLengthIsWritable || !loose) && (hasDescriptors ? defineDataProperty(fn, "length", length, !0, !0) : defineDataProperty(fn, "length", length)), fn; 32916 }; 32917 callBind = createCommonjsModule((function(module) { 32918 var $apply = getIntrinsic("%Function.prototype.apply%"), $call = getIntrinsic("%Function.prototype.call%"), $reflectAp
32918ply = getIntrinsic("%Reflect.apply%", !0) || functionBind.call($call, $apply), $max = getIntrinsic("%Math.max%"); 32919 module.exports = function(originalFunction) { 32920 if ("function" != typeof originalFunction) throw new type("a function is required"); 32921 return setFunctionLength($reflectApply(functionBind, $call, arguments), 1 + $max(0, originalFunction.length - (arguments.length - 1)), !0); 32922 }; 32923 var applyBind = function() { 32924 return $reflectApply(functionBind, $apply, arguments); 32925 }; 32926 esDefineProperty ? esDefineProperty(module.exports, "apply", { value: applyBind }) : module.exports.apply = applyBind; 32927 })); 32928 $indexOf = (callBind.apply, callBind(getIntrinsic("String.prototype.indexOf"))); 32929 callBound = function(name, allowMissing) { 32930 var intrinsic = getIntrinsic(name, !!allowMissing); 32931 return "function" == typeof intrinsic && $indexOf(name, ".prototype.") > -1 ? callBind(intrinsic) : intrinsic; 32932 }; 32933 semver = function(n) { 32934 return n && n.default || n; 32935 }(Object.freeze({ 32936 __proto__: null, 32937 default: {} 32938 })); 32939 hasMap = "function" == typeof Map && Map.prototype; 32940 mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; 32941 mapSize = hasMap && mapSizeDescriptor && "function" == typeof mapSizeDescriptor.get ? mapSizeDescriptor.get : null; 32942 mapForEach = hasMap && Map.prototype.forEach; 32943 hasSet = "function" == typeof Set && Set.prototype; 32944 setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; 32945 setSize = hasSet && setSizeDescriptor && "function" == typeof setSizeDescriptor.get ? setSizeDescriptor.get : null; 32946 setForEach = hasSet && Set.prototype.forEach; 32947 weakMapHas = "function" == typeof WeakMap && WeakMap.prototype ? WeakMap.prototype.has : null; 32948 weakSetHas = "function" == typeof WeakSet && WeakSet.prototype ? WeakSet.prototype.has : null; 32949 weakRefDeref = "function" == typeof WeakRef && WeakRef.prototype ? WeakRef.prototype.deref : null; 32950 booleanValueOf = Boolean.prototype.valueOf; 32951 objectToString = Object.prototype.toString; 32952 functionToString = Function.prototype.toString; 32953 $match = String.prototype.match; 32954 $slice = String.prototype.slice; 32955 $replace$1 = String.prototype.replace; 32956 $toUpperCase = String.prototype.toUpperCase; 32957 $toLowerCase = String.prototype.toLowerCase; 32958 $test = RegExp.prototype.test; 32959 $concat$1 = Array.prototype.concat; 32960 $join = Array.prototype.join; 32961 $arrSlice = Array.prototype.slice; 32962 $floor$1 = Math.floor; 32963 bigIntValueOf = "function" == typeof BigInt ? BigInt.prototype.valueOf : null; 32964 gOPS = Object.getOwnPropertySymbols; 32965 symToString = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol.prototype.toString : null; 32966 hasShammedSymbols = "function" == typeof Symbol && "object" == typeof Symbol.iterator; 32967 toStringTag = "function" == typeof Symbol && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols || "symbol") ? Symbol.toStringTag : null; 32968 isEnumerable = Object.prototype.propertyIsEnumerable; 32969 gPO = ("function" == typeof Reflect ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) { 32970 return O.__proto__; 32971 } : null); 32972 inspectCustom = semver.custom; 32973 inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; 32974 objectInspect = function inspect_(obj, options, depth, seen) { 32975 var opts = options || {}; 32976 if (has(opts, "quoteStyle") && "single" !== opts.quoteStyle && "double" !== opts.quoteStyle) throw new TypeError("option \"quoteStyle\" must be \"single\" or \"double\""); 32977 if (has(opts, "maxStringLength") && ("number" == typeof opts.maxStringLength ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : null !== opts.maxStringLength)) throw new TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`"); 32978 var customInspect = !has(opts, "customInspect") || opts.customInspect; 32979 if ("boolean" != typeof customInspect && "symbol" !== customInspect) throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); 32980 if (has(opts, "indent") && null !== opts.indent && " " !== opts.indent && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) throw new TypeError("option \"indent\" must be \"\\t\", an integer > 0, or `null`"); 32981 if (has(opts, "numericSeparator") && "boolean" != typeof opts.numericSeparator) throw new TypeError("option \"numericSeparator\", if provided, must be `true` or `false`"); 32982 var numericSeparator = opts.numericSeparator; 32983 if (void 0 === obj) return "undefined"; 32984 if (null === obj) return "null"; 32985 if ("boolean" == typeof obj) return obj ? "true" : "false"; 32986 if ("string" == typeof obj) return function inspectString(str, opts) { 32987 if (str.length > opts.maxStringLength) { 32988 var remaining = str.length - opts.maxStringLength, trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); 32989 return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; 32990 } 32991 return wrapQuotes($replace$1.call($replace$1.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte), "single", opts); 32992 }(obj, opts); 32993 if ("number" == typeof obj) { 32994 if (0 === obj) return Infinity / obj > 0 ? "0" : "-0"; 32995 var str = String(obj); 32996 return numericSeparator ? addNumericSeparator(obj, str) : str; 32997 } 32998 if ("bigint" == typeof obj) { 32999 var bigIntStr = String(obj) + "n"; 33000 return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; 33001 } 33002 var maxDepth = void 0 === opts.depth ? 5 : opts.depth; 33003 if (void 0 === depth && (depth = 0), depth >= maxDepth && maxDepth > 0 && "object" == typeof obj) return isArray(obj) ? "[Array]" : "[Object]"; 33004 var indent = function(opts, depth) { 33005 var baseIndent; 33006 if (" " === opts.indent) baseIndent = " ";
33007 else { 33008 if (!("number" == typeof opts.indent && opts.indent > 0)) return null; 33009 baseIndent = $join.call(Array(opts.indent + 1), " "); 33010 } 33011 return { 33012 base: baseIndent, 33013 prev: $join.call(Array(depth + 1), baseIndent) 33014 }; 33015 }(opts, depth); 33016 if (void 0 === seen) seen = []; 33017 else if (indexOf(seen, obj) >= 0) return "[Circular]"; 33018 function inspect(value, from, noIndent) { 33019 if (from && (seen = $arrSlice.call(seen)).push(from), noIndent) { 33020 var newOpts = { depth: opts.depth }; 33021 return has(opts, "quoteStyle") && (newOpts.quoteStyle = opts.quoteStyle), inspect_(value, newOpts, depth + 1, seen); 33022 } 33023 return inspect_(value, opts, depth + 1, seen); 33024 } 33025 if ("function" == typeof obj && !isRegExp(obj)) { 33026 var name = function(f) { 33027 if (f.name) return f.name; 33028 var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); 33029 if (m) return m[1]; 33030 return null; 33031 }(obj), keys = arrObjKeys(obj, inspect); 33032 return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : ""); 33033 } 33034 if (isSymbol(obj)) { 33035 var symString = hasShammedSymbols ? $replace$1.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); 33036 return "object" != typeof obj || hasShammedSymbols ? symString : markBoxed(symString); 33037 } 33038 if (function(x) { 33039 if (!x || "object" != typeof x) return !1; 33040 if ("undefined" != typeof HTMLElement && x instanceof HTMLElement) return !0; 33041 return "string" == typeof x.nodeName && "function" == typeof x.getAttribute; 33042 }(obj)) { 33043 for (var s = "<" + $toLowerCase.call(String(obj.nodeName)), attrs = obj.attributes || [], i = 0; i < attrs.length; i++) s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts); 33044 return s += ">", obj.childNodes && obj.childNodes.length && (s += "..."), s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">"; 33045 } 33046 if (isArray(obj)) { 33047 if (0 === obj.length) return "[]"; 33048 var xs = arrObjKeys(obj, inspect); 33049 return indent && !function(xs) { 33050 for (var i = 0; i < xs.length; i++) if (indexOf(xs[i], "\n") >= 0) return !1; 33051 return !0; 33052 }(xs) ? "[" + indentedJoin(xs, indent) + "]" : "[ " + $join.call(xs, ", ") + " ]"; 33053 } 33054 if (function(obj) { 33055 return !("[object Error]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 33056 }(obj)) { 33057 var parts = arrObjKeys(obj, inspect); 33058 return "cause" in Error.prototype || !("cause" in obj) || isEnumerable.call(obj, "cause") ? 0 === parts.length ? "[" + String(obj) + "]" : "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }" : "{ [" + String(obj) + "] " + $join.call($concat$1.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }"; 33059 } 33060 if ("object" == typeof obj && customInspect) { 33061 if (inspectSymbol && "function" == typeof obj[inspectSymbol] && semver) return semver(obj, { depth: maxDepth - depth }); 33062 if ("symbol" !== customInspect && "function" == typeof obj.inspect) return obj.inspect(); 33063 } 33064 if (function(x) { 33065 if (!mapSize || !x || "object" != typeof x) return !1; 33066 try { 33067 mapSize.call(x); 33068 try { 33069 setSize.call(x); 33070 } catch (s) { 33071 return !0; 33072 } 33073 return x instanceof Map; 33074 } catch (e) {} 33075 return !1; 33076 }(obj)) { 33077 var mapParts = []; 33078 return mapForEach && mapForEach.call(obj, (function(value, key) { 33079 mapParts.push(inspect(key, obj, !0) + " => " + inspect(value, obj)); 33080 })), collectionOf("Map", mapSize.call(obj), mapParts, indent); 33081 } 33082 if (function(x) { 33083 if (!setSize || !x || "object" != typeof x) return !1; 33084 try { 33085 setSize.call(x); 33086 try { 33087 mapSize.call(x); 33088 } catch (m) { 33089 return !0; 33090 } 33091 return x instanceof Set; 33092 } catch (e) {} 33093 return !1; 33094 }(obj)) { 33095 var setParts = []; 33096 return setForEach && setForEach.call(obj, (function(value) { 33097 setParts.push(inspect(value, obj)); 33098 })), collectionOf("Set", setSize.call(obj), setParts, indent); 33099 } 33100 if (function(x) { 33101 if (!weakMapHas || !x || "object" != typeof x) return !1; 33102 try { 33103 weakMapHas.call(x, weakMapHas); 33104 try { 33105 weakSetHas.call(x, weakSetHas); 33106 } catch (s) { 33107 return !0; 33108 } 33109 return x instanceof WeakMap; 33110 } catch (e) {} 33111 return !1; 33112 }(obj)) return weakCollectionOf("WeakMap"); 33113 if (function(x) { 33114 if (!weakSetHas || !x || "object" != typeof x) return !1; 33115 try { 33116 weakSetHas.call(x, weakSetHas);
33117 try { 33118 weakMapHas.call(x, weakMapHas); 33119 } catch (s) { 33120 return !0; 33121 } 33122 return x instanceof WeakSet; 33123 } catch (e) {} 33124 return !1; 33125 }(obj)) return weakCollectionOf("WeakSet"); 33126 if (function(x) { 33127 if (!weakRefDeref || !x || "object" != typeof x) return !1; 33128 try { 33129 return weakRefDeref.call(x), !0; 33130 } catch (e) {} 33131 return !1; 33132 }(obj)) return weakCollectionOf("WeakRef"); 33133 if (function(obj) { 33134 return !("[object Number]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 33135 }(obj)) return markBoxed(inspect(Number(obj))); 33136 if (function(obj) { 33137 if (!obj || "object" != typeof obj || !bigIntValueOf) return !1; 33138 try { 33139 return bigIntValueOf.call(obj), !0; 33140 } catch (e) {} 33141 return !1; 33142 }(obj)) return markBoxed(inspect(bigIntValueOf.call(obj))); 33143 if (function(obj) { 33144 return !("[object Boolean]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 33145 }(obj)) return markBoxed(booleanValueOf.call(obj)); 33146 if (function(obj) { 33147 return !("[object String]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 33148 }(obj)) return markBoxed(inspect(String(obj))); 33149 if ("undefined" != typeof window && obj === window) return "{ [object Window] }"; 33150 if (obj === commonjsGlobal) return "{ [object globalThis] }"; 33151 if (!function(obj) { 33152 return !("[object Date]" !== toStr$1(obj) || toStringTag && "object" == typeof obj && toStringTag in obj); 33153 }(obj) && !isRegExp(obj)) { 33154 var ys = arrObjKeys(obj, inspect), isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object, protoTag = obj instanceof Object ? "" : "null prototype", stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "", tag = (isPlainObject || "function" != typeof obj.constructor ? "" : obj.constructor.name ? obj.constructor.name + " " : "") + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : ""); 33155 return 0 === ys.length ? tag + "{}" : indent ? tag + "{" + indentedJoin(ys, indent) + "}" : tag + "{ " + $join.call(ys, ", ") + " }"; 33156 } 33157 return String(obj); 33158 }; 33159 hasOwn = Object.prototype.hasOwnProperty || function(key) { 33160 return key in this; 33161 }; 33162 $WeakMap = getIntrinsic("%WeakMap%", !0); 33163 $Map = getIntrinsic("%Map%", !0); 33164 $weakMapGet = callBound("WeakMap.prototype.get", !0); 33165 $weakMapSet = callBound("WeakMap.prototype.set", !0); 33166 $weakMapHas = callBound("WeakMap.prototype.has", !0); 33167 $mapGet = callBound("Map.prototype.get", !0); 33168 $mapSet = callBound("Map.prototype.set", !0); 33169 $mapHas = callBound("Map.prototype.has", !0); 33170 listGetNode = function(list, key) { 33171 for (var curr, prev = list; null !== (curr = prev.next); prev = curr) if (curr.key === key) return prev.next = curr.next, curr.next = list.next, list.next = curr, curr; 33172 }; 33173 sideChannel = function() { 33174 var $wm, $m, $o, channel = { 33175 assert: function(key) { 33176 if (!channel.has(key)) throw new type("Side channel does not contain " + objectInspect(key)); 33177 }, 33178 get: function(key) { 33179 if ($WeakMap && key && ("object" == typeof key || "function" == typeof key)) { 33180 if ($wm) return $weakMapGet($wm, key); 33181 } else if ($Map) { 33182 if ($m) return $mapGet($m, key); 33183 } else if ($o) return function(objects, key) { 33184 var node = listGetNode(objects, key); 33185 return node && node.value; 33186 }($o, key); 33187 }, 33188 has: function(key) { 33189 if ($WeakMap && key && ("object" == typeof key || "function" == typeof key)) { 33190 if ($wm) return $weakMapHas($wm, key); 33191 } else if ($Map) { 33192 if ($m) return $mapHas($m, key); 33193 } else if ($o) return function(objects, key) { 33194 return !!listGetNode(objects, key); 33195 }($o, key); 33196 return !1; 33197 }, 33198 set: function(key, value) { 33199 $WeakMap && key && ("object" == typeof key || "function" == typeof key) ? ($wm || ($wm = new $WeakMap()), $weakMapSet($wm, key, value)) : $Map ? ($m || ($m = new $Map()), $mapSet($m, key, value)) : ($o || ($o = { 33200 key: {}, 33201 next: null 33202 }), function(objects, key, value) { 33203 var node = listGetNode(objects, key); 33204 node ? node.value = value : objects.next = { 33205 key, 33206 next: objects.next, 33207 value 33208 }; 33209 }($o, key, value)); 33210 } 33211 }; 33212 return channel; 33213 }; 33214 replace = String.prototype.replace; 33215 percentTwenties = /%20/g; 33216 Format_RFC3986 = "RFC3986"; 33217 formats = { 33218 default: Format_RFC3986, 33219 formatters: { 33220 RFC1738: function(value) { 33221 return replace.call(value, percentTwenties, "+"); 33222 }, 33223 RFC3986: function(value) { 33224 return String(value); 33225 } 33226 }, 33227 RFC1738: "RFC1738", 33228 RFC3986: Format_RFC3986 33229 }; 33230 has$1 = Object.prototype.hasOwnProperty; 33231 isArray$1 = Array.isArray; 33232 hexTable = function() { 33233 for (var array = [], i = 0; i < 256; ++i) array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); 33234 return array; 33235 }(); 33236 arrayToObject = function(source, options) { 33237 for (var obj = options && options.plainObjects ? Object.create(null) : {}, i = 0; i < source.length; ++i) void 0 !== source[i] && (obj[i] = source[i]); 33238 return obj; 33239 }; 33240 utils = { 33241 arrayToObject, 33242 assign: function(target, source) { 33243 return Object.keys(source).reduce((function(acc, key) { 33244 return acc[key] = source[key], acc; 33245 }), target); 33246 }, 33247 combine: function(a, b) { 33248 return [].concat(a, b); 33249 }, 33250 compact: function(value) { 33251 for (var queue = [{ 33252 obj: { o: value }, 33253 prop: "o" 33254 }], refs = [], i = 0; i < queue.length; ++i) for (var item = queue[i], obj = item.obj[item.prop], keys = Object.keys(obj), j = 0; j < keys.length; ++j) { 33255 var key = keys[j], val = obj[key]; 33256 "object" == typeof val && null !== val && -1 === refs.indexOf(val) && (queue.push({ 33257 obj, 33258 prop: key 33259 }), refs.push(val)); 33260 } 33261 return function(queue) { 33262 for (; queue.length > 1;) { 33263 var item = queue.pop(), obj = item.obj[item.prop]; 33264 if (isArray$1(obj)) { 33265 for (var compacted = [], j = 0; j < obj.length; ++j) void 0 !== obj[j] && compacted.push(obj[j]); 33266 item.obj[item.prop] = compacted; 33267 } 33268 } 33269 }(queue), value; 33270 }, 33271 decode: function(str, decoder, charset) { 33272 var strWithoutPlus = str.replace(/\+/g, " "); 33273 if ("iso-8859-1" === charset) return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); 33274 try { 33275 return decodeURIComponent(strWithoutPlus); 33276 } catch (e) { 33277 return strWithoutPlus; 33278 } 33279 }, 33280 encode: function(str, defaultEncoder, charset, kind, format) { 33281 if (0 === str.length) return str; 33282 var string = str; 33283 if ("symbol" == typeof str ? string = Symbol.prototype.toString.call(str)
33283: "string" != typeof str && (string = String(str)), "iso-8859-1" === charset) return escape(string).replace(/%u[0-9a-f]{4}/gi, (function($0) { 33284 return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; 33285 })); 33286 for (var out = "", j = 0; j < string.length; j += 1024) { 33287 for (var segment = string.length >= 1024 ? string.slice(j, j + 1024) : string, arr = [], i = 0; i < segment.length; ++i) { 33288 var c = segment.charCodeAt(i); 33289 45 === c || 46 === c || 95 === c || 126 === c || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (40 === c || 41 === c) ? arr[arr.length] = segment.charAt(i) : c < 128 ? arr[arr.length] = hexTable[c] : c < 2048 ? arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | 63 & c] : c < 55296 || c >= 57344 ? arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | 63 & c] : (i += 1, c = 65536 + ((1023 & c) << 10 | 1023 & segment.charCodeAt(i)), arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | 63 & c]); 33290 } 33291 out += arr.join(""); 33292 } 33293 return out; 33294 }, 33295 isBuffer: function(obj) { 33296 return !(!obj || "object" != typeof obj) && !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 33297 }, 33298 isRegExp: function(obj) { 33299 return "[object RegExp]" === Object.prototype.toString.call(obj); 33300 }, 33301 maybeMap: function(val, fn) { 33302 if (isArray$1(val)) { 33303 for (var mapped = [], i = 0; i < val.length; i += 1) mapped.push(fn(val[i])); 33304 return mapped; 33305 } 33306 return fn(val); 33307 }, 33308 merge: function merge(target, source, options) { 33309 if (!source) return target; 33310 if ("object" != typeof source) { 33311 if (isArray$1(target)) target.push(source); 33312 else { 33313 if (!target || "object" != typeof target) return [target, source]; 33314 (options && (options.plainObjects || options.allowPrototypes) || !has$1.call(Object.prototype, source)) && (target[source] = !0); 33315 } 33316 return target; 33317 } 33318 if (!target || "object" != typeof target) return [target].concat(source); 33319 var mergeTarget = target; 33320 return isArray$1(target) && !isArray$1(source) && (mergeTarget = arrayToObject(target, options)), isArray$1(target) && isArray$1(source) ? (source.forEach((function(item, i) { 33321 if (has$1.call(target, i)) { 33322 var targetItem = target[i]; 33323 targetItem && "object" == typeof targetItem && item && "object" == typeof item ? target[i] = merge(targetItem, item, options) : target.push(item); 33324 } else target[i] = item; 33325 })), target) : Object.keys(source).reduce((function(acc, key) { 33326 var value = source[key]; 33327 return has$1.call(acc, key) ? acc[key] = merge(acc[key], value, options) : acc[key] = value, acc; 33328 }), mergeTarget); 33329 } 33330 }; 33331 has$2 = Object.prototype.hasOwnProperty; 33332 arrayPrefixGenerators = { 33333 brackets: function(prefix) { 33334 return prefix + "[]"; 33335 }, 33336 comma: "comma", 33337 indices: function(prefix, key) { 33338 return prefix + "[" + key + "]"; 33339 }, 33340 repeat: function(prefix) { 33341 return prefix; 33342 } 33343 }; 33344 isArray$2 = Array.isArray; 33345 push = Array.prototype.push; 33346 pushToArray = function(arr, valueOrArray) { 33347 push.apply(arr, isArray$2(valueOrArray) ? valueOrArray : [valueOrArray]); 33348 }; 33349 toISO = Date.prototype.toISOString; 33350 defaultFormat = formats.default; 33351 defaults = { 33352 addQueryPrefix: !1, 33353 allowDots: !1, 33354 allowEmptyArrays: !1, 33355 arrayFormat: "indices", 33356 charset: "utf-8", 33357 charsetSentinel: !1, 33358 delimiter: "&", 33359 encode: !0, 33360 encodeDotInKeys: !1, 33361 encoder: utils.encode, 33362 encodeValuesOnly: !1, 33363 format: defaultFormat, 33364 formatter: formats.formatters[defaultFormat], 33365 indices: !1, 33366 serializeDate: function(date) { 33367 return toISO.call(date); 33368 }, 33369 skipNulls: !1, 33370 strictNullHandling: !1 33371 }; 33372 sentinel = {}; 33373 stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel$1) { 33374 for (var obj = object, tmpSc = sideChannel$1, step = 0, findFlag = !1; void 0 !== (tmpSc = tmpSc.get(sentinel)) && !findFlag;) { 33375 var pos = tmpSc.get(object); 33376 if (step += 1, void 0 !== pos) { 33377 if (pos === step) throw new RangeError("Cyclic object value"); 33378 findFlag = !0; 33379 } 33380 void 0 === tmpSc.get(sentinel) && (step = 0); 33381 } 33382 if ("function" == typeof filter ? obj = filter(prefix, obj) : obj instanceof Date ? obj = serializeDate(obj) : "comma" === generateArrayPrefix && isArray$2(obj) && (obj = utils.maybeMap(obj, (function(value) { 33383 return value instanceof Date ? serializeDate(value) : value; 33384 }))), null === obj) { 33385 if (strictNullHandling) return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix; 33386 obj = ""; 33387 } 33388 if (function(v) { 33389 return "string" == typeof v || "number" == typeof v || "boolean" == typeof v || "symbol" == typeof v || "bigint" == typeof v; 33390 }(obj) || utils.isBuffer(obj)) return encoder ? [formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format)) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))] : [formatter(prefix) + "=" + formatter(String(obj))]; 33391 var objKeys, values = []; 33392 if (void 0 === obj) return values; 33393 if ("comma" === generateArrayPrefix && isArray$2(obj)) encodeValuesOnly && encoder && (obj = utils.maybeMap(obj, encoder)), objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }]; 33394 else if (isArray$2(filter)) objKeys = filter; 33395 else { 33396 var keys = Object.keys(obj); 33397 objKeys = sort ? keys.sort(sort) : keys; 33398 } 33399 var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix, adjustedPrefix = commaRoundTrip && isArray$2(obj) && 1 === obj.length ? encodedPrefix + "[]" : encodedPrefix; 33400 if (allowEmptyArrays && isArray$2(obj) && 0 === obj.length) return adjustedPrefix + "[]"; 33401 for (var j = 0; j < objKeys.length; ++j) { 33402 var key = objKeys[j], value = "object" == typeof key && void 0 !== key.value ? key.value : obj[key]; 33403 if (!skipNulls || null !== value) { 33404 var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key, keyPrefix = isArray$2(obj) ? "function" == typeof generateArrayPrefix ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]"); 33405 sideChannel$1.set(object, step); 33406 var valueSideChannel = sideChannel(); 33407 valueSideChannel.set(sentinel, sideChannel$1), pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, "comma" === generateArrayPrefix && encodeValuesOnly && isArray$2(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel)); 33408 } 33409 } 33410 return values; 33411 }; 33412 has$3 = Object.prototype.hasOwnProperty; 33413 isArray$3 = Array.isArray; 33414 defaults$1 = { 33415 allowDots: !1, 33416 allowEmptyArrays: !1, 33417 allowPrototypes: !1, 33418 allowSparse: !1, 33419 arrayLimit: 20, 33420 charset: "utf-8", 33421 charsetSentinel: !1, 33422 comma: !1, 33423 decodeDotInKeys: !1, 33424 decoder: utils.decode, 33425 delimiter: "&", 33426 depth: 5, 33427 duplicates: "combine", 33428 ignoreQueryPrefix: !1, 33429 interpretNumericEntities: !1, 33430 parameterLimit: 1e3, 33431 parseArrays: !0, 33432 plainObjects: !1, 33433 strictNullHandling: !1 33434 }; 33435 interpretNumericEntities = function(str) { 33436 return str.replace(/&#(\d+);
vendor: 11,354 bytes, lines 33436-33569
33436/g, (function($0, numberStr) { 33437 return String.fromCharCode(parseInt(numberStr, 10)); 33438 })); 33439 }; 33440 parseArrayValue = function(val, options) { 33441 return val && "string" == typeof val && options.comma && val.indexOf(",") > -1 ? val.split(",") : val; 33442 }; 33443 parseKeys = function(givenKey, val, options, valuesParsed) { 33444 if (givenKey) { 33445 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey, child = /(\[[^[\]]*])/g, segment = options.depth > 0 && /(\[[^[\]]*])/.exec(key), parent = segment ? key.slice(0, segment.index) : key, keys = []; 33446 if (parent) { 33447 if (!options.plainObjects && has$3.call(Object.prototype, parent) && !options.allowPrototypes) return; 33448 keys.push(parent); 33449 } 33450 for (var i = 0; options.depth > 0 && null !== (segment = child.exec(key)) && i < options.depth;) { 33451 if (i += 1, !options.plainObjects && has$3.call(Object.prototype, segment[1].slice(1, -1)) && !options.allowPrototypes) return; 33452 keys.push(segment[1]); 33453 } 33454 return segment && keys.push("[" + key.slice(segment.index) + "]"), function(chain, val, options, valuesParsed) { 33455 for (var leaf = valuesParsed ? val : parseArrayValue(val, options), i = chain.length - 1; i >= 0; --i) { 33456 var obj, root = chain[i]; 33457 if ("[]" === root && options.parseArrays) obj = options.allowEmptyArrays && "" === leaf ? [] : [].concat(leaf); 33458 else { 33459 obj = options.plainObjects ? Object.create(null) : {}; 33460 var cleanRoot = "[" === root.charAt(0) && "]" === root.charAt(root.length - 1) ? root.slice(1, -1) : root, decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot, index = parseInt(decodedRoot, 10); 33461 options.parseArrays || "" !== decodedRoot ? !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit ? (obj = [])[index] = leaf : "__proto__" !== decodedRoot && (obj[decodedRoot] = leaf) : obj = { 0: leaf }; 33462 } 33463 leaf = obj; 33464 } 33465 return leaf; 33466 }(keys, val, options, valuesParsed); 33467 } 33468 }; 33469 lib = { 33470 formats, 33471 parse: function(str, opts) { 33472 var options = function(opts) { 33473 if (!opts) return defaults$1; 33474 if (void 0 !== opts.allowEmptyArrays && "boolean" != typeof opts.allowEmptyArrays) throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); 33475 if (void 0 !== opts.decodeDotInKeys && "boolean" != typeof opts.decodeDotInKeys) throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); 33476 if (null !== opts.decoder && void 0 !== opts.decoder && "function" != typeof opts.decoder) throw new TypeError("Decoder has to be a function."); 33477 if (void 0 !== opts.charset && "utf-8" !== opts.charset && "iso-8859-1" !== opts.charset) throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); 33478 var charset = void 0 === opts.charset ? defaults$1.charset : opts.charset, duplicates = void 0 === opts.duplicates ? defaults$1.duplicates : opts.duplicates; 33479 if ("combine" !== duplicates && "first" !== duplicates && "last" !== duplicates) throw new TypeError("The duplicates option must be either combine, first, or last"); 33480 return { 33481 allowDots: void 0 === opts.allowDots ? !0 === opts.decodeDotInKeys || defaults$1.allowDots : !!opts.allowDots, 33482 allowEmptyArrays: "boolean" == typeof opts.allowEmptyArrays ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays, 33483 allowPrototypes: "boolean" == typeof opts.allowPrototypes ? opts.allowPrototypes : defaults$1.allowPrototypes, 33484 allowSparse: "boolean" == typeof opts.allowSparse ? opts.allowSparse : defaults$1.allowSparse, 33485 arrayLimit: "number" == typeof opts.arrayLimit ? opts.arrayLimit : defaults$1.arrayLimit, 33486 charset, 33487 charsetSentinel: "boolean" == typeof opts.charsetSentinel ? opts.charsetSentinel : defaults$1.charsetSentinel, 33488 comma: "boolean" == typeof opts.comma ? opts.comma : defaults$1.comma, 33489 decodeDotInKeys: "boolean" == typeof opts.decodeDotInKeys ? opts.decodeDotInKeys : defaults$1.decodeDotInKeys, 33490 decoder: "function" == typeof opts.decoder ? opts.decoder : defaults$1.decoder, 33491 delimiter: "string" == typeof opts.delimiter || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults$1.delimiter, 33492 depth: "number" == typeof opts.depth || !1 === opts.depth ? +opts.depth : defaults$1.depth, 33493 duplicates, 33494 ignoreQueryPrefix: !0 === opts.ignoreQueryPrefix, 33495 interpretNumericEntities: "boolean" == typeof opts.interpretNumericEntities ? opts.interpretNumericEntities : defaults$1.interpretNumericEntities, 33496 parameterLimit: "number" == typeof opts.parameterLimit ? opts.parameterLimit : defaults$1.parameterLimit, 33497 parseArrays: !1 !== opts.parseArrays, 33498 plainObjects: "boolean" == typeof opts.plainObjects ? opts.plainObjects : defaults$1.plainObjects, 33499 strictNullHandling: "boolean" == typeof opts.strictNullHandling ? opts.strictNullHandling : defaults$1.strictNullHandling 33500 }; 33501 }(opts); 33502 if ("" === str || null == str) return options.plainObjects ? Object.create(null) : {}; 33503 for (var tempObj = "string" == typeof str ? function(str, options) { 33504 var i, obj = { __proto__: null }, cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str, limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit, parts = cleanStr.split(options.delimiter, limit), skipIndex = -1, charset = options.charset; 33505 if (options.charsetSentinel) for (i = 0; i < parts.length; ++i) 0 === parts[i].indexOf("utf8=") && ("utf8=%E2%9C%93" === parts[i] ? charset = "utf-8" : "utf8=%26%2310003%3B" === parts[i] && (charset = "iso-8859-1"), skipIndex = i, i = parts.length); 33506 for (i = 0; i < parts.length; ++i) if (i !== skipIndex) { 33507 var key, val, part = parts[i], bracketEqualsPos = part.indexOf("]="), pos = -1 === bracketEqualsPos ? part.indexOf("=") : bracketEqualsPos + 1; 33508 -1 === pos ? (key = options.decoder(part, defaults$1.decoder, charset, "key"), val = options.strictNullHandling ? null : "") : (key = options.decoder(part.slice(0, pos), defaults$1.decoder, charset, "key"), val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options), (function(encodedVal) { 33509 return options.decoder(encodedVal, defaults$1.decoder, charset, "value"); 33510 }))), val && options.interpretNumericEntities && "iso-8859-1" === charset && (val = interpretNumericEntities(val)), part.indexOf("[]=") > -1 && (val = isArray$3(val) ? [val] : val); 33511 var existing = has$3.call(obj, key); 33512 existing && "combine" === options.duplicates ? obj[key] = utils.combine(obj[key], val) : existing && "last" !== options.duplicates || (obj[key] = val); 33513 } 33514 return obj; 33515 }(str, options) : str, obj = options.plainObjects ? Object.create(null) : {}, keys = Object.keys(tempObj), i = 0; i < keys.length; ++i) { 33516 var key = keys[i], newObj = parseKeys(key, tempObj[key], options, "string" == typeof str); 33517 obj = utils.merge(obj, newObj, options); 33518 } 33519 return !0 === options.allowSparse ? obj : utils.compact(obj); 33520 }, 33521 stringify: function(object, opts) { 33522 var objKeys, obj = object, options = function(opts) { 33523 if (!opts) return defaults; 33524 if (void 0 !== opts.allowEmptyArrays && "boolean" != typeof opts.allowEmptyArrays) throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); 33525 if (void 0 !== opts.encodeDotInKeys && "boolean" != typeof opts.encodeDotInKeys) throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); 33526 if (null !== opts.encoder && void 0 !== opts.encoder && "function" != typeof opts.encoder) throw new TypeError("Encoder has to be a function."); 33527 var charset = opts.charset || defaults.charset; 33528 if (void 0 !== opts.charset && "utf-8" !== opts.charset && "iso-8859-1" !== opts.charset) throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); 33529 var format = formats.default; 33530 if (void 0 !== opts.format) { 33531 if (!has$2.call(formats.formatters, opts.format)) throw new TypeError("Unknown format option provided."); 33532 format = opts.format; 33533 } 33534 var arrayFormat, formatter = formats.formatters[format], filter = defaults.filter; 33535 if (("function" == typeof opts.filter || isArray$2(opts.filter)) && (filter = opts.filter), arrayFormat = opts.arrayFormat in arrayPrefixGenerators ? opts.arrayFormat : "indices" in opts ? opts.indices ? "indices" : "repeat" : defaults.arrayFormat, "commaRoundTrip" in opts && "boolean" != typeof opts.commaRoundTrip) throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); 33536 var allowDots = void 0 === opts.allowDots ? !0 === opts.encodeDotInKeys || defaults.allowDots : !!opts.allowDots; 33537 return { 33538 addQueryPrefix: "boolean" == typeof opts.addQueryPrefix ? opts.addQueryPrefix : defaults.addQueryPrefix, 33539 allowDots, 33540 allowEmptyArrays: "boolean" == typeof opts.allowEmptyArrays ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 33541 arrayFormat, 33542 charset, 33543 charsetSentinel: "boolean" == typeof opts.charsetSentinel ? opts.charsetSentinel : defaults.charsetSentinel, 33544 commaRoundTrip: opts.commaRoundTrip, 33545 delimiter: void 0 === opts.delimiter ? defaults.delimiter : opts.delimiter, 33546 encode: "boolean" == typeof opts.encode ? opts.encode : defaults.encode, 33547 encodeDotInKeys: "boolean" == typeof opts.encodeDotInKeys ? opts.encodeDotInKeys : defaults.encodeDotInKeys, 33548 encoder: "function" == typeof opts.encoder ? opts.encoder : defaults.encoder, 33549 encodeValuesOnly: "boolean" == typeof opts.encodeValuesOnly ? opts.encodeValuesOnly : defaults.encodeValuesOnly, 33550 filter, 33551 format, 33552 formatter, 33553 serializeDate: "function" == typeof opts.serializeDate ? opts.serializeDate : defaults.serializeDate, 33554 skipNulls: "boolean" == typeof opts.skipNulls ? opts.skipNulls : defaults.skipNulls, 33555 sort: "function" == typeof opts.sort ? opts.sort : null, 33556 strictNullHandling: "boolean" == typeof opts.strictNullHandling ? opts.strictNullHandling : defaults.strictNullHandling 33557 }; 33558 }(opts); 33559 "function" == typeof options.filter ? obj = (0, options.filter)("", obj) : isArray$2(options.filter) && (objKeys = options.filter); 33560 var keys = []; 33561 if ("object" != typeof obj || null === obj) return ""; 33562 var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat], commaRoundTrip = "comma" === generateArrayPrefix && options.commaRoundTrip; 33563 objKeys || (objKeys = Object.keys(obj)), options.sort && objKeys.sort(options.sort); 33564 for (var sideChannel$1 = sideChannel(), i = 0; i < objKeys.length; ++i) { 33565 var key = objKeys[i]; 33566 options.skipNulls && null === obj[key] || pushToArray(keys, stringify(obj[key], key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel$1)); 33567 } 33568 var joined = keys.join(options.delimiter), prefix = !0 === options.addQueryPrefix ? "?" : ""; 33569 return options.charsetSentinel && ("iso-8859-1" === options.charset ? prefix += "utf8=%26%2310003%3B&" : prefix += "utf8=%E2%9C%93&"), joined.length >
33569 0 ? prefix + joined : ""; 33570 } 33571 }; 33572 componentEmitter = createCommonjsModule((function(module) { 33573 function Emitter(obj) { 33574 if (obj) return function(obj) { 33575 for (var key in Emitter.prototype) obj[key] = Emitter.prototype[key]; 33576 return obj; 33577 }(obj); 33578 } 33579 module.exports = Emitter, Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn) { 33580 return this._callbacks = this._callbacks || {}, (this._callbacks["$" + event] = this._callbacks["$" + event] || []).push(fn), this; 33581 }, Emitter.prototype.once = function(event, fn) { 33582 function on() { 33583 this.off(event, on), fn.apply(this, arguments); 33584 } 33585 return on.fn = fn, this.on(event, on), this; 33586 }, Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn) { 33587 if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this; 33588 var cb, callbacks = this._callbacks["$" + event]; 33589 if (!callbacks) return this; 33590 if (1 == arguments.length) return delete this._callbacks["$" + event], this; 33591 for (var i = 0; i < callbacks.length; i++) if ((cb = callbacks[i]) === fn || cb.fn === fn) { 33592 callbacks.splice(i, 1); 33593 break; 33594 } 33595 return 0 === callbacks.length && delete this._callbacks["$" + event], this; 33596 }, Emitter.prototype.emit = function(event) { 33597 this._callbacks = this._callbacks || {}; 33598 for (var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event], i = 1; i < arguments.length; i++) args[i - 1] = arguments[i]; 33599 if (callbacks) { 33600 i = 0; 33601 for (var len = (callbacks = callbacks.slice(0)).length; i < len; ++i) callbacks[i].apply(this, args); 33602 } 33603 return this; 33604 }, Emitter.prototype.listeners = function(event) { 33605 return this._callbacks = this._callbacks || {}, this._callbacks["$" + event] || []; 33606 }, Emitter.prototype.hasListeners = function(event) { 33607 return !!this.listeners(event).length; 33608 }; 33609 })); 33610 fastSafeStringify = stringify$1; 33611 stringify$1.default = stringify$1, stringify$1.stable = deterministicStringify, stringify$1.stableStringify = deterministicStringify; 33612 arr = []; 33613 replacerStack = []; 33614 utils$1 = createCommonjsModule((function(module, exports) { 33615 function _typeof(obj) { 33616 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 33617 return typeof obj; 33618 } : function(obj) { 33619 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 33620 })(obj); 33621 } 33622 function _createForOfIteratorHelper(o, allowArrayLike) { 33623 var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"]; 33624 if (!it) { 33625 if (Array.isArray(o) || (it = function(o, minLen) { 33626 if (!o) return; 33627 if ("string" == typeof o) return _arrayLikeToArray(o, minLen); 33628 var n = Object.prototype.toString.call(o).slice(8, -1); 33629 "Object" === n && o.constructor && (n = o.constructor.name); 33630 if ("Map" === n || "Set" === n) return Array.from(o); 33631 if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 33632 }(o)) || allowArrayLike && o && "number" == typeof o.length) { 33633 it && (o = it); 33634 var i = 0, F = function() {}; 33635 return { 33636 s: F, 33637 n: function() { 33638 return i >= o.length ? { done: !0 } : { 33639 done: !1, 33640 value: o[i++] 33641 }; 33642 }, 33643 e: function(_e) { 33644 throw _e; 33645 }, 33646 f: F 33647 }; 33648 } 33649 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 33650 } 33651 var err, normalCompletion = !0, didErr = !1; 33652 return { 33653 s: function() { 33654 it = it.call(o); 33655 }, 33656 n: function() { 33657 var step = it.next(); 33658 return normalCompletion = step.done, step; 33659 }, 33660 e: function(_e2) { 33661 didErr = !0, err = _e2; 33662 }, 33663 f: function() { 33664 try { 33665 normalCompletion || null == it.return || it.return(); 33666 } finally { 33667 if (didErr) throw err; 33668 } 33669 } 33670 }; 33671 } 33672 function _arrayLikeToArray(arr, len) { 33673 (null == len || len > arr.length) && (len = arr.length); 33674 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 33675 return arr2; 33676 } 33677 exports.type = function(string_) { 33678 return string_.split(/ *; */).shift(); 33679 }, exports.params = function(value) { 33680 var _step, object = {}, _iterator = _createForOfIteratorHelper(value.split(/ *; */)); 33681 try { 33682 for (_iterator.s();
33682 !(_step = _iterator.n()).done;) { 33683 var parts = _step.value.split(/ *= */), key = parts.shift(), _value = parts.shift(); 33684 key && _value && (object[key] = _value); 33685 } 33686 } catch (err) { 33687 _iterator.e(err); 33688 } finally { 33689 _iterator.f(); 33690 } 33691 return object; 33692 }, exports.parseLinks = function(value) { 33693 var _step2, object = {}, _iterator2 = _createForOfIteratorHelper(value.split(/ *, */)); 33694 try { 33695 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { 33696 var parts = _step2.value.split(/ *; */), url = parts[0].slice(1, -1); 33697 object[parts[1].split(/ *= */)[1].slice(1, -1)] = url; 33698 } 33699 } catch (err) { 33700 _iterator2.e(err); 33701 } finally { 33702 _iterator2.f(); 33703 } 33704 return object; 33705 }, exports.cleanHeader = function(header, changesOrigin) { 33706 return delete header["content-type"], delete header["content-length"], delete header["transfer-encoding"], delete header.host, changesOrigin && (delete header.authorization, delete header.cookie), header; 33707 }, exports.isObject = function(object) { 33708 return null !== object && "object" === _typeof(object); 33709 }, exports.hasOwn = Object.hasOwn || function(object, property) { 33710 if (null == object) throw new TypeError("Cannot convert undefined or null to object"); 33711 return Object.prototype.hasOwnProperty.call(new Object(object), property); 33712 }, exports.mixin = function(target, source) { 33713 for (var key in source) exports.hasOwn(source, key) && (target[key] = source[key]); 33714 }; 33715 })); 33716 utils$1.type, utils$1.params, utils$1.parseLinks, utils$1.cleanHeader, utils$1.isObject, utils$1.hasOwn, utils$1.mixin; 33717 isObject = utils$1.isObject; 33718 hasOwn$1 = utils$1.hasOwn; 33719 requestBase = RequestBase; 33720 RequestBase.prototype.clearTimeout = function() { 33721 return clearTimeout(this._timer), clearTimeout(this._responseTimeoutTimer), clearTimeout(this._uploadTimeoutTimer), delete this._timer, delete this._responseTimeoutTimer, delete this._uploadTimeoutTimer, this; 33722 }, RequestBase.prototype.parse = function(fn) { 33723 return this._parser = fn, this; 33724 }, RequestBase.prototype.responseType = function(value) { 33725 return this._responseType = value, this; 33726 }, RequestBase.prototype.serialize = function(fn) { 33727 return this._serializer = fn, this; 33728 }, RequestBase.prototype.timeout = function(options) { 33729 if (!options || "object" !== _typeof(options)) return this._timeout = options, this._responseTimeout = 0, this._uploadTimeout = 0, this; 33730 for (var option in options) if (hasOwn$1(options, option)) switch (option) { 33731 case "deadline": 33732 this._timeout = options.deadline; 33733 break; 33734 case "response": 33735 this._responseTimeout = options.response; 33736 break; 33737 case "upload": 33738 this._uploadTimeout = options.upload; 33739 break; 33740 default: console.warn("Unknown timeout option", option); 33741 } 33742 return this; 33743 }, RequestBase.prototype.retry = function(count, fn) { 33744 return 0 !== arguments.length && !0 !== count || (count = 1), count <= 0 && (count = 0), this._maxRetries = count, this._retries = 0, this._retryCallback = fn, this; 33745 }; 33746 ERROR_CODES = /* @__PURE__ */ new Set([ 33747 "ETIMEDOUT", 33748 "ECONNRESET", 33749 "EADDRINUSE", 33750 "ECONNREFUSED", 33751 "EPIPE", 33752 "ENOTFOUND", 33753 "ENETUNREACH", 33754 "EAI_AGAIN" 33755 ]); 33756 STATUS_CODES = /* @__PURE__ */ new Set([ 33757 408, 33758 413, 33759 429, 33760 500, 33761 502, 33762 503, 33763 504, 33764 521, 33765 522, 33766 524 33767 ]); 33768 RequestBase.prototype._shouldRetry = function(error, res) { 33769 if (!this._maxRetries || this._retries++ >= this._maxRetries) return !1; 33770 if (this._retryCallback) try { 33771 var override = this._retryCallback(error, res); 33772 if (!0 === override) return !0; 33773 if (!1 === override) return !1; 33774 } catch (err) { 33775 console.error(err); 33776 } 33777 if (res && res.status && STATUS_CODES.has(res.status)) return !0; 33778 if (error) { 33779 if (error.code && ERROR_CODES.has(error.code)) return !0; 33780 if (error.timeout && "ECONNABORTED" === error.code) return !0; 33781 if (error.crossDomain) return !0; 33782 } 33783 return !1; 33784 }, RequestBase.prototype._retry = function() { 33785 return this.clearTimeout(), this.req && (this.req = null, this.req = this.request()), this._aborted = !1, this.timedout = !1, this.timedoutError = null, this._end(); 33786 }, RequestBase.prototype.then = function(resolve, reject) { 33787 var _this = this; 33788 if (!this._fullfilledPromise) { 33789 var self = this; 33790 this._endCalled && console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"), this._fullfilledPromise = new Promise((function(resolve, reject) { 33791 self.on("abort", (function() { 33792 if (!(_this._maxRetries && _this._maxRetries > _this._retries)) if (_this.timedout && _this.timedoutError) reject(_this.timedoutError); 33793 else { 33794 var error = /* @__PURE__ */ new Error("Aborted"); 33795 error.code = "ABORTED", error.status = _this.status, error.method = _this.method, error.url = _this.url, reject(error); 33796 } 33797 })), self.end((function(error, res) { 33798 error ? reject(error) : resolve(res); 33799 })); 33800 })); 33801 } 33802 return this._fullfilledPromise.then(resolve, reject); 33803 }, RequestBase.prototype.catch = function(callback) { 33804 return this.then(void 0, callback); 33805 }, RequestBase.prototype.use = function(fn) { 33806 return fn(this), this; 33807 }, RequestBase.prototype.ok = function(callback) { 33808 if ("function" != typeof callback) throw new Error("Callback required"); 33809 return this._okCallback = callback, this; 33810 }, RequestBase.prototype._isResponseOK = function(res) { 33811 return !!res && (this._okCallback ? this._okCallback(res) : res.status >= 200 && res.status < 300); 33812 }, RequestBase.prototype.get = function(field) { 33813 return this._header[field.toLowerCase()]; 33814 }, RequestBase.prototype.getHeader = RequestBase.prototype.get, RequestBase.prototype.set = function(field, value) { 33815 if (isObject(field)) { 33816 for (var key in field) hasOwn$1(field, key) && this.set(key, field[key]); 33817 return this; 33818 } 33819 return this._header[field.toLowerCase()] = value, this.header[field] = value, this; 33820 }, RequestBase.prototype.unset = function(field) { 33821 return delete this._header[field.toLowerCase()], delete this.header[field], this; 33822 }, RequestBase.prototype.field = function(name, value, options) { 33823 if (null == name) throw new Error(".field(name, val) name can not be empty"); 33824 if (this._data) throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"); 33825 if (isObject(name)) { 33826 for (var key in name) hasOwn$1(name, key) && this.field(key, name[key]); 33827 return this; 33828 } 33829 if (Array.isArray(value)) { 33830 for (var i in value) hasOwn$1(value, i) && this.field(name, value[i]); 33831 return this; 33832 } 33833 if (null == value) throw new Error(".field(name, val) val can not be empty"); 33834 return "boolean" == typeof value && (value = String(value)), options ? this._getFormData().append(name, value, options) : this._getFormData().append(name, value), this; 33835 }, RequestBase.prototype.abort = function() { 33836 if (this._aborted) return this; 33837 if (this._aborted = !0, this.xhr && this.xhr.abort(), this.req) { 33838 if (semver.gte(process.version, "v13.0.0") && semver.lt(process.version, "v14.0.0")) throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes"); 33839 semver.gte(process.version, "v14.0.0") && (this.req.destroyed = !0), this.req.abort(); 33840 }
33841 return this.clearTimeout(), this.emit("abort"), this; 33842 }, RequestBase.prototype._auth = function(user, pass, options, base64Encoder) { 33843 switch (options.type) { 33844 case "basic": 33845 this.set("Authorization", "Basic ".concat(base64Encoder("".concat(user, ":").concat(pass)))); 33846 break; 33847 case "auto": 33848 this.username = user, this.password = pass; 33849 break; 33850 case "bearer": this.set("Authorization", "Bearer ".concat(user)); 33851 } 33852 return this; 33853 }, RequestBase.prototype.withCredentials = function(on) { 33854 return void 0 === on && (on = !0), this._withCredentials = on, this; 33855 }, RequestBase.prototype.redirects = function(n) { 33856 return this._maxRedirects = n, this; 33857 }, RequestBase.prototype.maxResponseSize = function(n) { 33858 if ("number" != typeof n) throw new TypeError("Invalid argument"); 33859 return this._maxResponseSize = n, this; 33860 }, RequestBase.prototype.toJSON = function() { 33861 return { 33862 method: this.method, 33863 url: this.url, 33864 data: this._data, 33865 headers: this._header 33866 }; 33867 }, RequestBase.prototype.send = function(data) { 33868 var isObject_ = isObject(data), type = this._header["content-type"]; 33869 if (this._formData) throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"); 33870 if (isObject_ && !this._data) Array.isArray(data) ? this._data = [] : this._isHost(data) || (this._data = {}); 33871 else if (data && this._data && this._isHost(this._data)) throw new Error("Can't merge these send calls"); 33872 if (isObject_ && isObject(this._data)) for (var key in data) hasOwn$1(data, key) && (this._data[key] = data[key]); 33873 else "string" == typeof data ? (type || this.type("form"), (type = this._header["content-type"]) && (type = type.toLowerCase().trim()), this._data = "application/x-www-form-urlencoded" === type ? this._data ? "".concat(this._data, "&").concat(data) : data : (this._data || "") + data) : this._data = data; 33874 return !isObject_ || this._isHost(data) || type || this.type("json"), this; 33875 }, RequestBase.prototype.sortQuery = function(sort) { 33876 return this._sort = void 0 === sort || sort, this; 33877 }, RequestBase.prototype._finalizeQueryString = function() { 33878 var query = this._query.join("&"); 33879 if (query && (this.url += (this.url.includes("?") ? "&" : "?") + query), this._query.length = 0, this._sort) { 33880 var index = this.url.indexOf("?"); 33881 if (index >= 0) { 33882 var queryArray = this.url.slice(index + 1).split("&"); 33883 "function" == typeof this._sort ? queryArray.sort(this._sort) : queryArray.sort(), this.url = this.url.slice(0, index) + "?" + queryArray.join("&"); 33884 } 33885 } 33886 }, RequestBase.prototype._appendQueryString = function() { 33887 console.warn("Unsupported"); 33888 }, RequestBase.prototype._timeoutError = function(reason, timeout, errno) { 33889 if (!this._aborted) { 33890 var error = new Error("".concat(reason + timeout, "ms exceeded")); 33891 error.timeout = timeout, error.code = "ECONNABORTED", error.errno = errno, this.timedout = !0, this.timedoutError = error, this.abort(), this.callback(error); 33892 } 33893 }, RequestBase.prototype._setTimeouts = function() { 33894 var self = this; 33895 this._timeout && !this._timer && (this._timer = setTimeout((function() { 33896 self._timeoutError("Timeout of ", self._timeout, "ETIME"); 33897 }), this._timeout)), this._responseTimeout && !this._responseTimeoutTimer && (this._responseTimeoutTimer = setTimeout((function() { 33898 self._timeoutError("Response timeout of ", self._responseTimeout, "ETIMEDOUT"); 33899 }), this._responseTimeout)); 33900 }; 33901 responseBase = ResponseBase; 33902 ResponseBase.prototype.get = function(field) { 33903 return this.header[field.toLowerCase()]; 33904 }, ResponseBase.prototype._setHeaderProperties = function(header) { 33905 var ct = header["content-type"] || ""; 33906 this.type = utils$1.type(ct); 33907 var parameters = utils$1.params(ct); 33908 for (var key in parameters) Object.prototype.hasOwnProperty.call(parameters, key) && (this[key] = parameters[key]); 33909 this.links = {}; 33910 try { 33911 header.link && (this.links = utils$1.parseLinks(header.link)); 33912 } catch (_unused) {} 33913 }, ResponseBase.prototype._setStatusProperties = function(status) { 33914 var type = Math.trunc(status / 100); 33915 this.statusCode = status, this.status = this.statusCode, this.statusType = type, this.info = 1 === type, this.ok = 2 === type, this.redirect = 3 === type, this.clientError = 4 === type, this.serverError = 5 === type, this.error = (4 === type || 5 === type) && this.toError(), this.created = 201 === status, this.accepted = 202 === status, this.noContent = 204 === status, this.badRequest = 400 === status, this.unauthorized = 401 === status, this.notAcceptable = 406 === status, this.forbidden = 403 === status, this.notFound = 404 === status, this.unprocessableEntity = 422 === status; 33916 }; 33917 for (_loop = function() { 33918 var fn = _arr[_i]; 33919 Agent.prototype[fn] = function() { 33920 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; 33921 return this._defaults.push({ 33922 fn, 33923 args 33924 }), this; 33925 }; 33926 }, _i = 0, _arr = [ 33927 "use", 33928 "on", 33929 "once", 33930 "set", 33931 "query", 33932 "type", 33933 "accept", 33934 "auth", 33935 "withCredentials", 33936 "sortQuery", 33937 "retry", 33938 "ok", 33939 "redirects", 33940 "timeout", 33941 "buffer", 33942 "serialize", 33943 "parse", 33944 "ca", 33945 "key", 33946 "pfx", 33947 "cert", 33948 "disableTLSCerts" 33949 ]; _i < _arr.length; _i++) _loop(); 33950 Agent.prototype._setDefaults = function(request) { 33951 var _step, _iterator = function(o, allowArrayLike) { 33952 var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"]; 33953 if (!it) { 33954 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && "number" == typeof o.length) { 33955 it && (o = it); 33956 var i = 0, F = function() {}; 33957 return { 33958 s: F, 33959 n: function() { 33960 return i >= o.length ? { done: !0 } : { 33961 done: !1, 33962 value: o[i++] 33963 }; 33964 }, 33965 e: function(_e) { 33966 throw _e; 33967 }, 33968 f: F 33969 }; 33970 } 33971 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 33972 } 33973 var err, normalCompletion = !0, didErr = !1; 33974 return { 33975 s: function() { 33976 it = it.call(o); 33977 }, 33978 n: function() { 33979 var step = it.next(); 33980 return normalCompletion = step.done, step; 33981 }, 33982 e: function(_e2) { 33983 didErr = !0, err = _e2; 33984 }, 33985 f: function() { 33986 try { 33987 normalCompletion || null == it.return || it.return(); 33988 } finally { 33989 if (didErr) throw err; 33990 } 33991 } 33992 }; 33993 }(this._defaults); 33994 try { 33995 for (_iterator.s();
33995 !(_step = _iterator.n()).done;) { 33996 var def = _step.value; 33997 request[def.fn].apply(request, _toConsumableArray(def.args)); 33998 } 33999 } catch (err) { 34000 _iterator.e(err); 34001 } finally { 34002 _iterator.f(); 34003 } 34004 }; 34005 for (agentBase = Agent, client = createCommonjsModule((function(module, exports) { 34006 function _typeof(obj) { 34007 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 34008 return typeof obj; 34009 } : function(obj) { 34010 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 34011 })(obj); 34012 } 34013 function _createForOfIteratorHelper(o, allowArrayLike) { 34014 var it = "undefined" != typeof Symbol && o[Symbol.iterator] || o["@@iterator"]; 34015 if (!it) { 34016 if (Array.isArray(o) || (it = function(o, minLen) { 34017 if (!o) return; 34018 if ("string" == typeof o) return _arrayLikeToArray(o, minLen); 34019 var n = Object.prototype.toString.call(o).slice(8, -1); 34020 "Object" === n && o.constructor && (n = o.constructor.name); 34021 if ("Map" === n || "Set" === n) return Array.from(o); 34022 if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 34023 }(o)) || allowArrayLike && o && "number" == typeof o.length) { 34024 it && (o = it); 34025 var i = 0, F = function() {}; 34026 return { 34027 s: F, 34028 n: function() { 34029 return i >= o.length ? { done: !0 } : { 34030 done: !1, 34031 value: o[i++] 34032 }; 34033 }, 34034 e: function(_e) { 34035 throw _e; 34036 }, 34037 f: F 34038 }; 34039 } 34040 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 34041 } 34042 var err, normalCompletion = !0, didErr = !1; 34043 return { 34044 s: function() { 34045 it = it.call(o); 34046 }, 34047 n: function() { 34048 var step = it.next(); 34049 return normalCompletion = step.done, step; 34050 }, 34051 e: function(_e2) { 34052 didErr = !0, err = _e2; 34053 }, 34054 f: function() { 34055 try { 34056 normalCompletion || null == it.return || it.return(); 34057 } finally { 34058 if (didErr) throw err; 34059 } 34060 } 34061 }; 34062 } 34063 function _arrayLikeToArray(arr, len) { 34064 (null == len || len > arr.length) && (len = arr.length); 34065 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 34066 return arr2; 34067 } 34068 var root; 34069 "undefined" != typeof window ? root = window : "undefined" == typeof self ? (console.warn("Using browser-only version of superagent in non-browser environment"), root = void 0) : root = self; 34070 var isObject = utils$1.isObject, mixin = utils$1.mixin, hasOwn = utils$1.hasOwn; 34071 function noop() {} 34072 module.exports = function(method, url) { 34073 return "function" == typeof url ? new exports.Request("GET", method).end(url) : 1 === arguments.length ? new exports.Request("GET", method) : new exports.Request(method, url); 34074 }; 34075 var request = exports = module.exports; 34076 exports.Request = Request, request.getXHR = function() { 34077 if (root.XMLHttpRequest && (!root.location || "file:" !== root.location.protocol || !root.ActiveXObject)) return new XMLHttpRequest(); 34078 try { 34079 return new ActiveXObject("Microsoft.XMLHTTP"); 34080 } catch (_unused) {} 34081 try { 34082 return new ActiveXObject("Msxml2.XMLHTTP.6.0"); 34083 } catch (_unused2) {} 34084 try { 34085 return new ActiveXObject("Msxml2.XMLHTTP.3.0"); 34086 } catch (_unused3) {} 34087 try { 34088 return new ActiveXObject("Msxml2.XMLHTTP"); 34089 } catch (_unused4) {} 34090 throw new Error("Browser-only version of superagent could not find XHR"); 34091 }; 34092 var trim = "".trim ? function(s) { 34093 return s.trim(); 34094 } : function(s) { 34095 return s.replace(/(^\s*|\s*$)/g, ""); 34096 }; 34097 function serialize(object) { 34098 if (!isObject(object)) return object; 34099 var pairs = []; 34100 for (var key in object) hasOwn(object, key) && pushEncodedKeyValuePair(pairs, key, object[key]); 34101 return pairs.join("&"); 34102 } 34103 function pushEncodedKeyValuePair(pairs, key, value) { 34104 if (void 0 !== value) if (null !== value) if (Array.isArray(value)) { 34105 var _step, _iterator = _createForOfIteratorHelper(value);
vendor: 2,028 bytes, lines 34106-34131
34106 try { 34107 for (_iterator.s(); !(_step = _iterator.n()).done;) pushEncodedKeyValuePair(pairs, key, _step.value); 34108 } catch (err) { 34109 _iterator.e(err); 34110 } finally { 34111 _iterator.f(); 34112 } 34113 } else if (isObject(value)) for (var subkey in value) hasOwn(value, subkey) && pushEncodedKeyValuePair(pairs, "".concat(key, "[").concat(subkey, "]"), value[subkey]); 34114 else pairs.push(encodeURI(key) + "=" + encodeURIComponent(value)); 34115 else pairs.push(encodeURI(key)); 34116 } 34117 function parseString(string_) { 34118 for (var pair, pos, object = {}, pairs = string_.split("&"), i = 0, length_ = pairs.length; i < length_; ++i) -1 === (pos = (pair = pairs[i]).indexOf("=")) ? object[decodeURIComponent(pair)] = "" : object[decodeURIComponent(pair.slice(0, pos))] = decodeURIComponent(pair.slice(pos + 1)); 34119 return object; 34120 } 34121 function isJSON(mime) { 34122 return /[/+]json($|[^-\w])/i.test(mime); 34123 } 34124 function Response(request_) { 34125 this.req = request_, this.xhr = this.req.xhr, this.text = "HEAD" !== this.req.method && ("" === this.xhr.responseType || "text" === this.xhr.responseType) || void 0 === this.xhr.responseType ? this.xhr.responseText : null, this.statusText = this.req.xhr.statusText; 34126 var status = this.xhr.status; 34127 1223 === status && (status = 204), this._setStatusProperties(status), this.headers = function(string_) { 34128 for (var index, line, field, value, lines = string_.split(/\r?\n/), fields = {}, i = 0, length_ = lines.length; i < length_; ++i) -1 !== (index = (line = lines[i]).indexOf(":")) && (field = line.slice(0, index).toLowerCase(), value = trim(line.slice(index + 1)), fields[field] = value); 34129 return fields; 34130 }(this.xhr.getAllResponseHeaders()), this.header = this.headers, this.header["content-type"] = this.xhr.getResponseHeader("content-type"), this._setHeaderProperties(this.header), null === this.text && request_._responseType ? this.body = this.xhr.response : this.body = "HEAD" === this.req.method ? null : this._parseBody(this.text ? this.text : this.xhr.response); 34131 }
34132 function Request(method, url) { 34133 var self = this; 34134 this._query = this._query || [], this.method = method, this.url = url, this.header = {}, this._header = {}, this.on("end", (function() { 34135 var new_error, error = null, res = null; 34136 try { 34137 res = new Response(self); 34138 } catch (err) { 34139 return (error = /* @__PURE__ */ new Error("Parser is unable to parse the response")).parse = !0, error.original = err, self.xhr ? (error.rawResponse = void 0 === self.xhr.responseType ? self.xhr.responseText : self.xhr.response, error.status = self.xhr.status ? self.xhr.status : null, error.statusCode = error.status) : (error.rawResponse = null, error.status = null), self.callback(error); 34140 } 34141 self.emit("response", res); 34142 try { 34143 self._isResponseOK(res) || (new_error = new Error(res.statusText || res.text || "Unsuccessful HTTP response")); 34144 } catch (err) { 34145 new_error = err; 34146 } 34147 new_error ? (new_error.original = error, new_error.response = res, new_error.status = res.status, self.callback(new_error, res)) : self.callback(null, res); 34148 })); 34149 } 34150 request.serializeObject = serialize, request.parseString = parseString, request.types = { 34151 html: "text/html", 34152 json: "application/json", 34153 xml: "text/xml", 34154 urlencoded: "application/x-www-form-urlencoded", 34155 form: "application/x-www-form-urlencoded", 34156 "form-data": "application/x-www-form-urlencoded" 34157 }, request.serialize = { 34158 "application/x-www-form-urlencoded": lib.stringify, 34159 "application/json": fastSafeStringify 34160 }, request.parse = { 34161 "application/x-www-form-urlencoded": parseString, 34162 "application/json": JSON.parse 34163 }, mixin(Response.prototype, responseBase.prototype), Response.prototype._parseBody = function(string_) { 34164 var parse = request.parse[this.type]; 34165 return this.req._parser ? this.req._parser(this, string_) : (!parse && isJSON(this.type) && (parse = request.parse["application/json"]), parse && string_ && (string_.length > 0 || string_ instanceof Object) ? parse(string_) : null); 34166 }, Response.prototype.toError = function() { 34167 var req = this.req, method = req.method, url = req.url, message = "cannot ".concat(method, " ").concat(url, " (").concat(this.status, ")"), error = new Error(message); 34168 return error.status = this.status, error.method = method, error.url = url, error; 34169 }, request.Response = Response, componentEmitter(Request.prototype), mixin(Request.prototype, requestBase.prototype), Request.prototype.type = function(type) { 34170 return this.set("Content-Type", request.types[type] || type), this; 34171 }, Request.prototype.accept = function(type) { 34172 return this.set("Accept", request.types[type] || type), this; 34173 }, Request.prototype.auth = function(user, pass, options) { 34174 1 === arguments.length && (pass = ""), "object" === _typeof(pass) && null !== pass && (options = pass, pass = ""), options || (options = { type: "function" == typeof btoa ? "basic" : "auto" }); 34175 var encoder = options.encoder ? options.encoder : function(string) { 34176 if ("function" == typeof btoa) return btoa(string); 34177 throw new Error("Cannot use basic auth, btoa is not a function"); 34178 }; 34179 return this._auth(user, pass, options, encoder); 34180 }, Request.prototype.query = function(value) { 34181 return "string" != typeof value && (value = serialize(value)), value && this._query.push(value), this; 34182 }, Request.prototype.attach = function(field, file, options) { 34183 if (file) { 34184 if (this._data) throw new Error("superagent can't mix .send() and .attach()"); 34185 this._getFormData().append(field, file, options || file.name); 34186 } 34187 return this; 34188 }, Request.prototype._getFormData = function() { 34189 return this._formData || (this._formData = new root.FormData()), this._formData; 34190 }, Request.prototype.callback = function(error, res) { 34191 if (this._shouldRetry(error, res)) return this._retry(); 34192 var fn = this._callback; 34193 this.clearTimeout(), error && (this._maxRetries && (error.retries = this._retries - 1), this.emit("error", error)), fn(error, res); 34194 }, Request.prototype.crossDomainError = function() { 34195 var error = /* @__PURE__ */ new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc."); 34196 error.crossDomain = !0, error.status = this.status, error.method = this.method, error.url = this.url, this.callback(error); 34197 }, Request.prototype.agent = function() { 34198 return console.warn("This is not supported in browser version of superagent"), this; 34199 }, Request.prototype.ca = Request.prototype.agent, Request.prototype.buffer = Request.prototype.ca, Request.prototype.write = function() { 34200 throw new Error("Streaming is not supported in browser version of superagent"); 34201 }, Request.prototype.pipe = Request.prototype.write, Request.prototype._isHost = function(object) { 34202 return object && "object" === _typeof(object) && !Array.isArray(object) && "[object Object]" !== Object.prototype.toString.call(object); 34203 }, Request.prototype.end = function(fn) { 34204 this._endCalled && console.warn("Warning: .end() was called twice. This is not supported in superagent"), this._endCalled = !0, this._callback = fn || noop, this._finalizeQueryString(), this._end(); 34205 }, Request.prototype._setUploadTimeout = function() { 34206 var self = this; 34207 this._uploadTimeout && !this._uploadTimeoutTimer && (this._uploadTimeoutTimer = setTimeout((function() { 34208 self._timeoutError("Upload timeout of ", self._uploadTimeout, "ETIMEDOUT"); 34209 }), this._uploadTimeout)); 34210 }, Request.prototype._end = function() { 34211 if (this._aborted) return this.callback(/* @__PURE__ */ new Error("The request has been aborted even before .end() was called")); 34212 var self = this; 34213 this.xhr = request.getXHR(); 34214 var xhr = this.xhr, data = this._formData || this._data; 34215 this._setTimeouts(), xhr.addEventListener("readystatechange", (function() { 34216 var readyState = xhr.readyState; 34217 if (readyState >= 2 && self._responseTimeoutTimer && clearTimeout(self._responseTimeoutTimer), 4 === readyState) { 34218 var status; 34219 try { 34220 status = xhr.status; 34221 } catch (_unused5) { 34222 status = 0; 34223 } 34224 if (!status) { 34225 if (self.timedout || self._aborted) return; 34226 return self.crossDomainError(); 34227 } 34228 self.emit("end"); 34229 } 34230 })); 34231 var handleProgress = function(direction, e) { 34232 e.total > 0 && (e.percent = e.loaded / e.total * 100, 100 === e.percent && clearTimeout(self._uploadTimeoutTimer)), e.direction = direction, self.emit("progress", e); 34233 }; 34234 if (this.hasListeners("progress")) try { 34235 xhr.addEventListener("progress", handleProgress.bind(null, "download")), xhr.upload && xhr.upload.addEventListener("progress", handleProgress.bind(null, "upload")); 34236 } catch (_unused6) {} 34237 xhr.upload && this._setUploadTimeout(); 34238 try { 34239 this.username && this.password ? xhr.open(this.method, this.url, !0, this.username, this.password) : xhr.open(this.method, this.url, !0); 34240 } catch (err) { 34241 return this.callback(err); 34242 } 34243 if (this._withCredentials && (xhr.withCredentials = !0), !this._formData && "GET" !== this.method && "HEAD" !== this.method && "string" != typeof data && !this._isHost(data)) { 34244 var contentType = this._header["content-type"], _serialize = this._serializer || request.serialize[contentType ? contentType.split(";")[0] : ""]; 34245 !_serialize && isJSON(contentType) && (_serialize = request.serialize["application/json"]), _serialize && (data = _serialize(data)); 34246 } 34247 for (var field in this.header) null !== this.header[field] && hasOwn(this.header, field) && xhr.setRequestHeader(field, this.header[field]); 34248 this._responseType && (xhr.responseType = this._responseType), this.emit
34248("request", this), xhr.send(void 0 === data ? null : data); 34249 }, request.agent = function() { 34250 return new agentBase(); 34251 }; 34252 for (var _loop = function() { 34253 var method = _arr[_i]; 34254 agentBase.prototype[method.toLowerCase()] = function(url, fn) { 34255 var request_ = new request.Request(method, url); 34256 return this._setDefaults(request_), fn && request_.end(fn), request_; 34257 }; 34258 }, _i = 0, _arr = [ 34259 "GET", 34260 "POST", 34261 "OPTIONS", 34262 "PATCH", 34263 "PUT", 34264 "DELETE" 34265 ]; _i < _arr.length; _i++) _loop(); 34266 function del(url, data, fn) { 34267 var request_ = request("DELETE", url); 34268 return "function" == typeof data && (fn = data, data = null), data && request_.send(data), fn && request_.end(fn), request_; 34269 } 34270 agentBase.prototype.del = agentBase.prototype.delete, request.get = function(url, data, fn) { 34271 var request_ = request("GET", url); 34272 return "function" == typeof data && (fn = data, data = null), data && request_.query(data), fn && request_.end(fn), request_; 34273 }, request.head = function(url, data, fn) { 34274 var request_ = request("HEAD", url); 34275 return "function" == typeof data && (fn = data, data = null), data && request_.query(data), fn && request_.end(fn), request_; 34276 }, request.options = function(url, data, fn) { 34277 var request_ = request("OPTIONS", url); 34278 return "function" == typeof data && (fn = data, data = null), data && request_.send(data), fn && request_.end(fn), request_; 34279 }, request.del = del, request.delete = del, request.patch = function(url, data, fn) { 34280 var request_ = request("PATCH", url); 34281 return "function" == typeof data && (fn = data, data = null), data && request_.send(data), fn && request_.end(fn), request_; 34282 }, request.post = function(url, data, fn) { 34283 var request_ = request("POST", url); 34284 return "function" == typeof data && (fn = data, data = null), data && request_.send(data), fn && request_.end(fn), request_; 34285 }, request.put = function(url, data, fn) { 34286 var request_ = request("PUT", url); 34287 return "function" == typeof data && (fn = data, data = null), data && request_.send(data), fn && request_.end(fn), request_; 34288 }; 34289 })), byteLength_1 = (client.Request, function(b64) { 34290 var lens = getLens(b64), validLen = lens[0], placeHoldersLen = lens[1]; 34291 return 3 * (validLen + placeHoldersLen) / 4 - placeHoldersLen; 34292 }), toByteArray_1 = function(b64) { 34293 var tmp, i, lens = getLens(b64), validLen = lens[0], placeHoldersLen = lens[1], arr = new Arr(function(b64, validLen, placeHoldersLen) { 34294 return 3 * (validLen + placeHoldersLen) / 4 - placeHoldersLen; 34295 }(0, validLen, placeHoldersLen)), curByte = 0, len = placeHoldersLen > 0 ? validLen - 4 : validLen; 34296 for (i = 0; i < len; i += 4) tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)], arr[curByte++] = tmp >> 16 & 255, arr[curByte++] = tmp >> 8 & 255, arr[curByte++] = 255 & tmp; 34297 2 === placeHoldersLen && (tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4, arr[curByte++] = 255 & tmp); 34298 1 === placeHoldersLen && (tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2, arr[curByte++] = tmp >> 8 & 255, arr[curByte++] = 255 & tmp); 34299 return arr; 34300 }, fromByteArray_1 = function(uint8) { 34301 for (var tmp, len = uint8.length, extraBytes = len % 3, parts = [], i = 0, len2 = len - extraBytes; i < len2; i += 16383) parts.push(encodeChunk(uint8, i, i + 16383 > len2 ? len2 : i + 16383)); 34302 1 === extraBytes ? (tmp = uint8[len - 1], parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==")) : 2 === extraBytes && (tmp = (uint8[len - 2] << 8) + uint8[len - 1], parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=")); 34303 return parts.join(""); 34304 }, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, len = code.length; i < len; ++i) lookup[i] = code[i], revLookup[code.charCodeAt(i)] = i; 34305 revLookup["-".charCodeAt(0)] = 62, revLookup["_".charCodeAt(0)] = 63; 34306 base64Js = { 34307 byteLength: byteLength_1, 34308 toByteArray: toByteArray_1, 34309 fromByteArray: fromByteArray_1 34310 }; 34311 base64Url = { 34312 encode: function(str) { 34313 return base64Js.fromByteArray(function(str) { 34314 for (var arr = new Array(str.length), a = 0; a < str.length; a++) arr[a] = str.charCodeAt(a); 34315 return arr; 34316 }(str)).replace(/\+/g, "-").replace(/\//g, "_"); 34317 }, 34318 decode: function(str) { 34319 return str = function(str) { 34320 var mod = str.length % 4; 34321 return 0 === mod ? str : str + new Array(1 + (4 - mod)).join("="); 34322 }(str).replace(/-/g, "+").replace(/_/g, "/"), function(array) { 34323 for (var result = "", i = 0; i < array.length; i++) result += String.fromCharCode(array[i]); 34324 return result; 34325 }(base64Js.toByteArray(str)); 34326 } 34327 }; 34328 version = { raw: "9.26.1" }; 34329 toString = Object.prototype.toString; 34330 assert = { 34331 check: function(o, config, attributes) { 34332 if (config.optional && !o || variable(o, config.type, config.message), "object" === config.type && attributes) for (var keys = Object.keys(attributes), index = 0; index < keys.length; index++) { 34333 var a = keys[index]; 34334 attributes[a].optional && !o[a] || attributes[a].condition && !attributes[a].condition(o) || (attribute(o, a, attributes[a].type, attributes[a].message), attributes[a].values && value(o[a], attributes[a].values, attributes[a].value_message)); 34335 } 34336 }, 34337 attribute, 34338 variable, 34339 value, 34340 isArray: function(array) { 34341 return this.supportsIsArray() ? Array.isArray(array) : "[object Array]" === toString.call(array); 34342 }, 34343 supportsIsArray: function() { 34344 return null != Array.isArray; 34345 } 34346 }; 34347 objectAssign = { 34348 get: function() { 34349 return Object.assign ? Object.assign : objectAssignPolyfill; 34350 }, 34351 objectAssignPolyfill 34352 }; 34353 objectHelper = { 34354 toSnakeCase: function toSnakeCase(object, exceptions) { 34355 return "object" != typeof object || assert.isArray(object) || null === object ? object : (exceptions = exceptions || [], Object.keys(object).reduce((function(p, key) { 34356 return p[-1 === exceptions.indexOf(key) ? function(str) { 34357 for (var code, newKey = "", index = 0, wasPrevNumber = !0, wasPrevUppercase = !0; index < str.length;) code = str.charCodeAt(index), !wasPrevUppercase && code >= 65 && code <= 90 || !wasPrevNumber && code >= 48 && code <= 57 ? (newKey += "_", newKey += str[index].toLowerCase()) : newKey += str[index].toLowerCase(), wasPrevNumber = code >= 48 && code <= 57, wasPrevUppercase = code >= 65 && code <= 90, index++; 34358 return newKey; 34359 }(key) : key] = toSnakeCase(object[key]), p; 34360 }), {})); 34361 }, 34362 toCamelCase: function toCamelCase(object, exceptions, options) { 34363 return "object" != typeof object || assert.isArray(object) || null === object ? object : (exceptions = exceptions || [], options = options || {}, Object.keys(object).reduce((function(p, key) { 34364 var parts, newKey = -1 === exceptions.indexOf(key) ? (parts = key.split("_")).reduce((function(p, c) { 34365 return p + c.charAt(0).toUpperCase() + c.slice(1); 34366 }), parts.shift()) : key; 34367 return p[newKey] = toCamelCase(object[newKey] || object[key], [], options), options.keepOriginal && (p[key] = toCamelCase(object[key], [], options)), p; 34368 }), {})); 34369 },
34370 blacklist: function(object, blacklistedKeys) { 34371 return Object.keys(object).reduce((function(p, key) { 34372 return -1 === blacklistedKeys.indexOf(key) && (p[key] = object[key]), p; 34373 }), {}); 34374 }, 34375 merge: function(object, keys) { 34376 return { 34377 base: keys ? pick(object, keys) : object, 34378 with: function(object2, keys2) { 34379 return object2 = keys2 ? pick(object2, keys2) : object2, extend(this.base, object2); 34380 } 34381 }; 34382 }, 34383 pick, 34384 getKeysNotIn: function(obj, allowedKeys) { 34385 var notAllowed = []; 34386 for (var key in obj) -1 === allowedKeys.indexOf(key) && notAllowed.push(key); 34387 return notAllowed; 34388 }, 34389 extend, 34390 getOriginFromUrl: function(url) { 34391 if (url) { 34392 var parsed = getLocationFromUrl(url); 34393 if (!parsed) return null; 34394 var origin = parsed.protocol + "//" + parsed.hostname; 34395 return parsed.port && (origin += ":" + parsed.port), origin; 34396 } 34397 }, 34398 getLocationFromUrl, 34399 trimUserDetails: function(options) { 34400 return function(options, keys) { 34401 return keys.reduce(trim, options); 34402 }(options, [ 34403 "username", 34404 "email", 34405 "phoneNumber" 34406 ]); 34407 }, 34408 updatePropertyOn: function updatePropertyOn(obj, path, value) { 34409 "string" == typeof path && (path = path.split(".")); 34410 var next = path[0]; 34411 obj.hasOwnProperty(next) && (1 === path.length ? obj[next] = value : updatePropertyOn(obj[next], path.slice(1), value)); 34412 } 34413 }; 34414 RequestWrapper.prototype.abort = function() { 34415 this.request.abort(); 34416 }, RequestWrapper.prototype.getMethod = function() { 34417 return this.method; 34418 }, RequestWrapper.prototype.getBody = function() { 34419 return this.body; 34420 }, RequestWrapper.prototype.getUrl = function() { 34421 return this.url; 34422 }, RequestWrapper.prototype.getHeaders = function() { 34423 return this.headers; 34424 }, RequestObj.prototype.set = function(key, value) { 34425 return this.request = this.request.set(key, value), this; 34426 }, RequestObj.prototype.send = function(body) { 34427 return this.request = this.request.send(objectHelper.trimUserDetails(body)), this; 34428 }, RequestObj.prototype.withCredentials = function() { 34429 return this.request = this.request.withCredentials(), this; 34430 }, RequestObj.prototype.end = function(cb) { 34431 return this.request.end(cb), new RequestWrapper(this.request); 34432 }, RequestBuilder.prototype.setCommonConfiguration = function(ongoingRequest, options) { 34433 if (options = options || {}, this._timesToRetryFailedRequests > 0 && (ongoingRequest = ongoingRequest.retry(this._timesToRetryFailedRequests)), options.noHeaders) return ongoingRequest; 34434 var headers = this.headers; 34435 ongoingRequest = ongoingRequest.set("Content-Type", "application/json"), options.xRequestLanguage && (ongoingRequest = ongoingRequest.set("X-Request-Language", options.xRequestLanguage)); 34436 for (var keys = Object.keys(this.headers), a = 0; a < keys.length; a++) ongoingRequest = ongoingRequest.set(keys[a], headers[keys[a]]); 34437 return this._sendTelemetry && (ongoingRequest = ongoingRequest.set("Auth0-Client", this.getTelemetryData())), ongoingRequest; 34438 }, RequestBuilder.prototype.getTelemetryData = function() { 34439 var telemetryName = this._universalLoginPage ? "auth0.js-ulp" : "auth0.js", clientInfo = { 34440 name: telemetryName, 34441 version: version.raw 34442 }; 34443 this._telemetryInfo && ((clientInfo = objectHelper.extend({}, this._telemetryInfo)).env = objectHelper.extend({}, this._telemetryInfo.env), clientInfo.env[telemetryName] = version.raw); 34444 var jsonClientInfo = JSON.stringify(clientInfo); 34445 return base64Url.encode(jsonClientInfo); 34446 }, RequestBuilder.prototype.get = function(url, options) { 34447 return new RequestObj(this.setCommonConfiguration(client.get(url), options)); 34448 }, RequestBuilder.prototype.post = function(url, options) { 34449 return new RequestObj(this.setCommonConfiguration(client.post(url), options)); 34450 }, RequestBuilder.prototype.patch = function(url, options) { 34451 return new RequestObj(this.setCommonConfiguration(client.patch(url), options)); 34452 }; 34453 windowHelper = { 34454 redirect: function(url) { 34455 getWindow().location = url; 34456 }, 34457 getDocument: function() { 34458 return getWindow().document; 34459 }, 34460 getWindow, 34461 getOrigin: function() { 34462 var location = getWindow().location, origin = location.origin; 34463 return origin || (origin = objectHelper.getOriginFromUrl(location.href)), origin; 34464 } 34465 }; 34466 DummyStorage.prototype.getItem = function() { 34467 return null; 34468 }, DummyStorage.prototype.removeItem = function() {}, DummyStorage.prototype.setItem = function() {};
34469 js_cookie = createCommonjsModule((function(module, exports) { 34470 var factory = function() { 34471 function extend() { 34472 for (var i = 0, result = {}; i < arguments.length; i++) { 34473 var attributes = arguments[i]; 34474 for (var key in attributes) result[key] = attributes[key]; 34475 } 34476 return result; 34477 } 34478 function decode(s) { 34479 return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); 34480 } 34481 return function init(converter) { 34482 function api() {} 34483 function set(key, value, attributes) { 34484 if ("undefined" != typeof document) { 34485 "number" == typeof (attributes = extend({ path: "/" }, api.defaults, attributes)).expires && (attributes.expires = /* @__PURE__ */ new Date(1 * /* @__PURE__ */ new Date() + 864e5 * attributes.expires)), attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ""; 34486 try { 34487 var result = JSON.stringify(value); 34488 /^[\{\[]/.test(result) && (value = result); 34489 } catch (e) {} 34490 value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); 34491 var stringifiedAttributes = ""; 34492 for (var attributeName in attributes) attributes[attributeName] && (stringifiedAttributes += "; " + attributeName, !0 !== attributes[attributeName] && (stringifiedAttributes += "=" + attributes[attributeName].split(";")[0])); 34493 return document.cookie = key + "=" + value + stringifiedAttributes; 34494 } 34495 } 34496 function get(key, json) { 34497 if ("undefined" != typeof document) { 34498 for (var jar = {}, cookies = document.cookie ? document.cookie.split("; ") : [], i = 0; i < cookies.length; i++) { 34499 var parts = cookies[i].split("="), cookie = parts.slice(1).join("="); 34500 json || "\"" !== cookie.charAt(0) || (cookie = cookie.slice(1, -1)); 34501 try { 34502 var name = decode(parts[0]); 34503 if (cookie = (converter.read || converter)(cookie, name) || decode(cookie), json) try { 34504 cookie = JSON.parse(cookie); 34505 } catch (e) {} 34506 if (jar[name] = cookie, key === name) break; 34507 } catch (e) {} 34508 } 34509 return key ? jar[key] : jar; 34510 } 34511 } 34512 return api.set = set, api.get = function(key) { 34513 return get(key, !1); 34514 }, api.getJSON = function(key) { 34515 return get(key, !0); 34516 }, api.remove = function(key, attributes) { 34517 set(key, "", extend(attributes, { expires: -1 })); 34518 }, api.defaults = {}, api.withConverter = init, api; 34519 }((function() {})); 34520 }; 34521 module.exports = factory(); 34522 })); 34523 CookieStorage$1.prototype.getItem = function(key) { 34524 return js_cookie.get(key) || js_cookie.get(buildCompatCookieKey(key)); 34525 }, CookieStorage$1.prototype.removeItem = function(key) { 34526 var params = {}; 34527 this._options.cookieDomain && (params.domain = this._options.cookieDomain), js_cookie.remove(key, params), js_cookie.remove(buildCompatCookieKey(key), params); 34528 }, CookieStorage$1.prototype.setItem = function(key, value, options) { 34529 var params = objectHelper.extend({ expires: 1 }, options); 34530 if ("https:" === windowHelper.getWindow().location.protocol && (params.secure = !0, params.sameSite = "none", this._options.legacySameSiteCookie)) { 34531 var legacyOptions = objectHelper.blacklist(params, ["sameSite"]); 34532 js_cookie.set(buildCompatCookieKey(key), value, legacyOptions); 34533 } 34534 this._options.cookieDomain && (params.domain = this._options.cookieDomain), js_cookie.set(key, value, params); 34535 }, Warn.prototype.warning = function(message) { 34536 this.disableWarnings || console.warn(message); 34537 }, StorageHandler.prototype.failover = function() { 34538 this.storage instanceof DummyStorage ? this.warn.warning("DummyStorage: ignore failover") : this.storage instanceof CookieStorage$1 ? (this.warn.warning("CookieStorage: failing over DummyStorage"), this.storage = new DummyStorage()) : (this.warn.warning("LocalStorage: failing over CookieStorage"), this.storage = new CookieStorage$1()); 34539 }, StorageHandler.prototype.getItem = function(key) { 34540 try { 34541 return this.storage.getItem(key); 34542 } catch (e) { 34543 return this.warn.warning(e), this.failover(), this.getItem(key); 34544 } 34545 }, StorageHandler.prototype.removeItem = function(key) { 34546 try { 34547 return this.storage.removeItem(key); 34548 } catch (e) { 34549 return this.warn.warning(e), this.failover(), this.removeItem(key); 34550 } 34551 }, StorageHandler.prototype.setItem = function(key, value, options) { 34552 try { 34553 return this.storage.setItem(key, value, options); 34554 } catch (e) { 34555 return this.warn.warning(e), this.failover(), this.setItem(key, value, options); 34556 } 34557 }, Storage.prototype.getItem = function(key) { 34558 var value = this.handler.getItem(key); 34559 try { 34560 return JSON.parse(value); 34561 } catch (_) { 34562 return value; 34563 } 34564 }, Storage.prototype.removeItem = function(key) { 34565 return this.handler.removeItem(key); 34566 }, Storage.prototype.setItem = function(key, value, options) { 34567 var json = JSON.stringify(value); 34568 return this.handler.setItem(key, json, options); 34569 }, SSODataStorage.prototype.set = function(connection, sub) { 34570 var ssodata = { 34571 lastUsedConnection: connection, 34572 lastUsedSub: sub 34573 }; 34574 this.storage.setItem("auth0.ssodata", JSON.stringify(ssodata)); 34575 }, SSODataStorage.prototype.get = function() { 34576 var ssodata = this.storage.getItem("auth0.ssodata"); 34577 if (ssodata) return JSON.parse(ssodata); 34578 }; 34579 error = { 34580 buildResponse, 34581 invalidToken: function(description) { 34582 return buildResponse("invalid_token", description); 34583 } 34584 }; 34585 tokenParams = [ 34586 "realm", 34587 "audience", 34588 "otp", 34589 "client_id", 34590 "client_secret", 34591 "redirect_uri", 34592 "scope", 34593 "code", 34594 "grant_type", 34595 "username", 34596 "password", 34597 "refresh_token", 34598 "assertion", 34599 "client_assertion", 34600 "client_assertion_type", 34601 "code_verifier" 34602 ]; 34603 authorizeParams = [ 34604 "connection", 34605 "connection_scope", 34606 "auth0Client", 34607 "owp", 34608 "device", 34609 "realm", 34610 "organization", 34611 "invitation", 34612 "protocol", 34613 "_csrf", 34614 "_intstate", 34615 "login_ticket", 34616 "client_id", 34617 "response_type", 34618 "response_mode", 34619 "redirect_uri", 34620 "audience", 34621 "scope", 34622 "state", 34623 "nonce", 34624 "display", 34625 "prompt", 34626 "screen_hint", 34627 "max_age", 34628 "ui_locales", 34629 "claims_locales", 34630 "id_token_hint", 34631 "login_hint", 34632 "acr_values", 34633 "claims", 34634 "registration", 34635 "request", 34636 "request_uri", 34637 "code_challenge", 34638 "code_challenge_method", 34639 "access_type", 34640 "display" 34641 ]; 34642 parametersWhitelist = { 34643 oauthTokenParams: function(warn, params) { 34644 return objectHelper.pick(params, tokenParams); 34645 }, 34646 oauthAuthorizeParams: function(warn, params) { 34647 var notAllowed = objectHelper.getKeysNotIn(params, authorizeParams); 34648 return notAllowed.length > 0 && warn.warning("Following parameters are not allowed on the `/authorize` endpoint: [" + notAllowed.join(",") + "]"), params; 34649 } 34650 }; 34651 t = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; 34652 r = e((function(e, r) { 34653 e.exports = function() { 34654 function e(t) { 34655 return "function" == typeof t; 34656 } 34657 var r = Array.isArray ? Array.isArray : function(t) { 34658 return "[object Array]" === Object.prototype.toString.call(t); 34659 }, i = 0, n = void 0, o = void 0, s = function(t, e) { 34660 l[i] = t, l[i + 1] = e, 2 === (i += 2) && (o ? o(d) : w()); 34661 }, h = "undefined" != typeof window ? window : void 0, u = h || {}, a = u.MutationObserver || u.WebKitMutationObserver, f = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process), c = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel; 34662 function p() { 34663 var t = setTimeout; 34664 return function() { 34665 return t(d, 1); 34666 }; 34667 } 34668 var l = new Array(1e3); 34669 function d() { 34670 for (var t = 0; t < i; t += 2) (0, l[t])(l[t + 1]), l[t] = void 0, l[t + 1] = void 0; 34671 i = 0; 34672 } 34673 var m, v, y, g, w = void 0; 34674 function T(t, e) { 34675 var r = this, i = new this.constructor(S); 34676 void 0 === i[_] && N(i); 34677 var n = r._state; 34678 if (n) { 34679 var o = arguments[n - 1]; 34680 s((function() { 34681 return O(n, i, o, r._result); 34682 })); 34683 } else C(r, i, t, e); 34684 return i; 34685 } 34686 function b(t) { 34687 if (t && "object" == typeof t && t.constructor === this) return t; 34688 var e = new this(S); 34689 return E(e, t), e; 34690 } 34691 w = f ? function() { 34692 return process.nextTick(d); 34693 } : a ? (v = 0, y = new a(d), g = document.createTextNode(""), y.observe(g, { characterData: !0 }), function() { 34694 g.data = v = ++v % 2; 34695 }) : c ? ((m = new MessageChannel()).port1.onmessage = d, function() { 34696 return m.port2.postMessage(0); 34697 }) : void 0 === h ? function() { 34698 try { 34699 var t = Function("return this")().require("vertx"); 34700 return void 0 !== (n = t.runOnLoop || t.runOnContext) ? function() { 34701 n(d); 34702 } : p(); 34703 } catch (t) { 34704 return p(); 34705 } 34706 }() : p(); 34707 var _ = Math.random().toString(36).substring(2); 34708 function S() {} 34709 var A = void 0; 34710 function x(t, r, i) { 34711 r.constructor === t.constructor && i === T && r.constructor.resolve === b ? function(t, e) { 34712 1 === e._state ? I(t, e._result) : 2 === e._state ? M(t, e._result) : C(e, void 0, (function(e) { 34713 return E(t, e); 34714 }), (function(e) { 34715 return M(t, e); 34716 })); 34717 }(t, r) : void 0 === i ? I(t, r) : e(i) ? function(t, e, r) { 34718 s((function(t) { 34719 var i = !1, n = function(r, n, o, s) { 34720 try { 34721 r.call(n, (function(r) { 34722 i || (i = !0, e !== r ? E(t, r) : I(t, r)); 34723 }), (function(e) { 34724 i || (i = !0, M(t, e)); 34725 })); 34726 } catch (t) { 34727 return t; 34728 } 34729 }(r, e); 34730 !i && n && (i = !0, M(t, n)); 34731 }), t); 34732 }(t, r, i) : I(t, r); 34733 } 34734 function E(t, e) {
34735 if (t === e) M(t, /* @__PURE__ */ new TypeError("You cannot resolve a promise with itself")); 34736 else if (n = typeof (i = e), null === i || "object" !== n && "function" !== n) I(t, e); 34737 else { 34738 var r = void 0; 34739 try { 34740 r = e.then; 34741 } catch (e) { 34742 M(t, e); 34743 return; 34744 } 34745 x(t, e, r); 34746 } 34747 var i, n; 34748 } 34749 function k(t) { 34750 t._onerror && t._onerror(t._result), R(t); 34751 } 34752 function I(t, e) { 34753 t._state === A && (t._result = e, t._state = 1, 0 !== t._subscribers.length && s(R, t)); 34754 } 34755 function M(t, e) { 34756 t._state === A && (t._state = 2, t._result = e, s(k, t)); 34757 } 34758 function C(t, e, r, i) { 34759 var n = t._subscribers, o = n.length; 34760 t._onerror = null, n[o] = e, n[o + 1] = r, n[o + 2] = i, 0 === o && t._state && s(R, t); 34761 } 34762 function R(t) { 34763 var e = t._subscribers, r = t._state; 34764 if (0 !== e.length) { 34765 for (var i = void 0, n = void 0, o = t._result, s = 0; s < e.length; s += 3) n = e[s + r], (i = e[s]) ? O(r, i, n, o) : n(o); 34766 t._subscribers.length = 0; 34767 } 34768 } 34769 function O(t, r, i, n) { 34770 var o = e(i), s = void 0, h = void 0, u = !0; 34771 if (o) { 34772 try { 34773 s = i(n); 34774 } catch (t) { 34775 u = !1, h = t; 34776 } 34777 if (r === s) return void M(r, /* @__PURE__ */ new TypeError("A promises callback cannot return that same promise.")); 34778 } else s = n; 34779 r._state !== A || (o && u ? E(r, s) : !1 === u ? M(r, h) : 1 === t ? I(r, s) : 2 === t && M(r, s)); 34780 } 34781 var j = 0; 34782 function N(t) { 34783 t[_] = j++, t._state = void 0, t._result = void 0, t._subscribers = []; 34784 } 34785 var P = function() { 34786 function t(t, e) { 34787 this._instanceConstructor = t, this.promise = new t(S), this.promise[_] || N(this.promise), r(e) ? (this.length = e.length, this._remaining = e.length, this._result = new Array(this.length), 0 === this.length ? I(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(e), 0 === this._remaining && I(this.promise, this._result))) : M(this.promise, /* @__PURE__ */ new Error("Array Methods must be provided an Array")); 34788 } 34789 return t.prototype._enumerate = function(t) { 34790 for (var e = 0; this._state === A && e < t.length; e++) this._eachEntry(t[e], e); 34791 }, t.prototype._eachEntry = function(t, e) { 34792 var r = this._instanceConstructor, i = r.resolve; 34793 if (i === b) { 34794 var n = void 0, o = void 0, s = !1; 34795 try { 34796 n = t.then; 34797 } catch (t) { 34798 s = !0, o = t; 34799 } 34800 if (n === T && t._state !== A) this._settledAt(t._state, e, t._result); 34801 else if ("function" != typeof n) this._remaining--, this._result[e] = t; 34802 else if (r === V) { 34803 var h = new r(S); 34804 s ? M(h, o) : x(h, t, n), this._willSettleAt(h, e); 34805 } else this._willSettleAt(new r((function(e) { 34806 return e(t); 34807 })), e); 34808 } else this._willSettleAt(i(t), e); 34809 }, t.prototype._settledAt = function(t, e, r) { 34810 var i = this.promise; 34811 i._state === A && (this._remaining--, 2 === t ? M(i, r) : this._result[e] = r), 0 === this._remaining && I(i, this._result); 34812 }, t.prototype._willSettleAt = function(t, e) { 34813 var r = this; 34814 C(t, void 0, (function(t) { 34815 return r._settledAt(1, e, t); 34816 }), (function(t) { 34817 return r._settledAt(2, e, t); 34818 })); 34819 }, t; 34820 }(), V = function() { 34821 function t(e) { 34822 this[_] = j++, this._result = this._state = void 0, this._subscribers = [], S !== e && ("function" != typeof e && function() { 34823 throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); 34824 }(), this instanceof t ? function(t, e) { 34825 try { 34826 e((function(e) { 34827 E(t, e); 34828 }), (function(e) { 34829 M(t, e); 34830 })); 34831 } catch (e) { 34832 M(t, e); 34833 } 34834 }(this, e) : function() { 34835 throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
34835onstructor cannot be called as a function."); 34836 }()); 34837 } 34838 return t.prototype.catch = function(t) { 34839 return this.then(null, t); 34840 }, t.prototype.finally = function(t) { 34841 var r = this, i = r.constructor; 34842 return e(t) ? r.then((function(e) { 34843 return i.resolve(t()).then((function() { 34844 return e; 34845 })); 34846 }), (function(e) { 34847 return i.resolve(t()).then((function() { 34848 throw e; 34849 })); 34850 })) : r.then(t, t); 34851 }, t; 34852 }(); 34853 return V.prototype.then = T, V.all = function(t) { 34854 return new P(this, t).promise; 34855 }, V.race = function(t) { 34856 var e = this; 34857 return r(t) ? new e((function(r, i) { 34858 for (var n = t.length, o = 0; o < n; o++) e.resolve(t[o]).then(r, i); 34859 })) : new e((function(t, e) { 34860 return e(/* @__PURE__ */ new TypeError("You must pass an array to race.")); 34861 })); 34862 }, V.resolve = b, V.reject = function(t) { 34863 var e = new this(S); 34864 return M(e, t), e; 34865 }, V._setScheduler = function(t) { 34866 o = t; 34867 }, V._setAsap = function(t) { 34868 s = t; 34869 }, V._asap = s, V.polyfill = function() { 34870 var e = void 0; 34871 if (void 0 !== t) e = t; 34872 else if ("undefined" != typeof self) e = self; 34873 else try { 34874 e = Function("return this")(); 34875 } catch (t) { 34876 throw new Error("polyfill failed because global object is unavailable in this environment"); 34877 } 34878 var r = e.Promise; 34879 if (r) { 34880 var i = null; 34881 try { 34882 i = Object.prototype.toString.call(r.resolve()); 34883 } catch (t) {} 34884 if ("[object Promise]" === i && !r.cast) return; 34885 } 34886 e.Promise = V; 34887 }, V.Promise = V, V; 34888 }(); 34889 })); 34890 i$1 = { 34891 __proto__: null, 34892 default: {} 34893 }; 34894 n = e((function(e, r) { 34895 var n; 34896 e.exports = n = n || function(e, r) { 34897 var n; 34898 if ("undefined" != typeof window && window.crypto && (n = window.crypto), "undefined" != typeof self && self.crypto && (n = self.crypto), "undefined" != typeof globalThis && globalThis.crypto && (n = globalThis.crypto), !n && "undefined" != typeof window && window.msCrypto && (n = window.msCrypto), !n && void 0 !== t && t.crypto && (n = t.crypto), !n) try { 34899 n = i$1; 34900 } catch (t) {} 34901 var o = function() { 34902 if (n) { 34903 if ("function" == typeof n.getRandomValues) try { 34904 return n.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0]; 34905 } catch (t) {} 34906 if ("function" == typeof n.randomBytes) try { 34907 return n.randomBytes(4).readInt32LE(); 34908 } catch (t) {} 34909 } 34910 throw new Error("Native crypto module could not be used to get secure random number."); 34911 }, s = Object.create || function() { 34912 function t() {} 34913 return function(e) { 34914 var r; 34915 return t.prototype = e, r = new t(), t.prototype = null, r; 34916 }; 34917 }(), h = {}, u = h.lib = {}, a = u.Base = { 34918 extend: function(t) { 34919 var e = s(this); 34920 return t && e.mixIn(t), e.hasOwnProperty("init") && this.init !== e.init || (e.init = function() { 34921 e.$super.init.apply(this, arguments); 34922 }), e.init.prototype = e, e.$super = this, e; 34923 }, 34924 create: function() { 34925 var t = this.extend(); 34926 return t.init.apply(t, arguments), t; 34927 }, 34928 init: function() {}, 34929 mixIn: function(t) { 34930 for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e]); 34931 t.hasOwnProperty("toString") && (this.toString = t.toString); 34932 }, 34933 clone: function() { 34934 return this.init.prototype.extend(this); 34935 } 34936 }, f = u.WordArray = a.extend({ 34937 init: function(t, e) { 34938 t = this.words = t || [], this.sigBytes = null != e ? e : 4 * t.length; 34939 }, 34940 toString: function(t) { 34941 return (t || p).stringify(this); 34942 }, 34943 concat: function(t) { 34944 var e = this.words, r = t.words, i = this.sigBytes, n = t.sigBytes; 34945 if (this.clamp(), i % 4) for (var o = 0; o < n; o++) e[i + o >>> 2] |= (r[o >>> 2] >>> 24 - o % 4 * 8 & 255) << 24 - (i + o) % 4 * 8; 34946 else for (var s = 0; s < n; s += 4) e[i + s >>> 2] = r[s >>> 2]; 34947 return this.sigBytes += n, this; 34948 }, 34949 clamp: function() { 34950 var t = this.words, r = this.sigBytes; 34951 t[r >>> 2] &= 4294967295 << 32 - r % 4 * 8, t.length = e.ceil(r / 4); 34952 }, 34953 clone: function() { 34954 var t = a.clone.call(this); 34955 return t.words = this.words.slice(0), t; 34956 }, 34957 random: function(t) { 34958 for (var e = [], r = 0; r < t; r += 4) e.push(o()); 34959 return new f.init(e, t); 34960 } 34961 }), c = h.enc = {}, p = c.Hex = {
vendor: 29,844 bytes, lines 34962-35759
34962 stringify: function(t) { 34963 for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) { 34964 var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255; 34965 i.push((o >>> 4).toString(16)), i.push((15 & o).toString(16)); 34966 } 34967 return i.join(""); 34968 }, 34969 parse: function(t) { 34970 for (var e = t.length, r = [], i = 0; i < e; i += 2) r[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4; 34971 return new f.init(r, e / 2); 34972 } 34973 }, l = c.Latin1 = { 34974 stringify: function(t) { 34975 for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) i.push(String.fromCharCode(e[n >>> 2] >>> 24 - n % 4 * 8 & 255)); 34976 return i.join(""); 34977 }, 34978 parse: function(t) { 34979 for (var e = t.length, r = [], i = 0; i < e; i++) r[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8; 34980 return new f.init(r, e); 34981 } 34982 }, d = c.Utf8 = { 34983 stringify: function(t) { 34984 try { 34985 return decodeURIComponent(escape(l.stringify(t))); 34986 } catch (t) { 34987 throw new Error("Malformed UTF-8 data"); 34988 } 34989 }, 34990 parse: function(t) { 34991 return l.parse(unescape(encodeURIComponent(t))); 34992 } 34993 }, m = u.BufferedBlockAlgorithm = a.extend({ 34994 reset: function() { 34995 this._data = new f.init(), this._nDataBytes = 0; 34996 }, 34997 _append: function(t) { 34998 "string" == typeof t && (t = d.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes; 34999 }, 35000 _process: function(t) { 35001 var r, i = this._data, n = i.words, o = i.sigBytes, s = this.blockSize, h = o / (4 * s), u = (h = t ? e.ceil(h) : e.max((0 | h) - this._minBufferSize, 0)) * s, a = e.min(4 * u, o); 35002 if (u) { 35003 for (var c = 0; c < u; c += s) this._doProcessBlock(n, c); 35004 r = n.splice(0, u), i.sigBytes -= a; 35005 } 35006 return new f.init(r, a); 35007 }, 35008 clone: function() { 35009 var t = a.clone.call(this); 35010 return t._data = this._data.clone(), t; 35011 }, 35012 _minBufferSize: 0 35013 }); 35014 u.Hasher = m.extend({ 35015 cfg: a.extend(), 35016 init: function(t) { 35017 this.cfg = this.cfg.extend(t), this.reset(); 35018 }, 35019 reset: function() { 35020 m.reset.call(this), this._doReset(); 35021 }, 35022 update: function(t) { 35023 return this._append(t), this._process(), this; 35024 }, 35025 finalize: function(t) { 35026 return t && this._append(t), this._doFinalize(); 35027 }, 35028 blockSize: 16, 35029 _createHelper: function(t) { 35030 return function(e, r) { 35031 return new t.init(r).finalize(e); 35032 }; 35033 }, 35034 _createHmacHelper: function(t) { 35035 return function(e, r) { 35036 return new v.HMAC.init(t, r).finalize(e); 35037 }; 35038 } 35039 }); 35040 var v = h.algo = {}; 35041 return h; 35042 }(Math); 35043 })); 35044 o = e((function(t, e) { 35045 var r; 35046 t.exports = (r = n, function(t) { 35047 var e = r, i = e.lib, n = i.WordArray, o = i.Hasher, s = e.algo, h = [], u = []; 35048 (function() { 35049 function e(e) { 35050 for (var r = t.sqrt(e), i = 2; i <= r; i++) if (!(e % i)) return !1; 35051 return !0; 35052 } 35053 function r(t) { 35054 return 4294967296 * (t - (0 | t)) | 0; 35055 } 35056 for (var i = 2, n = 0; n < 64;) e(i) && (n < 8 && (h[n] = r(t.pow(i, .5))), u[n] = r(t.pow(i, 1 / 3)), n++), i++; 35057 })(); 35058 var a = [], f = s.SHA256 = o.extend({ 35059 _doReset: function() { 35060 this._hash = new n.init(h.slice(0)); 35061 }, 35062 _doProcessBlock: function(t, e) { 35063 for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], h = r[4], f = r[5], c = r[6], p = r[7], l = 0; l < 64; l++) { 35064 if (l < 16) a[l] = 0 | t[e + l]; 35065 else { 35066 var d = a[l - 15], m = a[l - 2]; 35067 a[l] = ((d << 25 | d >>> 7) ^ (d << 14 | d >>> 18) ^ d >>> 3) + a[l - 7] + ((m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10) + a[l - 16]; 35068 } 35069 var v = i & n ^ i & o ^ n & o, y = p + ((h << 26 | h >>> 6) ^ (h << 21 | h >>> 11) ^ (h << 7 | h >>> 25)) + (h & f ^ ~h & c) + u[l] + a[l]; 35070 p = c, c = f, f = h, h = s + y | 0, s = o, o = n, n = i, i = y + (((i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22)) + v) | 0; 35071 } 35072 r[0] = r[0] + i | 0, r[1] = r[1] + n | 0, r[2] = r[2] + o | 0, r[3] = r[3] + s | 0, r[4] = r[4] + h | 0, r[5] = r[5] + f | 0, r[6] = r[6] + c | 0, r[7] = r[7] + p | 0; 35073 }, 35074 _doFinalize: function() { 35075 var e = this._data, r = e.words, i = 8 * this._nDataBytes, n = 8 * e.sigBytes; 35076 return r[n >>> 5] |= 128 << 24 - n % 32, r[14 + (n + 64 >>> 9 << 4)] = t.floor(i / 4294967296), r[15 + (n + 64 >>> 9 << 4)] = i, e.sigBytes = 4 * r.length, this._process(), this._hash; 35077 }, 35078 clone: function() { 35079 var t = o.clone.call(this); 35080 return t._hash = this._hash.clone(), t; 35081 } 35082 }); 35083 e.SHA256 = o._createHelper(f), e.HmacSHA256 = o._createHmacHelper(f); 35084 }(Math), r.SHA256); 35085 })); 35086 s = e((function(t, e) { 35087 var r, i; 35088 t.exports = (i = (r = n).lib.WordArray, r.enc.Base64 = { 35089 stringify: function(t) { 35090 var e = t.words, r = t.sigBytes, i = this._map; 35091 t.clamp(); 35092 for (var n = [], o = 0; o < r; o += 3) for (var s = (e[o >>> 2] >>> 24 - o % 4 * 8 & 255) << 16 | (e[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255) << 8 | e[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, h = 0; h < 4 && o + .75 * h < r; h++) n.push(i.charAt(s >>> 6 * (3 - h) & 63)); 35093 var u = i.charAt(64); 35094 if (u) for (; n.length % 4;) n.push(u); 35095 return n.join(""); 35096 }, 35097 parse: function(t) { 35098 var e = t.length, r = this._map, n = this._reverseMap; 35099 if (!n) { 35100 n = this._reverseMap = []; 35101 for (var o = 0; o < r.length; o++) n[r.charCodeAt(o)] = o; 35102 } 35103 var s = r.charAt(64); 35104 if (s) { 35105 var h = t.indexOf(s); 35106 -1 !== h && (e = h); 35107 } 35108 return function(t, e, r) { 35109 for (var n = [], o = 0, s = 0; s < e; s++) if (s % 4) { 35110 var h = r[t.charCodeAt(s - 1)] << s % 4 * 2, u = r[t.charCodeAt(s)] >>> 6 - s % 4 * 2; 35111 n[o >>> 2] |= (h | u) << 24 - o % 4 * 8, o++; 35112 } 35113 return i.create(n, o); 35114 }(t, e, n); 35115 }, 35116 _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" 35117 }, r.enc.Base64); 35118 })); 35119 h = e((function(t, e) { 35120 t.exports = n.enc.Hex; 35121 })); 35122 u = e((function(e, r) { 35123 (function() { 35124 var t; 35125 function r(t, e, r) { 35126 null != t && ("number" == typeof t ? this.fromNumber(t, e, r) : this.fromString(t, null == e && "string" != typeof t ? 256 : e)); 35127 } 35128 function i() { 35129 return new r(null); 35130 } 35131 var n = "undefined" != typeof navigator; 35132 n && "Microsoft Internet Explorer" == navigator.appName ? (r.prototype.am = function(t, e, r, i, n, o) { 35133 for (var s = 32767 & e, h = e >> 15; --o >= 0;) { 35134 var u = 32767 & this[t], a = this[t++] >> 15, f = h * u + a * s; 35135 n = ((u = s * u + ((32767 & f) << 15) + r[i] + (1073741823 & n)) >>> 30) + (f >>> 15) + h * a + (n >>> 30), r[i++] = 1073741823 & u; 35136 } 35137 return n; 35138 }, t = 30) : n && "Netscape" != navigator.appName ? (r.prototype.am = function(t, e, r, i, n, o) { 35139 for (; --o >= 0;) { 35140 var s = e * this[t++] + r[i] + n; 35141 n = Math.floor(s / 67108864), r[i++] = 67108863 & s; 35142 } 35143 return n; 35144 }, t = 26) : (r.prototype.am = function(t, e, r, i, n, o) { 35145 for (var s = 16383 & e, h = e >> 14; --o >= 0;) { 35146 var u = 16383 & this[t], a = this[t++] >> 14, f = h * u + a * s; 35147 n = ((u = s * u + ((16383 & f) << 14) + r[i] + n) >> 28) + (f >> 14) + h * a, r[i++] = 268435455 & u; 35148 } 35149 return n; 35150 }, t = 28), r.prototype.DB = t, r.prototype.DM = (1 << t) - 1, r.prototype.DV = 1 << t, r.prototype.FV = Math.pow(2, 52), r.prototype.F1 = 52 - t, r.prototype.F2 = 2 * t - 52; 35151 var o, s, h = new Array(); 35152 for (o = "0".charCodeAt(0), s = 0; s <= 9; ++s) h[o++] = s; 35153 for (o = "a".charCodeAt(0), s = 10; s < 36; ++s) h[o++] = s; 35154 for (o = "A".charCodeAt(0), s = 10; s < 36; ++s) h[o++] = s; 35155 function u(t) { 35156 return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(t); 35157 } 35158 function a(t, e) { 35159 var r = h[t.charCodeAt(e)]; 35160 return null == r ? -1 : r; 35161 } 35162 function f(t) { 35163 var e = i(); 35164 return e.fromInt(t), e; 35165 } 35166 function c(t) { 35167 var e, r = 1; 35168 return 0 != (e = t >>> 16) && (t = e, r += 16), 0 != (e = t >> 8) && (t = e, r += 8), 0 != (e = t >> 4) && (t = e, r += 4), 0 != (e = t >> 2) && (t = e, r += 2), 0 != (e = t >> 1) && (t = e, r += 1), r; 35169 } 35170 function p(t) { 35171 this.m = t; 35172 } 35173 function l(t) { 35174 this.m = t, this.mp = t.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t; 35175 } 35176 function d(t, e) { 35177 return t & e; 35178 } 35179 function m(t, e) { 35180 return t | e; 35181 } 35182 function v(t, e) { 35183 return t ^ e; 35184 } 35185 function y(t, e) { 35186 return t & ~e; 35187 } 35188 function g(t) { 35189 if (0 == t) return -1; 35190 var e = 0; 35191 return 0 == (65535 & t) && (t >>= 16, e += 16), 0 == (255 & t) && (t >>= 8, e += 8), 0 == (15 & t) && (t >>= 4, e += 4), 0 == (3 & t) && (t >>= 2, e += 2), 0 == (1 & t) && ++e, e; 35192 } 35193 function w(t) { 35194 for (var e = 0; 0 != t;) t &= t - 1, ++e; 35195 return e; 35196 } 35197 function T() {} 35198 function b(t) { 35199 return t; 35200 } 35201 function _(t) { 35202 this.r2 = i(), this.q3 = i(), r.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t), this.m = t; 35203 } 35204 p.prototype.convert = function(t) { 35205 return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t; 35206 }, p.prototype.revert = function(t) { 35207 return t; 35208 }, p.prototype.reduce = function(t) { 35209 t.divRemTo(this.m, null, t); 35210 }, p.prototype.mulTo = function(t, e, r) { 35211 t.multiplyTo(e, r), this.reduce(r); 35212 }, p.prototype.sqrTo = function(t, e) { 35213 t.squareTo(e), this.reduce(e); 35214 }, l.prototype.convert = function(t) { 35215 var e = i(); 35216 return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(r.ZERO) > 0 && this.m.subTo(e, e), e; 35217 }, l.prototype.revert = function(t) { 35218 var e = i(); 35219 return t.copyTo(e), this.reduce(e), e; 35220 }, l.prototype.reduce = function(t) { 35221 for (; t.t <= this.mt2;) t[t.t++] = 0; 35222 for (var e = 0; e < this.m.t; ++e) { 35223 var r = 32767 & t[e], i = r * this.mpl + ((r * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM; 35224 for (t[r = e + this.m.t] += this.m.am(0, i, t, e, 0, this.m.t); t[r] >= t.DV;) t[r] -= t.DV, t[++r]++; 35225 } 35226 t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t); 35227 }, l.prototype.mulTo = function(t, e, r) { 35228 t.multiplyTo(e, r), this.reduce(r); 35229 }, l.prototype.sqrTo = function(t, e) { 35230 t.squareTo(e), this.reduce(e); 35231 }, r.prototype.copyTo = function(t) { 35232 for (var e = this.t - 1; e >= 0; --e) t[e] = this[e]; 35233 t.t = this.t, t.s = this.s; 35234 }, r.prototype.fromInt = function(t) { 35235 this.t = 1, this.s = t < 0 ? -1 : 0, t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0; 35236 }, r.prototype.fromString = function(t, e) { 35237 var i; 35238 if (16 == e) i = 4; 35239 else if (8 == e) i = 3; 35240 else if (256 == e) i = 8; 35241 else if (2 == e) i = 1; 35242 else if (32 == e) i = 5; 35243 else { 35244 if (4 != e) return void this.fromRadix(t, e); 35245 i = 2; 35246 } 35247 this.t = 0, this.s = 0; 35248 for (var n = t.length, o = !1, s = 0; --n >= 0;) { 35249 var h = 8 == i ? 255 & t[n] : a(t, n); 35250 h < 0 ? "-" == t.charAt(n) && (o = !0) : (o = !1, 0 == s ? this[this.t++] = h : s + i > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - s) - 1) << s, this[this.t++] = h >> this.DB - s) : this[this.t - 1] |= h << s, (s += i) >= this.DB && (s -= this.DB)); 35251 } 35252 8 == i && 0 != (128 & t[0]) && (this.s = -1, s > 0 && (this[this.t - 1] |= (1 << this.DB - s) - 1 << s)), this.clamp(), o && r.ZERO.subTo(this, this); 35253 }, r.prototype.clamp = function() { 35254 for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;) --this.t; 35255 }, r.prototype.dlShiftTo = function(t, e) { 35256 var r; 35257 for (r = this.t - 1; r >= 0; --r) e[r + t] = this[r]; 35258 for (r = t - 1; r >= 0; --r) e[r] = 0; 35259 e.t = this.t + t, e.s = this.s; 35260 }, r.prototype.drShiftTo = function(t, e) { 35261 for (var r = t; r < this.t; ++r) e[r - t] = this[r]; 35262 e.t = Math.max(this.t - t, 0), e.s = this.s; 35263 }, r.prototype.lShiftTo = function(t, e) { 35264 var r, i = t % this.DB, n = this.DB - i, o = (1 << n) - 1, s = Math.floor(t / this.DB), h = this.s << i & this.DM; 35265 for (r = this.t - 1; r >= 0; --r) e[r + s + 1] = this[r] >> n | h, h = (this[r] & o) << i; 35266 for (r = s - 1; r >= 0; --r) e[r] = 0; 35267 e[s] = h, e.t = this.t + s + 1, e.s = this.s, e.clamp(); 35268 }, r.prototype.rShiftTo = function(t, e) { 35269 e.s = this.s; 35270 var r = Math.floor(t / this.DB); 35271 if (r >= this.t) e.t = 0; 35272 else { 35273 var i = t % this.DB, n = this.DB - i, o = (1 << i) - 1; 35274 e[0] = this[r] >> i; 35275 for (var s = r + 1; s < this.t; ++s) e[s - r - 1] |= (this[s] & o) << n, e[s - r] = this[s] >> i; 35276 i > 0 && (e[this.t - r - 1] |= (this.s & o) << n), e.t = this.t - r, e.clamp(); 35277 } 35278 }, r.prototype.subTo = function(t, e) { 35279 for (var r = 0, i = 0, n = Math.min(t.t, this.t); r < n;) i += this[r] - t[r], e[r++] = i & this.DM, i >>= this.DB; 35280 if (t.t < this.t) { 35281 for (i -= t.s; r < this.t;) i += this[r], e[r++] = i & this.DM, i >>= this.DB; 35282 i += this.s; 35283 } else { 35284 for (i += this.s; r < t.t;) i -= t[r], e[r++] = i & this.DM, i >>= this.DB; 35285 i -= t.s; 35286 } 35287 e.s = i < 0 ? -1 : 0, i < -1 ? e[r++] = this.DV + i : i > 0 && (e[r++] = i), e.t = r, e.clamp(); 35288 }, r.prototype.multiplyTo = function(t, e) { 35289 var i = this.abs(), n = t.abs(), o = i.t; 35290 for (e.t = o + n.t; --o >= 0;) e[o] = 0; 35291 for (o = 0; o < n.t; ++o) e[o + i.t] = i.am(0, n[o], e, o, 0, i.t); 35292 e.s = 0, e.clamp(), this.s != t.s && r.ZERO.subTo(e, e); 35293 }, r.prototype.squareTo = function(t) { 35294 for (var e = this.abs(), r = t.t = 2 * e.t; --r >= 0;) t[r] = 0; 35295 for (r = 0; r < e.t - 1; ++r) { 35296 var i = e.am(r, e[r], t, 2 * r, 0, 1); 35297 (t[r + e.t] += e.am(r + 1, 2 * e[r], t, 2 * r + 1, i, e.t - r - 1)) >= e.DV && (t[r + e.t] -= e.DV, t[r + e.t + 1] = 1); 35298 } 35299 t.t > 0 && (t[t.t - 1] += e.am(r, e[r], t, 2 * r, 0, 1)), t.s = 0, t.clamp(); 35300 }, r.prototype.divRemTo = function(t, e, n) { 35301 var o = t.abs(); 35302 if (!(o.t <= 0)) { 35303 var s = this.abs(); 35304 if (s.t < o.t) return e?.fromInt(0), void (null != n && this.copyTo(n)); 35305 n ??= i(); 35306 var h = i(), u = this.s, a = t.s, f = this.DB - c(o[o.t - 1]); 35307 f > 0 ? (o.lShiftTo(f, h), s.lShiftTo(f, n)) : (o.copyTo(h), s.copyTo(n)); 35308 var p = h.t, l = h[p - 1]; 35309 if (0 != l) { 35310 var d = l * (1 << this.F1) + (p > 1 ? h[p - 2] >> this.F2 : 0), m = this.FV / d, v = (1 << this.F1) / d, y = 1 << this.F2, g = n.t, w = g - p, T = null == e ? i() : e; 35311 for (h.dlShiftTo(w, T), n.compareTo(T) >= 0 && (n[n.t++] = 1, n.subTo(T, n)), r.ONE.dlShiftTo(p, T), T.subTo(h, h); h.t < p;) h[h.t++] = 0; 35312 for (; --w >= 0;) { 35313 var b = n[--g] == l ? this.DM : Math.floor(n[g] * m + (n[g - 1] + y) * v); 35314 if ((n[g] += h.am(0, b, n, w, 0, p)) < b) for (h.dlShiftTo(w, T), n.subTo(T, n); n[g] < --b;) n.subTo(T, n); 35315 } 35316 null != e && (n.drShiftTo(p, e), u != a && r.ZERO.subTo(e, e)), n.t = p, n.clamp(), f > 0 && n.rShiftTo(f, n), u < 0 && r.ZERO.subTo(n, n); 35317 } 35318 } 35319 }, r.prototype.invDigit = function() { 35320 if (this.t < 1) return 0; 35321 var t = this[0]; 35322 if (0 == (1 & t)) return 0; 35323 var e = 3 & t; 35324 return (e = (e = (e = (e = e * (2 - (15 & t) * e) & 15) * (2 - (255 & t) * e) & 255) * (2 - ((65535 & t) * e & 65535)) & 65535) * (2 - t * e % this.DV) % this.DV) > 0 ? this.DV - e : -e; 35325 }, r.prototype.isEven = function() { 35326 return 0 == (this.t > 0 ? 1 & this[0] : this.s); 35327 }, r.prototype.exp = function(t, e) { 35328 if (t > 4294967295 || t < 1) return r.ONE; 35329 var n = i(), o = i(), s = e.convert(this), h = c(t) - 1; 35330 for (s.copyTo(n); --h >= 0;) if (e.sqrTo(n, o), (t & 1 << h) > 0) e.mulTo(o, s, n); 35331 else { 35332 var u = n; 35333 n = o, o = u; 35334 } 35335 return e.revert(n); 35336 }, r.prototype.toString = function(t) { 35337 if (this.s < 0) return "-" + this.negate().toString(t); 35338 var e; 35339 if (16 == t) e = 4; 35340 else if (8 == t) e = 3; 35341 else if (2 == t) e = 1; 35342 else if (32 == t) e = 5; 35343 else { 35344 if (4 != t) return this.toRadix(t); 35345 e = 2; 35346 } 35347 var r, i = (1 << e) - 1, n = !1, o = "", s = this.t, h = this.DB - s * this.DB % e; 35348 if (s-- > 0) for (h < this.DB && (r = this[s] >> h) > 0 && (n = !0, o = u(r)); s >= 0;) h < e ? (r = (this[s] & (1 << h) - 1) << e - h, r |= this[--s] >> (h += this.DB - e)) : (r = this[s] >> (h -= e) & i, h <= 0 && (h += this.DB, --s)), r > 0 && (n = !0), n && (o += u(r)); 35349 return n ? o : "0"; 35350 }, r.prototype.negate = function() { 35351 var t = i(); 35352 return r.ZERO.subTo(this, t), t; 35353 }, r.prototype.abs = function() { 35354 return this.s < 0 ? this.negate() : this; 35355 }, r.prototype.compareTo = function(t) { 35356 var e = this.s - t.s; 35357 if (0 != e) return e; 35358 var r = this.t; 35359 if (0 != (e = r - t.t)) return this.s < 0 ? -e : e; 35360 for (; --r >= 0;) if (0 != (e = this[r] - t[r])) return e; 35361 return 0; 35362 }, r.prototype.bitLength = function() { 35363 return this.t <= 0 ? 0 : this.DB * (this.t - 1) + c(this[this.t - 1] ^ this.s & this.DM); 35364 }, r.prototype.mod = function(t) { 35365 var e = i(); 35366 return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(r.ZERO) > 0 && t.subTo(e, e), e; 35367 }, r.prototype.modPowInt = function(t, e) { 35368 var r; 35369 return r = t < 256 || e.isEven() ? new p(e) : new l(e), this.exp(t, r); 35370 }, r.ZERO = f(0), r.ONE = f(1), T.prototype.convert = b, T.prototype.revert = b, T.prototype.mulTo = function(t, e, r) { 35371 t.multiplyTo(e, r); 35372 }, T.prototype.sqrTo = function(t, e) { 35373 t.squareTo(e); 35374 }, _.prototype.convert = function(t) { 35375 if (t.s < 0 || t.t > 2 * this.m.t) return t.mod(this.m); 35376 if (t.compareTo(this.m) < 0) return t; 35377 var e = i(); 35378 return t.copyTo(e), this.reduce(e), e; 35379 }, _.prototype.revert = function(t) { 35380 return t; 35381 }, _.prototype.reduce = function(t) { 35382 for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0;) t.dAddOffset(1, this.m.t + 1); 35383 for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0;) t.subTo(this.m, t); 35384 }, _.prototype.mulTo = function(t, e, r) { 35385 t.multiplyTo(e, r), this.reduce(r); 35386 }, _.prototype.sqrTo = function(t, e) { 35387 t.squareTo(e), this.reduce(e); 35388 }; 35389 var S, A, D, B = [ 35390 2, 35391 3, 35392 5, 35393 7, 35394 11, 35395 13, 35396 17, 35397 19, 35398 23, 35399 29, 35400 31, 35401 37, 35402 41, 35403 43, 35404 47, 35405 53, 35406 59, 35407 61, 35408 67, 35409 71, 35410 73, 35411 79, 35412 83, 35413 89, 35414 97, 35415 101, 35416 103, 35417 107, 35418 109, 35419 113, 35420 127, 35421 131, 35422 137, 35423 139, 35424 149, 35425 151, 35426 157, 35427 163, 35428 167, 35429 173, 35430 179, 35431 181, 35432 191, 35433 193, 35434 197, 35435 199, 35436 211, 35437 223, 35438 227, 35439 229, 35440 233, 35441 239, 35442 241, 35443 251, 35444 257, 35445 263, 35446 269, 35447 271, 35448 277, 35449 281, 35450 283, 35451 293, 35452 307, 35453 311, 35454 313, 35455 317, 35456 331, 35457 337, 35458 347, 35459 349, 35460 353, 35461 359, 35462 367, 35463 373, 35464 379, 35465 383, 35466 389, 35467 397, 35468 401, 35469 409, 35470 419, 35471 421, 35472 431, 35473 433, 35474 439, 35475 443, 35476 449, 35477 457, 35478 461, 35479 463, 35480 467, 35481 479, 35482 487, 35483 491, 35484 499, 35485 503, 35486 509, 35487 521, 35488 523, 35489 541, 35490 547, 35491 557, 35492 563, 35493 569, 35494 571, 35495 577, 35496 587, 35497 593, 35498 599, 35499 601, 35500 607, 35501 613, 35502 617, 35503 619, 35504 631, 35505 641, 35506 643, 35507 647, 35508 653, 35509 659, 35510 661, 35511 673, 35512 677, 35513 683, 35514 691, 35515 701, 35516 709, 35517 719, 35518 727, 35519 733, 35520 739, 35521 743, 35522 751, 35523 757, 35524 761, 35525 769, 35526 773, 35527 787, 35528 797, 35529 809, 35530 811, 35531 821, 35532 823, 35533 827, 35534 829, 35535 839, 35536 853, 35537 857, 35538 859, 35539 863, 35540 877, 35541 881, 35542 883, 35543 887, 35544 907, 35545 911, 35546 919, 35547 929, 35548 937, 35549 941, 35550 947, 35551 953, 35552 967, 35553 971, 35554 977, 35555 983, 35556 991, 35557 997 35558 ], x = (1 << 26) / B[B.length - 1]; 35559 function E() { 35560 var t = (/* @__PURE__ */ new Date()).getTime(); 35561 A[D++] ^= 255 & t, A[D++] ^= t >> 8 & 255, A[D++] ^= t >> 16 & 255, A[D++] ^= t >> 24 & 255, D >= j && (D -= j); 35562 } 35563 if (r.prototype.chunkSize = function(t) { 35564 return Math.floor(Math.LN2 * this.DB / Math.log(t)); 35565 }, r.prototype.toRadix = function(t) { 35566 if (t ??= 10, 0 == this.signum() || t < 2 || t > 36) return "0"; 35567 var e = this.chunkSize(t), r = Math.pow(t, e), n = f(r), o = i(), s = i(), h = ""; 35568 for (this.divRemTo(n, o, s); o.signum() > 0;) h = (r + s.intValue()).toString(t).substr(1) + h, o.divRemTo(n, o, s); 35569 return s.intValue().toString(t) + h; 35570 }, r.prototype.fromRadix = function(t, e) { 35571 this.fromInt(0), e ??= 10; 35572 for (var i = this.chunkSize(e), n = Math.pow(e, i), o = !1, s = 0, h = 0, u = 0; u < t.length; ++u) { 35573 var f = a(t, u); 35574 f < 0 ? "-" == t.charAt(u) && 0 == this.signum() && (o = !0) : (h = e * h + f, ++s >= i && (this.dMultiply(n), this.dAddOffset(h, 0), s = 0, h = 0)); 35575 } 35576 s > 0 && (this.dMultiply(Math.pow(e, s)), this.dAddOffset(h, 0)), o && r.ZERO.subTo(this, this); 35577 }, r.prototype.fromNumber = function(t, e, i) { 35578 if ("number" == typeof e) if (t < 2) this.fromInt(1); 35579 else for (this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(r.ONE.shiftLeft(t - 1), m, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(e);) this.dAddOffset(2, 0), this.bitLength() > t && this.subTo(r.ONE.shiftLeft(t - 1), this); 35580 else { 35581 var n = new Array(), o = 7 & t; 35582 n.length = 1 + (t >> 3), e.nextBytes(n), o > 0 ? n[0] &= (1 << o) - 1 : n[0] = 0, this.fromString(n, 256); 35583 } 35584 }, r.prototype.bitwiseTo = function(t, e, r) { 35585 var i, n, o = Math.min(t.t, this.t); 35586 for (i = 0; i < o; ++i) r[i] = e(this[i], t[i]); 35587 if (t.t < this.t) { 35588 for (n = t.s & this.DM, i = o; i < this.t; ++i) r[i] = e(this[i], n); 35589 r.t = this.t; 35590 } else { 35591 for (n = this.s & this.DM, i = o; i < t.t; ++i) r[i] = e(n, t[i]); 35592 r.t = t.t; 35593 } 35594 r.s = e(this.s, t.s), r.clamp(); 35595 }, r.prototype.changeBit = function(t, e) { 35596 var i = r.ONE.shiftLeft(t); 35597 return this.bitwiseTo(i, e, i), i; 35598 }, r.prototype.addTo = function(t, e) { 35599 for (var r = 0, i = 0, n = Math.min(t.t, this.t); r < n;) i += this[r] + t[r], e[r++] = i & this.DM, i >>= this.DB; 35600 if (t.t < this.t) { 35601 for (i += t.s; r < this.t;) i += this[r], e[r++] = i & this.DM, i >>= this.DB; 35602 i += this.s; 35603 } else { 35604 for (i += this.s; r < t.t;) i += t[r], e[r++] = i & this.DM, i >>= this.DB; 35605 i += t.s; 35606 } 35607 e.s = i < 0 ? -1 : 0, i > 0 ? e[r++] = i : i < -1 && (e[r++] = this.DV + i), e.t = r, e.clamp(); 35608 }, r.prototype.dMultiply = function(t) { 35609 this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp(); 35610 }, r.prototype.dAddOffset = function(t, e) { 35611 if (0 != t) { 35612 for (; this.t <= e;) this[this.t++] = 0; 35613 for (this[e] += t; this[e] >= this.DV;) this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e]; 35614 } 35615 }, r.prototype.multiplyLowerTo = function(t, e, r) { 35616 var i, n = Math.min(this.t + t.t, e); 35617 for (r.s = 0, r.t = n; n > 0;) r[--n] = 0; 35618 for (i = r.t - this.t; n < i; ++n) r[n + this.t] = this.am(0, t[n], r, n, 0, this.t); 35619 for (i = Math.min(t.t, e); n < i; ++n) this.am(0, t[n], r, n, 0, e - n); 35620 r.clamp(); 35621 }, r.prototype.multiplyUpperTo = function(t, e, r) { 35622 --e; 35623 var i = r.t = this.t + t.t - e; 35624 for (r.s = 0; --i >= 0;) r[i] = 0; 35625 for (i = Math.max(e - this.t, 0); i < t.t; ++i) r[this.t + i - e] = this.am(e - i, t[i], r, 0, 0, this.t + i - e); 35626 r.clamp(), r.drShiftTo(1, r); 35627 }, r.prototype.modInt = function(t) { 35628 if (t <= 0) return 0; 35629 var e = this.DV % t, r = this.s < 0 ? t - 1 : 0; 35630 if (this.t > 0) if (0 == e) r = this[0] % t; 35631 else for (var i = this.t - 1; i >= 0; --i) r = (e * r + this[i]) % t; 35632 return r; 35633 }, r.prototype.millerRabin = function(t) { 35634 var e = this.subtract(r.ONE), n = e.getLowestSetBit(); 35635 if (n <= 0) return !1; 35636 var o = e.shiftRight(n); 35637 (t = t + 1 >> 1) > B.length && (t = B.length); 35638 for (var s = i(), h = 0; h < t; ++h) { 35639 s.fromInt(B[Math.floor(Math.random() * B.length)]); 35640 var u = s.modPow(o, this); 35641 if (0 != u.compareTo(r.ONE) && 0 != u.compareTo(e)) { 35642 for (var a = 1; a++ < n && 0 != u.compareTo(e);) if (0 == (u = u.modPowInt(2, this)).compareTo(r.ONE)) return !1; 35643 if (0 != u.compareTo(e)) return !1; 35644 } 35645 } 35646 return !0; 35647 }, r.prototype.clone = function() { 35648 var t = i(); 35649 return this.copyTo(t), t; 35650 }, r.prototype.intValue = function() { 35651 if (this.s < 0) { 35652 if (1 == this.t) return this[0] - this.DV; 35653 if (0 == this.t) return -1; 35654 } else { 35655 if (1 == this.t) return this[0]; 35656 if (0 == this.t) return 0; 35657 } 35658 return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]; 35659 }, r.prototype.byteValue = function() { 35660 return 0 == this.t ? this.s : this[0] << 24 >> 24; 35661 }, r.prototype.shortValue = function() { 35662 return 0 == this.t ? this.s : this[0] << 16 >> 16; 35663 }, r.prototype.signum = function() { 35664 return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1; 35665 }, r.prototype.toByteArray = function() { 35666 var t = this.t, e = new Array(); 35667 e[0] = this.s; 35668 var r, i = this.DB - t * this.DB % 8, n = 0; 35669 if (t-- > 0) for (i < this.DB && (r = this[t] >> i) != (this.s & this.DM) >> i && (e[n++] = r | this.s << this.DB - i); t >= 0;) i < 8 ? (r = (this[t] & (1 << i) - 1) << 8 - i, r |= this[--t] >> (i += this.DB - 8)) : (r = this[t] >> (i -= 8) & 255, i <= 0 && (i += this.DB, --t)), 0 != (128 & r) && (r |= -256), 0 == n && (128 & this.s) != (128 & r) && ++n, (n > 0 || r != this.s) && (e[n++] = r); 35670 return e; 35671 }, r.prototype.equals = function(t) { 35672 return 0 == this.compareTo(t); 35673 }, r.prototype.min = function(t) { 35674 return this.compareTo(t) < 0 ? this : t; 35675 }, r.prototype.max = function(t) { 35676 return this.compareTo(t) > 0 ? this : t; 35677 }, r.prototype.and = function(t) { 35678 var e = i(); 35679 return this.bitwiseTo(t, d, e), e; 35680 }, r.prototype.or = function(t) { 35681 var e = i(); 35682 return this.bitwiseTo(t, m, e), e; 35683 }, r.prototype.xor = function(t) { 35684 var e = i(); 35685 return this.bitwiseTo(t, v, e), e; 35686 }, r.prototype.andNot = function(t) { 35687 var e = i(); 35688 return this.bitwiseTo(t, y, e), e; 35689 }, r.prototype.not = function() { 35690 for (var t = i(), e = 0; e < this.t; ++e) t[e] = this.DM & ~this[e]; 35691 return t.t = this.t, t.s = ~this.s, t; 35692 }, r.prototype.shiftLeft = function(t) { 35693 var e = i(); 35694 return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e; 35695 }, r.prototype.shiftRight = function(t) { 35696 var e = i(); 35697 return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e; 35698 }, r.prototype.getLowestSetBit = function() { 35699 for (var t = 0; t < this.t; ++t) if (0 != this[t]) return t * this.DB + g(this[t]); 35700 return this.s < 0 ? this.t * this.DB : -1; 35701 }, r.prototype.bitCount = function() { 35702 for (var t = 0, e = this.s & this.DM, r = 0; r < this.t; ++r) t += w(this[r] ^ e); 35703 return t; 35704 }, r.prototype.testBit = function(t) { 35705 var e = Math.floor(t / this.DB); 35706 return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB); 35707 }, r.prototype.setBit = function(t) { 35708 return this.changeBit(t, m); 35709 }, r.prototype.clearBit = function(t) { 35710 return this.changeBit(t, y); 35711 }, r.prototype.flipBit = function(t) { 35712 return this.changeBit(t, v); 35713 }, r.prototype.add = function(t) { 35714 var e = i(); 35715 return this.addTo(t, e), e; 35716 }, r.prototype.subtract = function(t) { 35717 var e = i(); 35718 return this.subTo(t, e), e; 35719 }, r.prototype.multiply = function(t) { 35720 var e = i(); 35721 return this.multiplyTo(t, e), e; 35722 }, r.prototype.divide = function(t) { 35723 var e = i(); 35724 return this.divRemTo(t, e, null), e; 35725 }, r.prototype.remainder = function(t) { 35726 var e = i(); 35727 return this.divRemTo(t, null, e), e; 35728 }, r.prototype.divideAndRemainder = function(t) { 35729 var e = i(), r = i(); 35730 return this.divRemTo(t, e, r), new Array(e, r); 35731 }, r.prototype.modPow = function(t, e) { 35732 var r, n, o = t.bitLength(), s = f(1); 35733 if (o <= 0) return s; 35734 r = o < 18 ? 1 : o < 48 ? 3 : o < 144 ? 4 : o < 768 ? 5 : 6, n = o < 8 ? new p(e) : e.isEven() ? new _(e) : new l(e); 35735 var h = new Array(), u = 3, a = r - 1, d = (1 << r) - 1; 35736 if (h[1] = n.convert(this), r > 1) { 35737 var m = i(); 35738 for (n.sqrTo(h[1], m); u <= d;) h[u] = i(), n.mulTo(m, h[u - 2], h[u]), u += 2; 35739 } 35740 var v, y, g = t.t - 1, w = !0, T = i(); 35741 for (o = c(t[g]) - 1; g >= 0;) { 35742 for (o >= a ? v = t[g] >> o - a & d : (v = (t[g] & (1 << o + 1) - 1) << a - o, g > 0 && (v |= t[g - 1] >> this.DB + o - a)), u = r; 0 == (1 & v);) v >>= 1, --u; 35743 if ((o -= u) < 0 && (o += this.DB, --g), w) h[v].copyTo(s), w = !1; 35744 else { 35745 for (; u > 1;) n.sqrTo(s, T), n.sqrTo(T, s), u -= 2; 35746 u > 0 ? n.sqrTo(s, T) : (y = s, s = T, T = y), n.mulTo(T, h[v], s); 35747 } 35748 for (; g >= 0 && 0 == (t[g] & 1 << o);) n.sqrTo(s, T), y = s, s = T, T = y, --o < 0 && (o = this.DB - 1, --g); 35749 } 35750 return n.revert(s); 35751 }, r.prototype.modInverse = function(t) { 35752 var e = t.isEven(); 35753 if (this.isEven() && e || 0 == t.signum()) return r.ZERO; 35754 for (var i = t.clone(), n = this.clone(), o = f(1), s = f(0), h = f(0), u = f(1); 0 != i.signum();) { 35755 for (; i.isEven();) i.rShiftTo(1, i), e ? (o.isEven() && s.isEven() || (o.addTo(this, o), s.subTo(t, s)), o.rShiftTo(1, o)) : s.isEven() || s.subTo(t, s), s.rShiftTo(1, s); 35756 for (; n.isEven();) n.rShiftTo(1, n), e ? (h.isEven() && u.isEven() || (h.addTo(this, h), u.subTo(t, u)), h.rShiftTo(1, h)) : u.isEven() || u.subTo(t, u), u.rShiftTo(1, u); 35757 i.compareTo(n) >= 0 ? (i.subTo(n, i), e && o.subTo(h, o), s.subTo(u, s)) : (n.subTo(i, n), e && h.subTo(o, h), u.subTo(s, u)); 35758 } 35759 return 0 != n.compareTo(r.ONE) ? r.ZERO : u.compareTo(t) >
35759= 0 ? u.subtract(t) : u.signum() < 0 ? (u.addTo(t, u), u.signum() < 0 ? u.add(t) : u) : u; 35760 }, r.prototype.pow = function(t) { 35761 return this.exp(t, new T()); 35762 }, r.prototype.gcd = function(t) { 35763 var e = this.s < 0 ? this.negate() : this.clone(), r = t.s < 0 ? t.negate() : t.clone(); 35764 if (e.compareTo(r) < 0) { 35765 var i = e; 35766 e = r, r = i; 35767 } 35768 var n = e.getLowestSetBit(), o = r.getLowestSetBit(); 35769 if (o < 0) return e; 35770 for (n < o && (o = n), o > 0 && (e.rShiftTo(o, e), r.rShiftTo(o, r)); e.signum() > 0;) (n = e.getLowestSetBit()) > 0 && e.rShiftTo(n, e), (n = r.getLowestSetBit()) > 0 && r.rShiftTo(n, r), e.compareTo(r) >= 0 ? (e.subTo(r, e), e.rShiftTo(1, e)) : (r.subTo(e, r), r.rShiftTo(1, r)); 35771 return o > 0 && r.lShiftTo(o, r), r; 35772 }, r.prototype.isProbablePrime = function(t) { 35773 var e, r = this.abs(); 35774 if (1 == r.t && r[0] <= B[B.length - 1]) { 35775 for (e = 0; e < B.length; ++e) if (r[0] == B[e]) return !0; 35776 return !1; 35777 } 35778 if (r.isEven()) return !1; 35779 for (e = 1; e < B.length;) { 35780 for (var i = B[e], n = e + 1; n < B.length && i < x;) i *= B[n++]; 35781 for (i = r.modInt(i); e < n;) if (i % B[e++] == 0) return !1; 35782 } 35783 return r.millerRabin(t); 35784 }, r.prototype.square = function() { 35785 var t = i(); 35786 return this.squareTo(t), t; 35787 }, r.prototype.Barrett = _, null == A) { 35788 var k; 35789 if (A = new Array(), D = 0, "undefined" != typeof window && window.crypto) { 35790 if (window.crypto.getRandomValues) { 35791 var I = /* @__PURE__ */ new Uint8Array(32); 35792 for (window.crypto.getRandomValues(I), k = 0; k < 32; ++k) A[D++] = I[k]; 35793 } else if ("Netscape" == navigator.appName && navigator.appVersion < "5") { 35794 var M = window.crypto.random(32); 35795 for (k = 0; k < M.length; ++k) A[D++] = 255 & M.charCodeAt(k); 35796 } 35797 } 35798 for (; D < j;) k = Math.floor(65536 * Math.random()), A[D++] = k >>> 8, A[D++] = 255 & k; 35799 D = 0, E(); 35800 } 35801 function C() { 35802 if (null == S) { 35803 for (E(), (S = new O()).init(A), D = 0; D < A.length; ++D) A[D] = 0; 35804 D = 0; 35805 } 35806 return S.next(); 35807 } 35808 function R() {} 35809 function O() { 35810 this.i = 0, this.j = 0, this.S = new Array(); 35811 } 35812 R.prototype.nextBytes = function(t) { 35813 var e; 35814 for (e = 0; e < t.length; ++e) t[e] = C(); 35815 }, O.prototype.init = function(t) { 35816 var e, r, i; 35817 for (e = 0; e < 256; ++e) this.S[e] = e; 35818 for (r = 0, e = 0; e < 256; ++e) i = this.S[e], this.S[e] = this.S[r = r + this.S[e] + t[e % t.length] & 255], this.S[r] = i; 35819 this.i = 0, this.j = 0; 35820 }, O.prototype.next = function() { 35821 var t; 35822 return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255]; 35823 }; 35824 var j = 256; 35825 e.exports = { 35826 default: r, 35827 BigInteger: r, 35828 SecureRandom: R 35829 }; 35830 }).call(t); 35831 })); 35832 a = { 35833 sha1: "3021300906052b0e03021a05000414", 35834 sha224: "302d300d06096086480165030402040500041c", 35835 sha256: "3031300d060960864801650304020105000420", 35836 sha384: "3041300d060960864801650304020205000430", 35837 sha512: "3051300d060960864801650304020305000440", 35838 md2: "3020300c06082a864886f70d020205000410", 35839 md5: "3020300c06082a864886f70d020505000410", 35840 ripemd160: "3021300906052b2403020105000414" 35841 }; 35842 f = { sha256: o }; 35843 c.prototype.verify = function(t, e) { 35844 e = e.replace(/[^0-9a-f]|[\s\n]]/gi, ""); 35845 var r = new u.BigInteger(e, 16); 35846 if (r.bitLength() > this.n.bitLength()) throw new Error("Signature does not match with the key modulus."); 35847 var i = function(t) { 35848 for (var e in a) { 35849 var r = a[e], i = r.length; 35850 if (t.substring(0, i) === r) return { 35851 alg: e, 35852 hash: t.substring(i) 35853 }; 35854 } 35855 return []; 35856 }(r.modPowInt(this.e, this.n).toString(16).replace(/^1f+00/, "")); 35857 if (0 === i.length) return !1; 35858 if (!f.hasOwnProperty(i.alg)) throw new Error("Hashing algorithm is not supported."); 35859 var n = f[i.alg](t).toString(); 35860 return i.hash === n; 35861 }; 35862 for (p = [], l = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, m = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
35862+/", v = 0; v < 64; ++v) p[v] = m[v], l[m.charCodeAt(v)] = v; 35863 l["-".charCodeAt(0)] = 62, l["_".charCodeAt(0)] = 63; 35864 y = function(t) { 35865 var e, r, i = function(t) { 35866 var e = t.length; 35867 if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); 35868 var r = t.indexOf("="); 35869 return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4]; 35870 }(t), n = i[0], o = i[1], s = new d(function(t, e, r) { 35871 return 3 * (e + r) / 4 - r; 35872 }(0, n, o)), h = 0, u = o > 0 ? n - 4 : n; 35873 for (r = 0; r < u; r += 4) e = l[t.charCodeAt(r)] << 18 | l[t.charCodeAt(r + 1)] << 12 | l[t.charCodeAt(r + 2)] << 6 | l[t.charCodeAt(r + 3)], s[h++] = e >> 16 & 255, s[h++] = e >> 8 & 255, s[h++] = 255 & e; 35874 return 2 === o && (e = l[t.charCodeAt(r)] << 2 | l[t.charCodeAt(r + 1)] >> 4, s[h++] = 255 & e), 1 === o && (e = l[t.charCodeAt(r)] << 10 | l[t.charCodeAt(r + 1)] << 4 | l[t.charCodeAt(r + 2)] >> 2, s[h++] = e >> 8 & 255, s[h++] = 255 & e), s; 35875 }; 35876 b = e((function(e) { 35877 var r = t, i = function() { 35878 return function() { 35879 return function(t) { 35880 var e = []; 35881 if (0 === t.length) return ""; 35882 if ("string" != typeof t[0]) throw new TypeError("Url must be a string. Received " + t[0]); 35883 if (t[0].match(/^[^/:]+:\/*$/) && t.length > 1) t[0] = t.shift() + t[0]; 35884 t[0] = t[0].match(/^file:\/\/\//) ? t[0].replace(/^([^/:]+):\/*/, "$1:///") : t[0].replace(/^([^/:]+):\/*/, "$1://"); 35885 for (var i = 0; i < t.length; i++) { 35886 var n = t[i]; 35887 if ("string" != typeof n) throw new TypeError("Url must be a string. Received " + n); 35888 "" !== n && (i > 0 && (n = n.replace(/^[\/]+/, "")), n = n.replace(/[\/]+$/, i < t.length - 1 ? "" : "/"), e.push(n)); 35889 } 35890 var o = e.join("/"), s = (o = o.replace(/\/(\?|&|#[^!])/g, "$1")).split("?"); 35891 return s.shift() + (s.length > 0 ? "?" : "") + s.join("&"); 35892 }("object" == typeof arguments[0] ? arguments[0] : [].slice.call(arguments)); 35893 }; 35894 }; 35895 e.exports ? e.exports = i() : r.urljoin = i(); 35896 })); 35897 A.prototype = Error.prototype, D.prototype = Error.prototype; 35898 B = function() { 35899 function t() {} 35900 var e = t.prototype; 35901 return e.get = function() { 35902 return null; 35903 }, e.has = function() { 35904 return null; 35905 }, e.set = function() { 35906 return null; 35907 }, t; 35908 }(); 35909 r.polyfill(); 35910 x = "RS256"; 35911 E = function(t) { 35912 return "number" == typeof t; 35913 }; 35914 k = function() { 35915 return /* @__PURE__ */ new Date(); 35916 }; 35917 I.prototype.verify = function(t, e, r) { 35918 if (!r && e && "function" == typeof e && (r = e, e = void 0), !t) return r(new D("ID token is required but missing"), null); 35919 var i = this.decode(t); 35920 if (i instanceof Error) return r(new D("ID token could not be decoded"), null); 35921 var n = i.encoded.header + "." + i.encoded.payload, o = T(i.encoded.signature), s = i.header.alg, h = i.header.kid, u = i.payload.aud, a = i.payload.sub, f = i.payload.iss, c = i.payload.exp, p = i.payload.nbf, l = i.payload.iat, d = i.payload.azp, m = i.payload.auth_time, v = i.payload.nonce, y = this.__clock(), g = this; 35922 if (g.expectedAlg !== s) return r(new D("Signature algorithm of \"" + s + "\" is not supported. Expected the ID token to be signed with \"" + x + "\"."), null); 35923 this.getRsaVerifier(f, h, (function(t, s) { 35924 if (t) return r(t, null); 35925 if (!s.verify(n, o)) return r(new D("Invalid ID token signature."), null); 35926 if (!f || "string" != typeof f) return r(new D("Issuer (iss) claim must be a string present in the ID token"), null); 35927 if (g.issuer !== f) return r(new D("Issuer (iss) claim mismatch in the ID token, expected \"" + g.issuer + "\", found \"" + f + "\""), null); 35928 if (!a || "string" != typeof a) return r(new D("Subject (sub) claim must be a string present in the ID token"), null); 35929 if (!u || "string" != typeof u && !Array.isArray(u)) return r(new D("Audience (aud) claim must be a string or array of strings present in the ID token"), null); 35930 if (Array.isArray(u) && !u.includes(g.audience)) return r(new D("Audience (aud) claim mismatch in the ID token; expected \"" + g.audience + "\" but was not one of \"" + u.join(", ") + "\""), null); 35931 if ("string" == typeof u && g.audience !== u) return r(new D("Audience (aud) claim mismatch in the ID token; expected \"" + g.audience + "\" but found \"" + u + "\""), null); 35932 if (e) { 35933 if (!v || "string" != typeof v) return r(new D("Nonce (nonce) claim must be a string present in the ID token"), null); 35934 if (v !== e) return r(new D("Nonce (nonce) claim value mismatch in the ID token; expected \"" + e + "\", found \"" + v + "\""), null); 35935 } 35936 if (Array.isArray(u) && u.length > 1) { 35937 if (!d || "string" != typeof d) return r(new D("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"), null); 35938 if (d !== g.audience) return r(new D("Authorized Party (azp) claim mismatch in the ID token; expected \"" + g.audience + "\", found \"" + d + "\""), null); 35939 } 35940 if (!c || !E(c)) return r(new D("Expiration Time (exp) claim must be a number present in the ID token"), null); 35941 if (!l || !E(l)) return r(new D("Issued At (iat) claim must be a number present in the ID token"), null); 35942 var h = c + g.leeway, w = /* @__PURE__ */ new Date(0); 35943 if (w.setUTCSeconds(h), y > w) return r(new D("Expiration Time (exp) claim error in the ID token; current time \"" + y + "\" is after expiration time \"" + w + "\""), null); 35944 if (p && E(p)) { 35945 var T = p - g.leeway, b = /* @__PURE__ */ new Date(0); 35946 if (b.setUTCSeconds(T), y < b) return r(new D("Not Before Time (nbf) claim error in the ID token; current time \"" + y + "\" is before the not before time \"" + b + "\""), null); 35947 } 35948 if (g.maxAge) { 35949 if (!m || !E(m)) return r(new D("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"), null); 35950 var _ = m + g.maxAge + g.leeway, S = /* @__PURE__ */ new Date(0); 35951 if (S.setUTCSeconds(_), y > S) return r(new D("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time \"" + y + "\" is after last auth time at \"" + S + "\""), null); 35952 } 35953 return r(null, i.payload); 35954 })); 35955 }, I.prototype.getRsaVerifier = function(t, e, r) { 35956 var i = this, n = t + e; 35957 Promise.resolve(this.jwksCache.has(n)).then((function(r) { 35958 return r ? i.jwksCache.get(n) : (s = (o = { 35959 jwksURI: i.jwksURI, 35960 iss: t, 35961 kid: e 35962 }).jwksURI || b(o.iss, ".well-known", "jwks.json"), ("undefined" == fetch ? _ : fetch)(s).then(S).then((function(t) { 35963 var e, r, i, n = null; 35964 for (e = 0; e < t.keys.length && null === n;
35964 e++) (r = t.keys[e]).kid === o.kid && (n = r); 35965 if (!n) throw new Error("Could not find a public key for Key ID (kid) \"" + o.kid + "\""); 35966 return { 35967 modulus: T((i = n).n), 35968 exp: T(i.e) 35969 }; 35970 })).catch((function(t) { 35971 throw t; 35972 }))); 35973 var o, s; 35974 })).then((function(t) { 35975 if (!t || !t.modulus || !t.exp) throw new Error("Empty keyInfo in response"); 35976 return Promise.resolve(i.jwksCache.set(n, t)).then((function() { 35977 r && r(null, new c(t.modulus, t.exp)); 35978 })); 35979 })).catch((function(t) { 35980 r && r(t); 35981 })); 35982 }, I.prototype.decode = function(t) { 35983 var e, r, i = t.split("."); 35984 if (3 !== i.length) return new D("Cannot decode a malformed JWT"); 35985 try { 35986 e = JSON.parse(w(i[0])), r = JSON.parse(w(i[1])); 35987 } catch (t) { 35988 return new D("Token header or payload is not valid JSON"); 35989 } 35990 return { 35991 header: e, 35992 payload: r, 35993 encoded: { 35994 header: i[0], 35995 payload: i[1], 35996 signature: i[2] 35997 } 35998 }; 35999 }, I.prototype.validateAccessToken = function(t, e, r, i) { 36000 if (this.expectedAlg !== e) return i(new D("Signature algorithm of \"" + e + "\" is not supported. Expected \"" + this.expectedAlg + "\"")); 36001 var n, u = o(t), a = h.stringify(u), f = a.substring(0, a.length / 2), c = h.parse(f), p = s.stringify(c); 36002 return i((n = { 36003 "+": "-", 36004 "/": "_", 36005 "=": "" 36006 }, p.replace(/[+/=]/g, (function(t) { 36007 return n[t]; 36008 })) !== r ? new D("Invalid access_token") : null)); 36009 }, PluginHandler.prototype.get = function(extensibilityPoint) { 36010 for (var a = 0; a < this.plugins.length; a++) if (this.plugins[a].supports(extensibilityPoint)) return this.plugins[a].init(); 36011 return null; 36012 }; 36013 random = { randomString: function(length) { 36014 var bytes = new Uint8Array(length), result = [], charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~", cryptoObj = windowHelper.getWindow().crypto || windowHelper.getWindow().msCrypto; 36015 if (!cryptoObj) return null; 36016 for (var random = cryptoObj.getRandomValues(bytes), a = 0; a < random.length; a++) result.push(charset[random[a] % charset.length]); 36017 return result.join(""); 36018 } }; 36019 TransactionManager.prototype.process = function(options) { 36020 if (!options.responseType) throw new Error("responseType is required"); 36021 var lastUsedConnection = options.realm || options.connection, responseTypeIncludesIdToken = -1 !== options.responseType.indexOf("id_token"), transaction = this.generateTransaction(options.appState, options.state, options.nonce, lastUsedConnection, responseTypeIncludesIdToken, options.organization); 36022 return options.state || (options.state = transaction.state), responseTypeIncludesIdToken && !options.nonce && (options.nonce = transaction.nonce), options; 36023 }, TransactionManager.prototype.generateTransaction = function(appState, state, nonce, lastUsedConnection, generateNonce, organization) { 36024 if (state = state || random.randomString(this.keyLength), nonce = nonce || (generateNonce ? random.randomString(this.keyLength) : null), !(windowHelper.getWindow().location.host === this.options.domain)) { 36025 var transactionPayload = { 36026 nonce, 36027 appState, 36028 state, 36029 lastUsedConnection 36030 }; 36031 organization && (transactionPayload.organization = organization), this.storage.setItem(this.namespace + state, transactionPayload, { expires: this.stateExpiration }); 36032 } 36033 return { 36034 state, 36035 nonce 36036 }; 36037 }, TransactionManager.prototype.getStoredTransaction = function(state) { 36038 var transactionData; 36039 return transactionData = this.storage.getItem(this.namespace + state), this.clearTransaction(state), transactionData; 36040 }, TransactionManager.prototype.clearTransaction = function(state) { 36041 this.storage.removeItem(this.namespace + state); 36042 }, IframeHandler.prototype.init = function() { 36043 var _this = this, _window = windowHelper.getWindow(); 36044 switch (this.iframe = _window.document.createElement("iframe"), this.iframe.style.display = "none", this.proxyEventListener = function(e) { 36045 _this.eventListener(e); 36046 }, this.eventListenerType) { 36047 case "message": 36048 this.eventSourceObject = _window; 36049 break; 36050 case "load": 36051 this.eventSourceObject = this.iframe; 36052 break; 36053 default: throw new Error("Unsupported event listener type: " + this.eventListenerType); 36054 } 36055 this.eventSourceObject.addEventListener(this.eventListenerType, this.proxyEventListener, !1), _window.document.body.appendChild(this.iframe), this.iframe.src = this.url, this.timeoutHandle = setTimeout((function() { 36056 _this.timeoutHandler(); 36057 }), this.timeout); 36058 }, IframeHandler.prototype.eventListener = function(event) { 36059 var eventData = { 36060 event, 36061 sourceObject: this.eventSourceObject 36062 }; 36063 this.eventValidator.isValid(eventData) && (this.destroy(), this.callback(eventData)); 36064 }, IframeHandler.prototype.timeoutHandler = function() { 36065 this.destroy(), this.timeoutCallback && this.timeoutCallback(); 36066 }, IframeHandler.prototype.destroy = function() { 36067 var _this = this; 36068 clearTimeout(this.timeoutHandle), this._destroyTimeout = setTimeout((function() { 36069 _this.eventSourceObject.removeEventListener(_this.eventListenerType, _this.proxyEventListener, !1), _this.iframe.parentNode && _this.iframe.parentNode.removeChild(_this.iframe); 36070 }), 0); 36071 }, WebMessageHandler.prototype.run = function(options, cb) { 36072 var _this = this; 36073 options.responseMode = "web_message", options.prompt = "none"; 36074 var currentOrigin = windowHelper.getOrigin(), redirectUriOrigin = objectHelper.getOriginFromUrl(options.redirectUri); 36075 if (redirectUriOrigin && currentOrigin !== redirectUriOrigin) return cb({ 36076 error: "origin_mismatch", 36077 error_description: "The redirectUri's origin (" + redirectUriOrigin + ") should match the window's origin (" + currentOrigin + ")." 36078 }); 36079 (function(authorizeUrl, options, callback) { 36080 new IframeHandler({ 36081 url: authorizeUrl, 36082 eventListenerType: "message", 36083 callback: function(eventData) { 36084 callback(null, eventData); 36085 }, 36086 timeout: options.timeout, 36087 eventValidator: { isValid: function(eventData) { 36088 return !(!eventData.event.data || "authorization_response" !== eventData.event.data.type || options.state !== eventData.event.data.response.state); 36089 } },
36090 timeoutCallback: function() { 36091 callback({ 36092 error: "timeout", 36093 error_description: "Timeout during executing web_message communication", 36094 state: options.state 36095 }); 36096 } 36097 }).init(); 36098 })(this.webAuth.client.buildAuthorizeUrl(options), options, (function(err, eventData) { 36099 var error = err; 36100 if (!err && eventData.event.data.response.error && (error = eventData.event.data.response), !error) { 36101 var parsedHash = eventData.event.data.response; 36102 return _this.webAuth.validateAuthenticationResponse(options, parsedHash, cb); 36103 } 36104 return "consent_required" === error.error && "localhost" === windowHelper.getWindow().location.hostname && _this.warn.warning("Consent Required. Consent can't be skipped on localhost. Read more here: https://auth0.com/docs/api-auth/user-consent#skipping-consent-for-first-party-clients"), _this.webAuth.transactionManager.clearTransaction(error.state), cb(objectHelper.pick(error, ["error", "error_description"])); 36105 })); 36106 }, CrossOriginAuthentication.prototype.login = function(options, cb) { 36107 var _this = this, url = urlJoin(this.baseOptions.rootUrl, "/co/authenticate"); 36108 options.username = options.username || options.email, delete options.email; 36109 var authenticateBody = { 36110 client_id: options.clientID || this.baseOptions.clientID, 36111 username: options.username 36112 }; 36113 options.password && (authenticateBody.password = options.password), options.otp && (authenticateBody.otp = options.otp); 36114 var realm = options.realm || this.baseOptions.realm; 36115 if (realm) { 36116 var credentialType = options.credentialType || this.baseOptions.credentialType || "http://auth0.com/oauth/grant-type/password-realm"; 36117 authenticateBody.realm = realm, authenticateBody.credential_type = credentialType; 36118 } else authenticateBody.credential_type = "password"; 36119 this.request.post(url).withCredentials().send(authenticateBody).end((function(err, data) { 36120 if (err) { 36121 var errorObject = err.response && err.response.body || { 36122 error: "request_error", 36123 error_description: JSON.stringify(err) 36124 }; 36125 return wrapCallback(cb, { forceLegacyError: !0 })(errorObject); 36126 } 36127 function doAuth() { 36128 var popupMode = !0 === options.popup; 36129 options = objectHelper.blacklist(options, [ 36130 "password", 36131 "credentialType", 36132 "otp", 36133 "popup", 36134 "onRedirecting" 36135 ]); 36136 var authorizeOptions = objectHelper.merge(options).with({ loginTicket: data.body.login_ticket }), key = createKey(_this.baseOptions.rootUrl, data.body.co_id); 36137 _this.storage.setItem(key, data.body.co_verifier, { expires: 1 / 96 }), popupMode ? _this.webMessageHandler.run(authorizeOptions, wrapCallback(cb, { forceLegacyError: !0 })) : _this.webAuth.authorize(authorizeOptions); 36138 } 36139 "function" == typeof options.onRedirecting ? options.onRedirecting(doAuth) : doAuth(); 36140 })); 36141 }, CrossOriginAuthentication.prototype.callback = function() { 36142 var targetOrigin = decodeURIComponent(function(name) { 36143 var parts = ("&" + windowHelper.getWindow().location.hash.substring(1)).split("&" + name + "="); 36144 if (2 === parts.length) return parts.pop().split("&").shift(); 36145 }("origin")), theWindow = windowHelper.getWindow(), _this = this; 36146 theWindow.addEventListener("message", (function(evt) { 36147 if ("co_verifier_request" === evt.data.type) { 36148 var key = createKey(evt.origin, evt.data.request.id), verifier = function(storage, key) { 36149 try { 36150 var verifier = storage.getItem(key); 36151 return storage.removeItem(key), verifier || ""; 36152 } catch (e) { 36153 return ""; 36154 } 36155 }(_this.storage, key); 36156 evt.source.postMessage({ 36157 type: "co_verifier_response", 36158 response: { verifier } 36159 }, evt.origin); 36160 } 36161 })), theWindow.parent.postMessage({ type: "ready" }, targetOrigin); 36162 }, Redirect.prototype.loginWithCredentials = function(options, cb) { 36163 options.realm = options.realm || options.connection, delete options.connection, this.crossOriginAuthentication.login(options, cb); 36164 }, Redirect.prototype.signupAndLogin = function(options, cb) { 36165 var _this = this; 36166 return this.webAuth.client.dbConnection.signup(options, (function(err) { 36167 return err ? cb(err) : (options.realm = options.realm || options.connection, delete options.connection, _this.webAuth.login(options, cb)); 36168 })); 36169 }; 36170 winchan = createCommonjsModule((function(module) { 36171 var WinChan = function() { 36172 function addListener(w, event, cb) { 36173 w.attachEvent ? w.attachEvent("on" + event, cb) : w.addEventListener && w.addEventListener(event, cb, !1); 36174 } 36175 function removeListener(w, event, cb) { 36176 w.detachEvent ? w.detachEvent("on" + event, cb) : w.removeEventListener && w.removeEventListener(event, cb, !1); 36177 } 36178 function extractOrigin(url) { 36179 /^https?:\/\//.test(url) || (url = window.location.href); 36180 var m = /^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(url); 36181 return m ? m[1] : url; 36182 } 36183 var isIE = function() { 36184 if ("undefined" == typeof navigator) return !1; 36185 var rv = -1, ua = navigator.userAgent; 36186 if ("Microsoft Internet Explorer" === navigator.appName) null != (/* @__PURE__ */ new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(ua) && (rv = parseFloat(RegExp.$1)); 36187 else if (ua.indexOf("Trident") > -1) null !== (/* @__PURE__ */ new RegExp("rv:([0-9]{2,2}[.0-9]{0,})")).exec(ua) && (rv = parseFloat(RegExp.$1)); 36188 return rv >= 8; 36189 }(); 36190 return "undefined" != typeof window && window.JSON && window.JSON.stringify && window.JSON.parse && window.postMessage ? { 36191 open: function(opts, cb) { 36192 if (!cb) throw "missing required callback argument"; 36193 var err, iframe; 36194 opts.url || (err = "missing required 'url' parameter"), opts.relay_url || (err = "missing required 'relay_url' parameter"), err && setTimeout((function() { 36195 cb(err); 36196 }), 0), opts.window_name || (opts.window_name = null), opts.window_features && !function() { 36197 try { 36198 var userAgent = navigator.userAgent; 36199 return -1 != userAgent.indexOf("Fennec/") || -1 != userAgent.indexOf("Firefox/") && -1 != userAgent.indexOf("Android"); 36200 } catch (e) {} 36201 return !1; 36202 }() || (opts.window_features = void 0); 36203 var messageTarget, origin = opts.origin || extractOrigin(opts.url); 36204 if (origin !== extractOrigin(opts.relay_url)) return setTimeout((function() { 36205 cb("invalid arguments: origin of url and relay_url must match"); 36206 }), 0); 36207 isIE && ((iframe = document.createElement("iframe")).setAttribute("src", opts.relay_url), iframe.style.display = "none", iframe.setAttribute("name", "__winchan_relay_frame"), document.body.appendChild(iframe), messageTarget = iframe.contentWindow); 36208 var w = opts.popup || window.open(opts.url, opts.window_name, opts.window_features); 36209 opts.popup && (w.location.href = opts.url), messageTarget || (messageTarget = w
36209); 36210 var closeInterval = setInterval((function() { 36211 w && w.closed && (cleanup(), cb && (cb("User closed the popup window"), cb = null)); 36212 }), 500), req = JSON.stringify({ 36213 a: "request", 36214 d: opts.params 36215 }); 36216 function cleanup() { 36217 if (iframe && document.body.removeChild(iframe), iframe = void 0, closeInterval && (closeInterval = clearInterval(closeInterval)), removeListener(window, "message", onMessage), removeListener(window, "unload", cleanup), w) try { 36218 w.close(); 36219 } catch (securityViolation) { 36220 messageTarget.postMessage("die", origin); 36221 } 36222 w = messageTarget = void 0; 36223 } 36224 function onMessage(e) { 36225 if (e.origin === origin) { 36226 try { 36227 var d = JSON.parse(e.data); 36228 } catch (err) { 36229 if (cb) return cb(err); 36230 throw err; 36231 } 36232 "ready" === d.a ? messageTarget.postMessage(req, origin) : "error" === d.a ? (cleanup(), cb && (cb(d.d), cb = null)) : "response" === d.a && (cleanup(), cb && (cb(null, d.d), cb = null)); 36233 } 36234 } 36235 return addListener(window, "unload", cleanup), addListener(window, "message", onMessage), { 36236 originalPopup: w, 36237 close: cleanup, 36238 focus: function() { 36239 if (w) try { 36240 w.focus(); 36241 } catch (e) {} 36242 } 36243 }; 36244 }, 36245 onOpen: function(cb) { 36246 var o = "*", msgTarget = isIE ? function() { 36247 for (var frames = window.opener.frames, i = frames.length - 1; i >= 0; i--) try { 36248 if (frames[i].location.protocol === window.location.protocol && frames[i].location.host === window.location.host && "__winchan_relay_frame" === frames[i].name) return frames[i]; 36249 } catch (e) {} 36250 }() : window.opener; 36251 if (!msgTarget) throw "can't find relay frame"; 36252 function doPost(msg) { 36253 msg = JSON.stringify(msg), isIE ? msgTarget.doPost(msg, o) : msgTarget.postMessage(msg, o); 36254 } 36255 function onDie(e) { 36256 if ("die" === e.data) try { 36257 window.close(); 36258 } catch (o_O) {} 36259 } 36260 addListener(isIE ? msgTarget : window, "message", (function onMessage(e) { 36261 var d; 36262 try { 36263 d = JSON.parse(e.data); 36264 } catch (err) {} 36265 d && "request" === d.a && (removeListener(window, "message", onMessage), o = e.origin, cb && setTimeout((function() { 36266 cb(o, d.d, (function(r) { 36267 cb = void 0, doPost({ 36268 a: "response", 36269 d: r 36270 }); 36271 })); 36272 }), 0)); 36273 })), addListener(isIE ? msgTarget : window, "message", onDie); 36274 try { 36275 doPost({ a: "ready" }); 36276 } catch (e) { 36277 addListener(msgTarget, "load", (function(e) { 36278 doPost({ a: "ready" }); 36279 })); 36280 } 36281 var onUnload = function() { 36282 try { 36283 removeListener(isIE ? msgTarget : window, "message", onDie); 36284 } catch (ohWell) {} 36285 cb && doPost({ 36286 a: "error", 36287 d: "client closed window" 36288 }), cb = void 0; 36289 try { 36290 window.close(); 36291 } catch (e) {} 36292 }; 36293 return addListener(window, "unload", onUnload), { detach: function() { 36294 removeListener(window, "unload", onUnload); 36295 } }; 36296 } 36297 } : { 36298 open: function(url, winopts, arg, cb) { 36299 setTimeout((function() { 36300 cb("unsupported browser"); 36301 }), 0); 36302 }, 36303 onOpen: function(cb) { 36304 setTimeout((function() { 36305 cb("unsupported browser"); 36306 }), 0); 36307 } 36308 }; 36309 }(); 36310 module.exports && (module.exports = WinChan); 36311 })); 36312 urlHelper = { extractOrigin: function(url) { 36313 /^https?:\/\//.test(url) || (url = window.location.href); 36314 var m = /^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(url); 36315 return m ? m[1] : url; 36316 } }; 36317 PopupHandler.prototype.calculatePosition = function(options) { 36318 var width = options.width || 500, height = options.height || 600, _window = windowHelper.getWindow(), screenX = void 0 !== _window.screenX ? _window.screenX : _window.screenLeft, screenY = void 0 !== _window.screenY ? _window.screenY : _window.screenTop, outerWidth = void 0 !== _window.outerWidth ? _window.outerWidth : _window.document.body.clientWidth, outerHeight = void 0 !== _window.outerHeight ? _window.outerHeight : _window.document.body.clientHeight; 36319 return { 36320 width, 36321 height, 36322 left: options.left || screenX + (outerWidth - width) / 2, 36323 top: options.top || screenY + (outerHeight - height) / 2 36324 }; 36325 }, PopupHandler.prototype.preload = function(options) { 36326 var _this = this, _window = windowHelper.getWindow(), popupPosition = this.calculatePosition(options.popupOptions || {}), popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions), url = options.url || "about:blank", windowFeatures = lib.stringify(popupOptions, { 36327 encode: !1, 36328 delimiter: "," 36329 }); 36330 return this._current_popup && !this._current_popup.closed || (this._current_popup = _window.open(url, "auth0_signup_popup", windowFeatures), this._current_popup.kill = function() { 36331 this.close(), _this._current_popup = null; 36332 }), this._current_popup; 36333 }, PopupHandler.prototype.load = function(url, relayUrl, options, cb) { 36334 var _this = this, popupPosition = this.calculatePosition(options.popupOptions || {}), popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions), winchanOptions = objectHelper.merge({ 36335 url, 36336 relay_url: relayUrl, 36337 window_features: lib.stringify(popupOptions, { 36338 delimiter: ",", 36339 encode: !1 36340 }), 36341 popup: this._current_popup 36342 }).with(options), popup = winchan.open(winchanOptions, (function(err, data) { 36343 if (!err || "SyntaxError" !== err.name) return _this._current_popup = null, cb(err, data); 36344 })); 36345 return popup.focus(), popup; 36346 }, Popup.prototype.buildPopupHandler = function() { 36347 var pluginHandler = this.baseOptions.plugins.get("popup.getPopupHandler"); 36348 return pluginHandler ? pluginHandler.getPopupHandler() : new PopupHandler(); 36349 }, Popup.prototype.preload = function(options) { 36350 options = options || {}; 36351 var popup = this.buildPopupHandler(); 36352 return popup.preload(options), popup; 36353 }, Popup.prototype.getPopupHandler = function(options, preload) { 36354 return options.popupHandler ? options.popupHandler : preload ? this.preload(options) : this.buildPopupHandler(); 36355 }, Popup.prototype.callback = function(options) { 36356 var _this = this, theWindow = windowHelper.getWindow(), originUrl = (options = options || {}).popupOrigin || this.baseOptions.popupOrigin || windowHelper.getOrigin(); 36357 theWindow.opener ? winchan.onOpen((function(popupOrigin, r, cb) { 36358 if (popupOrigin !== originUrl) return cb({ 36359 error: "origin_mismatch", 36360 error_description: "The popup's origin (" + popupOrigin + ") should match the `popupOrigin` parameter (" + originUrl + ")." 36361 }); 36362 _this.webAuth.parseHash(options || {}, (function(err, data) { 36363 return cb(err || data); 36364 })); 36365 })) : theWindow.doPost = function(msg) { 36366 theWindow.parent && theWindow.parent.postMessage(msg, originUrl); 36367 }; 36368 }, Popup.prototype.authorize = function(options, cb) { 36369 var url, relayUrl, popOpts = {}, pluginHandler = this.baseOptions.plugins.get("popup.authorize"), params = objectHelper.merge(this.baseOptions, [ 36370 "clientID", 36371 "scope", 36372 "domain", 36373 "audience", 36374 "tenant", 36375 "responseType", 36376 "redirectUri", 36377 "_csrf", 36378 "state", 36379 "_intstate", 36380 "nonce", 36381 "organization", 36382 "invitation" 36383 ]).with(objectHelper.blacklist(options, ["popupHandler"])); 36384 return assert.check(params, { 36385 type: "object",
36386 message: "options parameter is not valid" 36387 }, { responseType: { 36388 type: "string", 36389 message: "responseType option is required" 36390 } }), relayUrl = urlJoin(this.baseOptions.rootUrl, "relay.html"), options.owp ? params.owp = !0 : (popOpts.origin = urlHelper.extractOrigin(params.redirectUri), relayUrl = params.redirectUri), options.popupOptions && (popOpts.popupOptions = objectHelper.pick(options.popupOptions, [ 36391 "width", 36392 "height", 36393 "top", 36394 "left" 36395 ])), pluginHandler && (params = pluginHandler.processParams(params)), (params = this.transactionManager.process(params)).scope = params.scope || "openid profile email", delete params.domain, url = this.client.buildAuthorizeUrl(params), this.getPopupHandler(options).load(url, relayUrl, popOpts, wrapCallback(cb, { keepOriginalCasing: !0 })); 36396 }, Popup.prototype.loginWithCredentials = function(options, cb) { 36397 options.realm = options.realm || options.connection, options.popup = !0, options = objectHelper.merge(this.baseOptions, [ 36398 "redirectUri", 36399 "responseType", 36400 "state", 36401 "nonce", 36402 "timeout" 36403 ]).with(objectHelper.blacklist(options, ["popupHandler", "connection"])), options = this.transactionManager.process(options), this.crossOriginAuthentication.login(options, cb); 36404 }, Popup.prototype.passwordlessVerify = function(options, cb) { 36405 var _this = this; 36406 return this.client.passwordless.verify(objectHelper.blacklist(options, ["popupHandler"]), (function(err) { 36407 if (err) return cb(err); 36408 options.username = options.phoneNumber || options.email, options.password = options.verificationCode, delete options.email, delete options.phoneNumber, delete options.verificationCode, delete options.type, _this.client.loginWithResourceOwner(options, cb); 36409 })); 36410 }, Popup.prototype.signupAndLogin = function(options, cb) { 36411 var _this = this; 36412 return this.client.dbConnection.signup(options, (function(err) { 36413 if (err) return cb(err); 36414 _this.loginWithCredentials(options, cb); 36415 })); 36416 }, SilentAuthenticationHandler.create = function(options) { 36417 return new SilentAuthenticationHandler(options); 36418 }, SilentAuthenticationHandler.prototype.login = function(usePostMessage, callback) { 36419 this.handler = new IframeHandler({ 36420 auth0: this.auth0, 36421 url: this.authenticationUrl, 36422 eventListenerType: usePostMessage ? "message" : "load", 36423 callback: this.getCallbackHandler(callback, usePostMessage),
36424 timeout: this.timeout, 36425 eventValidator: this.getEventValidator(), 36426 timeoutCallback: function() { 36427 callback(null, "#error=timeout&error_description=Timeout+during+authentication+renew."); 36428 }, 36429 usePostMessage: usePostMessage || !1 36430 }), this.handler.init(); 36431 }, SilentAuthenticationHandler.prototype.getEventValidator = function() { 36432 var _this = this; 36433 return { isValid: function(eventData) { 36434 switch (eventData.event.type) { 36435 case "message": return eventData.event.origin === _this.postMessageOrigin && eventData.event.source === _this.handler.iframe.contentWindow && (!1 === _this.postMessageDataType || eventData.event.data.type && eventData.event.data.type === _this.postMessageDataType); 36436 case "load": if ("about:" === eventData.sourceObject.contentWindow.location.protocol) return !1; 36437 default: return !0; 36438 } 36439 } }; 36440 }, SilentAuthenticationHandler.prototype.getCallbackHandler = function(callback, usePostMessage) { 36441 return function(eventData) { 36442 callback(null, usePostMessage ? "object" == typeof eventData.event.data && eventData.event.data.hash ? eventData.event.data.hash : eventData.event.data : eventData.sourceObject.contentWindow.location.hash); 36443 }; 36444 }, UsernamePassword.prototype.login = function(options, cb) { 36445 var url, body; 36446 return url = urlJoin(this.baseOptions.rootUrl, "usernamepassword", "login"), options.username = options.username || options.email, options = objectHelper.blacklist(options, ["email", "onRedirecting"]), body = objectHelper.merge(this.baseOptions, [ 36447 "clientID", 36448 "redirectUri", 36449 "tenant", 36450 "responseType", 36451 "responseMode", 36452 "scope", 36453 "audience" 36454 ]).with(options), body = this.transactionManager.process(body), body = objectHelper.toSnakeCase(body, ["auth0Client"]), this.request.post(url).send(body).end(wrapCallback(cb)); 36455 }, UsernamePassword.prototype.callback = function(formHtml) { 36456 var div, _document = windowHelper.getDocument(); 36457 (div = _document.createElement("div")).innerHTML = formHtml, _document.body.appendChild(div).children[0].submit(); 36458 }, HostedPages.prototype.login = function(options, cb) { 36459 if (windowHelper.getWindow().location.host !== this.baseOptions.domain) throw new Error("This method is meant to be used only inside the Universal Login Page."); 36460 var usernamePassword, params = objectHelper.merge(this.baseOptions, [ 36461 "clientID", 36462 "redirectUri", 36463 "tenant", 36464 "responseType", 36465 "responseMode", 36466 "scope", 36467 "audience", 36468 "_csrf", 36469 "state", 36470 "_intstate", 36471 "nonce" 36472 ]).with(options); 36473 return assert.check(params, { 36474 type: "object", 36475 message: "options parameter is not valid" 36476 }, { responseType: { 36477 type: "string", 36478 message: "responseType option is required" 36479 } }), (usernamePassword = new UsernamePassword(this.baseOptions)).login(params, (function(err, data) { 36480 if (err) return cb(err); 36481 function doAuth() { 36482 usernamePassword.callback(data); 36483 } 36484 if ("function" == typeof options.onRedirecting) return options.onRedirecting((function() { 36485 doAuth(); 36486 })); 36487 doAuth(); 36488 })); 36489 }, HostedPages.prototype.signupAndLogin = function(options, cb) { 36490 var _this = this; 36491 return _this.client.client.dbConnection.signup(options, (function(err) { 36492 return err ? cb(err) : _this.login(options, cb); 36493 })); 36494 }, HostedPages.prototype.getSSOData = function(withActiveDirectories, cb) { 36495 var url, params = ""; 36496 return "function" == typeof withActiveDirectories && (cb = withActiveDirectories, withActiveDirectories = !1), assert.check(withActiveDirectories, { 36497 type: "boolean", 36498 message: "withActiveDirectories parameter is not valid" 36499 }), assert.check(cb, { 36500 type: "function", 36501 message: "cb parameter is not valid" 36502 }), withActiveDirectories && (params = "?" + lib.stringify({ 36503 ldaps: 1, 36504 client_id: this.baseOptions.clientID 36505 })), url = urlJoin(this.baseOptions.rootUrl, "user", "ssodata", params), this.request.get(url, { noHeaders: !0 }).withCredentials().end(wrapCallback(cb)); 36506 }; 36507 noop = function() {}; 36508 captchaSolved = noop; 36509 Flow = { 36510 DEFAULT: "default", 36511 PASSWORDLESS: "passwordless", 36512 PASSWORD_RESET: "password_reset" 36513 }; 36514 defaults$2 = { 36515 lang: "en", 36516 templates: {
36517 auth0: function(challenge) { 36518 var message = "code" === challenge.type ? "Enter the code shown above" : "Solve the formula shown above"; 36519 return "<div class=\"captcha-challenge\">\n <img src=\"" + challenge.image + "\" />\n <button type=\"button\" class=\"captcha-reload\">↺</button>\n</div>\n<input type=\"text\" name=\"captcha\"\n class=\"form-control captcha-control\"\n placeholder=\"" + message + "\" />"; 36520 }, 36521 recaptcha_v2: function() { 36522 return "<div class=\"recaptcha\" ></div><input type=\"hidden\" name=\"captcha\" />"; 36523 }, 36524 recaptcha_enterprise: function() { 36525 return "<div class=\"recaptcha\" ></div><input type=\"hidden\" name=\"captcha\" />"; 36526 }, 36527 hcaptcha: function() { 36528 return "<div class=\"hcaptcha\" ></div><input type=\"hidden\" name=\"captcha\" />"; 36529 }, 36530 friendly_captcha: function() { 36531 return "<div class=\"friendly-captcha\" ></div><input type=\"hidden\" name=\"captcha\" />"; 36532 }, 36533 arkose: function() { 36534 return "<div class=\"arkose\" ></div><input type=\"hidden\" name=\"captcha\" />"; 36535 }, 36536 auth0_v2: function() { 36537 return "<div class=\"auth0_v2\" ></div><input type=\"hidden\" name=\"captcha\" />"; 36538 }, 36539 error: function() { 36540 return "<div class=\"error\" style=\"color: red;\">Error getting the bot detection challenge. Please contact the system administrator.</div>"; 36541 } 36542 } 36543 }; 36544 captcha = { 36545 render: function(auth0Client, flow, element, options, callback) { 36546 function load(done) { 36547 function challengeCallback(err, challenge) { 36548 return err ? (element.innerHTML = options.templates.error(err), done(err)) : challenge.required ? (element.style.display = "", void ("auth0" === challenge.provider ? (function(element, options, challenge, load) { 36549 element.innerHTML = options.templates[challenge.provider](challenge), element.querySelector(".captcha-reload").addEventListener("click", (function(e) { 36550 e.preventDefault(), load(); 36551 })); 36552 }(element, options, challenge, load), done()) : "recaptcha_v2" !== challenge.provider && "recaptcha_enterprise" !== challenge.provider && "hcaptcha" !== challenge.provider && "friendly_captcha" !== challenge.provider && "arkose" !== challenge.provider && "auth0_v2" !== challenge.provider || function(element, options, challenge, done) { 36553 var captchaClass, widgetId = element.hasAttribute("data-wid") && element.getAttribute("data-wid"); 36554 function setValue(value) { 36555 element.querySelector("input[name=\"captcha\"]").value = value || ""; 36556 } 36557 if ("friendly_captcha" === challenge.provider && window.auth0FCInstance) return setValue(), void window.auth0FCInstance.reset(); 36558 if ("arkose" === challenge.provider && globalForCaptchaProvider(challenge.provider)) return setValue(), void globalForCaptchaProvider(challenge.provider).reset(); 36559 if (widgetId) return setValue(), void globalForCaptchaProvider(challenge.provider).reset(widgetId); 36560 switch (element.innerHTML = options.templates[challenge.provider](challenge), challenge.provider) { 36561 case "recaptcha_enterprise": 36562 case "recaptcha_v2": 36563 captchaClass = ".recaptcha"; 36564 break; 36565 case "hcaptcha": 36566 captchaClass = ".hcaptcha"; 36567 break; 36568 case "friendly_captcha": 36569 captchaClass = ".friendly-captcha"; 36570 break; 36571 case "arkose": 36572 captchaClass = ".arkose"; 36573 break; 36574 case "auth0_v2": captchaClass = ".auth0_v2"; 36575 } 36576 var captchaDiv = element.querySelector(captchaClass); 36577 injectCaptchaScript({ 36578 lang: options.lang, 36579 provider: challenge.provider, 36580 clientSubdomain: challenge.clientSubdomain, 36581 siteKey: challenge.siteKey 36582 }, (function(arkose) { 36583 var global = globalForCaptchaProvider(challenge.provider); 36584 if ("arkose" === challenge.provider) { 36585 var retryCount = 0, arkoseLoaded = !1; 36586 arkose.setConfig({ 36587 onReady: function() { 36588 arkoseLoaded || (done(null, { triggerCaptcha: function(solvedCallback) { 36589 arkose.run(), captchaSolved = solvedCallback; 36590 } }), arkoseLoaded = !0); 36591 }, 36592 onCompleted: function(response) { 36593 setValue(response.token), captchaSolved(); 36594 }, 36595 onError: function(response) { 36596 retryCount < 3 ? (setValue(), arkose.reset(), setTimeout((function() { 36597 arkose.run(); 36598 }), 500), retryCount++) : (arkoseLoaded || (done(new Error(response.error.error)), arkoseLoaded = !0), setValue("BYPASS_CAPTCHA")); 36599 } 36600 }); 36601 } else if ("friendly_captcha" === challenge.provider) window.auth0FCInstance = new global.WidgetInstance(captchaDiv, { 36602 sitekey: challenge.siteKey, 36603 language: options.lang, 36604 doneCallback: function(solution) { 36605 setValue(solution); 36606 }, 36607 errorCallback: function() { 36608 setValue(); 36609 } 36610 }), done(); 36611 else { 36612 var renderParams = { 36613 callback: setValue, 36614 "expired-callback": function() { 36615 setValue(); 36616 }, 36617 "error-callback": function() { 36618 setValue(); 36619 }, 36620 sitekey: challenge.siteKey 36621 }; 36622 "auth0_v2" === challenge.provider && (retryCount = 0, renderParams.language = options.lang, renderParams.theme = "light", renderParams.retry = "never", renderParams["response-field"] = !1, renderParams["error-callback"] = function() { 36623 return retryCount < 3 ? (setValue(), globalForCaptchaProvider(challenge.provider).reset(widgetId), retryCount++) : setValue("BYPASS_CAPTCHA"), !0; 36624 }), widgetId = global.render(captchaDiv, renderParams), element.setAttribute("data-wid", widgetId), done(); 36625 } 36626 }), setValue, done); 36627 }(element, options, challenge, done))) : (element.style.display = "none", void (element.innerHTML = "")); 36628 } 36629 done = done || noop, flow === Flow.PASSWORDLESS ? auth0Client.passwordless.getChallenge(challengeCallback) : flow === Flow.PASSWORD_RESET ? auth0Client.dbConnection.getPasswordResetChallenge(challengeCallback) : auth0Client.getChallenge(challengeCallback); 36630 } 36631 return options = objectHelper.merge(defaults$2).with(options || {}), load(callback), { 36632 reload: load, 36633 getValue: function() { 36634 var captchaInput = element.querySelector("input[name=\"captcha\"]"); 36635 if (captchaInput) return captchaInput.value; 36636 } 36637 }; 36638 }, 36639 Flow 36640 }; 36641 WebAuth.prototype.parseHash = function(options, cb) { 36642 var parsedQs, err; 36643 cb || "function" != typeof options ? options = options || {} : (cb = options, options = {}); 36644 var hashStr = void 0 === options.hash ? windowHelper.getWindow().location.hash : options.hash; 36645 if (hashStr = hashStr.replace(/^#?\/?/, ""), (parsedQs = lib.parse(hashStr)).hasOwnProperty("error")) return err = error.buildResponse(parsedQs.error, parsedQs.error_description), parsedQs.state && (err.state = parsedQs.state), cb(err); 36646 if (!parsedQs.hasOwnProperty("access_token") && !parsedQs.hasOwnProperty("id_token") && !parsedQs.hasOwnProperty("refresh_token")) return cb(null, null); 36647 var responseTypes = (this.baseOptions.responseType || options.responseType || "").split(" "); 36648 return responseTypes.length > 0 && -1 !== responseTypes.indexOf("token") && !parsedQs.hasOwnProperty("access_token") ? cb(error.buildResponse("invalid_hash", "response_type contains `token`, but the parsed hash does not contain an `access_token` property")) : responseTypes.length > 0 && -1 !== responseTypes.indexOf("id_token") && !parsedQs.hasOwnProperty("id_token") ? cb(error.buildResponse("invalid_hash", "response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")) : this.validateAuthenticationResponse(options, parsedQs, cb); 36649 }, WebAuth.prototype.validateAuthenticationResponse = function(options, parsedHash, cb) { 36650 var _this = this; 36651 options.__enableIdPInitiatedLogin = options.__enableIdPInitiatedLogin || options.__enableImpersonation; 36652 var state = parsedHash.state, transaction = this.transactionManager.getStoredTransaction(state), transactionState = options.state || transaction && transaction.state || null, transactionStateMatchesState = transactionState === state; 36653 if (!(!state && !transactionState && options.__enableIdPInitiatedLogin) && !transactionStateMatchesState) return cb({
36654 error: "invalid_token", 36655 errorDescription: "`state` does not match." 36656 }); 36657 var transactionNonce = options.nonce || transaction && transaction.nonce || null, transactionOrganization = transaction && transaction.organization, appState = options.state || transaction && transaction.appState || null, callback = function(err, payload) { 36658 if (err) return cb(err); 36659 var sub; 36660 transaction && transaction.lastUsedConnection && (payload && (sub = payload.sub), _this.ssodataStorage.set(transaction.lastUsedConnection, sub)); 36661 return cb(null, function(qsParams, appState, token) { 36662 return { 36663 accessToken: qsParams.access_token || null, 36664 idToken: qsParams.id_token || null, 36665 idTokenPayload: token || null, 36666 appState: appState || null, 36667 refreshToken: qsParams.refresh_token || null, 36668 state: qsParams.state || null, 36669 expiresIn: qsParams.expires_in ? parseInt(qsParams.expires_in, 10) : null, 36670 tokenType: qsParams.token_type || null, 36671 scope: qsParams.scope || null 36672 }; 36673 }(parsedHash, appState, payload)); 36674 }; 36675 return parsedHash.id_token ? this.validateToken(parsedHash.id_token, transactionNonce, (function(validationError, payload) { 36676 if (!validationError) { 36677 if (transactionOrganization) if (0 === transactionOrganization.indexOf("org_")) { 36678 if (!payload.org_id) return callback(error.invalidToken("Organization Id (org_id) claim must be a string present in the ID token")); 36679 if (payload.org_id !== transactionOrganization) return callback(error.invalidToken("Organization Id (org_id) claim value mismatch in the ID token; expected \"" + transactionOrganization + "\", found \"" + payload.org_id + "\"")); 36680 } else { 36681 if (!payload.org_name) return callback(error.invalidToken("Organization Name (org_name) claim must be a string present in the ID token")); 36682 if (payload.org_name !== transactionOrganization.toLowerCase()) return callback(error.invalidToken("Organization Name (org_name) claim value mismatch in the ID token; expected \"" + transactionOrganization + "\", found \"" + payload.org_name + "\"")); 36683 } 36684 return parsedHash.access_token && payload.at_hash ? new I().validateAccessToken(parsedHash.access_token, "RS256", payload.at_hash, (function(err) { 36685 return err ? callback(error.invalidToken(err.message)) : callback(null, payload); 36686 })) : callback(null, payload); 36687 } 36688 if ("invalid_token" !== validationError.error || validationError.errorDescription && validationError.errorDescription.indexOf("Nonce (nonce) claim value mismatch in the ID token") > -1) return callback(validationError); 36689 var decodedToken = new I().decode(parsedHash.id_token); 36690 if ("HS256" !== decodedToken.header.alg) return callback(validationError); 36691 if ((decodedToken.payload.nonce || null) !== transactionNonce) return callback({ 36692 error: "invalid_token", 36693 errorDescription: "Nonce (nonce) claim value mismatch in the ID token; expected \"" + transactionNonce + "\", found \"" + decodedToken.payload.nonce + "\"" 36694 }); 36695 if (!parsedHash.access_token) return callback({ 36696 error: "invalid_token", 36697 description: "The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can’t store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token" 36698 }); 36699 return _this.client.userInfo(parsedHash.access_token, (function(errUserInfo, profile) { 36700 return errUserInfo ? callback(errUserInfo) : callback(null, profile); 36701 })); 36702 })) : callback(null, null); 36703 }, WebAuth.prototype.validateToken = function(token, nonce, cb) { 36704 new I({ 36705 issuer: this.baseOptions.token_issuer, 36706 jwksURI: this.baseOptions.jwksURI, 36707 audience: this.baseOptions.clientID, 36708 leeway: this.baseOptions.leeway || 60, 36709 maxAge: this.baseOptions.maxAge, 36710 __clock: this.baseOptions.__clock || defaultClock 36711 }).verify(token, nonce, (function(err, payload) { 36712 if (err) return cb(error.invalidToken(err.message)); 36713 cb(null, payload); 36714 })); 36715 }, WebAuth.prototype.renewAuth = function(options, cb) { 36716 var usePostMessage = !!options.usePostMessage, postMessageDataType = options.postMessageDataType || !1, postMessageOrigin = options.postMessageOrigin || windowHelper.getWindow().origin, timeout = options.timeout, _this = this, params = objectHelper.merge(this.baseOptions, [ 36717 "clientID", 36718 "redirectUri", 36719 "responseType", 36720 "scope", 36721 "audience", 36722 "_csrf", 36723 "state", 36724 "_intstate", 36725 "nonce" 36726 ]).with(options); 36727 params.responseType = params.responseType || "token", params.responseMode = params.responseMode || "fragment", params = this.transactionManager.process(params), assert.check(params, { 36728 type: "object",
vendor: 5,387 bytes, lines 36729-36889
36729 message: "options parameter is not valid" 36730 }), assert.check(cb, { 36731 type: "function", 36732 message: "cb parameter is not valid" 36733 }), params.prompt = "none", params = objectHelper.blacklist(params, [ 36734 "usePostMessage", 36735 "tenant", 36736 "postMessageDataType", 36737 "postMessageOrigin" 36738 ]), SilentAuthenticationHandler.create({ 36739 authenticationUrl: this.client.buildAuthorizeUrl(params), 36740 postMessageDataType, 36741 postMessageOrigin, 36742 timeout 36743 }).login(usePostMessage, (function(err, hash) { 36744 if ("object" == typeof hash) return cb(err, hash); 36745 _this.parseHash({ hash }, cb); 36746 })); 36747 }, WebAuth.prototype.checkSession = function(options, cb) { 36748 var params = objectHelper.merge(this.baseOptions, [ 36749 "clientID", 36750 "responseType", 36751 "redirectUri", 36752 "scope", 36753 "audience", 36754 "_csrf", 36755 "state", 36756 "_intstate", 36757 "nonce" 36758 ]).with(options); 36759 return "code" === params.responseType ? cb({ 36760 error: "error", 36761 error_description: "responseType can't be `code`" 36762 }) : (options.nonce || (params = this.transactionManager.process(params)), params.redirectUri ? (assert.check(params, { 36763 type: "object", 36764 message: "options parameter is not valid" 36765 }), assert.check(cb, { 36766 type: "function", 36767 message: "cb parameter is not valid" 36768 }), params = objectHelper.blacklist(params, [ 36769 "usePostMessage", 36770 "tenant", 36771 "postMessageDataType" 36772 ]), void this.webMessageHandler.run(params, wrapCallback(cb, { 36773 forceLegacyError: !0, 36774 ignoreCasing: !0 36775 }))) : cb({ 36776 error: "error", 36777 error_description: "redirectUri can't be empty" 36778 })); 36779 }, WebAuth.prototype.changePassword = function(options, cb) { 36780 return this.client.dbConnection.changePassword(options, cb); 36781 }, WebAuth.prototype.passwordlessStart = function(options, cb) { 36782 var authParams = objectHelper.merge(this.baseOptions, [ 36783 "responseType", 36784 "responseMode", 36785 "redirectUri", 36786 "scope", 36787 "audience", 36788 "_csrf", 36789 "state", 36790 "_intstate", 36791 "nonce" 36792 ]).with(options.authParams); 36793 return options.authParams = this.transactionManager.process(authParams), this.client.passwordless.start(options, cb); 36794 }, WebAuth.prototype.signup = function(options, cb) { 36795 return this.client.dbConnection.signup(options, cb); 36796 }, WebAuth.prototype.authorize = function(options) { 36797 var params = objectHelper.merge(this.baseOptions, [ 36798 "clientID", 36799 "responseType", 36800 "responseMode", 36801 "redirectUri", 36802 "scope", 36803 "audience", 36804 "_csrf", 36805 "state", 36806 "_intstate", 36807 "nonce", 36808 "organization", 36809 "invitation" 36810 ]).with(options); 36811 assert.check(params, { 36812 type: "object", 36813 message: "options parameter is not valid" 36814 }, { responseType: { 36815 type: "string", 36816 message: "responseType option is required" 36817 } }), (params = this.transactionManager.process(params)).scope = params.scope || "openid profile email", windowHelper.redirect(this.client.buildAuthorizeUrl(params)); 36818 }, WebAuth.prototype.signupAndAuthorize = function(options, cb) { 36819 var _this = this; 36820 return this.client.dbConnection.signup(objectHelper.blacklist(options, ["popupHandler"]), (function(err) { 36821 if (err) return cb(err); 36822 options.realm = options.connection, options.username || (options.username = options.email), _this.client.login(options, cb); 36823 })); 36824 }, WebAuth.prototype.login = function(options, cb) { 36825 var params = objectHelper.merge(this.baseOptions, [ 36826 "clientID", 36827 "responseType", 36828 "redirectUri", 36829 "scope", 36830 "audience", 36831 "_csrf", 36832 "state", 36833 "_intstate", 36834 "nonce", 36835 "onRedirecting", 36836 "organization", 36837 "invitation" 36838 ]).with(options); 36839 params = this.transactionManager.process(params), windowHelper.getWindow().location.host === this.baseOptions.domain ? (params.connection = params.realm, delete params.realm, this._universalLogin.login(params, cb)) : this.crossOriginAuthentication.login(params, cb); 36840 }, WebAuth.prototype.passwordlessLogin = function(options, cb) { 36841 var params = objectHelper.merge(this.baseOptions, [ 36842 "clientID", 36843 "responseType", 36844 "redirectUri", 36845 "scope", 36846 "audience", 36847 "_csrf", 36848 "state", 36849 "_intstate", 36850 "nonce", 36851 "onRedirecting" 36852 ]).with(options); 36853 if (params = this.transactionManager.process(params), windowHelper.getWindow().location.host === this.baseOptions.domain) this.passwordlessVerify(params, cb); 36854 else { 36855 var crossOriginOptions = objectHelper.extend({ 36856 credentialType: "http://auth0.com/oauth/grant-type/passwordless/otp", 36857 realm: params.connection, 36858 username: params.email || params.phoneNumber, 36859 otp: params.verificationCode 36860 }, objectHelper.blacklist(params, [ 36861 "connection", 36862 "email", 36863 "phoneNumber", 36864 "verificationCode" 36865 ])); 36866 this.crossOriginAuthentication.login(crossOriginOptions, cb); 36867 } 36868 }, WebAuth.prototype.crossOriginAuthenticationCallback = function() { 36869 this.crossOriginVerification(); 36870 }, WebAuth.prototype.crossOriginVerification = function() { 36871 this.crossOriginAuthentication.callback(); 36872 }, WebAuth.prototype.logout = function(options) { 36873 windowHelper.redirect(this.client.buildLogoutUrl(options)); 36874 }, WebAuth.prototype.passwordlessVerify = function(options, cb) { 36875 var _this = this, params = objectHelper.merge(this.baseOptions, [ 36876 "clientID", 36877 "responseType", 36878 "responseMode", 36879 "redirectUri", 36880 "scope", 36881 "audience", 36882 "_csrf", 36883 "state", 36884 "_intstate", 36885 "nonce", 36886 "onRedirecting" 36887 ]).with(options); 36888 return assert.check(params, { 36889 type: "object",
36890 message: "options parameter is not valid" 36891 }, { responseType: { 36892 type: "string", 36893 message: "responseType option is required" 36894 } }), params = this.transactionManager.process(params), this.client.passwordless.verify(params, (function(err) { 36895 if (err) return cb(err); 36896 function doAuth() { 36897 windowHelper.redirect(_this.client.passwordless.buildVerifyUrl(params)); 36898 } 36899 if ("function" == typeof options.onRedirecting) return options.onRedirecting((function() { 36900 doAuth(); 36901 })); 36902 doAuth(); 36903 })); 36904 }, WebAuth.prototype.renderCaptcha = function(element, options, callback) { 36905 return captcha.render(this.client, captcha.Flow.DEFAULT, element, options, callback); 36906 }, WebAuth.prototype.renderPasswordlessCaptcha = function(element, options, callback) { 36907 return captcha.render(this.client, captcha.Flow.PASSWORDLESS, element, options, callback); 36908 }, WebAuth.prototype.renderPasswordResetCaptcha = function(element, options, callback) { 36909 return captcha.render(this.client, captcha.Flow.PASSWORD_RESET, element, options, callback); 36910 }, PasswordlessAuthentication.prototype.buildVerifyUrl = function(options) { 36911 var params, qString; 36912 return assert.check(options, { 36913 type: "object", 36914 message: "options parameter is not valid" 36915 }, { 36916 connection: { 36917 type: "string", 36918 message: "connection option is required" 36919 }, 36920 verificationCode: { 36921 type: "string", 36922 message: "verificationCode option is required" 36923 }, 36924 phoneNumber: { 36925 optional: !1, 36926 type: "string", 36927 message: "phoneNumber option is required", 36928 condition: function(o) { 36929 return !o.email; 36930 } 36931 }, 36932 email: { 36933 optional: !1, 36934 type: "string", 36935 message: "email option is required", 36936 condition: function(o) { 36937 return !o.phoneNumber; 36938 } 36939 } 36940 }), params = objectHelper.merge(this.baseOptions, [ 36941 "clientID", 36942 "responseType", 36943 "responseMode", 36944 "redirectUri", 36945 "scope", 36946 "audience", 36947 "_csrf", 36948 "state", 36949 "_intstate", 36950 "protocol", 36951 "nonce" 36952 ]).with(options), this.baseOptions._sendTelemetry && (params.auth0Client = this.request.getTelemetryData()), params = objectHelper.toSnakeCase(params, ["auth0Client"]), qString = lib.stringify(params), urlJoin(this.baseOptions.rootUrl, "passwordless", "verify_redirect", "?" + qString); 36953 }, PasswordlessAuthentication.prototype.start = function(options, cb) { 36954 var url, body; 36955 assert.check(options, { 36956 type: "object", 36957 message: "options parameter is not valid" 36958 }, { 36959 connection: { 36960 type: "string", 36961 message: "connection option is required" 36962 }, 36963 send: { 36964 type: "string", 36965 message: "send option is required", 36966 values: ["link", "code"], 36967 value_message: "send is not valid ([link, code])" 36968 }, 36969 phoneNumber: { 36970 optional: !0, 36971 type: "string", 36972 message: "phoneNumber option is required", 36973 condition: function(o) { 36974 return "code" === o.send || !o.email; 36975 } 36976 }, 36977 email: { 36978 optional: !0, 36979 type: "string", 36980 message: "email option is required", 36981 condition: function(o) { 36982 return "link" === o.send || !o.phoneNumber; 36983 } 36984 }, 36985 authParams: { 36986 optional: !0, 36987 type: "object", 36988 message: "authParams option is required" 36989 } 36990 }), assert.check(cb, { 36991 type: "function", 36992 message: "cb parameter is not valid" 36993 }), url = urlJoin(this.baseOptions.rootUrl, "passwordless", "start"); 36994 var xRequestLanguage = options.xRequestLanguage; 36995 delete options.xRequestLanguage, (body = objectHelper.merge(this.baseOptions, [ 36996 "clientID", 36997 "responseType", 36998 "redirectUri", 36999 "scope" 37000 ]).with(options)).scope && (body.authParams = body.authParams || {}, body.authParams.scope = body.authParams.scope || body.scope), body.redirectUri && (body.authParams = body.authParams || {}, body.authParams.redirect_uri = body.authParams.redirectUri || body.redirectUri), body.responseType && (body.authParams = body.authParams || {}, body.authParams.response_type = body.authParams.responseType || body.responseType), delete body.redirectUri, delete body.responseType, delete body.scope, body = objectHelper.toSnakeCase(body, ["auth0Client", "authParams"]); 37001 var postOptions = xRequestLanguage ? { xRequestLanguage } : void 0; 37002 return this.request.post(url, postOptions).send(body).end(wrapCallback(cb)); 37003 }, PasswordlessAuthentication.prototype.verify = function(options, cb) { 37004 var url, cleanOption; 37005 return assert.check(options, { 37006 type: "object",
vendor: 14,189 bytes, lines 37007-37379
37007 message: "options parameter is not valid" 37008 }, { 37009 connection: { 37010 type: "string", 37011 message: "connection option is required" 37012 }, 37013 verificationCode: { 37014 type: "string", 37015 message: "verificationCode option is required" 37016 }, 37017 phoneNumber: { 37018 optional: !1, 37019 type: "string", 37020 message: "phoneNumber option is required", 37021 condition: function(o) { 37022 return !o.email; 37023 } 37024 }, 37025 email: { 37026 optional: !1, 37027 type: "string", 37028 message: "email option is required", 37029 condition: function(o) { 37030 return !o.phoneNumber; 37031 } 37032 } 37033 }), assert.check(cb, { 37034 type: "function", 37035 message: "cb parameter is not valid" 37036 }), cleanOption = objectHelper.pick(options, [ 37037 "connection", 37038 "verificationCode", 37039 "phoneNumber", 37040 "email", 37041 "auth0Client", 37042 "clientID" 37043 ]), cleanOption = objectHelper.toSnakeCase(cleanOption, ["auth0Client"]), url = urlJoin(this.baseOptions.rootUrl, "passwordless", "verify"), this.request.post(url).send(cleanOption).end(wrapCallback(cb)); 37044 }, PasswordlessAuthentication.prototype.getChallenge = function(cb) { 37045 if (assert.check(cb, { 37046 type: "function", 37047 message: "cb parameter is not valid" 37048 }), !this.baseOptions.state) return cb(); 37049 var url = urlJoin(this.baseOptions.rootUrl, "passwordless", "challenge"); 37050 return this.request.post(url).send({ state: this.baseOptions.state }).end(wrapCallback(cb, { ignoreCasing: !0 })); 37051 }, DBConnection.prototype.signup = function(options, cb) { 37052 var url, body, metadata; 37053 return assert.check(options, { 37054 type: "object", 37055 message: "options parameter is not valid" 37056 }, { 37057 connection: { 37058 type: "string", 37059 message: "connection option is required" 37060 }, 37061 email: { 37062 type: "string", 37063 message: "email option is required" 37064 }, 37065 password: { 37066 type: "string", 37067 message: "password option is required" 37068 } 37069 }), assert.check(cb, { 37070 type: "function", 37071 message: "cb parameter is not valid" 37072 }), url = urlJoin(this.baseOptions.rootUrl, "dbconnections", "signup"), metadata = (body = objectHelper.merge(this.baseOptions, ["clientID", "state"]).with(options)).user_metadata || body.userMetadata, body = objectHelper.blacklist(body, [ 37073 "scope", 37074 "userMetadata", 37075 "user_metadata" 37076 ]), body = objectHelper.toSnakeCase(body, ["auth0Client"]), metadata && (body.user_metadata = metadata), this.request.post(url).send(body).end(wrapCallback(cb)); 37077 }, DBConnection.prototype.changePassword = function(options, cb) { 37078 var url, body; 37079 return assert.check(options, { 37080 type: "object", 37081 message: "options parameter is not valid" 37082 }, { 37083 connection: { 37084 type: "string", 37085 message: "connection option is required" 37086 }, 37087 email: { 37088 type: "string", 37089 message: "email option is required" 37090 } 37091 }), assert.check(cb, { 37092 type: "function", 37093 message: "cb parameter is not valid" 37094 }), url = urlJoin(this.baseOptions.rootUrl, "dbconnections", "change_password"), body = objectHelper.merge(this.baseOptions, ["clientID", "state"]).with(options, [ 37095 "email", 37096 "connection", 37097 "captcha" 37098 ]), body = objectHelper.toSnakeCase(body, ["auth0Client"]), this.request.post(url).send(body).end(wrapCallback(cb)); 37099 }, DBConnection.prototype.getPasswordResetChallenge = function(cb) { 37100 if (assert.check(cb, { 37101 type: "function", 37102 message: "cb parameter is not valid" 37103 }), !this.baseOptions.state) return cb(); 37104 var url = urlJoin(this.baseOptions.rootUrl, "dbconnections", "change_password", "challenge"); 37105 return this.request.post(url).send({ state: this.baseOptions.state }).end(wrapCallback(cb, { ignoreCasing: !0 })); 37106 }, Authentication.prototype.buildAuthorizeUrl = function(options) { 37107 var params, qString; 37108 return assert.check(options, { 37109 type: "object", 37110 message: "options parameter is not valid" 37111 }), params = objectHelper.merge(this.baseOptions, [ 37112 "clientID", 37113 "responseType", 37114 "responseMode", 37115 "redirectUri", 37116 "scope", 37117 "audience" 37118 ]).with(options), assert.check(params, { 37119 type: "object", 37120 message: "options parameter is not valid" 37121 }, { 37122 clientID: { 37123 type: "string", 37124 message: "clientID option is required" 37125 }, 37126 redirectUri: { 37127 optional: !0, 37128 type: "string", 37129 message: "redirectUri option is required" 37130 }, 37131 responseType: { 37132 type: "string", 37133 message: "responseType option is required" 37134 }, 37135 nonce: { 37136 type: "string", 37137 message: "nonce option is required", 37138 condition: function(o) { 37139 return -1 === o.responseType.indexOf("code") && -1 !== o.responseType.indexOf("id_token"); 37140 } 37141 }, 37142 scope: { 37143 optional: !0, 37144 type: "string", 37145 message: "scope option is required" 37146 }, 37147 audience: { 37148 optional: !0, 37149 type: "string", 37150 message: "audience option is required" 37151 } 37152 }), this.baseOptions._sendTelemetry && (params.auth0Client = this.request.getTelemetryData()), params.connection_scope && assert.isArray(params.connection_scope) && (params.connection_scope = params.connection_scope.join(",")), params = objectHelper.blacklist(params, [ 37153 "username", 37154 "popupOptions", 37155 "domain", 37156 "tenant", 37157 "timeout", 37158 "appState" 37159 ]), params = objectHelper.toSnakeCase(params, ["auth0Client"]), params = parametersWhitelist.oauthAuthorizeParams(this.warn, params), qString = lib.stringify(params), urlJoin(this.baseOptions.rootUrl, "authorize", "?" + qString); 37160 }, Authentication.prototype.buildLogoutUrl = function(options) { 37161 var params, qString; 37162 return assert.check(options, { 37163 optional: !0, 37164 type: "object", 37165 message: "options parameter is not valid" 37166 }), params = objectHelper.merge(this.baseOptions, ["clientID"]).with(options || {}), this.baseOptions._sendTelemetry && (params.auth0Client = this.request.getTelemetryData()), params = objectHelper.toSnakeCase(params, ["auth0Client", "returnTo"]), qString = lib.stringify(objectHelper.blacklist(params, ["federated"])), options && void 0 !== options.federated && !1 !== options.federated && "false" !== options.federated && (qString += "&federated"), urlJoin(this.baseOptions.rootUrl, "v2", "logout", "?" + qString); 37167 }, Authentication.prototype.loginWithDefaultDirectory = function(options, cb) { 37168 return assert.check(options, { 37169 type: "object", 37170 message: "options parameter is not valid" 37171 }, { 37172 username: { 37173 type: "string", 37174 message: "username option is required" 37175 }, 37176 password: { 37177 type: "string", 37178 message: "password option is required" 37179 }, 37180 scope: { 37181 optional: !0, 37182 type: "string", 37183 message: "scope option is required" 37184 }, 37185 audience: { 37186 optional: !0, 37187 type: "string", 37188 message: "audience option is required" 37189 } 37190 }), options.grantType = "password", this.oauthToken(options, cb); 37191 }, Authentication.prototype.login = function(options, cb) { 37192 return assert.check(options, { 37193 type: "object", 37194 message: "options parameter is not valid" 37195 }, { 37196 username: { 37197 type: "string", 37198 message: "username option is required" 37199 }, 37200 password: { 37201 type: "string", 37202 message: "password option is required" 37203 }, 37204 realm: { 37205 type: "string", 37206 message: "realm option is required" 37207 }, 37208 scope: { 37209 optional: !0, 37210 type: "string", 37211 message: "scope option is required" 37212 }, 37213 audience: { 37214 optional: !0, 37215 type: "string", 37216 message: "audience option is required" 37217 } 37218 }), options.grantType = "http://auth0.com/oauth/grant-type/password-realm", this.oauthToken(options, cb); 37219 }, Authentication.prototype.oauthToken = function(options, cb) { 37220 var url, body; 37221 return assert.check(options, { 37222 type: "object", 37223 message: "options parameter is not valid" 37224 }), assert.check(cb, { 37225 type: "function", 37226 message: "cb parameter is not valid" 37227 }), url = urlJoin(this.baseOptions.rootUrl, "oauth", "token"), body = objectHelper.merge(this.baseOptions, [ 37228 "clientID", 37229 "scope", 37230 "audience" 37231 ]).with(options), assert.check(body, { 37232 type: "object", 37233 message: "options parameter is not valid" 37234 }, { 37235 clientID: { 37236 type: "string", 37237 message: "clientID option is required" 37238 }, 37239 grantType: { 37240 type: "string", 37241 message: "grantType option is required" 37242 }, 37243 scope: { 37244 optional: !0, 37245 type: "string", 37246 message: "scope option is required" 37247 }, 37248 audience: { 37249 optional: !0, 37250 type: "string", 37251 message: "audience option is required" 37252 } 37253 }), body = objectHelper.toSnakeCase(body, ["auth0Client"]), body = parametersWhitelist.oauthTokenParams(this.warn, body), this.request.post(url).send(body).end(wrapCallback(cb)); 37254 }, Authentication.prototype.loginWithResourceOwner = function(options, cb) { 37255 var url, body; 37256 return assert.check(options, { 37257 type: "object", 37258 message: "options parameter is not valid" 37259 }, { 37260 username: { 37261 type: "string", 37262 message: "username option is required" 37263 }, 37264 password: { 37265 type: "string", 37266 message: "password option is required" 37267 }, 37268 connection: { 37269 type: "string", 37270 message: "connection option is required" 37271 }, 37272 scope: { 37273 optional: !0, 37274 type: "string", 37275 message: "scope option is required" 37276 } 37277 }), assert.check(cb, { 37278 type: "function", 37279 message: "cb parameter is not valid" 37280 }), url = urlJoin(this.baseOptions.rootUrl, "oauth", "ro"), body = objectHelper.merge(this.baseOptions, ["clientID", "scope"]).with(options, [ 37281 "username", 37282 "password", 37283 "scope", 37284 "connection", 37285 "device" 37286 ]), (body = objectHelper.toSnakeCase(body, ["auth0Client"])).grant_type = body.grant_type || "password", this.request.post(url).send(body).end(wrapCallback(cb)); 37287 }, Authentication.prototype.getSSOData = function(withActiveDirectories, cb) { 37288 if (this.auth0 || (this.auth0 = new WebAuth(this.baseOptions)), windowHelper.getWindow().location.host === this.baseOptions.domain) return this.auth0._universalLogin.getSSOData(withActiveDirectories, cb); 37289 "function" == typeof withActiveDirectories && (cb = withActiveDirectories), assert.check(cb, { 37290 type: "function", 37291 message: "cb parameter is not valid" 37292 }); 37293 var clientId = this.baseOptions.clientID, ssodataInformation = this.ssodataStorage.get() || {}; 37294 this.auth0.checkSession({ 37295 responseType: "token id_token", 37296 scope: "openid profile email", 37297 connection: ssodataInformation.lastUsedConnection, 37298 timeout: 5e3 37299 }, (function(err, result) { 37300 return err ? "login_required" === err.error ? cb(null, { sso: !1 }) : ("consent_required" === err.error && (err.error_description = "Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."), cb(err, { sso: !1 })) : ssodataInformation.lastUsedSub && ssodataInformation.lastUsedSub !== result.idTokenPayload.sub ? cb(err, { sso: !1 }) : cb(null, { 37301 lastUsedConnection: { name: ssodataInformation.lastUsedConnection }, 37302 lastUsedUserID: result.idTokenPayload.sub, 37303 lastUsedUsername: result.idTokenPayload.email || result.idTokenPayload.name, 37304 lastUsedClientID: clientId, 37305 sessionClients: [clientId], 37306 sso: !0 37307 }); 37308 })); 37309 }, Authentication.prototype.userInfo = function(accessToken, cb) { 37310 var url; 37311 return assert.check(accessToken, { 37312 type: "string", 37313 message: "accessToken parameter is not valid" 37314 }), assert.check(cb, { 37315 type: "function", 37316 message: "cb parameter is not valid" 37317 }), url = urlJoin(this.baseOptions.rootUrl, "userinfo"), this.request.get(url).set("Authorization", "Bearer " + accessToken).end(wrapCallback(cb, { ignoreCasing: !0 })); 37318 }, Authentication.prototype.getChallenge = function(cb) { 37319 if (assert.check(cb, { 37320 type: "function", 37321 message: "cb parameter is not valid" 37322 }), !this.baseOptions.state) return cb(); 37323 var url = urlJoin(this.baseOptions.rootUrl, "usernamepassword", "challenge"); 37324 return this.request.post(url).send({ state: this.baseOptions.state }).end(wrapCallback(cb, { ignoreCasing: !0 })); 37325 }, Authentication.prototype.delegation = function(options, cb) { 37326 var url, body; 37327 return assert.check(options, { 37328 type: "object", 37329 message: "options parameter is not valid" 37330 }, { grant_type: { 37331 type: "string", 37332 message: "grant_type option is required" 37333 } }), assert.check(cb, { 37334 type: "function", 37335 message: "cb parameter is not valid" 37336 }), url = urlJoin(this.baseOptions.rootUrl, "delegation"), body = objectHelper.merge(this.baseOptions, ["clientID"]).with(options), body = objectHelper.toSnakeCase(body, ["auth0Client"]), this.request.post(url).send(body).end(wrapCallback(cb)); 37337 }, Authentication.prototype.getUserCountry = function(cb) { 37338 var url; 37339 return assert.check(cb, { 37340 type: "function", 37341 message: "cb parameter is not valid" 37342 }), url = urlJoin(this.baseOptions.rootUrl, "user", "geoloc", "country"), this.request.get(url).end(wrapCallback(cb)); 37343 }, Management.prototype.getUser = function(userId, cb) { 37344 var url; 37345 return assert.check(userId, { 37346 type: "string", 37347 message: "userId parameter is not valid" 37348 }), assert.check(cb, { 37349 type: "function", 37350 message: "cb parameter is not valid" 37351 }), url = urlJoin(this.baseOptions.rootUrl, "users", userId), this.request.get(url).end(wrapCallback(cb, { ignoreCasing: !0 })); 37352 }, Management.prototype.patchUserMetadata = function(userId, userMetadata, cb) { 37353 var url; 37354 return assert.check(userId, { 37355 type: "string", 37356 message: "userId parameter is not valid" 37357 }), assert.check(userMetadata, { 37358 type: "object", 37359 message: "userMetadata parameter is not valid" 37360 }), assert.check(cb, { 37361 type: "function", 37362 message: "cb parameter is not valid" 37363 }), url = urlJoin(this.baseOptions.rootUrl, "users", userId), this.request.patch(url).send({ user_metadata: userMetadata }).end(wrapCallback(cb, { ignoreCasing: !0 })); 37364 }, Management.prototype.patchUserAttributes = function(userId, user, cb) { 37365 var url; 37366 return assert.check(userId, { 37367 type: "string", 37368 message: "userId parameter is not valid" 37369 }), assert.check(user, { 37370 type: "object", 37371 message: "user parameter is not valid" 37372 }), assert.check(cb, { 37373 type: "function", 37374 message: "cb parameter is not valid" 37375 }), url = urlJoin(this.baseOptions.rootUrl, "users", userId), this.request.patch(url).send(user).end(wrapCallback(cb, { ignoreCasing: !0 })); 37376 }, Management.prototype.linkUser = function(userId, secondaryUserToken, cb) { 37377 var url; 37378 return assert.check(userId, { 37379 type: "string",
37380 message: "userId parameter is not valid" 37381 }), assert.check(secondaryUserToken, { 37382 type: "string", 37383 message: "secondaryUserToken parameter is not valid" 37384 }), assert.check(cb, { 37385 type: "function", 37386 message: "cb parameter is not valid" 37387 }), url = urlJoin(this.baseOptions.rootUrl, "users", userId, "identities"), this.request.post(url).send({ link_with: secondaryUserToken }).end(wrapCallback(cb, { ignoreCasing: !0 })); 37388 }; 37389 index = { 37390 Authentication, 37391 Management, 37392 WebAuth, 37393 version 37394 }; 37395})); 37396//#endregion 37397//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/auth0/SskyAuth0Service.js 37398var require_SskyAuth0Service = /* @__PURE__ */ __commonJSMin(((exports) => { 37399 var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { 37400 function adopt(value) { 37401 return value instanceof P ? value : new P(function(resolve) { 37402 resolve(value); 37403 }); 37404 } 37405 return new (P || (P = Promise))(function(resolve, reject) { 37406 function fulfilled(value) { 37407 try { 37408 step(generator.next(value)); 37409 } catch (e) { 37410 reject(e); 37411 } 37412 } 37413 function rejected(value) { 37414 try { 37415 step(generator["throw"](value)); 37416 } catch (e) { 37417 reject(e); 37418 } 37419 } 37420 function step(result) { 37421 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); 37422 } 37423 step((generator = generator.apply(thisArg, _arguments || [])).next()); 37424 }); 37425 }; 37426 var __rest = exports && exports.__rest || function(s, e) { 37427 var t = {}; 37428 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; 37429 if (s != null && typeof Object.getOwnPropertySymbols === "function") { 37430 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; 37431 } 37432 return t; 37433 }; 37434 Object.defineProperty(exports, "__esModule", { value: true }); 37435 exports.SskyAuth0Service = void 0; 37436 var authService_1 = require_authService(); 37437 var utils_1 = require_utils(); 37438 var LEEWAY_MS = 120 * 1e3; 37439 var SskyAuth0Service = class { 37440 constructor(config) { 37441 var _a; 37442 const { initiateForgotPasswordCB, confirmForgotPasswordCB, changePasswordFunction, postLogoutRedirectUri, managedUserConnectionName, customDomain, acceptIdpInitiatedLogin } = config, auth0Options = __rest(config, [ 37443 "initiateForgotPasswordCB", 37444 "confirmForgotPasswordCB", 37445 "changePasswordFunction", 37446 "postLogoutRedirectUri", 37447 "managedUserConnectionName", 37448 "customDomain", 37449 "acceptIdpInitiatedLogin" 37450 ]); 37451 this.auth0Options = auth0Options; 37452 this.authClient = this.createClient(((_a = globalThis.localStorage) === null || _a === void 0 ? void 0 : _a.getItem("useCustomDomain")) === "true" ? customDomain : auth0Options.domain); 37453 this.postLogoutRedirectUri = postLogoutRedirectUri; 37454 this.managedUserConnectionName = managedUserConnectionName; 37455 this.initiateForgotPasswordCB = initiateForgotPasswordCB; 37456 this.confirmForgotPasswordCB = confirmForgotPasswordCB; 37457 this.changePasswordFunction = changePasswordFunction; 37458 this.customDomain = customDomain; 37459 this.acceptIdpInitiatedLogin = !!acceptIdpInitiatedLogin; 37460 } 37461 init() { 37462 return __awaiter(this, void 0, void 0, function* () { 37463 var _a; 37464 const callbackDomain = this.acceptIdpInitiatedLogin ? this.getCallbackIssuerDomain((_a = globalThis.location) === null || _a === void 0 ? void 0 : _a.hash) : null; 37465 const callbackClient = callbackDomain ? this.createClient(callbackDomain) : this.authClient; 37466 yield new Promise((resolve, reject) => { 37467 callbackClient.parseHash({ __enableIdPInitiatedLogin: this.acceptIdpInitiatedLogin }, (error, result) => { 37468 if (error) return reject(error); 37469 if (result) { 37470 this.idToken = result.idToken; 37471 this.idTokenPayload = result.idTokenPayload; 37472 if (callbackDomain) this.useCustomDomain(callbackDomain === this.customDomain); 37473 } 37474 return resolve(); 37475 }); 37476 }); 37477 }); 37478 } 37479 isFirstLogin(email) { 37480 return __awaiter(this, void 0, void 0, function* () { 37481 throw new Error("Not implemented"); 37482 }); 37483 } 37484 isUserDeactivated(email) { 37485 return __awaiter(this, void 0, void 0, function* () { 37486 throw new Error("Not implemented"); 37487 }); 37488 } 37489 shouldInitiateForgotPassword() { 37490 return __awaiter(this, void 0, void 0, function* () { 37491 throw new Error("Not implemented"); 37492 }); 37493 } 37494 isNewPasswordRequired() { 37495 return __awaiter(this, void 0, void 0, function* () { 37496 throw new Error("Not implemented"); 37497 }); 37498 } 37499 login(email, password) { 37500 return __awaiter(this, void 0, void 0, function* () { 37501 const username = (0, utils_1.normalizeUsername)(email); 37502 yield new Promise((resolve, reject) => { 37503 this.authClient.login({ 37504 username, 37505 password, 37506 realm: this.managedUserConnectionName 37507 }, (error) => { 37508 if (error) return reject(error); 37509 return resolve(); 37510 }); 37511 }); 37512 }); 37513 } 37514 loginWithRedirect(email) { 37515 return __awaiter(this, void 0, void 0, function* () { 37516 this.authClient.authorize({ 37517 login_hint: email, 37518 mode: "login" 37519 }); 37520 }); 37521 } 37522 loginWithPopup(email) { 37523 return __awaiter(this, void 0, void 0, function* () { 37524 throw new Error("Not implemented"); 37525 }); 37526 } 37527 logout() { 37528 return __awaiter(this, void 0, void 0, function* () { 37529 var _a; 37530 (_a = globalThis.localStorage) === null || _a === void 0 || _a.removeItem("useCustomDomain"); 37531 this.authClient.logout({ 37532 clientID: this.auth0Options.clientID, 37533 returnTo: this.postLogoutRedirectUri 37534 }); 37535 }); 37536 } 37537 isUserManaged(email, force) { 37538 return __awaiter(this, void 0, void 0, function* () { 37539 throw new Error("Not implemented"); 37540 }); 37541 } 37542 getUserAccessToken() { 37543 return __awaiter(this, void 0, void 0, function* () { 37544 return this.getUserIdToken(); 37545 }); 37546 } 37547 getUserIdToken() { 37548 return __awaiter(this, void 0, void 0, function* () { 37549 var _a, _b; 37550 if (((_b = (_a = this.idTokenPayload) === null || _a === void 0 ? void 0 : _a.exp) !== null && _b !== void 0 ? _b : 0) * 1e3 - (/* @__PURE__ */ new Date()).getTime() <= LEEWAY_MS) yield new Promise((resolve, reject) => { 37551 this.authClient.checkSession({}, (error, result) => { 37552 if (error) return reject(error); 37553 this.idToken = result.idToken; 37554 this.idTokenPayload = result.idTokenPayload; 37555 return resolve(); 37556 }); 37557 }); 37558 return this.idToken; 37559 }); 37560 } 37561 getUserName() { 37562 var _a; 37563 return (_a = this.idTokenPayload.email) === null || _a === void 0 ? void 0 : _a.toLowerCase(); 37564 } 37565 initiateForgotPassword(user, recaptchaToken) { 37566 return __awaiter(this, void 0, void 0, function* () { 37567 try { 37568 yield this.initiateForgotPasswordCB(user, recaptchaToken); 37569 } catch (err) { 37570 this._raiseError(err); 37571 } 37572 }); 37573 } 37574 confirmForgotPassword(user, verificationCode, newPassword) { 37575 return __awaiter(this, void 0, void 0, function* () { 37576 try { 37577 yield this.confirmForgotPasswordCB(user, verificationCode.trim(), newPassword); 37578 yield this.login(user, newPassword); 37579 } catch (err) { 37580 this._raiseError(err); 37581 } 37582 }); 37583 } 37584 changePassword(email, oldPassword, newPassword) { 37585 return __awaiter(this, void 0, void 0, function* () { 37586 try { 37587 yield this.changePasswordFunction(email, oldPassword, newPassword); 37588 yield this.login(email, newPassword); 37589 } catch (err) { 37590 this._raiseError(err); 37591 } 37592 }); 37593 } 37594 _raiseError(err) { 37595 throw err; 37596 } 37597 subscribe(callback) {} 37598 getAuthServiceType() { 37599 return authService_1.AuthServiceType.AUTH0; 37600 } 37601 useCustomDomain(value) { 37602 var _a, _b; 37603 this.authClient = this.createClient(value ? this.customDomain : this.auth0Options.domain); 37604 if (value) (_a = globalThis.localStorage) === null || _a === void 0 || _a.setItem("useCustomDomain", "true"); 37605 else (_b = globalThis.localStorage) === null || _b === void 0 || _b.removeItem("useCustomDomain"); 37606 } 37607 createClient(domain) { 37608 return new (init_auth0_min_esm(), __toCommonJS(auth0_min_esm_exports
37608)).WebAuth(Object.assign(Object.assign({}, this.auth0Options), { domain })); 37609 } 37610 /** 37611 * The token is only decoded here to choose which domain validates it; parseHash still verifies it. 37612 * Returns null unless the issuer is one of our two Auth0 domains. 37613 */ 37614 getCallbackIssuerDomain(hash) { 37615 const idToken = new URLSearchParams(hash === null || hash === void 0 ? void 0 : hash.replace(/^#/, "")).get("id_token"); 37616 const encodedPayload = idToken === null || idToken === void 0 ? void 0 : idToken.split(".")[1]; 37617 if (!encodedPayload) return null; 37618 try { 37619 const { iss } = JSON.parse(atob(encodedPayload.replace(/-/g, "+").replace(/_/g, "/"))); 37620 const issuerDomain = new URL(iss).hostname; 37621 return [this.auth0Options.domain, this.customDomain].includes(issuerDomain) ? issuerDomain : null; 37622 } catch (_a) { 37623 return null; 37624 } 37625 } 37626 }; 37627 exports.SskyAuth0Service = SskyAuth0Service; 37628})); 37629//#endregion 37630//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/auth0/index.js 37631var require_auth0 = /* @__PURE__ */ __commonJSMin(((exports) => { 37632 var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { 37633 if (k2 === void 0) k2 = k; 37634 var desc = Object.getOwnPropertyDescriptor(m, k); 37635 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = { 37636 enumerable: true, 37637 get: function() { 37638 return m[k]; 37639 } 37640 }; 37641 Object.defineProperty(o, k2, desc); 37642 }) : (function(o, m, k, k2) { 37643 if (k2 === void 0) k2 = k; 37644 o[k2] = m[k]; 37645 })); 37646 var __exportStar = exports && exports.__exportStar || function(m, exports$4) { 37647 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$4, p)) __createBinding(exports$4, m, p); 37648 }; 37649 Object.defineProperty(exports, "__esModule", { value: true }); 37650 __exportStar(require_SskyAuth0Service(), exports); 37651})); 37652//#endregion 37653//#region node_modules/amazon-cognito-identity-js/es/AuthenticationDetails.js 37654var AuthenticationDetails; 37655var init_AuthenticationDetails = __esmMin((() => { 37656 AuthenticationDetails = /*#__PURE__*/ function() { 37657 /*! 37658 * Copyright 2016 Amazon.com, 37659 * Inc. or its affiliates. All Rights Reserved. 37660 * 37661 * Licensed under the Amazon Software License (the "License"). 37662 * You may not use this file except in compliance with the 37663 * License. A copy of the License is located at 37664 * 37665 * http://aws.amazon.com/asl/ 37666 * 37667 * or in the "license" file accompanying this file. This file is 37668 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 37669 * CONDITIONS OF ANY KIND, express or implied. See the License 37670 * for the specific language governing permissions and 37671 * limitations under the License. 37672 */ 37673 /** 37674 * Constructs a new AuthenticationDetails object 37675 * @param {object=} data Creation options. 37676 * @param {string} data.Username User being authenticated. 37677 * @param {string} data.Password Plain-text password to authenticate with. 37678 * @param {(AttributeArg[])?} data.ValidationData Application extra metadata. 37679 * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth. 37680 */ 37681 function AuthenticationDetails(data) { 37682 var _ref = data || {}, ValidationData = _ref.ValidationData, Username = _ref.Username, Password = _ref.Password, AuthParameters = _ref.AuthParameters, ClientMetadata = _ref.ClientMetadata; 37683 this.validationData = ValidationData || {}; 37684 this.authParameters = AuthParameters || {}; 37685 this.clientMetadata = ClientMetadata || {}; 37686 this.username = Username; 37687 this.password = Password; 37688 } 37689 /** 37690 * @returns {string} the record's username 37691 */ 37692 var _proto = AuthenticationDetails.prototype; 37693 _proto.getUsername = function getUsername() { 37694 return this.username; 37695 }; 37696 _proto.getPassword = function getPassword() { 37697 return this.password; 37698 }; 37699 _proto.getValidationData = function getValidationData() { 37700 return this.validationData; 37701 }; 37702 _proto.getAuthParameters = function getAuthParameters() { 37703 return this.authParameters; 37704 }; 37705 _proto.getClientMetadata = function getClientMetadata() { 37706 return this.clientMetadata; 37707 };
vendor: 9,126 bytes, lines 37708-38023
37708 return AuthenticationDetails; 37709 }(); 37710})); 37711//#endregion 37712//#region node_modules/crypto-js/core.js 37713var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => { 37714 (function(root, factory) { 37715 if (typeof exports === "object") module.exports = exports = factory(); 37716 else if (typeof define === "function" && define.amd) define([], factory); 37717 else root.CryptoJS = factory(); 37718 })(exports, function() { 37719 /** 37720 * CryptoJS core components. 37721 */ 37722 var CryptoJS = CryptoJS || function(Math, undefined) { 37723 var crypto; 37724 if (typeof window !== "undefined" && window.crypto) crypto = window.crypto; 37725 if (typeof self !== "undefined" && self.crypto) crypto = self.crypto; 37726 if (typeof globalThis !== "undefined" && globalThis.crypto) crypto = globalThis.crypto; 37727 if (!crypto && typeof window !== "undefined" && window.msCrypto) crypto = window.msCrypto; 37728 if (!crypto && typeof globalThis !== "undefined" && globalThis.crypto) crypto = globalThis.crypto; 37729 if (!crypto && typeof __require === "function") try { 37730 crypto = require_crypto_browserify(); 37731 } catch (err) {} 37732 var cryptoSecureRandomInt = function() { 37733 if (crypto) { 37734 if (typeof crypto.getRandomValues === "function") try { 37735 return crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0]; 37736 } catch (err) {} 37737 if (typeof crypto.randomBytes === "function") try { 37738 return crypto.randomBytes(4).readInt32LE(); 37739 } catch (err) {} 37740 } 37741 throw new Error("Native crypto module could not be used to get secure random number."); 37742 }; 37743 var create = Object.create || function() { 37744 function F() {} 37745 return function(obj) { 37746 var subtype; 37747 F.prototype = obj; 37748 subtype = new F(); 37749 F.prototype = null; 37750 return subtype; 37751 }; 37752 }(); 37753 /** 37754 * CryptoJS namespace. 37755 */ 37756 var C = {}; 37757 /** 37758 * Library namespace. 37759 */ 37760 var C_lib = C.lib = {}; 37761 /** 37762 * Base object for prototypal inheritance. 37763 */ 37764 var Base = C_lib.Base = function() { 37765 return { 37766 /** 37767 * Creates a new object that inherits from this object. 37768 * 37769 * @param {Object} overrides Properties to copy into the new object. 37770 * 37771 * @return {Object} The new object. 37772 * 37773 * @static 37774 * 37775 * @example 37776 * 37777 * var MyType = CryptoJS.lib.Base.extend({ 37778 * field: 'value', 37779 * 37780 * method: function () { 37781 * } 37782 * }); 37783 */ 37784 extend: function(overrides) { 37785 var subtype = create(this); 37786 if (overrides) subtype.mixIn(overrides); 37787 if (!subtype.hasOwnProperty("init") || this.init === subtype.init) subtype.init = function() { 37788 subtype.$super.init.apply(this, arguments); 37789 }; 37790 subtype.init.prototype = subtype; 37791 subtype.$super = this; 37792 return subtype; 37793 }, 37794 /** 37795 * Extends this object and runs the init method. 37796 * Arguments to create() will be passed to init(). 37797 * 37798 * @return {Object} The new object. 37799 * 37800 * @static 37801 * 37802 * @example 37803 * 37804 * var instance = MyType.create(); 37805 */ 37806 create: function() { 37807 var instance = this.extend(); 37808 instance.init.apply(instance, arguments); 37809 return instance; 37810 }, 37811 /** 37812 * Initializes a newly created object. 37813 * Override this method to add some logic when your objects are created. 37814 * 37815 * @example 37816 * 37817 * var MyType = CryptoJS.lib.Base.extend({ 37818 * init: function () { 37819 * // ... 37820 * } 37821 * }); 37822 */ 37823 init: function() {}, 37824 /** 37825 * Copies properties into this object. 37826 * 37827 * @param {Object} properties The properties to mix in. 37828 * 37829 * @example 37830 * 37831 * MyType.mixIn({ 37832 * field: 'value' 37833 * }); 37834 */ 37835 mixIn: function(properties) { 37836 for (var propertyName in properties) if (properties.hasOwnProperty(propertyName)) this[propertyName] = properties[propertyName]; 37837 if (properties.hasOwnProperty("toString")) this.toString = properties.toString; 37838 }, 37839 /** 37840 * Creates a copy of this object. 37841 * 37842 * @return {Object} The clone. 37843 * 37844 * @example 37845 * 37846 * var clone = instance.clone(); 37847 */ 37848 clone: function() { 37849 return this.init.prototype.extend(this); 37850 } 37851 }; 37852 }(); 37853 /** 37854 * An array of 32-bit words. 37855 * 37856 * @property {Array} words The array of 32-bit words. 37857 * @property {number} sigBytes The number of significant bytes in this word array. 37858 */ 37859 var WordArray = C_lib.WordArray = Base.extend({ 37860 /** 37861 * Initializes a newly created word array. 37862 * 37863 * @param {Array} words (Optional) An array of 32-bit words. 37864 * @param {number} sigBytes (Optional) The number of significant bytes in the words. 37865 * 37866 * @example 37867 * 37868 * var wordArray = CryptoJS.lib.WordArray.create(); 37869 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); 37870 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); 37871 */ 37872 init: function(words, sigBytes) { 37873 words = this.words = words || []; 37874 if (sigBytes != undefined) this.sigBytes = sigBytes; 37875 else this.sigBytes = words.length * 4; 37876 }, 37877 /** 37878 * Converts this word array to a string. 37879 * 37880 * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex 37881 * 37882 * @return {string} The stringified word array. 37883 * 37884 * @example 37885 * 37886 * var string = wordArray + ''; 37887 * var string = wordArray.toString(); 37888 * var string = wordArray.toString(CryptoJS.enc.Utf8); 37889 */ 37890 toString: function(encoder) { 37891 return (encoder || Hex).stringify(this); 37892 }, 37893 /** 37894 * Concatenates a word array to this word array. 37895 * 37896 * @param {WordArray} wordArray The word array to append. 37897 * 37898 * @return {WordArray} This word array. 37899 * 37900 * @example 37901 * 37902 * wordArray1.concat(wordArray2); 37903 */ 37904 concat: function(wordArray) { 37905 var thisWords = this.words; 37906 var thatWords = wordArray.words; 37907 var thisSigBytes = this.sigBytes; 37908 var thatSigBytes = wordArray.sigBytes; 37909 this.clamp(); 37910 if (thisSigBytes % 4) for (var i = 0; i < thatSigBytes; i++) { 37911 var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 255; 37912 thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8; 37913 } 37914 else for (var j = 0; j < thatSigBytes; j += 4) thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2]; 37915 this.sigBytes += thatSigBytes; 37916 return this; 37917 }, 37918 /** 37919 * Removes insignificant bits. 37920 * 37921 * @example 37922 * 37923 * wordArray.clamp(); 37924 */ 37925 clamp: function() { 37926 var words = this.words; 37927 var sigBytes = this.sigBytes; 37928 words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8; 37929 words.length = Math.ceil(sigBytes / 4); 37930 }, 37931 /** 37932 * Creates a copy of this word array. 37933 * 37934 * @return {WordArray} The clone. 37935 * 37936 * @example 37937 * 37938 * var clone = wordArray.clone(); 37939 */ 37940 clone: function() { 37941 var clone = Base.clone.call(this); 37942 clone.words = this.words.slice(0); 37943 return clone; 37944 }, 37945 /** 37946 * Creates a word array filled with random bytes. 37947 * 37948 * @param {number} nBytes The number of random bytes to generate. 37949 * 37950 * @return {WordArray} The random word array. 37951 * 37952 * @static 37953 * 37954 * @example 37955 * 37956 * var wordArray = CryptoJS.lib.WordArray.random(16); 37957 */ 37958 random: function(nBytes) { 37959 var words = []; 37960 for (var i = 0; i < nBytes; i += 4) words.push(cryptoSecureRandomInt()); 37961 return new WordArray.init(words, nBytes); 37962 } 37963 }); 37964 /** 37965 * Encoder namespace. 37966 */ 37967 var C_enc = C.enc = {}; 37968 /** 37969 * Hex encoding strategy. 37970 */ 37971 var Hex = C_enc.Hex = { 37972 /** 37973 * Converts a word array to a hex string. 37974 * 37975 * @param {WordArray} wordArray The word array. 37976 * 37977 * @return {string} The hex string. 37978 * 37979 * @static 37980 * 37981 * @example 37982 * 37983 * var hexString = CryptoJS.enc.Hex.stringify(wordArray); 37984 */ 37985 stringify: function(wordArray) { 37986 var words = wordArray.words; 37987 var sigBytes = wordArray.sigBytes; 37988 var hexChars = []; 37989 for (var i = 0; i < sigBytes; i++) { 37990 var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; 37991 hexChars.push((bite >>> 4).toString(16)); 37992 hexChars.push((bite & 15).toString(16)); 37993 } 37994 return hexChars.join(""); 37995 }, 37996 /** 37997 * Converts a hex string to a word array. 37998 * 37999 * @param {string} hexStr The hex string. 38000 * 38001 * @return {WordArray} The word array. 38002 * 38003 * @static 38004 * 38005 * @example 38006 * 38007 * var wordArray = CryptoJS.enc.Hex.parse(hexString); 38008 */ 38009 parse: function(hexStr) { 38010 var hexStrLength = hexStr.length; 38011 var words = []; 38012 for (var i = 0; i < hexStrLength; i += 2) words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4; 38013 return new WordArray.init(words, hexStrLength / 2); 38014 } 38015 }; 38016 /** 38017 * Latin1 encoding strategy. 38018 */ 38019 var Latin1 = C_enc.Latin1 = { 38020 /** 38021 * Converts a word array to a Latin1 string. 38022 * 38023 * @param {WordArray} wordArray The word array.
38024 * 38025 * @return {string} The Latin1 string. 38026 * 38027 * @static 38028 * 38029 * @example 38030 * 38031 * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); 38032 */ 38033 stringify: function(wordArray) { 38034 var words = wordArray.words; 38035 var sigBytes = wordArray.sigBytes; 38036 var latin1Chars = []; 38037 for (var i = 0; i < sigBytes; i++) { 38038 var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; 38039 latin1Chars.push(String.fromCharCode(bite)); 38040 } 38041 return latin1Chars.join(""); 38042 }, 38043 /** 38044 * Converts a Latin1 string to a word array. 38045 * 38046 * @param {string} latin1Str The Latin1 string. 38047 * 38048 * @return {WordArray} The word array. 38049 * 38050 * @static 38051 * 38052 * @example 38053 * 38054 * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); 38055 */ 38056 parse: function(latin1Str) { 38057 var latin1StrLength = latin1Str.length; 38058 var words = []; 38059 for (var i = 0; i < latin1StrLength; i++) words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8; 38060 return new WordArray.init(words, latin1StrLength); 38061 } 38062 }; 38063 /** 38064 * UTF-8 encoding strategy. 38065 */ 38066 var Utf8 = C_enc.Utf8 = { 38067 /** 38068 * Converts a word array to a UTF-8 string. 38069 * 38070 * @param {WordArray} wordArray The word array. 38071 * 38072 * @return {string} The UTF-8 string. 38073 * 38074 * @static 38075 * 38076 * @example 38077 * 38078 * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); 38079 */ 38080 stringify: function(wordArray) { 38081 try { 38082 return decodeURIComponent(escape(Latin1.stringify(wordArray))); 38083 } catch (e) { 38084 throw new Error("Malformed UTF-8 data"); 38085 } 38086 }, 38087 /** 38088 * Converts a UTF-8 string to a word array. 38089 * 38090 * @param {string} utf8Str The UTF-8 string. 38091 * 38092 * @return {WordArray} The word array. 38093 * 38094 * @static 38095 * 38096 * @example 38097 *
vendor: 7,906 bytes, lines 38098-38343
38098 * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); 38099 */ 38100 parse: function(utf8Str) { 38101 return Latin1.parse(unescape(encodeURIComponent(utf8Str))); 38102 } 38103 }; 38104 /** 38105 * Abstract buffered block algorithm template. 38106 * 38107 * The property blockSize must be implemented in a concrete subtype. 38108 * 38109 * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 38110 */ 38111 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ 38112 /** 38113 * Resets this block algorithm's data buffer to its initial state. 38114 * 38115 * @example 38116 * 38117 * bufferedBlockAlgorithm.reset(); 38118 */ 38119 reset: function() { 38120 this._data = new WordArray.init(); 38121 this._nDataBytes = 0; 38122 }, 38123 /** 38124 * Adds new data to this block algorithm's buffer. 38125 * 38126 * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. 38127 * 38128 * @example 38129 * 38130 * bufferedBlockAlgorithm._append('data'); 38131 * bufferedBlockAlgorithm._append(wordArray); 38132 */ 38133 _append: function(data) { 38134 if (typeof data == "string") data = Utf8.parse(data); 38135 this._data.concat(data); 38136 this._nDataBytes += data.sigBytes; 38137 }, 38138 /** 38139 * Processes available data blocks. 38140 * 38141 * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. 38142 * 38143 * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. 38144 * 38145 * @return {WordArray} The processed data. 38146 * 38147 * @example 38148 * 38149 * var processedData = bufferedBlockAlgorithm._process(); 38150 * var processedData = bufferedBlockAlgorithm._process(!!'flush'); 38151 */ 38152 _process: function(doFlush) { 38153 var processedWords; 38154 var data = this._data; 38155 var dataWords = data.words; 38156 var dataSigBytes = data.sigBytes; 38157 var blockSize = this.blockSize; 38158 var nBlocksReady = dataSigBytes / (blockSize * 4); 38159 if (doFlush) nBlocksReady = Math.ceil(nBlocksReady); 38160 else nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); 38161 var nWordsReady = nBlocksReady * blockSize; 38162 var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); 38163 if (nWordsReady) { 38164 for (var offset = 0; offset < nWordsReady; offset += blockSize) this._doProcessBlock(dataWords, offset); 38165 processedWords = dataWords.splice(0, nWordsReady); 38166 data.sigBytes -= nBytesReady; 38167 } 38168 return new WordArray.init(processedWords, nBytesReady); 38169 }, 38170 /** 38171 * Creates a copy of this object. 38172 * 38173 * @return {Object} The clone. 38174 * 38175 * @example 38176 * 38177 * var clone = bufferedBlockAlgorithm.clone(); 38178 */ 38179 clone: function() { 38180 var clone = Base.clone.call(this); 38181 clone._data = this._data.clone(); 38182 return clone; 38183 }, 38184 _minBufferSize: 0 38185 }); 38186 C_lib.Hasher = BufferedBlockAlgorithm.extend({ 38187 /** 38188 * Configuration options. 38189 */ 38190 cfg: Base.extend(), 38191 /** 38192 * Initializes a newly created hasher. 38193 * 38194 * @param {Object} cfg (Optional) The configuration options to use for this hash computation. 38195 * 38196 * @example 38197 * 38198 * var hasher = CryptoJS.algo.SHA256.create(); 38199 */ 38200 init: function(cfg) { 38201 this.cfg = this.cfg.extend(cfg); 38202 this.reset(); 38203 }, 38204 /** 38205 * Resets this hasher to its initial state. 38206 * 38207 * @example 38208 * 38209 * hasher.reset(); 38210 */ 38211 reset: function() { 38212 BufferedBlockAlgorithm.reset.call(this); 38213 this._doReset(); 38214 }, 38215 /** 38216 * Updates this hasher with a message. 38217 * 38218 * @param {WordArray|string} messageUpdate The message to append. 38219 * 38220 * @return {Hasher} This hasher. 38221 * 38222 * @example 38223 * 38224 * hasher.update('message'); 38225 * hasher.update(wordArray); 38226 */ 38227 update: function(messageUpdate) { 38228 this._append(messageUpdate); 38229 this._process(); 38230 return this; 38231 }, 38232 /** 38233 * Finalizes the hash computation. 38234 * Note that the finalize operation is effectively a destructive, read-once operation. 38235 * 38236 * @param {WordArray|string} messageUpdate (Optional) A final message update. 38237 * 38238 * @return {WordArray} The hash. 38239 * 38240 * @example 38241 * 38242 * var hash = hasher.finalize(); 38243 * var hash = hasher.finalize('message'); 38244 * var hash = hasher.finalize(wordArray); 38245 */ 38246 finalize: function(messageUpdate) { 38247 if (messageUpdate) this._append(messageUpdate); 38248 return this._doFinalize(); 38249 }, 38250 blockSize: 512 / 32, 38251 /** 38252 * Creates a shortcut function to a hasher's object interface. 38253 * 38254 * @param {Hasher} hasher The hasher to create a helper for. 38255 * 38256 * @return {Function} The shortcut function. 38257 * 38258 * @static 38259 * 38260 * @example 38261 * 38262 * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); 38263 */ 38264 _createHelper: function(hasher) { 38265 return function(message, cfg) { 38266 return new hasher.init(cfg).finalize(message); 38267 }; 38268 }, 38269 /** 38270 * Creates a shortcut function to the HMAC's object interface. 38271 * 38272 * @param {Hasher} hasher The hasher to use in this HMAC helper. 38273 * 38274 * @return {Function} The shortcut function. 38275 * 38276 * @static 38277 * 38278 * @example 38279 * 38280 * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); 38281 */ 38282 _createHmacHelper: function(hasher) { 38283 return function(message, key) { 38284 return new C_algo.HMAC.init(hasher, key).finalize(message); 38285 }; 38286 } 38287 }); 38288 /** 38289 * Algorithm namespace. 38290 */ 38291 var C_algo = C.algo = {}; 38292 return C; 38293 }(Math); 38294 return CryptoJS; 38295 }); 38296})); 38297//#endregion 38298//#region node_modules/crypto-js/lib-typedarrays.js 38299var require_lib_typedarrays = /* @__PURE__ */ __commonJSMin(((exports, module) => { 38300 (function(root, factory) { 38301 if (typeof exports === "object") module.exports = exports = factory(require_core()); 38302 else if (typeof define === "function" && define.amd) define(["./core"], factory); 38303 else factory(root.CryptoJS); 38304 })(exports, function(CryptoJS) { 38305 (function() { 38306 if (typeof ArrayBuffer != "function") return; 38307 var WordArray = CryptoJS.lib.WordArray; 38308 var superInit = WordArray.init; 38309 var subInit = WordArray.init = function(typedArray) { 38310 if (typedArray instanceof ArrayBuffer) typedArray = new Uint8Array(typedArray); 38311 if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); 38312 if (typedArray instanceof Uint8Array) { 38313 var typedArrayByteLength = typedArray.byteLength; 38314 var words = []; 38315 for (var i = 0; i < typedArrayByteLength; i++) words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8; 38316 superInit.call(this, words, typedArrayByteLength); 38317 } else superInit.apply(this, arguments); 38318 }; 38319 subInit.prototype = WordArray; 38320 })(); 38321 return CryptoJS.lib.WordArray; 38322 }); 38323})); 38324//#endregion 38325//#region node_modules/crypto-js/sha256.js 38326var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 38327 (function(root, factory) { 38328 if (typeof exports === "object") module.exports = exports = factory(require_core()); 38329 else if (typeof define === "function" && define.amd) define(["./core"], factory); 38330 else factory(root.CryptoJS); 38331 })(exports, function(CryptoJS) { 38332 (function(Math) { 38333 var C = CryptoJS; 38334 var C_lib = C.lib; 38335 var WordArray = C_lib.WordArray; 38336 var Hasher = C_lib.Hasher; 38337 var C_algo = C.algo; 38338 var H = []; 38339 var K = []; 38340 (function() { 38341 function isPrime(n) { 38342 var sqrtN = Math.sqrt(n); 38343 for (var factor = 2; factor <= sqrtN; factor++) if (!(n % factor)) return false;
38344 return true; 38345 } 38346 function getFractionalBits(n) { 38347 return (n - (n | 0)) * 4294967296 | 0; 38348 } 38349 var n = 2; 38350 var nPrime = 0; 38351 while (nPrime < 64) { 38352 if (isPrime(n)) { 38353 if (nPrime < 8) H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); 38354 K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); 38355 nPrime++; 38356 } 38357 n++; 38358 } 38359 })(); 38360 var W = []; 38361 /** 38362 * SHA-256 hash algorithm. 38363 */ 38364 var SHA256 = C_algo.SHA256 = Hasher.extend({ 38365 _doReset: function() { 38366 this._hash = new WordArray.init(H.slice(0)); 38367 }, 38368 _doProcessBlock: function(M, offset) { 38369 var H = this._hash.words; 38370 var a = H[0]; 38371 var b = H[1]; 38372 var c = H[2]; 38373 var d = H[3]; 38374 var e = H[4]; 38375 var f = H[5]; 38376 var g = H[6]; 38377 var h = H[7]; 38378 for (var i = 0; i < 64; i++) { 38379 if (i < 16) W[i] = M[offset + i] | 0; 38380 else { 38381 var gamma0x = W[i - 15]; 38382 var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3; 38383 var gamma1x = W[i - 2]; 38384 var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10; 38385 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; 38386 } 38387 var ch = e & f ^ ~e & g; 38388 var maj = a & b ^ a & c ^ b & c; 38389 var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22); 38390 var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25); 38391 var t1 = h + sigma1 + ch + K[i] + W[i]; 38392 var t2 = sigma0 + maj; 38393 h = g; 38394 g = f; 38395 f = e; 38396 e = d + t1 | 0; 38397 d = c; 38398 c = b; 38399 b = a; 38400 a = t1 + t2 | 0; 38401 } 38402 H[0] = H[0] + a | 0; 38403 H[1] = H[1] + b | 0; 38404 H[2] = H[2] + c | 0; 38405 H[3] = H[3] + d | 0; 38406 H[4] = H[4] + e | 0; 38407 H[5] = H[5] + f | 0; 38408 H[6] = H[6] + g | 0; 38409 H[7] = H[7] + h | 0; 38410 }, 38411 _doFinalize: function() { 38412 var data = this._data; 38413 var dataWords = data.words; 38414 var nBitsTotal = this._nDataBytes * 8; 38415 var nBitsLeft = data.sigBytes * 8; 38416 dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; 38417 dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 4294967296); 38418 dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal; 38419 data.sigBytes = dataWords.length * 4; 38420 this._process(); 38421 return this._hash; 38422 }, 38423 clone: function() { 38424 var clone = Hasher.clone.call(this); 38425 clone._hash = this._hash.clone(); 38426 return clone; 38427 } 38428 }); 38429 /** 38430 * Shortcut function to the hasher's object interface. 38431 * 38432 * @param {WordArray|string} message The message to hash. 38433 * 38434 * @return {WordArray} The hash. 38435 * 38436 * @static 38437 * 38438 * @example 38439 * 38440 * var hash = CryptoJS.SHA256('message'); 38441 * var hash = CryptoJS.SHA256(wordArray); 38442 */ 38443 C.SHA256 = Hasher._createHelper(SHA256); 38444 /** 38445 * Shortcut function to the HMAC's object interface. 38446 * 38447 * @param {WordArray|string} message The message to hash. 38448 * @param {WordArray|string} key The secret key. 38449 * 38450 * @return {WordArray} The HMAC. 38451 * 38452 * @static 38453 * 38454 * @example 38455 * 38456 * var hmac = CryptoJS.HmacSHA256(message, key); 38457 */ 38458 C.HmacSHA256 = Hasher._createHmacHelper(SHA256); 38459 })(Math); 38460 return CryptoJS.SHA256; 38461 }); 38462})); 38463//#endregion 38464//#region node_modules/crypto-js/hmac.js 38465var require_hmac = /* @__PURE__ */ __commonJSMin(((exports, module) => { 38466 (function(root, factory) { 38467 if (typeof exports === "object") module.exports = exports = factory(require_core()); 38468 else if (typeof define === "function" && define.amd) define(["./core"], factory); 38469 else factory(root.CryptoJS); 38470 })(exports, function(CryptoJS) { 38471 (function() { 38472 var C = CryptoJS; 38473 var Base = C.lib.Base; 38474 var Utf8 = C.enc.Utf8; 38475 var C_algo = C.algo; 38476 C_algo.HMAC = Base.extend({ 38477 /** 38478 * Initializes a newly created HMAC. 38479 * 38480 * @param {Hasher} hasher The hash algorithm to use. 38481 * @param {WordArray|string} key The secret key. 38482 * 38483 * @example 38484 * 38485 * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); 38486 */ 38487 init: function(hasher, key) { 38488 hasher = this._hasher = new hasher.init(); 38489 if (typeof key == "string") key = Utf8.parse(key); 38490 var hasherBlockSize = hasher.blockSize; 38491 var hasherBlockSizeBytes = hasherBlockSize * 4; 38492 if (key.sigBytes > hasherBlockSizeBytes) key = hasher.finalize(key); 38493 key.clamp(); 38494 var oKey = this._oKey = key.clone(); 38495 var iKey = this._iKey = key.clone(); 38496 var oKeyWords = oKey.words; 38497 var iKeyWords = iKey.words; 38498 for (var i = 0; i < hasherBlockSize; i++) { 38499 oKeyWords[i] ^= 1549556828; 38500 iKeyWords[i] ^= 909522486; 38501 } 38502 oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; 38503 this.reset(); 38504 }, 38505 /** 38506 * Resets this HMAC to its initial state. 38507 * 38508 * @example 38509 * 38510 * hmacHasher.reset(); 38511 */ 38512 reset: function() { 38513 var hasher = this._hasher; 38514 hasher.reset(); 38515 hasher.update(this._iKey); 38516 }, 38517 /** 38518 * Updates this HMAC with a message. 38519 * 38520 * @param {WordArray|string} messageUpdate The message to append. 38521 * 38522 * @return {HMAC} This HMAC instance. 38523 * 38524 * @example 38525 * 38526 * hmacHasher.update('message'); 38527 * hmacHasher.update(wordArray); 38528 */ 38529 update: function(messageUpdate) { 38530 this._hasher.update(messageUpdate); 38531 return this; 38532 }, 38533 /** 38534 * Finalizes the HMAC computation. 38535 * Note that the finalize operation is effectively a destructive, read-once operation. 38536 * 38537 * @param {WordArray|string} messageUpdate (Optional) A final message update. 38538 * 38539 * @return {WordArray} The HMAC. 38540 * 38541 * @example 38542 * 38543 * var hmac = hmacHasher.finalize(); 38544 * var hmac = hmacHasher.finalize('message'); 38545 * var hmac = hmacHasher.finalize(wordArray); 38546 */ 38547 finalize: function(messageUpdate) { 38548 var hasher = this._hasher; 38549 var innerHash = hasher.finalize(messageUpdate); 38550 hasher.reset(); 38551 return hasher.finalize(this._oKey.clone().concat(innerHash)); 38552 } 38553 }); 38554 })(); 38555 }); 38556})); 38557//#endregion 38558//#region node_modules/crypto-js/hmac-sha256.js 38559var require_hmac_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 38560 (function(root, factory, undef) { 38561 if (typeof exports === "object") module.exports = exports = factory(require_core(), require_sha256(), require_hmac()); 38562 else if (typeof define === "function" && define.amd) define([ 38563 "./core", 38564 "./sha256", 38565 "./hmac" 38566 ], factory); 38567 else factory(root.CryptoJS); 38568 })(exports, function(CryptoJS) { 38569 return CryptoJS.HmacSHA256; 38570 }); 38571})); 38572//#endregion 38573//#region node_modules/amazon-cognito-identity-js/es/utils/cryptoSecureRandomInt.js 38574function cryptoSecureRandomInt() { 38575 if (crypto$1) { 38576 if (typeof crypto$1.getRandomValues === "function") try { 38577 return crypto$1.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0]; 38578 } catch (err) {} 38579 if (typeof crypto$1.randomBytes === "function") try { 38580 return crypto$1.randomBytes(4).readInt32LE(); 38581 } catch (err) {} 38582 } 38583 throw new Error("Native crypto module could not be used to get secure random number."); 38584} 38585var crypto$1; 38586var init_cryptoSecureRandomInt = __esmMin((() => { 38587 if (typeof window !== "undefined" && window.crypto) crypto$1 = window.crypto; 38588 if (!crypto$1 && typeof window !== "undefined" && window.msCrypto) crypto$1 = window.msCrypto; 38589 if (!crypto$1 && typeof globalThis !== "undefined" && globalThis.crypto) crypto$1 = globalThis.crypto; 38590 if (!crypto$1 && typeof __require === "function") try { 38591 crypto$1 = require_crypto_browserify(); 38592 } catch (err) {} 38593})); 38594//#endregion 38595//#region node_modules/amazon-cognito-identity-js/es/utils/WordArray.js 38596/** 38597* Hex encoding strategy. 38598* Converts a word array to a hex string. 38599* @param {WordArray} wordArray The word array.
38600* @return {string} The hex string. 38601* @static 38602*/ 38603function hexStringify(wordArray) { 38604 var words = wordArray.words; 38605 var sigBytes = wordArray.sigBytes; 38606 var hexChars = []; 38607 for (var i = 0; i < sigBytes; i++) { 38608 var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; 38609 hexChars.push((bite >>> 4).toString(16)); 38610 hexChars.push((bite & 15).toString(16)); 38611 } 38612 return hexChars.join(""); 38613} 38614var WordArray; 38615var init_WordArray = __esmMin((() => { 38616 init_cryptoSecureRandomInt(); 38617 WordArray = /*#__PURE__*/ function() { 38618 function WordArray(words, sigBytes) { 38619 words = this.words = words || []; 38620 if (sigBytes != void 0) this.sigBytes = sigBytes; 38621 else this.sigBytes = words.length * 4; 38622 } 38623 var _proto = WordArray.prototype; 38624 _proto.random = function random(nBytes) { 38625 var words = []; 38626 for (var i = 0; i < nBytes; i += 4) words.push(cryptoSecureRandomInt()); 38627 return new WordArray(words, nBytes); 38628 }; 38629 _proto.toString = function toString() { 38630 return hexStringify(this); 38631 }; 38632 return WordArray; 38633 }(); 38634})); 38635//#endregion 38636//#region node_modules/amazon-cognito-identity-js/es/BigInteger.js 38637function BigInteger(a, b) { 38638 if (a != null) this.fromString(a, b); 38639} 38640function nbi() { 38641 return new BigInteger(null); 38642} 38643function am1(i, x, w, j, c, n) { 38644 while (--n >= 0) { 38645 var v = x * this[i++] + w[j] + c; 38646 c = Math.floor(v / 67108864); 38647 w[j++] = v & 67108863; 38648 } 38649 return c; 38650} 38651function am2(i, x, w, j, c, n) { 38652 var xl = x & 32767, xh = x >> 15; 38653 while (--n >= 0) { 38654 var l = this[i] & 32767;
vendor: 14,638 bytes, lines 38655-39245
38655 var h = this[i++] >> 15; 38656 var m = xh * l + h * xl; 38657 l = xl * l + ((m & 32767) << 15) + w[j] + (c & 1073741823); 38658 c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30); 38659 w[j++] = l & 1073741823; 38660 } 38661 return c; 38662} 38663function am3(i, x, w, j, c, n) { 38664 var xl = x & 16383, xh = x >> 14; 38665 while (--n >= 0) { 38666 var l = this[i] & 16383; 38667 var h = this[i++] >> 14; 38668 var m = xh * l + h * xl; 38669 l = xl * l + ((m & 16383) << 14) + w[j] + c; 38670 c = (l >> 28) + (m >> 14) + xh * h; 38671 w[j++] = l & 268435455; 38672 } 38673 return c; 38674} 38675function int2char(n) { 38676 return BI_RM.charAt(n); 38677} 38678function intAt(s, i) { 38679 var c = BI_RC[s.charCodeAt(i)]; 38680 return c == null ? -1 : c; 38681} 38682function bnpCopyTo(r) { 38683 for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]; 38684 r.t = this.t; 38685 r.s = this.s; 38686} 38687function bnpFromInt(x) { 38688 this.t = 1; 38689 this.s = x < 0 ? -1 : 0; 38690 if (x > 0) this[0] = x; 38691 else if (x < -1) this[0] = x + this.DV; 38692 else this.t = 0; 38693} 38694function nbv(i) { 38695 var r = nbi(); 38696 r.fromInt(i); 38697 return r; 38698} 38699function bnpFromString(s, b) { 38700 var k; 38701 if (b == 16) k = 4; 38702 else if (b == 8) k = 3; 38703 else if (b == 2) k = 1; 38704 else if (b == 32) k = 5; 38705 else if (b == 4) k = 2; 38706 else throw new Error("Only radix 2, 4, 8, 16, 32 are supported"); 38707 this.t = 0; 38708 this.s = 0; 38709 var i = s.length, mi = false, sh = 0; 38710 while (--i >= 0) { 38711 var x = intAt(s, i); 38712 if (x < 0) { 38713 if (s.charAt(i) == "-") mi = true; 38714 continue; 38715 } 38716 mi = false; 38717 if (sh == 0) this[this.t++] = x; 38718 else if (sh + k > this.DB) { 38719 this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh; 38720 this[this.t++] = x >> this.DB - sh; 38721 } else this[this.t - 1] |= x << sh; 38722 sh += k; 38723 if (sh >= this.DB) sh -= this.DB; 38724 } 38725 this.clamp(); 38726 if (mi) BigInteger.ZERO.subTo(this, this); 38727} 38728function bnpClamp() { 38729 var c = this.s & this.DM; 38730 while (this.t > 0 && this[this.t - 1] == c) --this.t; 38731} 38732function bnToString(b) { 38733 if (this.s < 0) return "-" + this.negate().toString(b); 38734 var k; 38735 if (b == 16) k = 4; 38736 else if (b == 8) k = 3; 38737 else if (b == 2) k = 1; 38738 else if (b == 32) k = 5; 38739 else if (b == 4) k = 2; 38740 else throw new Error("Only radix 2, 4, 8, 16, 32 are supported"); 38741 var km = (1 << k) - 1, d, m = false, r = "", i = this.t; 38742 var p = this.DB - i * this.DB % k; 38743 if (i-- > 0) { 38744 if (p < this.DB && (d = this[i] >> p) > 0) { 38745 m = true; 38746 r = int2char(d); 38747 } 38748 while (i >= 0) { 38749 if (p < k) { 38750 d = (this[i] & (1 << p) - 1) << k - p; 38751 d |= this[--i] >> (p += this.DB - k); 38752 } else { 38753 d = this[i] >> (p -= k) & km; 38754 if (p <= 0) { 38755 p += this.DB; 38756 --i; 38757 } 38758 } 38759 if (d > 0) m = true; 38760 if (m) r += int2char(d); 38761 } 38762 } 38763 return m ? r : "0"; 38764} 38765function bnNegate() { 38766 var r = nbi(); 38767 BigInteger.ZERO.subTo(this, r); 38768 return r; 38769} 38770function bnAbs() { 38771 return this.s < 0 ? this.negate() : this; 38772} 38773function bnCompareTo(a) { 38774 var r = this.s - a.s; 38775 if (r != 0) return r; 38776 var i = this.t; 38777 r = i - a.t; 38778 if (r != 0) return this.s < 0 ? -r : r; 38779 while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r; 38780 return 0; 38781} 38782function nbits(x) { 38783 var r = 1, t; 38784 if ((t = x >>> 16) != 0) { 38785 x = t; 38786 r += 16; 38787 } 38788 if ((t = x >> 8) != 0) { 38789 x = t; 38790 r += 8; 38791 } 38792 if ((t = x >> 4) != 0) { 38793 x = t; 38794 r += 4; 38795 } 38796 if ((t = x >> 2) != 0) { 38797 x = t; 38798 r += 2; 38799 } 38800 if ((t = x >> 1) != 0) { 38801 x = t; 38802 r += 1; 38803 } 38804 return r; 38805} 38806function bnBitLength() { 38807 if (this.t <= 0) return 0; 38808 return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM); 38809} 38810function bnpDLShiftTo(n, r) { 38811 var i; 38812 for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]; 38813 for (i = n - 1; i >= 0; --i) r[i] = 0; 38814 r.t = this.t + n; 38815 r.s = this.s; 38816} 38817function bnpDRShiftTo(n, r) { 38818 for (var i = n; i < this.t; ++i) r[i - n] = this[i]; 38819 r.t = Math.max(this.t - n, 0); 38820 r.s = this.s; 38821} 38822function bnpLShiftTo(n, r) { 38823 var bs = n % this.DB; 38824 var cbs = this.DB - bs; 38825 var bm = (1 << cbs) - 1; 38826 var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i; 38827 for (i = this.t - 1; i >= 0; --i) { 38828 r[i + ds + 1] = this[i] >> cbs | c; 38829 c = (this[i] & bm) << bs; 38830 } 38831 for (i = ds - 1; i >= 0; --i) r[i] = 0; 38832 r[ds] = c; 38833 r.t = this.t + ds + 1; 38834 r.s = this.s; 38835 r.clamp(); 38836} 38837function bnpRShiftTo(n, r) { 38838 r.s = this.s; 38839 var ds = Math.floor(n / this.DB); 38840 if (ds >= this.t) { 38841 r.t = 0; 38842 return; 38843 } 38844 var bs = n % this.DB; 38845 var cbs = this.DB - bs; 38846 var bm = (1 << bs) - 1; 38847 r[0] = this[ds] >> bs; 38848 for (var i = ds + 1; i < this.t; ++i) { 38849 r[i - ds - 1] |= (this[i] & bm) << cbs; 38850 r[i - ds] = this[i] >> bs; 38851 } 38852 if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs; 38853 r.t = this.t - ds; 38854 r.clamp(); 38855} 38856function bnpSubTo(a, r) { 38857 var i = 0, c = 0, m = Math.min(a.t, this.t); 38858 while (i < m) { 38859 c += this[i] - a[i]; 38860 r[i++] = c & this.DM; 38861 c >>= this.DB; 38862 } 38863 if (a.t < this.t) { 38864 c -= a.s; 38865 while (i < this.t) { 38866 c += this[i]; 38867 r[i++] = c & this.DM; 38868 c >>= this.DB; 38869 } 38870 c += this.s; 38871 } else { 38872 c += this.s; 38873 while (i < a.t) { 38874 c -= a[i]; 38875 r[i++] = c & this.DM; 38876 c >>= this.DB; 38877 } 38878 c -= a.s; 38879 } 38880 r.s = c < 0 ? -1 : 0; 38881 if (c < -1) r[i++] = this.DV + c; 38882 else if (c > 0) r[i++] = c; 38883 r.t = i; 38884 r.clamp(); 38885} 38886function bnpMultiplyTo(a, r) { 38887 var x = this.abs(), y = a.abs(); 38888 var i = x.t; 38889 r.t = i + y.t; 38890 while (--i >= 0) r[i] = 0; 38891 for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); 38892 r.s = 0; 38893 r.clamp(); 38894 if (this.s != a.s) BigInteger.ZERO.subTo(r, r); 38895} 38896function bnpSquareTo(r) { 38897 var x = this.abs(); 38898 var i = r.t = 2 * x.t; 38899 while (--i >= 0) r[i] = 0; 38900 for (i = 0; i < x.t - 1; ++i) { 38901 var c = x.am(i, x[i], r, 2 * i, 0, 1); 38902 if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) { 38903 r[i + x.t] -= x.DV; 38904 r[i + x.t + 1] = 1; 38905 } 38906 } 38907 if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1); 38908 r.s = 0; 38909 r.clamp(); 38910} 38911function bnpDivRemTo(m, q, r) { 38912 var pm = m.abs(); 38913 if (pm.t <= 0) return; 38914 var pt = this.abs(); 38915 if (pt.t < pm.t) { 38916 if (q != null) q.fromInt(0); 38917 if (r != null) this.copyTo(r); 38918 return; 38919 } 38920 if (r == null) r = nbi(); 38921 var y = nbi(), ts = this.s, ms = m.s; 38922 var nsh = this.DB - nbits(pm[pm.t - 1]); 38923 if (nsh > 0) { 38924 pm.lShiftTo(nsh, y); 38925 pt.lShiftTo(nsh, r); 38926 } else { 38927 pm.copyTo(y); 38928 pt.copyTo(r); 38929 } 38930 var ys = y.t; 38931 var y0 = y[ys - 1]; 38932 if (y0 == 0) return; 38933 var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0); 38934 var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2; 38935 var i = r.t, j = i - ys, t = q == null ? nbi() : q; 38936 y.dlShiftTo(j, t); 38937 if (r.compareTo(t) >= 0) { 38938 r[r.t++] = 1; 38939 r.subTo(t, r); 38940 } 38941 BigInteger.ONE.dlShiftTo(ys, t); 38942 t.subTo(y, y); 38943 while (y.t < ys) y[y.t++] = 0; 38944 while (--j >= 0) { 38945 var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); 38946 if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { 38947 y.dlShiftTo(j, t); 38948 r.subTo(t, r); 38949 while (r[i] < --qd) r.subTo(t, r); 38950 } 38951 } 38952 if (q != null) { 38953 r.drShiftTo(ys, q); 38954 if (ts != ms) BigInteger.ZERO.subTo(q, q); 38955 } 38956 r.t = ys; 38957 r.clamp(); 38958 if (nsh > 0) r.rShiftTo(nsh, r); 38959 if (ts < 0) BigInteger.ZERO.subTo(r, r); 38960} 38961function bnMod(a) { 38962 var r = nbi(); 38963 this.abs().divRemTo(a, null, r); 38964 if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); 38965 return r; 38966} 38967function bnpInvDigit() { 38968 if (this.t < 1) return 0; 38969 var x = this[0]; 38970 if ((x & 1) == 0) return 0; 38971 var y = x & 3; 38972 y = y * (2 - (x & 15) * y) & 15; 38973 y = y * (2 - (x & 255) * y) & 255; 38974 y = y * (2 - ((x & 65535) * y & 65535)) & 65535; 38975 y = y * (2 - x * y % this.DV) % this.DV; 38976 return y > 0 ? this.DV - y : -y; 38977} 38978function bnEquals(a) { 38979 return this.compareTo(a) == 0; 38980} 38981function bnpAddTo(a, r) { 38982 var i = 0, c = 0, m = Math.min(a.t, this.t); 38983 while (i < m) { 38984 c += this[i] + a[i]; 38985 r[i++] = c & this.DM; 38986 c >>= this.DB; 38987 } 38988 if (a.t < this.t) { 38989 c += a.s; 38990 while (i < this.t) { 38991 c += this[i]; 38992 r[i++] = c & this.DM; 38993 c >>= this.DB; 38994 } 38995 c += this.s; 38996 } else { 38997 c += this.s; 38998 while (i < a.t) { 38999 c += a[i]; 39000 r[i++] = c & this.DM; 39001 c >>= this.DB; 39002 } 39003 c += a.s; 39004 } 39005 r.s = c < 0 ? -1 : 0; 39006 if (c > 0) r[i++] = c; 39007 else if (c < -1) r[i++] = this.DV + c; 39008 r.t = i; 39009 r.clamp(); 39010} 39011function bnAdd(a) { 39012 var r = nbi(); 39013 this.addTo(a, r); 39014 return r; 39015} 39016function bnSubtract(a) { 39017 var r = nbi(); 39018 this.subTo(a, r); 39019 return r; 39020} 39021function bnMultiply(a) { 39022 var r = nbi(); 39023 this.multiplyTo(a, r); 39024 return r; 39025} 39026function bnDivide(a) { 39027 var r = nbi(); 39028 this.divRemTo(a, r, null); 39029 return r; 39030} 39031function Montgomery(m) { 39032 this.m = m; 39033 this.mp = m.invDigit(); 39034 this.mpl = this.mp & 32767; 39035 this.mph = this.mp >> 15; 39036 this.um = (1 << m.DB - 15) - 1; 39037 this.mt2 = 2 * m.t; 39038} 39039function montConvert(x) { 39040 var r = nbi(); 39041 x.abs().dlShiftTo(this.m.t, r); 39042 r.divRemTo(this.m, null, r); 39043 if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r); 39044 return r; 39045} 39046function montRevert(x) { 39047 var r = nbi(); 39048 x.copyTo(r); 39049 this.reduce(r); 39050 return r; 39051} 39052function montReduce(x) { 39053 while (x.t <= this.mt2) x[x.t++] = 0; 39054 for (var i = 0; i < this.m.t; ++i) { 39055 var j = x[i] & 32767; 39056 var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; 39057 j = i + this.m.t; 39058 x[j] += this.m.am(0, u0, x, i, 0, this.m.t); 39059 while (x[j] >= x.DV) { 39060 x[j] -= x.DV; 39061 x[++j]++; 39062 } 39063 } 39064 x.clamp(); 39065 x.drShiftTo(this.m.t, x); 39066 if (x.compareTo(this.m) >= 0) x.subTo(this.m, x); 39067} 39068function montSqrTo(x, r) { 39069 x.squareTo(r); 39070 this.reduce(r); 39071} 39072function montMulTo(x, y, r) { 39073 x.multiplyTo(y, r); 39074 this.reduce(r); 39075} 39076function bnModPow(e, m, callback) { 39077 var i = e.bitLength(), k, r = nbv(1), z = new Montgomery(m); 39078 if (i <= 0) return r; 39079 else if (i < 18) k = 1; 39080 else if (i < 48) k = 3; 39081 else if (i < 144) k = 4; 39082 else if (i < 768) k = 5; 39083 else k = 6; 39084 var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1; 39085 g[1] = z.convert(this); 39086 if (k > 1) { 39087 var g2 = nbi(); 39088 z.sqrTo(g[1], g2); 39089 while (n <= km) { 39090 g[n] = nbi(); 39091 z.mulTo(g2, g[n - 2], g[n]); 39092 n += 2; 39093 } 39094 } 39095 var j = e.t - 1, w, is1 = true, r2 = nbi(), t; 39096 i = nbits(e[j]) - 1; 39097 while (j >= 0) { 39098 if (i >= k1) w = e[j] >> i - k1 & km; 39099 else { 39100 w = (e[j] & (1 << i + 1) - 1) << k1 - i; 39101 if (j > 0) w |= e[j - 1] >> this.DB + i - k1; 39102 } 39103 n = k; 39104 while ((w & 1) == 0) { 39105 w >>= 1; 39106 --n; 39107 } 39108 if ((i -= n) < 0) { 39109 i += this.DB; 39110 --j; 39111 } 39112 if (is1) { 39113 g[w].copyTo(r); 39114 is1 = false; 39115 } else { 39116 while (n > 1) { 39117 z.sqrTo(r, r2); 39118 z.sqrTo(r2, r); 39119 n -= 2; 39120 } 39121 if (n > 0) z.sqrTo(r, r2); 39122 else { 39123 t = r; 39124 r = r2; 39125 r2 = t; 39126 } 39127 z.mulTo(r2, g[w], r); 39128 } 39129 while (j >= 0 && (e[j] & 1 << i) == 0) { 39130 z.sqrTo(r, r2); 39131 t = r; 39132 r = r2; 39133 r2 = t; 39134 if (--i < 0) { 39135 i = this.DB - 1; 39136 --j; 39137 } 39138 } 39139 } 39140 var result = z.revert(r); 39141 callback(null, result); 39142 return result; 39143} 39144var BigInteger_default, dbits, j_lm, inBrowser, BI_FP, BI_RM, BI_RC, rr, vv; 39145var init_BigInteger = __esmMin((() => { 39146 BigInteger_default = BigInteger; 39147 j_lm = true; 39148 inBrowser = typeof navigator !== "undefined"; 39149 if (inBrowser && j_lm && navigator.appName == "Microsoft Internet Explorer") { 39150 BigInteger.prototype.am = am2; 39151 dbits = 30; 39152 } else if (inBrowser && j_lm && navigator.appName != "Netscape") { 39153 BigInteger.prototype.am = am1; 39154 dbits = 26; 39155 } else { 39156 BigInteger.prototype.am = am3; 39157 dbits = 28; 39158 } 39159 BigInteger.prototype.DB = dbits; 39160 BigInteger.prototype.DM = (1 << dbits) - 1; 39161 BigInteger.prototype.DV = 1 << dbits; 39162 BI_FP = 52; 39163 BigInteger.prototype.FV = Math.pow(2, BI_FP); 39164 BigInteger.prototype.F1 = BI_FP - dbits; 39165 BigInteger.prototype.F2 = 2 * dbits - BI_FP; 39166 BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; 39167 BI_RC = new Array(); 39168 rr = "0".charCodeAt(0); 39169 for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; 39170 rr = "a".charCodeAt(0); 39171 for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; 39172 rr = "A".charCodeAt(0); 39173 for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; 39174 Montgomery.prototype.convert = montConvert; 39175 Montgomery.prototype.revert = montRevert; 39176 Montgomery.prototype.reduce = montReduce; 39177 Montgomery.prototype.mulTo = montMulTo; 39178 Montgomery.prototype.sqrTo = montSqrTo; 39179 BigInteger.prototype.copyTo = bnpCopyTo; 39180 BigInteger.prototype.fromInt = bnpFromInt; 39181 BigInteger.prototype.fromString = bnpFromString; 39182 BigInteger.prototype.clamp = bnpClamp; 39183 BigInteger.prototype.dlShiftTo = bnpDLShiftTo; 39184 BigInteger.prototype.drShiftTo = bnpDRShiftTo; 39185 BigInteger.prototype.lShiftTo = bnpLShiftTo; 39186 BigInteger.prototype.rShiftTo = bnpRShiftTo; 39187 BigInteger.prototype.subTo = bnpSubTo; 39188 BigInteger.prototype.multiplyTo = bnpMultiplyTo; 39189 BigInteger.prototype.squareTo = bnpSquareTo; 39190 BigInteger.prototype.divRemTo = bnpDivRemTo; 39191 BigInteger.prototype.invDigit = bnpInvDigit; 39192 BigInteger.prototype.addTo = bnpAddTo; 39193 BigInteger.prototype.toString = bnToString; 39194 BigInteger.prototype.negate = bnNegate; 39195 BigInteger.prototype.abs = bnAbs; 39196 BigInteger.prototype.compareTo = bnCompareTo; 39197 BigInteger.prototype.bitLength = bnBitLength; 39198 BigInteger.prototype.mod = bnMod; 39199 BigInteger.prototype.equals = bnEquals; 39200 BigInteger.prototype.add = bnAdd; 39201 BigInteger.prototype.subtract = bnSubtract; 39202 BigInteger.prototype.multiply = bnMultiply; 39203 BigInteger.prototype.divide = bnDivide; 39204 BigInteger.prototype.modPow = bnModPow; 39205 BigInteger.ZERO = nbv(0); 39206 BigInteger.ONE = nbv(1); 39207})); 39208//#endregion 39209//#region node_modules/amazon-cognito-identity-js/es/AuthenticationHelper.js 39210/*! 39211* Copyright 2016 Amazon.com, 39212* Inc. or its affiliates. All Rights Reserved. 39213* 39214* Licensed under the Amazon Software License (the "License"). 39215* You may not use this file except in compliance with the 39216* License. A copy of the License is located at 39217* 39218* http://aws.amazon.com/asl/ 39219* 39220* or in the "license" file accompanying this file. This file is 39221* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39222* CONDITIONS OF ANY KIND, express or implied. See the License 39223* for the specific language governing permissions and 39224* limitations under the License. 39225*/ 39226/** 39227* Returns a Buffer with a sequence of random nBytes 39228* 39229* @param {number} nBytes 39230* @returns {Buffer} fixed-length sequence of random bytes 39231*/ 39232function randomBytes(nBytes) { 39233 return import_buffer$2.Buffer.from(new WordArray().random(nBytes).toString(), "hex"); 39234} 39235var import_buffer$2, import_core$1, import_sha256, import_hmac_sha256$1, HEX_MSB_REGEX, initN, newPasswordRequiredChallengeUserAttributePrefix, AuthenticationHelper; 39236var init_AuthenticationHelper = __esmMin((() => { 39237 import_buffer$2 = require_buffer$1(); 39238 import_core$1 = /* @__PURE__ */ __toESM(require_core()); 39239 require_lib_typedarrays(); 39240 import_sha256 = /* @__PURE__ */ __toESM(require_sha256()); 39241 import_hmac_sha256$1 = /* @__PURE__ */ __toESM(require_hmac_sha256()); 39242 init_WordArray(); 39243 init_BigInteger(); 39244 HEX_MSB_REGEX = /^[89a-f]/i; 39245 initN = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E
392457EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF"; 39246 newPasswordRequiredChallengeUserAttributePrefix = "userAttributes."; 39247 AuthenticationHelper = /*#__PURE__*/ function() { 39248 /** 39249 * Constructs a new AuthenticationHelper object 39250 * @param {string} PoolName Cognito user pool name. 39251 */ 39252 function AuthenticationHelper(PoolName) { 39253 this.N = new BigInteger_default(initN, 16); 39254 this.g = new BigInteger_default("2", 16); 39255 this.k = new BigInteger_default(this.hexHash("" + this.padHex(this.N) + this.padHex(this.g)), 16); 39256 this.smallAValue = this.generateRandomSmallA(); 39257 this.getLargeAValue(function() {}); 39258 this.infoBits = import_buffer$2.Buffer.from("Caldera Derived Key", "utf8"); 39259 this.poolName = PoolName; 39260 } 39261 /** 39262 * @returns {BigInteger} small A, a random number 39263 */ 39264 var _proto = AuthenticationHelper.prototype; 39265 _proto.getSmallAValue = function getSmallAValue() { 39266 return this.smallAValue; 39267 }; 39268 _proto.getLargeAValue = function getLargeAValue(callback) { 39269 var _this = this; 39270 if (this.largeAValue) callback(null, this.largeAValue); 39271 else this.calculateA(this.smallAValue, function(err, largeAValue) { 39272 if (err) callback(err, null); 39273 _this.largeAValue = largeAValue; 39274 callback(null, _this.largeAValue); 39275 }); 39276 }; 39277 _proto.generateRandomSmallA = function generateRandomSmallA() { 39278 return new BigInteger_default(randomBytes(128).toString("hex"), 16); 39279 }; 39280 _proto.generateRandomString = function generateRandomString() { 39281 return randomBytes(40).toString("base64"); 39282 }; 39283 _proto.getRandomPassword = function getRandomPassword() { 39284 return this.randomPassword; 39285 }; 39286 _proto.getSaltDevices = function getSaltDevices() { 39287 return this.SaltToHashDevices; 39288 }; 39289 _proto.getVerifierDevices = function getVerifierDevices() { 39290 return this.verifierDevices; 39291 }; 39292 _proto.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) { 39293 var _this2 = this; 39294 this.randomPassword = this.generateRandomString(); 39295 var combinedString = "" + deviceGroupKey + username + ":" + this.randomPassword; 39296 var hashedString = this.hash(combinedString); 39297 var hexRandom = randomBytes(16).toString("hex"); 39298 this.SaltToHashDevices = this.padHex(new BigInteger_default(hexRandom, 16)); 39299 this.g.modPow(new BigInteger_default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function(err, verifierDevicesNotPadded) { 39300 if (err) callback(err, null); 39301 _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded); 39302 callback(null, null); 39303 }); 39304 }; 39305 _proto.calculateA = function calculateA(a, callback) { 39306 var _this3 = this; 39307 this.g.modPow(a, this.N, function(err, A) { 39308 if (err) callback(err, null); 39309 if (A.mod(_this3.N).equals(BigInteger_default.ZERO)) callback(/* @__PURE__ */ new Error("Illegal paramater. A mod N cannot be 0."), null); 39310 callback(null, A); 39311 }); 39312 }; 39313 _proto.calculateU = function calculateU(A, B) { 39314 this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B)); 39315 return new BigInteger_default(this.UHexHash, 16); 39316 }; 39317 _proto.hash = function hash(buf) { 39318 var hashHex = (0, import_sha256.default)(buf instanceof import_buffer$2.Buffer ? import_core$1.default.lib.WordArray.create(buf) : buf).toString(); 39319 return new Array(64 - hashHex.length).join("0") + hashHex; 39320 }; 39321 _proto.hexHash = function hexHash(hexStr) { 39322 return this.hash(import_buffer$2.Buffer.from(hexStr, "hex")); 39323 }; 39324 _proto.computehkdf = function computehkdf(ikm, salt) { 39325 var hmac = (0, import_hmac_sha256$1.default)(import_core$1.default.lib.WordArray.create(import_buffer$2.Buffer.concat([this.infoBits, import_buffer$2.Buffer.from(String.fromCharCode(1), "utf8")])), (0, import_hmac_sha256$1.default)(ikm instanceof import_buffer$2.Buffer ? import_core$1.default.lib.WordArray.create(ikm) : ikm, salt instanceof import_buffer$2.Buffer ? import_core$1.default.lib.WordArray.create(salt) : salt)); 39326 return import_buffer$2.Buffer.from(hmac.toString(), "hex").slice(0, 16); 39327 }; 39328 _proto.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) { 39329 var _this4 = this; 39330 if (serverBValue.mod(this.N).equals(BigInteger_default.ZERO)) throw new Error("B cannot be zero."); 39331 this.UValue = this.calculateU(this.largeAValue, serverBValue); 39332 if (this.UValue.equals(BigInteger_default.ZERO)) throw new Error("U cannot be zero."); 39333 var usernamePassword = "" + this.poolName + username + ":" + password;
39334 var usernamePasswordHash = this.hash(usernamePassword); 39335 var xValue = new BigInteger_default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16); 39336 this.calculateS(xValue, serverBValue, function(err, sValue) { 39337 if (err) callback(err, null); 39338 callback(null, _this4.computehkdf(import_buffer$2.Buffer.from(_this4.padHex(sValue), "hex"), import_buffer$2.Buffer.from(_this4.padHex(_this4.UValue), "hex"))); 39339 }); 39340 }; 39341 _proto.calculateS = function calculateS(xValue, serverBValue, callback) { 39342 var _this5 = this; 39343 this.g.modPow(xValue, this.N, function(err, gModPowXN) { 39344 if (err) callback(err, null); 39345 serverBValue.subtract(_this5.k.multiply(gModPowXN)).modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function(err2, result) { 39346 if (err2) callback(err2, null); 39347 callback(null, result.mod(_this5.N)); 39348 }); 39349 }); 39350 }; 39351 _proto.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() { 39352 return newPasswordRequiredChallengeUserAttributePrefix; 39353 }; 39354 _proto.padHex = function padHex(bigInt) { 39355 if (!(bigInt instanceof BigInteger_default)) throw new Error("Not a BigInteger"); 39356 var isNegative = bigInt.compareTo(BigInteger_default.ZERO) < 0; 39357 var hexStr = bigInt.abs().toString(16); 39358 hexStr = hexStr.length % 2 !== 0 ? "0" + hexStr : hexStr; 39359 hexStr = HEX_MSB_REGEX.test(hexStr) ? "00" + hexStr : hexStr; 39360 if (isNegative) { 39361 hexStr = new BigInteger_default(hexStr.split("").map(function(x) { 39362 var invertedNibble = ~parseInt(x, 16) & 15; 39363 return "0123456789ABCDEF".charAt(invertedNibble); 39364 }).join(""), 16).add(BigInteger_default.ONE).toString(16); 39365 if (hexStr.toUpperCase().startsWith("FF8")) hexStr = hexStr.substring(2); 39366 } 39367 return hexStr; 39368 }; 39369 return AuthenticationHelper; 39370 }(); 39371})); 39372//#endregion 39373//#region node_modules/amazon-cognito-identity-js/es/CognitoJwtToken.js 39374var import_buffer$1, CognitoJwtToken; 39375var init_CognitoJwtToken = __esmMin((() => { 39376 import_buffer$1 = require_buffer$1(); 39377 CognitoJwtToken = /*#__PURE__*/ function() { 39378 /*! 39379 * Copyright 2016 Amazon.com, 39380 * Inc. or its affiliates. All Rights Reserved. 39381 * 39382 * Licensed under the Amazon Software License (the "License"). 39383 * You may not use this file except in compliance with the 39384 * License. A copy of the License is located at 39385 * 39386 * http://aws.amazon.com/asl/ 39387 * 39388 * or in the "license" file accompanying this file. This file is 39389 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39390 * CONDITIONS OF ANY KIND, express or implied. See the License 39391 * for the specific language governing permissions and 39392 * limitations under the License. 39393 */ 39394 /** 39395 * Constructs a new CognitoJwtToken object 39396 * @param {string=} token The JWT token. 39397 */ 39398 function CognitoJwtToken(token) { 39399 this.jwtToken = token || ""; 39400 this.payload = this.decodePayload(); 39401 } 39402 /** 39403 * @returns {string} the record's token. 39404 */ 39405 var _proto = CognitoJwtToken.prototype; 39406 _proto.getJwtToken = function getJwtToken() { 39407 return this.jwtToken; 39408 }; 39409 _proto.getExpiration = function getExpiration() { 39410 return this.payload.exp; 39411 }; 39412 _proto.getIssuedAt = function getIssuedAt() { 39413 return this.payload.iat; 39414 }; 39415 _proto.decodePayload = function decodePayload() { 39416 var payload = this.jwtToken.split(".")[1]; 39417 try { 39418 return JSON.parse(import_buffer$1.Buffer.from(payload, "base64").toString("utf8")); 39419 } catch (err) { 39420 return {}; 39421 } 39422 }; 39423 return CognitoJwtToken; 39424 }(); 39425})); 39426//#endregion 39427//#region node_modules/amazon-cognito-identity-js/es/CognitoAccessToken.js 39428function _inheritsLoose$2(subClass, superClass) { 39429 subClass.prototype = Object.create(superClass.prototype); 39430 subClass.prototype.constructor = subClass; 39431 _setPrototypeOf$2(subClass, superClass); 39432} 39433function _setPrototypeOf$2(o, p) { 39434 _setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 39435 o.__proto__ = p; 39436 return o; 39437 }; 39438 return _setPrototypeOf$2(o, p); 39439} 39440var CognitoAccessToken; 39441var init_CognitoAccessToken = __esmMin((() => { 39442 init_CognitoJwtToken(); 39443 CognitoAccessToken = /*#__PURE__*/ function(_CognitoJwtToken) { 39444 _inheritsLoose$2(CognitoAccessToken, _CognitoJwtToken); 39445 /** 39446 * Constructs a new CognitoAccessToken object 39447 * @param {string=} AccessToken The JWT access token. 39448 */ 39449 function CognitoAccessToken(_temp) { 39450 var AccessToken = (_temp === void 0 ? {}
39450 : _temp).AccessToken; 39451 return _CognitoJwtToken.call(this, AccessToken || "") || this; 39452 } 39453 return CognitoAccessToken; 39454 }(CognitoJwtToken); 39455})); 39456//#endregion 39457//#region node_modules/amazon-cognito-identity-js/es/CognitoIdToken.js 39458function _inheritsLoose$1(subClass, superClass) { 39459 subClass.prototype = Object.create(superClass.prototype); 39460 subClass.prototype.constructor = subClass; 39461 _setPrototypeOf$1(subClass, superClass); 39462} 39463function _setPrototypeOf$1(o, p) { 39464 _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 39465 o.__proto__ = p; 39466 return o; 39467 }; 39468 return _setPrototypeOf$1(o, p); 39469} 39470var CognitoIdToken; 39471var init_CognitoIdToken = __esmMin((() => { 39472 init_CognitoJwtToken(); 39473 CognitoIdToken = /*#__PURE__*/ function(_CognitoJwtToken) { 39474 /*! 39475 * Copyright 2016 Amazon.com, 39476 * Inc. or its affiliates. All Rights Reserved. 39477 * 39478 * Licensed under the Amazon Software License (the "License"). 39479 * You may not use this file except in compliance with the 39480 * License. A copy of the License is located at 39481 * 39482 * http://aws.amazon.com/asl/ 39483 * 39484 * or in the "license" file accompanying this file. This file is 39485 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39486 * CONDITIONS OF ANY KIND, express or implied. See the License 39487 * for the specific language governing permissions and 39488 * limitations under the License. 39489 */ 39490 _inheritsLoose$1(CognitoIdToken, _CognitoJwtToken); 39491 /** 39492 * Constructs a new CognitoIdToken object 39493 * @param {string=} IdToken The JWT Id token 39494 */ 39495 function CognitoIdToken(_temp) { 39496 var IdToken = (_temp === void 0 ? {} : _temp).IdToken; 39497 return _CognitoJwtToken.call(this, IdToken || "") || this; 39498 } 39499 return CognitoIdToken; 39500 }(CognitoJwtToken); 39501})); 39502//#endregion 39503//#region node_modules/amazon-cognito-identity-js/es/CognitoRefreshToken.js 39504var CognitoRefreshToken; 39505var init_CognitoRefreshToken = __esmMin((() => { 39506 CognitoRefreshToken = /*#__PURE__*/ function() { 39507 /*! 39508 * Copyright 2016 Amazon.com, 39509 * Inc. or its affiliates. All Rights Reserved. 39510 * 39511 * Licensed under the Amazon Software License (the "License"). 39512 * You may not use this file except in compliance with the 39513 * License. A copy of the License is located at 39514 * 39515 * http://aws.amazon.com/asl/ 39516 * 39517 * or in the "license" file accompanying this file. This file is 39518 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39519 * CONDITIONS OF ANY KIND, express or implied. See the License 39520 * for the specific language governing permissions and 39521 * limitations under the License. 39522 */ 39523 /** 39524 * Constructs a new CognitoRefreshToken object 39525 * @param {string=} RefreshToken The JWT refresh token. 39526 */ 39527 function CognitoRefreshToken(_temp) { 39528 var RefreshToken = (_temp === void 0 ? {} : _temp).RefreshToken; 39529 this.token = RefreshToken || ""; 39530 } 39531 /** 39532 * @returns {string} the record's token. 39533 */ 39534 var _proto = CognitoRefreshToken.prototype; 39535 _proto.getToken = function getToken() { 39536 return this.token; 39537 }; 39538 return CognitoRefreshToken; 39539 }(); 39540})); 39541//#endregion 39542//#region node_modules/crypto-js/enc-base64.js 39543var require_enc_base64 = /* @__PURE__ */ __commonJSMin(((exports, module) => { 39544 (function(root, factory) { 39545 if (typeof exports === "object") module.exports = exports = factory(require_core()); 39546 else if (typeof define === "function" && define.amd) define(["./core"], factory); 39547 else factory(root.CryptoJS); 39548 })(exports, function(CryptoJS) { 39549 (function() { 39550 var C = CryptoJS; 39551 var WordArray = C.lib.WordArray; 39552 var C_enc = C.enc; 39553 C_enc.Base64 = { 39554 /** 39555 * Converts a word array to a Base64 string. 39556 * 39557 * @param {WordArray} wordArray The word array. 39558 * 39559 * @return {string} The Base64 string. 39560 * 39561 * @static 39562 * 39563 * @example 39564 * 39565 * var base64String = CryptoJS.enc.Base64.stringify(wordArray); 39566 */ 39567 stringify: function(wordArray) { 39568 var words = wordArray.words; 39569 var sigBytes = wordArray.sigBytes; 39570 var map = this._map; 39571 wordArray.clamp(); 39572 var base64Chars = []; 39573 for (var i = 0; i < sigBytes; i += 3) { 39574 var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; 39575 var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255; 39576 var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
39577 var triplet = byte1 << 16 | byte2 << 8 | byte3; 39578 for (var j = 0; j < 4 && i + j * .75 < sigBytes; j++) base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63)); 39579 } 39580 var paddingChar = map.charAt(64); 39581 if (paddingChar) while (base64Chars.length % 4) base64Chars.push(paddingChar); 39582 return base64Chars.join(""); 39583 }, 39584 /** 39585 * Converts a Base64 string to a word array. 39586 * 39587 * @param {string} base64Str The Base64 string. 39588 * 39589 * @return {WordArray} The word array. 39590 * 39591 * @static 39592 * 39593 * @example 39594 * 39595 * var wordArray = CryptoJS.enc.Base64.parse(base64String); 39596 */ 39597 parse: function(base64Str) { 39598 var base64StrLength = base64Str.length; 39599 var map = this._map; 39600 var reverseMap = this._reverseMap; 39601 if (!reverseMap) { 39602 reverseMap = this._reverseMap = []; 39603 for (var j = 0; j < map.length; j++) reverseMap[map.charCodeAt(j)] = j; 39604 } 39605 var paddingChar = map.charAt(64); 39606 if (paddingChar) { 39607 var paddingIndex = base64Str.indexOf(paddingChar); 39608 if (paddingIndex !== -1) base64StrLength = paddingIndex; 39609 } 39610 return parseLoop(base64Str, base64StrLength, reverseMap); 39611 }, 39612 _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" 39613 }; 39614 function parseLoop(base64Str, base64StrLength, reverseMap) { 39615 var words = []; 39616 var nBytes = 0; 39617 for (var i = 0; i < base64StrLength; i++) if (i % 4) { 39618 var bitsCombined = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2 | reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2; 39619 words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8; 39620 nBytes++; 39621 } 39622 return WordArray.create(words, nBytes); 39623 } 39624 })(); 39625 return CryptoJS.enc.Base64; 39626 }); 39627})); 39628//#endregion 39629//#region node_modules/amazon-cognito-identity-js/es/CognitoUserSession.js 39630var CognitoUserSession; 39631var init_CognitoUserSession = __esmMin((() => { 39632 CognitoUserSession = /*#__PURE__*/ function() { 39633 /*! 39634 * Copyright 2016 Amazon.com, 39635 * Inc. or its affiliates. All Rights Reserved. 39636 * 39637 * Licensed under the Amazon Software License (the "License"). 39638 * You may not use this file except in compliance with the 39639 * License. A copy of the License is located at 39640 * 39641 * http://aws.amazon.com/asl/ 39642 * 39643 * or in the "license" file accompanying this file. This file is 39644 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39645 * CONDITIONS OF ANY KIND, express or implied. See the License 39646 * for the specific language governing permissions and 39647 * limitations under the License. 39648 */ 39649 /** 39650 * Constructs a new CognitoUserSession object 39651 * @param {CognitoIdToken} IdToken The session's Id token. 39652 * @param {CognitoRefreshToken=} RefreshToken The session's refresh token. 39653 * @param {CognitoAccessToken} AccessToken The session's access token. 39654 * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation. 39655 */ 39656 function CognitoUserSession(_temp) { 39657 var _ref = _temp === void 0 ? {} : _temp, IdToken = _ref.IdToken, RefreshToken = _ref.RefreshToken, AccessToken = _ref.AccessToken, ClockDrift = _ref.ClockDrift; 39658 if (AccessToken == null || IdToken == null) throw new Error("Id token and Access Token must be present."); 39659 this.idToken = IdToken; 39660 this.refreshToken = RefreshToken; 39661 this.accessToken = AccessToken; 39662 this.clockDrift = ClockDrift === void 0 ? this.calculateClockDrift() : ClockDrift; 39663 } 39664 /** 39665 * @returns {CognitoIdToken} the session's Id token 39666 */ 39667 var _proto = CognitoUserSession.prototype; 39668 _proto.getIdToken = function getIdToken() { 39669 return this.idToken; 39670 }; 39671 _proto.getRefreshToken = function getRefreshToken() { 39672 return this.refreshToken; 39673 }; 39674 _proto.getAccessToken = function getAccessToken() { 39675 return this.accessToken; 39676 }; 39677 _proto.getClockDrift = function getClockDrift() { 39678 return this.clockDrift; 39679 }; 39680 _proto.calculateClockDrift = function calculateClockDrift() { 39681 return Math.floor(/* @__PURE__ */ new Date() / 1e3) - Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt()); 39682 }; 39683 _proto.isValid = function isValid() { 39684 var adjusted = Math.floor(/* @__PURE__ */ new Date() / 1e3) - this.clockDrift; 39685 return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration(); 39686 }; 39687 return CognitoUserSession; 39688 }(); 39689})); 39690//#endregion 39691//#region node_modules/amazon-cognito-identity-js/es/DateHelper.js 39692var monthNames, weekNames, DateHelper; 39693var init_DateHelper = __esmMin((() => { 39694 monthNames = [ 39695 "Jan", 39696 "Feb", 39697 "Mar", 39698 "Apr", 39699 "May", 39700 "Jun", 39701 "Jul", 39702 "Aug", 39703 "Sep", 39704 "Oct",
39705 "Nov", 39706 "Dec" 39707 ]; 39708 weekNames = [ 39709 "Sun", 39710 "Mon", 39711 "Tue", 39712 "Wed", 39713 "Thu", 39714 "Fri", 39715 "Sat" 39716 ]; 39717 DateHelper = /*#__PURE__*/ function() { 39718 /*! 39719 * Copyright 2016 Amazon.com, 39720 * Inc. or its affiliates. All Rights Reserved. 39721 * 39722 * Licensed under the Amazon Software License (the "License"). 39723 * You may not use this file except in compliance with the 39724 * License. A copy of the License is located at 39725 * 39726 * http://aws.amazon.com/asl/ 39727 * 39728 * or in the "license" file accompanying this file. This file is 39729 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39730 * CONDITIONS OF ANY KIND, express or implied. See the License 39731 * for the specific language governing permissions and 39732 * limitations under the License. 39733 */ 39734 function DateHelper() {} 39735 var _proto = DateHelper.prototype; 39736 /** 39737 * @returns {string} The current time in "ddd MMM D HH:mm:ss UTC YYYY" format. 39738 */ 39739 _proto.getNowString = function getNowString() { 39740 var now = /* @__PURE__ */ new Date(); 39741 var weekDay = weekNames[now.getUTCDay()]; 39742 var month = monthNames[now.getUTCMonth()]; 39743 var day = now.getUTCDate(); 39744 var hours = now.getUTCHours(); 39745 if (hours < 10) hours = "0" + hours; 39746 var minutes = now.getUTCMinutes(); 39747 if (minutes < 10) minutes = "0" + minutes; 39748 var seconds = now.getUTCSeconds(); 39749 if (seconds < 10) seconds = "0" + seconds; 39750 var year = now.getUTCFullYear(); 39751 return weekDay + " " + month + " " + day + " " + hours + ":" + minutes + ":" + seconds + " UTC " + year; 39752 }; 39753 return DateHelper; 39754 }(); 39755})); 39756//#endregion 39757//#region node_modules/amazon-cognito-identity-js/es/CognitoUserAttribute.js 39758var CognitoUserAttribute; 39759var init_CognitoUserAttribute = __esmMin((() => { 39760 CognitoUserAttribute = /*#__PURE__*/ function() { 39761 /*! 39762 * Copyright 2016 Amazon.com, 39763 * Inc. or its affiliates. All Rights Reserved. 39764 * 39765 * Licensed under the Amazon Software License (the "License"). 39766 * You may not use this file except in compliance with the 39767 * License. A copy of the License is located at 39768 * 39769 * http://aws.amazon.com/asl/ 39770 * 39771 * or in the "license" file accompanying this file. This file is 39772 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39773 * CONDITIONS OF ANY KIND, express or implied. See the License 39774 * for the specific language governing permissions and 39775 * limitations under the License. 39776 */ 39777 /** 39778 * Constructs a new CognitoUserAttribute object 39779 * @param {string=} Name The record's name 39780 * @param {string=} Value The record's value 39781 */ 39782 function CognitoUserAttribute(_temp) { 39783 var _ref = _temp === void 0 ? {} : _temp, Name = _ref.Name, Value = _ref.Value; 39784 this.Name = Name || ""; 39785 this.Value = Value || ""; 39786 } 39787 /** 39788 * @returns {string} the record's value. 39789 */ 39790 var _proto = CognitoUserAttribute.prototype; 39791 _proto.getValue = function getValue() { 39792 return this.Value; 39793 }; 39794 _proto.setValue = function setValue(value) { 39795 this.Value = value; 39796 return this; 39797 }; 39798 _proto.getName = function getName() { 39799 return this.Name; 39800 }; 39801 _proto.setName = function setName(name) { 39802 this.Name = name; 39803 return this; 39804 }; 39805 _proto.toString = function toString() { 39806 return JSON.stringify(this); 39807 }; 39808 _proto.toJSON = function toJSON() { 39809 return { 39810 Name: this.Name, 39811 Value: this.Value 39812 }; 39813 }; 39814 return CognitoUserAttribute; 39815 }(); 39816})); 39817//#endregion 39818//#region node_modules/amazon-cognito-identity-js/es/StorageHelper.js 39819var dataMemory, MemoryStorage, StorageHelper; 39820var init_StorageHelper = __esmMin((() => { 39821 dataMemory = {}; 39822 MemoryStorage = /*#__PURE__*/ function() { 39823 /*! 39824 * Copyright 2016 Amazon.com, 39825 * Inc. or its affiliates. All Rights Reserved. 39826 * 39827 * Licensed under the Amazon Software License (the "License"). 39828 * You may not use this file except in compliance with the 39829 * License. A copy of the License is located at 39830 * 39831 * http://aws.amazon.com/asl/ 39832 * 39833 * or in the "license" file accompanying this file. This file is 39834 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39835 * CONDITIONS OF ANY KIND, express or implied. See the License 39836 * for the specific language governing permissions and 39837 * limitations under the License. 39838 */ 39839 function MemoryStorage() {} 39840 /** 39841 * This is used to set a specific item in storage 39842 * @param {string} key - the key for the item 39843 * @param {object} value - the value 39844 * @returns {string} value that was set 39845 */ 39846 MemoryStorage.setItem = function setItem(key, value) { 39847 dataMemory[key] = value; 39848 return dataMemory[key]; 39849 }; 39850 MemoryStorage.getItem = function getItem(key) { 39851 return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : void 0; 39852 }; 39853 MemoryStorage.removeItem = function removeItem(key) { 39854 return delete dataMemory[key]; 39855 }; 39856 MemoryStorage.clear = function clear() { 39857 dataMemory = {}; 39858 return dataMemory; 39859 }; 39860 return MemoryStorage; 39861 }(); 39862 StorageHelper = /*#__PURE__*/ function() { 39863 /** 39864 * This is used to get a storage object 39865 * @returns {object} the storage 39866 */ 39867 function StorageHelper() { 39868 try { 39869 this.storageWindow = window.localStorage; 39870 this.storageWindow.setItem("aws.cognito.test-ls", 1); 39871 this.storageWindow.removeItem("aws.cognito.test-ls"); 39872 } catch (exception) { 39873 this.storageWindow = MemoryStorage; 39874 } 39875 } 39876 /** 39877 * This is used to return the storage 39878 * @returns {object} the storage 39879 */ 39880 var _proto = StorageHelper.prototype; 39881 _proto.getStorage = function getStorage() { 39882 return this.storageWindow; 39883 }; 39884 return StorageHelper; 39885 }(); 39886})), import_buffer, import_core, import_enc_base64, import_hmac_sha256, userAgent, CognitoUser; 39887var init_CognitoUser = __esmMin((() => { 39888 import_buffer = require_buffer$1(); 39889 import_core = /* @__PURE__ */ __toESM(require_core()); 39890 require_lib_typedarrays(); 39891 import_enc_base64 = /* @__PURE__ */ __toESM(require_enc_base64()); 39892 import_hmac_sha256 = /* @__PURE__ */ __toESM(require_hmac_sha256()); 39893 init_BigInteger(); 39894 init_AuthenticationHelper(); 39895 init_CognitoAccessToken(); 39896 init_CognitoIdToken(); 39897 init_CognitoRefreshToken(); 39898 init_CognitoUserSession(); 39899 init_DateHelper(); 39900 init_CognitoUserAttribute(); 39901 init_StorageHelper(); 39902 userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "nodejs"; 39903 CognitoUser = /*#__PURE__*/ function() { 39904 /*! 39905 * Copyright 2016 Amazon.com, 39906 * Inc. or its affiliates. All Rights Reserved. 39907 * 39908 * Licensed under the Amazon Software License (the "License"). 39909 * You may not use this file except in compliance with the 39910 * License. A copy of the License is located at 39911 * 39912 * http://aws.amazon.com/asl/ 39913 * 39914 * or in the "license" file accompanying this file. This file is 39915 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 39916 * CONDITIONS OF ANY KIND, express or implied. See the License 39917 * for the specific language governing permissions and 39918 * limitations under the License. 39919 */ 39920 /** 39921 * Constructs a new CognitoUser object 39922 * @param {object} data Creation options 39923 * @param {string} data.Username The user's username. 39924 * @param {CognitoUserPool} data.Pool Pool containing the user. 39925 * @param {object} data.Storage Optional storage object. 39926 */
39927 function CognitoUser(data) { 39928 if (data == null || data.Username == null || data.Pool == null) throw new Error("Username and Pool information are required."); 39929 this.username = data.Username || ""; 39930 this.pool = data.Pool; 39931 this.Session = null; 39932 this.client = data.Pool.client; 39933 this.signInUserSession = null; 39934 this.authenticationFlowType = "USER_SRP_AUTH"; 39935 this.storage = data.Storage || new StorageHelper().getStorage(); 39936 this.keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId(); 39937 this.userDataKey = this.keyPrefix + "." + this.username + ".userData"; 39938 } 39939 /** 39940 * Sets the session for this user 39941 * @param {CognitoUserSession} signInUserSession the session 39942 * @returns {void} 39943 */ 39944 var _proto = CognitoUser.prototype; 39945 _proto.setSignInUserSession = function setSignInUserSession(signInUserSession) { 39946 this.clearCachedUserData(); 39947 this.signInUserSession = signInUserSession; 39948 this.cacheTokens(); 39949 }; 39950 _proto.getSignInUserSession = function getSignInUserSession() { 39951 return this.signInUserSession; 39952 }; 39953 _proto.getUsername = function getUsername() { 39954 return this.username; 39955 }; 39956 _proto.getAuthenticationFlowType = function getAuthenticationFlowType() { 39957 return this.authenticationFlowType; 39958 }; 39959 _proto.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) { 39960 this.authenticationFlowType = authenticationFlowType; 39961 };
39962 _proto.initiateAuth = function initiateAuth(authDetails, callback) { 39963 var _this = this; 39964 var authParameters = authDetails.getAuthParameters(); 39965 authParameters.USERNAME = this.username; 39966 var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata(); 39967 var jsonReq = { 39968 AuthFlow: "CUSTOM_AUTH", 39969 ClientId: this.pool.getClientId(), 39970 AuthParameters: authParameters, 39971 ClientMetadata: clientMetaData 39972 }; 39973 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 39974 this.client.request("InitiateAuth", jsonReq, function(err, data) { 39975 if (err) return callback.onFailure(err); 39976 var challengeName = data.ChallengeName; 39977 var challengeParameters = data.ChallengeParameters; 39978 if (challengeName === "CUSTOM_CHALLENGE") { 39979 _this.Session = data.Session; 39980 return callback.customChallenge(challengeParameters); 39981 } 39982 _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult); 39983 _this.cacheTokens(); 39984 return callback.onSuccess(_this.signInUserSession); 39985 }); 39986 }; 39987 _proto.authenticateUser = function authenticateUser(authDetails, callback) { 39988 if (this.authenticationFlowType === "USER_PASSWORD_AUTH") return this.authenticateUserPlainUsernamePassword(authDetail
39988s, callback); 39989 else if (this.authenticationFlowType === "USER_SRP_AUTH" || this.authenticationFlowType === "CUSTOM_AUTH") return this.authenticateUserDefaultAuth(authDetails, callback); 39990 return callback.onFailure(/* @__PURE__ */ new Error("Authentication flow type is invalid.")); 39991 }; 39992 _proto.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) { 39993 var _this2 = this; 39994 var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split("_")[1]); 39995 var dateHelper = new DateHelper(); 39996 var serverBValue; 39997 var salt; 39998 var authParameters = {}; 39999 if (this.deviceKey != null) authParameters.DEVICE_KEY = this.deviceKey; 40000 authParameters.USERNAME = this.username; 40001 authenticationHelper.getLargeAValue(function(errOnAValue, aValue) { 40002 if (errOnAValue) callback.onFailure(errOnAValue); 40003 authParameters.SRP_A = aValue.toString(16); 40004 if (_this2.authenticationFlowType === "CUSTOM_AUTH") authParameters.CHALLENGE_NAME = "SRP_A"; 40005 var clientMetaData = Object.keys(authDetail
40005s.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata(); 40006 var jsonReq = { 40007 AuthFlow: _this2.authenticationFlowType, 40008 ClientId: _this2.pool.getClientId(), 40009 AuthParameters: authParameters, 40010 ClientMetadata: clientMetaData 40011 }; 40012 if (_this2.getUserContextData(_this2.username)) jsonReq.UserContextData = _this2.getUserContextData(_this2.username); 40013 _this2.client.request("InitiateAuth", jsonReq, function(err, data) { 40014 if (err) return callback.onFailure(err); 40015 var challengeParameters = data.ChallengeParameters; 40016 _this2.username = challengeParameters.USER_ID_FOR_SRP; 40017 _this2.userDataKey = _this2.keyPrefix + "." + _this2.username + ".userData"; 40018 serverBValue = new BigInteger_default(challengeParameters.SRP_B, 16); 40019 salt = new BigInteger_default(challengeParameters.SALT, 16); 40020 _this2.getCachedDeviceKeyAndPassword(); 40021 authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function(errOnHkdf, hkdf) { 40022 if (errOnHkdf) callback.onFailure(errOnHkdf); 40023 var dateNow = dateHelper.getNowString(); 40024 var message = import_core.default.lib.WordArray.create(import_buffer.Buffer.concat([ 40025 import_buffer.Buffer.from(_this2.pool.getUserPoolId().split("_")[1], "utf8"), 40026 import_buffer.Buffer.from(_this2.username, "utf8"), 40027 import_buffer.Buffer.from(challengeParameters.SECRET_BLOCK, "base64"), 40028 import_buffer.Buffer.from(dateNow, "utf8") 40029 ])); 40030 var key = import_core.default.lib.WordArray.create(hkdf); 40031 var signatureString = import_enc_base64.default.stringify((0, import_hmac_sha256.default)(message, key)); 40032 var challengeResponses = {}; 40033 challengeResponses.USERNAME = _this2.username; 40034 challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK; 40035 challengeResponses.TIMESTAMP = dateNow; 40036 challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString; 40037 if (_this2.deviceKey != null) challengeResponses.DEVICE_KEY = _this2.deviceKey; 40038 var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) { 40039 return _this2.client.request("RespondToAuthChallenge", challenge, function(errChallenge, dataChallenge) { 40040 if (errChallenge && errChallenge.code === "ResourceNotFoundException" && errChallenge.message.toLowerCase().indexOf("device") !== -1) { 40041 challengeResponses.DEVICE_KEY = null; 40042 _this2.deviceKey = null; 40043 _this2.randomPassword = null; 40044 _this2.deviceGroupKey = null; 40045 _this2.clearCachedDeviceKeyAndPassword(); 40046 return respondToAuthChallenge(challenge, challengeCallback); 40047 } 40048 return challengeCallback(errChallenge, dataChallenge); 40049 }); 40050 }; 40051 var jsonReqResp = { 40052 ChallengeName: "PASSWORD_VERIFIER", 40053 ClientId: _this2.pool.getClientId(), 40054 ChallengeResponses: challengeResponses, 40055 Session: data.Session, 40056 ClientMetadata: clientMetaData 40057 }; 40058 if (_this2.getUserContextData()) jsonReqResp.UserContextData = _this2.getUserContextData(); 40059 respondToAuthChallenge(jsonReqResp, function(errAuthenticate, dataAuthenticate) { 40060 if (errAuthenticate) return callback.onFailure(errAuthenticate); 40061 return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback); 40062 }); 40063 }); 40064 }); 40065 }); 40066 }; 40067 _proto.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetail
40067s, callback) { 40068 var _this3 = this; 40069 var authParameters = {}; 40070 authParameters.USERNAME = this.username; 40071 authParameters.PASSWORD = authDetails.getPassword(); 40072 if (!authParameters.PASSWORD) { 40073 callback.onFailure(/* @__PURE__ */ new Error("PASSWORD parameter is required")); 40074 return; 40075 } 40076 var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split("_")[1]); 40077 this.getCachedDeviceKeyAndPassword(); 40078 if (this.deviceKey != null) authParameters.DEVICE_KEY = this.deviceKey; 40079 var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata(); 40080 var jsonReq = { 40081 AuthFlow: "USER_PASSWORD_AUTH", 40082 ClientId: this.pool.getClientId(), 40083 AuthParameters: authParameters, 40084 ClientMetadata: clientMetaData 40085 }; 40086 if (this.getUserContextData(this.username)) jsonReq.UserContextData = this.getUserContextData(this.username); 40087 this.client.request("InitiateAuth", jsonReq, function(err, authResult) { 40088 if (err) return callback.onFailure(err); 40089 return _this3.authenticateUserInternal(authResult, authenticationHelper, callback); 40090 }); 40091 }; 40092 _proto.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) { 40093 var _this4 = this; 40094 var challengeName = dataAuthenticate.ChallengeName; 40095 var challengeParameters = dataAuthenticate.ChallengeParameters; 40096 if (challengeName === "SMS_MFA") { 40097 this.Session = dataAuthenticate.Session; 40098 return callback.mfaRequired(challengeName, challengeParameters); 40099 } 40100 if (challengeName === "SELECT_MFA_TYPE") { 40101 this.Session = dataAuthenticate.Session; 40102 return callback.selectMFAType(challengeName, challengeParameters); 40103 } 40104 if (challengeName === "MFA_SETUP") { 40105 this.Session = dataAuthenticate.Session; 40106 return callback.mfaSetup(challengeName, challengeParameters); 40107 } 40108 if (challengeName === "SOFTWARE_TOKEN_MFA") { 40109 this.Session = dataAuthenticate.Session; 40110 return callback.totpRequired(challengeName, challengeParameters); 40111 } 40112 if (challengeName === "CUSTOM_CHALLENGE") { 40113 this.Session = dataAuthenticate.Session; 40114 return callback.customChallenge(challengeParameters); 40115 } 40116 if (challengeName === "NEW_PASSWORD_REQUIRED") { 40117 this.Session = dataAuthenticate.Session; 40118 var userAttributes = null; 40119 var rawRequiredAttributes = null; 40120 var requiredAttributes = []; 40121 var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix(); 40122 if (challengeParameters) { 40123 userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes); 40124 rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes); 40125 } 40126 if (rawRequiredAttributes) for (var i = 0; i < rawRequiredAttributes.length; i++) requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length); 40127 return callback.newPasswordRequired(userAttributes, requiredAttributes); 40128 } 40129 if (challengeName === "DEVICE_SRP_AUTH") { 40130 this.getDeviceResponse(callback); 40131 return; 40132 } 40133 this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult); 40134 this.challengeName = challengeName; 40135 this.cacheTokens(); 40136 var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata; 40137 if (newDeviceMetadata == null) return callback.onSuccess(this.signInUserSession); 40138 authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function(errGenHash) { 40139 if (errGenHash) return callback.onFailure(errGenHash); 40140 var deviceSecretVerifierConfig = { 40141 Salt: import_buffer.Buffer.from(authenticationHelper.getSaltDevices(), "hex").toString("base64"), 40142 PasswordVerifier: import_buffer.Buffer.from(authenticationHelper.getVerifierDevices(), "hex").toString("base64") 40143 }; 40144 _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier; 40145 _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey; 40146 _this4.randomPassword = authenticationHelper.getRandomPassword(); 40147 _this4.client.request("ConfirmDevice", { 40148 DeviceKey: newDeviceMetadata.DeviceKey, 40149 AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(), 40150 DeviceSecretVerifierConfig: deviceSecretVerifierConfig, 40151 DeviceName: userAgent 40152 }, function(errConfirm, dataConfirm) { 40153 if (errConfirm) return callback.onFailure(errConfirm);
40154 _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey; 40155 _this4.cacheDeviceKeyAndPassword(); 40156 if (dataConfirm.UserConfirmationNecessary === true) return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary); 40157 return callback.onSuccess(_this4.signInUserSession); 40158 }); 40159 }); 40160 }; 40161 _proto.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback, clientMetadata) { 40162 var _this5 = this; 40163 if (!newPassword) return callback.onFailure(/* @__PURE__ */ new Error("New password is required.")); 40164 var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split("_")[1]); 40165 var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix(); 40166 var finalUserAttributes = {}; 40167 if (requiredAttributeData) Object.keys(requiredAttributeData).forEach(function(key) { 40168 finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key]; 40169 }); 40170 finalUserAttributes.NEW_PASSWORD = newPassword; 40171 finalUserAttributes.USERNAME = this.username; 40172 var jsonReq = { 40173 ChallengeName: "NEW_PASSWORD_REQUIRED", 40174 ClientId: this.pool.getClientId(), 40175 ChallengeResponses: finalUserAttributes, 40176 Session: this.Session, 40177 ClientMetadata: clientMetadata 40178 }; 40179 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40180 this.client.request("RespondToAuthChallenge", jsonReq, function(errAuthenticate, dataAuthenticate) { 40181 if (errAuthenticate) return callback.onFailure(errAuthenticate); 40182 return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback); 40183 }); 40184 }; 40185 _proto.getDeviceResponse = function getDeviceResponse(callback, clientMetadata) { 40186 var _this6 = this; 40187 var authenticationHelper = new AuthenticationHelper(this.deviceGroupKey); 40188 var dateHelper = new DateHelper(); 40189 var authParameters = {}; 40190 authParameters.USERNAME = this.username; 40191 authParameters.DEVICE_KEY = this.deviceKey; 40192 authenticationHelper.getLargeAValue(function(errAValue, aValue) { 40193 if (errAValue) callback.onFailure(errAValue); 40194 authParameters.SRP_A = aValue.toString(16); 40195 var jsonReq = { 40196 ChallengeName: "DEVICE_SRP_AUTH", 40197 ClientId: _this6.pool.getClientId(), 40198 ChallengeResponses: authParameters, 40199 ClientMetadata: clientMetadata 40200 }; 40201 if (_this6.getUserContextData()) jsonReq.UserContextData = _this6.getUserContextData(); 40202 _this6.client.request("RespondToAuthChallenge", jsonReq, function(err, data) { 40203 if (err) return callback.onFailure(err); 40204 var challengeParameters = data.ChallengeParameters; 40205 var serverBValue = new BigInteger_default(challengeParameters.SRP_B, 16); 40206 var salt = new BigInteger_default(challengeParameters.SALT, 16); 40207 authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function(errHkdf, hkdf) { 40208 if (errHkdf) return callback.onFailure(errHkdf); 40209 var dateNow = dateHelper.getNowString(); 40210 var message = import_core.default.lib.WordArray.create(import_buffer.Buffer.concat([ 40211 import_buffer.Buffer.from(_this6.deviceGroupKey, "utf8"), 40212 import_buffer.Buffer.from(_this6.deviceKey, "utf8"), 40213 import_buffer.Buffer.from(challengeParameters.SECRET_BLOCK, "base64"), 40214 import_buffer.Buffer.from(dateNow, "utf8") 40215 ])); 40216 var key = import_core.default.lib.WordArray.create(hkdf); 40217 var signatureString = import_enc_base64.default.stringify((0, import_hmac_sha256.default)(message, key)); 40218 var challengeResponses = {}; 40219 challengeResponses.USERNAME = _this6.username; 40220 challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK; 40221 challengeResponses.TIMESTAMP = dateNow; 40222 challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString; 40223 challengeResponses.DEVICE_KEY = _this6.deviceKey; 40224 var jsonReqResp = { 40225 ChallengeName: "DEVICE_PASSWORD_VERIFIER", 40226 ClientId: _this6.pool.getClientId(), 40227 ChallengeResponses: challengeResponses, 40228 Session: data.Session 40229 }; 40230 if (_this6.getUserContextData()) jsonReqResp.UserContextData = _this6.getUserContextData(); 40231 _this6.client.request("RespondToAuthChallenge", jsonReqResp, function(errAuthenticate, dataAuthenticate) { 40232 if (errAuthenticate) return callback.onFailure(errAuthenticate); 40233 _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult); 40234 _this6.cacheTokens(); 40235 return callback.onSuccess(_this6.signInUserSession); 40236 }); 40237 }); 40238 }); 40239 }); 40240 }; 40241 _proto.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback, clientMetadata) { 40242 var jsonReq = { 40243 ClientId: this.pool.getClientId(), 40244 ConfirmationCode: confirmationCode, 40245 Username: this.username, 40246 ForceAliasCreation: forceAliasCreation, 40247 ClientMetadata: clientMetadata 40248 }; 40249 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40250 this.client.request("ConfirmSignUp", jsonReq, function(err) { 40251 if (err) return callback(err, null); 40252 return callback(null, "SUCCESS"); 40253 }); 40254 }; 40255 _proto.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback, clientMetadata) { 40256 var _this7 = this; 40257 var challengeResponses = {}; 40258 challengeResponses.USERNAME = this.username; 40259 challengeResponses.ANSWER = answerChallenge; 40260 var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolId().split("_")[1]); 40261 this.getCachedDeviceKeyAndPassword(); 40262 if (this.deviceKey != null) challengeResponses.DEVICE_KEY = this.deviceKey; 40263 var jsonReq = { 40264 ChallengeName: "CUSTOM_CHALLENGE", 40265 ChallengeResponses: challengeResponses, 40266 ClientId: this.pool.getClientId(), 40267 Session: this.Session, 40268 ClientMetadata: clientMetadata 40269 }; 40270 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40271 this.client.request("RespondToAuthChallenge", jsonReq, function(err, data) { 40272 if (err) return callback.onFailure(err); 40273 return _this7.authenticateUserInternal(data, authenticationHelper, callback); 40274 }); 40275 }; 40276 _proto.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType, clientMetadata) { 40277 var _this8 = this; 40278 var challengeResponses = {}; 40279 challengeResponses.USERNAME = this.username; 40280 challengeResponses.SMS_MFA_CODE = confirmationCode; 40281 var mfaTypeSelection = mfaType || "SMS_MFA"; 40282 if (mfaTypeSelection === "SOFTWARE_TOKEN_MFA") challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode; 40283 if (this.deviceKey != null) challengeResponses.DEVICE_KEY = this.deviceKey; 40284 var jsonReq = { 40285 ChallengeName: mfaTypeSelection, 40286 ChallengeResponses: challengeResponses, 40287 ClientId: this.pool.getClientId(), 40288 Session: this.Session, 40289 ClientMetadata: clientMetadata 40290 }; 40291 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40292 this.client.request("RespondToAuthChallenge", jsonReq, function(err, dataAuthenticate) { 40293 if (err) return callback.onFailure(err); 40294 if (dataAuthenticate.ChallengeName === "DEVICE_SRP_AUTH") { 40295 _this8.getDeviceResponse(callback); 40296 return; 40297 } 40298 _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult); 40299 _this8.cacheTokens();
40300 if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) return callback.onSuccess(_this8.signInUserSession); 40301 var authenticationHelper = new AuthenticationHelper(_this8.pool.getUserPoolId().split("_")[1]); 40302 authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function(errGenHash) { 40303 if (errGenHash) return callback.onFailure(errGenHash); 40304 var deviceSecretVerifierConfig = { 40305 Salt: import_buffer.Buffer.from(authenticationHelper.getSaltDevices(), "hex").toString("base64"), 40306 PasswordVerifier: import_buffer.Buffer.from(authenticationHelper.getVerifierDevices(), "hex").toString("base64") 40307 }; 40308 _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier; 40309 _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey; 40310 _this8.randomPassword = authenticationHelper.getRandomPassword(); 40311 _this8.client.request("ConfirmDevice", { 40312 DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, 40313 AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(), 40314 DeviceSecretVerifierConfig: deviceSecretVerifierConfig, 40315 DeviceName: userAgent 40316 }, function(errConfirm, dataConfirm) { 40317 if (errConfirm) return callback.onFailure(errConfirm); 40318 _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey; 40319 _this8.cacheDeviceKeyAndPassword(); 40320 if (dataConfirm.UserConfirmationNecessary === true) return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary); 40321 return callback.onSuccess(_this8.signInUserSession); 40322 }); 40323 }); 40324 }); 40325 }; 40326 _proto.changePassword = function changePassword(oldUserPassword, newUserPassword, callback, clientMetadata) { 40327 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40328 this.client.request("ChangePassword", { 40329 PreviousPassword: oldUserPassword, 40330 ProposedPassword: newUserPassword, 40331 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40332 ClientMetadata: clientMetadata 40333 }, function(err) { 40334 if (err) return callback(err, null); 40335 return callback(null, "SUCCESS"); 40336 }); 40337 }; 40338 _proto.enableMFA = function enableMFA(callback) { 40339 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40340 var mfaOptions = []; 40341 mfaOptions.push({ 40342 DeliveryMedium: "SMS", 40343 AttributeName: "phone_number" 40344 }); 40345 this.client.request("SetUserSettings", { 40346 MFAOptions: mfaOptions, 40347 AccessToken: this.signInUserSession.getAccessToken().getJwtToken() 40348 }, function(err) { 40349 if (err) return callback(err, null); 40350 return callback(null, "SUCCESS"); 40351 }); 40352 }; 40353 _proto.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) { 40354 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40355 this.client.request("SetUserMFAPreference", { 40356 SMSMfaSettings: smsMfaSettings, 40357 SoftwareTokenMfaSettings: softwareTokenMfaSettings, 40358 AccessToken: this.signInUserSession.getAccessToken().getJwtToken() 40359 }, function(err) { 40360 if (err) return callback(err, null); 40361 return callback(null, "SUCCESS"); 40362 }); 40363 }; 40364 _proto.disableMFA = function disableMFA(callback) { 40365 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40366 this.client.request("SetUserSettings", { 40367 MFAOptions: [], 40368 AccessToken: this.signInUserSession.getAccessToken().getJwtToken() 40369 }, function(err) { 40370 if (err) return callback(err, null); 40371 return callback(null, "SUCCESS"); 40372 }); 40373 }; 40374 _proto.deleteUser = function deleteUser(callback, clientMetadata) { 40375 var _this9 = this; 40376 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40377 this.client.request("DeleteUser", { 40378 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40379 ClientMetadata: clientMetadata 40380 }, function(err) { 40381 if (err) return callback(err, null); 40382 _this9.clearCachedUser(); 40383 return callback(null, "SUCCESS"); 40384 }); 40385 }; 40386 _proto.updateAttributes = function updateAttributes(attributes, callback, clientMetadata) { 40387 var _this10 = this; 40388 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40389 this.client.request("UpdateUserAttributes", { 40390 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40391 UserAttributes: attributes, 40392 ClientMetadata: clientMetadata 40393 }, function(err) { 40394 if (err) return callback(err, null); 40395 return _this10.getUserData(function() { 40396 return callback(null, "SUCCESS"); 40397 }, { bypassCache: true }); 40398 }); 40399 }; 40400 _proto.getUserAttributes = function getUserAttributes(callback) { 40401 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40402 this.client.request("GetUser", { AccessToken: this.signInUserSession.getAccessToken().getJwtToken() }, function(err, userData) { 40403 if (err) return callback(err, null); 40404 var attributeList = []; 40405 for (var i = 0; i < userData.UserAttributes.length; i++) { 40406 var userAttribute = new CognitoUserAttribute({ 40407 Name: userData.UserAttributes[i].Name, 40408 Value: userData.UserAttributes[i].Value 40409 }); 40410 attributeList.push(userAttribute); 40411 } 40412 return callback(null, attributeList); 40413 }); 40414 }; 40415 _proto.getMFAOptions = function getMFAOptions(callback) { 40416 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40417 this.client.request("GetUser", { AccessToken: this.signInUserSession.getAccessToken().getJwtToken() }, function(err, userData) { 40418 if (err) return callback(err, null); 40419 return callback(null, userData.MFAOptions); 40420 }); 40421 };
40422 _proto.createGetUserRequest = function createGetUserRequest() { 40423 return this.client.promisifyRequest("GetUser", { AccessToken: this.signInUserSession.getAccessToken().getJwtToken() }); 40424 }; 40425 _proto.refreshSessionIfPossible = function refreshSessionIfPossible(options) { 40426 var _this11 = this; 40427 if (options === void 0) options = {}; 40428 return new Promise(function(resolve) { 40429 var refresh = _this11.signInUserSession.getRefreshToken(); 40430 if (refresh && refresh.getToken()) _this11.refreshSession(refresh, resolve, options.clientMetadata); 40431 else resolve(); 40432 }); 40433 }; 40434 _proto.getUserData = function getUserData(callback, params) { 40435 var _this12 = this; 40436 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { 40437 this.clearCachedUserData(); 40438 return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40439 } 40440 var userData = this.getUserDataFromCache(); 40441 if (!userData) { 40442 this.fetchUserData().then(function(data) { 40443 callback(null, data); 40444 })["catch"](callback); 40445 return; 40446 } 40447 if (this.isFetchUserDataAndTokenRequired(params)) { 40448 this.fetchUserData().then(function(data) { 40449 return _this12.refreshSessionIfPossible(params).then(function() { 40450 return data; 40451 }); 40452 }).then(function(data) { 40453 return callback(null, data); 40454 })["catch"](callback); 40455 return; 40456 } 40457 try { 40458 callback(null, JSON.parse(userData)); 40459 return; 40460 } catch (err) { 40461 this.clearCachedUserData(); 40462 callback(err, null); 40463 return; 40464 } 40465 }; 40466 _proto.getUserDataFromCache = function getUserDataFromCache() { 40467 return this.storage.getItem(this.userDataKey); 40468 }; 40469 _proto.isFetchUserDataAndTokenRequired = function isFetchUserDataAndTokenRequired(params) { 40470 var _ref$bypassCache = (params || {}).bypassCache; 40471 return _ref$bypassCache === void 0 ? false : _ref$bypassCache; 40472 }; 40473 _proto.fetchUserData = function fetchUserData() { 40474 var _this13 = this; 40475 return this.createGetUserRequest().then(function(data) { 40476 _this13.cacheUserData(data); 40477 return data; 40478 }); 40479 }; 40480 _proto.deleteAttributes = function deleteAttributes(attributeList, callback) { 40481 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) return callback(/* @__PURE__ */ new Error("User is not authenticated"), null); 40482 this.client.request("DeleteUserAttributes", { 40483 UserAttributeNames: attributeList, 40484 AccessToken: this.signInUserSession.getAccessToken().getJwtToken() 40485 }, function(err) { 40486 if (err) return callback(err, null); 40487 return callback(null, "SUCCESS"); 40488 }); 40489 }; 40490 _proto.resendConfirmationCode = function resendConfirmationCode(callback, clientMetadata) { 40491 var jsonReq = { 40492 ClientId: this.pool.getClientId(), 40493 Username: this.username, 40494 ClientMetadata: clientMetadata 40495 }; 40496 this.client.request("ResendConfirmationCode", jsonReq, function(err, result) { 40497 if (err) return callback(err, null); 40498 return callback(null, result); 40499 }); 40500 }; 40501 _proto.getSession = function getSession(callback, options) { 40502 if (options === void 0) options = {}; 40503 if (this.username == null) return callback(/* @__PURE__ */ new Error("Username is null. Cannot retrieve a new session"), null); 40504 if (this.signInUserSession != null && this.signInUserSession.isValid()) return callback(null, this.signInUserSession); 40505 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId() + "." + this.username; 40506 var idTokenKey = keyPrefix + ".idToken"; 40507 var accessTokenKey = keyPrefix + ".accessToken"; 40508 var refreshTokenKey = keyPrefix + ".refreshToken"; 40509 var clockDriftKey = keyPrefix + ".clockDrift"; 40510 if (this.storage.getItem(idTokenKey)) { 40511 var idToken = new CognitoIdToken({ IdToken: this.storage.getItem(idTokenKey) }); 40512 var accessToken = new CognitoAccessToken({ AccessToken: this.storage.getItem(accessTokenKey) }); 40513 var refreshToken = new CognitoRefreshToken({ RefreshToken: this.storage.getItem(refreshTokenKey) }); 40514 var cachedSession = new CognitoUserSession({ 40515 IdToken: idToken, 40516 AccessToken: accessToken, 40517 RefreshToken: refreshToken, 40518 ClockDrift: parseInt(this.storage.getItem(clockDriftKey), 0
40518) || 0 40519 }); 40520 if (cachedSession.isValid()) { 40521 this.signInUserSession = cachedSession; 40522 return callback(null, this.signInUserSession); 40523 } 40524 if (!refreshToken.getToken()) return callback(/* @__PURE__ */ new Error("Cannot retrieve a new session. Please authenticate."), null); 40525 this.refreshSession(refreshToken, callback, options.clientMetadata); 40526 } else callback(/* @__PURE__ */ new Error("Local storage is missing an ID Token, Please authenticate"), null); 40527 }; 40528 _proto.refreshSession = function refreshSession(refreshToken, callback, clientMetadata) { 40529 var _this14 = this; 40530 var wrappedCallback = this.pool.wrapRefreshSessionCallback ? this.pool.wrapRefreshSessionCallback(callback) : callback; 40531 var authParameters = {}; 40532 authParameters.REFRESH_TOKEN = refreshToken.getToken(); 40533 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId(); 40534 var lastUserKey = keyPrefix + ".LastAuthUser"; 40535 if (this.storage.getItem(lastUserKey)) { 40536 this.username = this.storage.getItem(lastUserKey); 40537 var deviceKeyKey = keyPrefix + "." + this.username + ".deviceKey"; 40538 this.deviceKey = this.storage.getItem(deviceKeyKey); 40539 authParameters.DEVICE_KEY = this.deviceKey; 40540 } 40541 var jsonReq = { 40542 ClientId: this.pool.getClientId(), 40543 AuthFlow: "REFRESH_TOKEN_AUTH", 40544 AuthParameters: authParameters, 40545 ClientMetadata: clientMetadata 40546 }; 40547 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40548 this.client.request("InitiateAuth", jsonReq, function(err, authResult) { 40549 if (err) { 40550 if (err.code === "NotAuthorizedException") _this14.clearCachedUser(); 40551 return wrappedCallback(err, null); 40552 } 40553 if (authResult) { 40554 var authenticationResult = authResult.AuthenticationResult; 40555 if (!Object.prototype.hasOwnProperty.call(authenticationResult, "RefreshToken")) authenticationResult.RefreshToken = refreshToken.getToken(); 40556 _this14.signInUserSession = _this14.getCognitoUserSession(authenticationResult); 40557 _this14.cacheTokens(); 40558 return wrappedCallback(null, _this14.signInUserSession); 40559 } 40560 }); 40561 }; 40562 _proto.cacheTokens = function cacheTokens() { 40563 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId(); 40564 var idTokenKey = keyPrefix + "." + this.username + ".idToken"; 40565 var accessTokenKey = keyPrefix + "." + this.username + ".accessToken"; 40566 var refreshTokenKey = keyPrefix + "." + this.username + ".refreshToken"; 40567 var clockDriftKey = keyPrefix + "." + this.username + ".clockDrift"; 40568 var lastUserKey = keyPrefix + ".LastAuthUser"; 40569 this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken()); 40570 this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken()); 40571 this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken()); 40572 this.storage.setItem(clockDriftKey, "" + this.signInUserSession.getClockDrift()); 40573 this.storage.setItem(lastUserKey, this.username); 40574 }; 40575 _proto.cacheUserData = function cacheUserData(userData) { 40576 this.storage.setItem(this.userDataKey, JSON.stringify(userData)); 40577 }; 40578 _proto.clearCachedUserData = function clearCachedUserData() { 40579 this.storage.removeItem(this.userDataKey); 40580 }; 40581 _proto.clearCachedUser = function clearCachedUser() { 40582 this.clearCachedTokens(); 40583 this.clearCachedUserData(); 40584 }; 40585 _proto.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() { 40586 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId() + "." + this.username; 40587 var deviceKeyKey = keyPrefix + ".deviceKey"; 40588 var randomPasswordKey = keyPrefix + ".randomPasswordKey"; 40589 var deviceGroupKeyKey = keyPrefix + ".deviceGroupKey"; 40590 this.storage.setItem(deviceKeyKey, this.deviceKey); 40591 this.storage.setItem(randomPasswordKey, this.randomPassword); 40592 this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey); 40593 }; 40594 _proto.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() { 40595 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId() + "." + this.username; 40596 var deviceKeyKey = keyPrefix + ".deviceKey"; 40597 var randomPasswordKey = keyPrefix + ".randomPasswordKey"; 40598 var deviceGroupKeyKey = keyPrefix + ".deviceGroupKey"; 40599 if (this.storage.getItem(deviceKeyKey)) { 40600 this.deviceKey = this.storage.getItem(deviceKeyKey); 40601 this.randomPassword = this.storage.getItem(randomPasswordKey); 40602 this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey); 40603 } 40604 }; 40605 _proto.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() { 40606 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId() + "." + this.username; 40607 var deviceKeyKey = keyPrefix + ".deviceKey"; 40608 var randomPasswordKey = keyPrefix + ".randomPasswordKey"; 40609 var deviceGroupKeyKey = keyPrefix + ".deviceGroupKey"; 40610 this.storage.removeItem(deviceKeyKey); 40611 this.storage.removeItem(randomPasswordKey); 40612 this.storage.removeItem(deviceGroupKeyKey); 40613 }; 40614 _proto.clearCachedTokens = function clearCachedTokens() { 40615 var keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId(); 40616 var idTokenKey = keyPrefix + "." + this.username + ".idToken"; 40617 var accessTokenKey = keyPrefix + "." + this.username + ".accessToken"; 40618 var refreshTokenKey = keyPrefix + "." + this.username + ".refreshToken"; 40619 var lastUserKey = keyPrefix + ".LastAuthUser"; 40620 var clockDriftKey = keyPrefix + "." + this.username + ".clockDrift"; 40621 this.storage.removeItem(idTokenKey); 40622 this.storage.removeItem(accessTokenKey); 40623 this.storage.removeItem(refreshTokenKey); 40624 this.storage.removeItem(lastUserKey); 40625 this.storage.removeItem(clockDriftKey); 40626 }; 40627 _proto.getCognitoUserSession = function getCognitoUserSession(authResult) { 40628 return new CognitoUserSession({ 40629 IdToken: new CognitoIdToken(authResult), 40630 AccessToken: new CognitoAccessToken(authResult), 40631 RefreshToken: new CognitoRefreshToken(authResult) 40632 }); 40633 }; 40634 _proto.forgotPassword = function forgotPassword(callback, clientMetadata) { 40635 var jsonReq = { 40636 ClientId: this.pool.getClientId(), 40637 Username: this.username, 40638 ClientMetadata: clientMetadata 40639 }; 40640 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40641 this.client.request("ForgotPassword", jsonReq, function(err, data) { 40642 if (err) return callback.onFailure(err); 40643 if (typeof callback.inputVerificationCode === "function") return callback.inputVerificationCode(data); 40644 return callback.onSuccess(data); 40645 }); 40646 }; 40647 _proto.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback, clientMetadata) { 40648 var jsonReq = { 40649 ClientId: this.pool.getClientId(), 40650 Username: this.username, 40651 ConfirmationCode: confirmationCode, 40652 Password: newPassword, 40653 ClientMetadata: clientMetadata 40654 }; 40655 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40656 this.client.request("ConfirmForgotPassword", jsonReq, function(err) { 40657 if (err) return callback.onFailure(err); 40658 return callback.onSuccess(); 40659 }); 40660 }; 40661 _proto.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback, clientMetadata) { 40662 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40663 this.client.request("GetUserAttributeVerificationCode", { 40664 AttributeName: attributeName, 40665 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40666 ClientMetadata: clientMetadata 40667 }, function(err, data) { 40668 if (err) return callback.onFailure(err); 40669 if (typeof callback.inputVerificationCode === "function") return callback.inputVerificationCode(data); 40670 return callback.onSuccess(); 40671 }); 40672 }; 40673 _proto.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) { 40674 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40675 this.client.request("VerifyUserAttribute", { 40676 AttributeName: attributeName, 40677 Code: confirmationCode, 40678 AccessToken: this.signInUserSession.getAccessToken().getJwtToken() 40679 }, function(err) { 40680 if (err) return callback.onFailure(err); 40681 return callback.onSuccess("SUCCESS"); 40682 }); 40683 }; 40684 _proto.getDevice = function getDevice(callback) { 40685 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40686 this.client.request("GetDevice", { 40687 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40688 DeviceKey: this.deviceKey 40689 }, function(err, data) { 40690 if (err) return callback.onFailure(err); 40691 return callback.onSuccess(data); 40692 }); 40693 }; 40694 _proto.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) { 40695 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40696 this.client.request("ForgetDevice", { 40697 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40698 DeviceKey: deviceKey 40699 }, function(err) { 40700 if (err) return callback.onFailure(err); 40701 return callback.onSuccess("SUCCESS"); 40702 }); 40703 }; 40704 _proto.forgetDevice = function forgetDevice(callback) { 40705 var _this15 = this; 40706 this.forgetSpecificDevice(this.deviceKey, { 40707 onFailure: callback.onFailure, 40708 onSuccess: function onSuccess(result) { 40709 _this15.deviceKey = null; 40710 _this15.deviceGroupKey = null; 40711 _this15.randomPassword = null; 40712 _this15.clearCachedDeviceKeyAndPassword(); 40713 return callback.onSuccess(result); 40714 } 40715 }); 40716 }; 40717 _proto.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) { 40718 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40719 this.client.request("UpdateDeviceStatus", { 40720 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40721 DeviceKey: this.deviceKey, 40722 DeviceRememberedStatus: "remembered" 40723 }, function(err) { 40724 if (err) return callback.onFailure(err); 40725 return callback.onSuccess("SUCCESS"); 40726 }); 40727 }; 40728 _proto.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) { 40729 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40730 this.client.request("UpdateDeviceStatus", { 40731 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40732 DeviceKey: this.deviceKey, 40733 DeviceRememberedStatus: "not_remembered" 40734 }, function(err) { 40735 if (err) return callback.onFailure(err); 40736 return callback.onSuccess("SUCCESS"); 40737 }); 40738 }; 40739 _proto.listDevices = function listDevices(limit, paginationToken, callback) { 40740 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated"));
40741 var requestParams = { 40742 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40743 Limit: limit 40744 }; 40745 if (paginationToken) requestParams.PaginationToken = paginationToken; 40746 this.client.request("ListDevices", requestParams, function(err, data) { 40747 if (err) return callback.onFailure(err); 40748 return callback.onSuccess(data); 40749 }); 40750 }; 40751 _proto.globalSignOut = function globalSignOut(callback) { 40752 var _this16 = this; 40753 if (this.signInUserSession == null || !this.signInUserSession.isValid()) return callback.onFailure(/* @__PURE__ */ new Error("User is not authenticated")); 40754 this.client.request("GlobalSignOut", { AccessToken: this.signInUserSession.getAccessToken().getJwtToken() }, function(err) { 40755 if (err) return callback.onFailure(err); 40756 _this16.clearCachedUser(); 40757 return callback.onSuccess("SUCCESS"); 40758 }); 40759 }; 40760 _proto.signOut = function signOut() { 40761 this.signInUserSession = null; 40762 this.clearCachedUser(); 40763 }; 40764 _proto.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) { 40765 var _this17 = this; 40766 var challengeResponses = {}; 40767 challengeResponses.USERNAME = this.username; 40768 challengeResponses.ANSWER = answerChallenge; 40769 var jsonReq = { 40770 ChallengeName: "SELECT_MFA_TYPE", 40771 ChallengeResponses: challengeResponses, 40772 ClientId: this.pool.getClientId(), 40773 Session: this.Session 40774 }; 40775 if (this.getUserContextData()) jsonReq.UserContextData = this.getUserContextData(); 40776 this.client.request("RespondToAuthChallenge", jsonReq, function(err, data) { 40777 if (err) return callback.onFailure(err); 40778 _this17.Session = data.Session; 40779 if (answerChallenge === "SMS_MFA") return callback.mfaRequired(data.ChallengeName, data.ChallengeParameters); 40780 if (answerChallenge === "SOFTWARE_TOKEN_MFA") return callback.totpRequired(data.ChallengeName, data.ChallengeParameters); 40781 }); 40782 }; 40783 _proto.getUserContextData = function getUserContextData() { 40784 return this.pool.getUserContextData(this.username); 40785 }; 40786 _proto.associateSoftwareToken = function associateSoftwareToken(callback) { 40787 var _this18 = this; 40788 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) this.client.request("AssociateSoftwareToken", { Session: this.Session }, function(err, data) { 40789 if (err) return callback.onFailure(err); 40790 _this18.Session = data.Session; 40791 return callback.associateSecretCode(data.SecretCode); 40792 }); 40793 else this.client.request("AssociateSoftwareToken", { AccessToken: this.signInUserSession.getAccessToken().getJwtToken() }, function(err, data) { 40794 if (err) return callback.onFailure(err); 40795 return callback.associateSecretCode(data.SecretCode); 40796 }); 40797 }; 40798 _proto.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) { 40799 var _this19 = this; 40800 if (!(this.signInUserSession != null && this.signInUserSession.isValid())) this.client.request("VerifySoftwareToken", { 40801 Session: this.Session, 40802 UserCode: totpCode, 40803 FriendlyDeviceName: friendlyDeviceName 40804 }, function(err, data) { 40805 if (err) return callback.onFailure(err); 40806 _this19.Session = data.Session; 40807 var challengeResponses = {}; 40808 challengeResponses.USERNAME = _this19.username; 40809 var jsonReq = { 40810 ChallengeName: "MFA_SETUP", 40811 ClientId: _this19.pool.getClientId(), 40812 ChallengeResponses: challengeResponses, 40813 Session: _this19.Session 40814 }; 40815 if (_this19.getUserContextData()) jsonReq.UserContextData = _this19.getUserContextData(); 40816 _this19.client.request("RespondToAuthChallenge", jsonReq, function(errRespond, dataRespond) { 40817 if (errRespond) return callback.onFailure(errRespond); 40818 _this19.signInUserSession = _this19.getCognitoUserSession(dataRespond.AuthenticationResult); 40819 _this19.cacheTokens(); 40820 return callback.onSuccess(_this19.signInUserSession); 40821 }); 40822 }); 40823 else this.client.request("VerifySoftwareToken", { 40824 AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), 40825 UserCode: totpCode, 40826 FriendlyDeviceName: friendlyDeviceName 40827 }, function(err, data) { 40828 if (err) return callback.onFailure(err); 40829 return callback.onSuccess(data); 40830 }); 40831 }; 40832 return CognitoUser; 40833 }(); 40834})); 40835//#endregion 40836//#region node_modules/unfetch/dist/unfetch.module.js 40837var unfetch_module_exports = /* @__PURE__ */ __exportAll({ default: () => unfetch_module_default }); 40838function unfetch_module_default(e, n) { 40839 return n = n || {}, new Promise(function(t, r) { 40840 var s = new XMLHttpRequest(), o = [], u = [], i = {}, a = function() { 40841 return { 40842 ok: 2 == (s.status / 100 | 0), 40843 statusText: s.statusText, 40844 status: s.status, 40845 url: s.responseURL, 40846 text: function() { 40847 return Promise.resolve(s.responseText); 40848 }, 40849 json: function() { 40850 return Promise.resolve(s.responseText).then(JSON.parse); 40851 }, 40852 blob: function() { 40853 return Promise.resolve(new Blob([s.response])); 40854 }, 40855 clone: a, 40856 headers: { 40857 keys: function() { 40858 return o; 40859 }, 40860 entries: function() { 40861 return u; 40862 }, 40863 get: function(e) { 40864 return i[e.toLowerCase()]; 40865 }, 40866 has: function(e) { 40867 return e.toLowerCase() in i; 40868 } 40869 } 40870 }; 40871 }; 40872 for (var l in s.open(n.method || "get", e, !0), s.onload = function() { 40873 s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e, n, t) { 40874 o.push(n = n.toLowerCase()), u.push([n, t]), i[n] = i[n] ? i[n] + "," + t : t; 40875 }), t(a()); 40876 }, s.onerror = r, s.withCredentials = "include" == n.credentials, n.headers) s.setRequestHeader(l, n.headers[l]); 40877 s.send(n.body || null); 40878 }); 40879} 40880var init_unfetch_module = __esmMin((() => {})); 40881//#endregion 40882//#region node_modules/isomorphic-unfetch/browser.js 40883var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { 40884 module.exports = self.fetch || (self.fetch = (init_unfetch_module(), __toCommonJS(unfetch_module_exports
40884)).default || (init_unfetch_module(), __toCommonJS(unfetch_module_exports))); 40885})); 40886//#endregion 40887//#region node_modules/amazon-cognito-identity-js/es/UserAgent.js 40888function UserAgent() {} 40889var appendToCognitoUserAgent; 40890var init_UserAgent = __esmMin((() => { 40891 UserAgent.prototype.userAgent = "aws-amplify/0.1.x js"; 40892 appendToCognitoUserAgent = function appendToCognitoUserAgent(content) { 40893 if (!content) return; 40894 if (UserAgent.prototype.userAgent && !UserAgent.prototype.userAgent.includes(content)) UserAgent.prototype.userAgent = UserAgent.prototype.userAgent.concat(" ", content); 40895 if (!UserAgent.prototype.userAgent || UserAgent.prototype.userAgent === "") UserAgent.prototype.userAgent = content; 40896 }; 40897})); 40898//#endregion 40899//#region node_modules/amazon-cognito-identity-js/es/Client.js 40900function _inheritsLoose(subClass, superClass) { 40901 subClass.prototype = Object.create(superClass.prototype); 40902 subClass.prototype.constructor = subClass; 40903 _setPrototypeOf(subClass, superClass); 40904} 40905function _wrapNativeSuper(Class) { 40906 var _cache = typeof Map === "function" ? /* @__P
40906URE__ */ new Map() : void 0; 40907 _wrapNativeSuper = function _wrapNativeSuper(Class) { 40908 if (Class === null || !_isNativeFunction(Class)) return Class; 40909 if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function"); 40910 if (typeof _cache !== "undefined") { 40911 if (_cache.has(Class)) return _cache.get(Class); 40912 _cache.set(Class, Wrapper); 40913 } 40914 function Wrapper() { 40915 return _construct(Class, arguments, _getPrototypeOf(this).constructor); 40916 } 40917 Wrapper.prototype = Object.create(Class.prototype, { constructor: { 40918 value: Wrapper, 40919 enumerable: false, 40920 writable: true, 40921 configurable: true 40922 } }); 40923 return _setPrototypeOf(Wrapper, Class); 40924 }; 40925 return _wrapNativeSuper(Class); 40926} 40927function _construct(Parent, args, Class) { 40928 if (_isNativeReflectConstruct()) _construct = Reflect.construct; 40929 else _construct = function _construct(Parent, args, Class) { 40930 var a = [null]; 40931 a.push.apply(a, args); 40932 var instance = new (Function.bind.apply(Parent, a))(); 40933 if (Class) _setPrototypeOf(instance, Class.prototype); 40934 return instance; 40935 }; 40936 return _construct.apply(null, arguments); 40937} 40938function _isNativeReflectConstruct() { 40939 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 40940 if (Reflect.construct.sham) return false; 40941 if (typeof Proxy === "function") return true; 40942 try { 40943 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); 40944 return true; 40945 } catch (e) { 40946 return false; 40947 } 40948} 40949function _isNativeFunction(fn) { 40950 return Function.toString.call(fn).indexOf("[native code]") !== -1; 40951} 40952function _setPrototypeOf(o, p) { 40953 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 40954 o.__proto__ = p; 40955 return o; 40956 }; 40957 return _setPrototypeOf(o, p); 40958} 40959function _getPrototypeOf(o) { 40960 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 40961 return o.__proto__ || Object.getPrototypeOf(o); 40962 }; 40963 return _getPrototypeOf(o); 40964} 40965var CognitoError, Client; 40966var init_Client = __esmMin((() => { 40967 require_browser(); 40968 init_UserAgent(); 40969 CognitoError = /*#__PURE__*/ function(_Error) { 40970 _inheritsLoose(CognitoError, _Error); 40971 function CognitoError(message, code, name, statusCode) { 40972 var _this = _Error.call(this, message) || this; 40973 _this.code = code; 40974 _this.name = name; 40975 _this.statusCode = statusCode; 40976 return _this; 40977 } 40978 return CognitoError; 40979 }(/*#__PURE__*/ _wrapNativeSuper(Error)); 40980 Client = /*#__PURE__*/ function() { 40981 /** 40982 * Constructs a new AWS Cognito Identity Provider client object 40983 * @param {string} region AWS region 40984 * @param {string} endpoint endpoint 40985 * @param {object} fetchOptions options for fetch API (only credentials is supported) 40986 */ 40987 function Client(region, endpoint, fetchOptions) { 40988 this.endpoint = endpoint || "https://cognito-idp." + region + ".amazonaws.com/"; 40989 var credentials = (fetchOptions || {}).credentials; 40990 this.fetchOptions = credentials ? { credentials } : {}; 40991 } 40992 /** 40993 * Makes an unauthenticated request on AWS Cognito Identity Provider API 40994 * using fetch 40995 * @param {string} operation API operation 40996 * @param {object} params Input parameters 40997 * @returns Promise<object> 40998 */ 40999 var _proto = Client.prototype; 41000 _proto.promisifyRequest = function promisifyRequest(operation, params) { 41001 var _this2 = this; 41002 return new Promise(function(resolve, reject) { 41003 _this2.request(operation, params, function(err, data) { 41004 if (err) reject(new CognitoError(err.message, err.code, err.name, err.statusCode)); 41005 else resolve(data); 41006 }); 41007 }); 41008 }; 41009 _proto.request = function request(operation, params, callback) { 41010 var headers = { 41011 "Content-Type": "application/x-amz-json-1.1", 41012 "X-Amz-Target": "AWSCognitoIdentityProviderService." + operation, 41013 "X-Amz-User-Agent": UserAgent.prototype.userAgent 41014 }; 41015 var options = Object.assign({}, this.fetchOptions, { 41016 headers, 41017 method: "POST", 41018 mode: "cors", 41019 cache: "no-cache", 41020 body: JSON.stringify(params) 41021 }); 41022 var response; 41023 fetch(this.endpoint, options).then(function(resp) { 41024 response = resp; 41025 return resp; 41026 }, function(err) { 41027 if (err instanceof TypeError) throw new Error("Network error"); 41028 throw err; 41029 }).then(function(resp) { 41030 return resp.json()["catch"](function() { 41031 return {}; 41032 }); 41033 }).then(function(data) { 41034 if (response.ok) return callback(null, data); 41035 var code = (data.__type || data.code).split("#").pop(); 41036 return callback({ 41037 code, 41038 name: code, 41039 message: data.message || data.Message || null 41040 }); 41041 })["catch"](function(err) { 41042 if (response && response.headers && response.headers.get("x-amzn-errortype")) try { 41043 var code = response.headers.get("x-amzn-errortype").split(":")[0]; 41044 return callback({ 41045 code, 41046 name: code, 41047 statusCode: response.status, 41048 message: response.status ? response.status.toString() : null 41049 }); 41050 } catch (ex) { 41051 return callback(err); 41052 } 41053 else if (err instanceof Error && err.message === "Network error") return callback({ 41054 code: "NetworkError", 41055 name: err.name, 41056 message: err.message 41057 }); 41058 else return callback(err); 41059 }); 41060 }; 41061 return Client; 41062 }(); 41063})); 41064//#endregion 41065//#region node_modules/amazon-cognito-identity-js/es/CognitoUserPool.js 41066var CognitoUserPool; 41067var init_CognitoUserPool = __esmMin((() => { 41068 init_Client(); 41069 init_CognitoUser(); 41070 init_StorageHelper(); 41071 CognitoUserPool = /*#__PURE__*/ function() { 41072 /*! 41073 * Copyright 2016 Amazon.com, 41074 * Inc. or its affiliates. All Rights Reserved. 41075 * 41076 * Licensed under the Amazon Software License (the "License"). 41077 * You may not use this file except in compliance with the 41078 * License. A copy of the License is located at 41079 * 41080 * http://aws.amazon.com/asl/ 41081 * 41082 * or in the "license" file accompanying this file. This file is 41083 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 41084 * CONDITIONS OF ANY KIND, express or implied. See the License 41085 * for the specific language governing permissions and 41086 * limitations under the License. 41087 */ 41088 /** 41089 * Constructs a new CognitoUserPool object 41090 * @param {object} data Creation options. 41091 * @param {string} data.UserPoolId Cognito user pool id. 41092 * @param {string} data.ClientId User pool application client id. 41093 * @param {string} data.endpoint Optional custom service endpoint. 41094 * @param {object} data.fetchOptions Optional options for fetch API. 41095 * (only credentials option is supported) 41096 * @param {object} data.Storage Optional storage object. 41097 * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional: 41098 * boolean flag indicating if the data collection is enabled
41099 * to support cognito advanced security features. By default, this 41100 * flag is set to true. 41101 */ 41102 function CognitoUserPool(data, wrapRefreshSessionCallback) { 41103 var _ref = data || {}, UserPoolId = _ref.UserPoolId, ClientId = _ref.ClientId, endpoint = _ref.endpoint, fetchOptions = _ref.fetchOptions, AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag; 41104 if (!UserPoolId || !ClientId) throw new Error("Both UserPoolId and ClientId are required."); 41105 if (!/^[\w-]+_.+$/.test(UserPoolId)) throw new Error("Invalid UserPoolId format."); 41106 var region = UserPoolId.split("_")[0]; 41107 this.userPoolId = UserPoolId; 41108 this.clientId = ClientId; 41109 this.client = new Client(region, endpoint, fetchOptions); 41110 /** 41111 * By default, AdvancedSecurityDataCollectionFlag is set to true, 41112 * if no input value is provided. 41113 */ 41114 this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false; 41115 this.storage = data.Storage || new StorageHelper().getStorage(); 41116 if (wrapRefreshSessionCallback) this.wrapRefreshSessionCallback = wrapRefreshSessionCallback; 41117 } 41118 /** 41119 * @returns {string} the user pool id 41120 */ 41121 var _proto = CognitoUserPool.prototype; 41122 _proto.getUserPoolId = function getUserPoolId() { 41123 return this.userPoolId; 41124 }; 41125 _proto.getClientId = function getClientId() { 41126 return this.clientId; 41127 }; 41128 _proto.signUp = function signUp(username, password, userAttributes, validationData, callback, clientMetadata) { 41129 var _this = this; 41130 var jsonReq = { 41131 ClientId: this.clientId, 41132 Username: username, 41133 Password: password, 41134 UserAttributes: userAttributes, 41135 ValidationData: validationData, 41136 ClientMetadata: clientMetadata 41137 }; 41138 if (this.getUserContextData(username)) jsonReq.UserContextData = this.getUserContextData(username); 41139 this.client.request("SignUp", jsonReq, function(err, data) { 41140 if (err) return callback(err, null); 41141 return callback(null, { 41142 user: new CognitoUser({ 41143 Username: username, 41144 Pool: _this, 41145 Storage: _this.storage 41146 }), 41147 userConfirmed: data.UserConfirmed, 41148 userSub: data.UserSub, 41149 codeDeliveryDetails: data.CodeDeliveryDetails 41150 }); 41151 }); 41152 }; 41153 _proto.getCurrentUser = function getCurrentUser() { 41154 var lastUserKey = "CognitoIdentityServiceProvider." + this.clientId + ".LastAuthUser"; 41155 var lastAuthUser = this.storage.getItem(lastUserKey); 41156 if (lastAuthUser) return new CognitoUser({ 41157 Username: lastAuthUser, 41158 Pool: this, 41159 Storage: this.storage 41160 }); 41161 return null; 41162 }; 41163 _proto.getUserContextData = function getUserContextData(username) { 41164 if (typeof AmazonCognitoAdvancedSecurityData === "undefined") return; 41165 var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData; 41166 if (this.advancedSecurityDataCollectionFlag) { 41167 var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId); 41168 if (advancedSecurityData) return { EncodedData: advancedSecurityData }; 41169 } 41170 return {}; 41171 }; 41172 return CognitoUserPool; 41173 }(); 41174})); 41175//#endregion 41176//#region node_modules/js-cookie/src/js.cookie.js 41177var require_js_cookie = /* @__PURE__ */ __commonJSMin(((exports, module) => { 41178 /*! 41179 * JavaScript Cookie v2.2.1 41180 * https://github.com/js-cookie/js-cookie 41181 * 41182 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 41183 * Released under the MIT license 41184 */ 41185 (function(factory) { 41186 var registeredInModuleLoader; 41187 if (typeof define === "function" && define.amd) { 41188 define(factory); 41189 registeredInModuleLoader = true; 41190 } 41191 if (typeof exports === "object") { 41192 module.exports = factory(); 41193 registeredInModuleLoader = true; 41194 } 41195 if (!registeredInModuleLoader) { 41196 var OldCookies = window.Cookies; 41197 var api = window.Cookies = factory(); 41198 api.noConflict = function() { 41199 window.Cookies = OldCookies; 41200 return api; 41201 }; 41202 } 41203 })(function() { 41204 function extend() { 41205 var i = 0; 41206 var result = {}; 41207 for (; i < arguments.length; i++) { 41208 var attributes = arguments[i]; 41209 for (var key in attributes) result[key] = attributes[key]; 41210 } 41211 return result; 41212 } 41213 function decode(s) { 41214 return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); 41215 } 41216 function init(converter) { 41217 function api() {} 41218 function set(key, value, attributes) { 41219 if (typeof document === "undefined") return; 41220 attributes = extend({ path: "/" }, api.defaults, attributes);
41221 if (typeof attributes.expires === "number") attributes.expires = /* @__PURE__ */ new Date(/* @__PURE__ */ new Date() * 1 + attributes.expires * 864e5); 41222 attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ""; 41223 try { 41224 var result = JSON.stringify(value); 41225 if (/^[\{\[]/.test(result)) value = result; 41226 } catch (e) {} 41227 value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 41228 key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); 41229 var stringifiedAttributes = ""; 41230 for (var attributeName in attributes) { 41231 if (!attributes[attributeName]) continue; 41232 stringifiedAttributes += "; " + attributeName; 41233 if (attributes[attributeName] === true) continue; 41234 stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; 41235 } 41236 return document.cookie = key + "=" + value + stringifiedAttributes; 41237 } 41238 function get(key, json) { 41239 if (typeof document === "undefined") return; 41240 var jar = {}; 41241 var cookies = document.cookie ? document.cookie.split("; ") : []; 41242 var i = 0; 41243 for (; i < cookies.length; i++) { 41244 var parts = cookies[i].split("="); 41245 var cookie = parts.slice(1).join("="); 41246 if (!json && cookie.charAt(0) === "\"") cookie = cookie.slice(1, -1); 41247 try { 41248 var name = decode(parts[0]); 41249 cookie = (converter.read || converter)(cookie, name) || decode(cookie); 41250 if (json) try { 41251 cookie = JSON.parse(cookie); 41252 } catch (e) {} 41253 jar[name] = cookie; 41254 if (key === name) break; 41255 } catch (e) {} 41256 } 41257 return key ? jar[key] : jar; 41258 } 41259 api.set = set; 41260 api.get = function(key) { 41261 return get(key, false); 41262 }; 41263 api.getJSON = function(key) { 41264 return get(key, true); 41265 }; 41266 api.remove = function(key, attributes) { 41267 set(key, "", extend(attributes, { expires: -1 })); 41268 }; 41269 api.defaults = {}; 41270 api.withConverter = init; 41271 return api; 41272 } 41273 return init(function() {}); 41274 }); 41275})); 41276//#endregion 41277//#region node_modules/amazon-cognito-identity-js/es/CookieStorage.js 41278var import_js_cookie, CookieStorage; 41279var init_CookieStorage = __esmMin((() => { 41280 import_js_cookie = /* @__PURE__ */ __toESM(require_js_cookie()); 41281 CookieStorage = /*#__PURE__*/ function() { 41282 /** 41283 * Constructs a new CookieStorage object 41284 * @param {object} data Creation options. 41285 * @param {string} data.domain Cookies domain (mandatory). 41286 * @param {string} data.path Cookies path (default: '/') 41287 * @param {integer} data.expires Cookie expiration (in days, default: 365) 41288 * @param {boolean} data.secure Cookie secure flag (default: true) 41289 * @param {string} data.sameSite Cookie request behaviour (default: null) 41290 */ 41291 function CookieStorage(data) { 41292 if (data.domain) this.domain = data.domain; 41293 else throw new Error("The domain of cookieStorage can not be undefined."); 41294 if (data.path) this.path = data.path; 41295 else this.path = "/"; 41296 if (Object.prototype.hasOwnProperty.call(data, "expires")) this.expires = data.expires; 41297 else this.expires = 365; 41298 if (Object.prototype.hasOwnProperty.call(data, "secure")) this.secure = data.secure; 41299 else this.secure = true; 41300 if (Object.prototype.hasOwnProperty.call(data, "sameSite")) { 41301 if (![ 41302 "strict", 41303 "lax", 41304 "none" 41305 ].includes(data.sameSite)) throw new Error("The sameSite value of cookieStorage must be \"lax\", \"strict\" or \"none\"."); 41306 if (data.sameSite === "none" && !this.secure) throw new Error("sameSite = None requires the Secure attribute in latest browser versions."); 41307 this.sameSite = data.sameSite; 41308 } else this.sameSite = null; 41309 } 41310 /** 41311 * This is used to set a specific item in storage 41312 * @param {string} key - the key for the item 41313 * @param {object} value - the value 41314 * @returns {string} value that was set 41315 */ 41316 var _proto = CookieStorage.prototype; 41317 _proto.setItem = function setItem(key, value) { 41318 var options = { 41319 path: this.path, 41320 expires: this.expires, 41321 domain: this.domain, 41322 secure: this.secure 41323 }; 41324 if (this.sameSite) options.sameSite = this.sameSite; 41325 import_js_cookie.set(key, value, options); 41326 return import_js_cookie.get(key); 41327 }; 41328 _proto.getItem = function getItem(key) { 41329 return import_js_cookie.get(key); 41330 }; 41331 _proto.removeItem = function removeItem(key) { 41332 var options = { 41333 path: this.path, 41334 expires: this.expires, 41335 domain: this.domain, 41336 secure: this.secure 41337 }; 41338 if (this.sameSite) options.sameSite = this.sameSite; 41339 return import_js_cookie.remove(key, options); 41340 }; 41341 _proto.clear = function clear() { 41342 var cookies = import_js_cookie.get(); 41343 var numKeys = Object.keys(cookies).length; 41344 for (var index = 0; index < numKeys; ++index) this.removeItem(Object.keys(cookies)[index]); 41345 return {}; 41346 }; 41347 return CookieStorage; 41348 }(); 41349})); 41350//#endregion 41351//#region node_modules/amazon-cognito-identity-js/es/index.js 41352var es_exports = /* @__PURE__ */ __exportAll({
41353 AuthenticationDetails: () => AuthenticationDetails, 41354 AuthenticationHelper: () => AuthenticationHelper, 41355 CognitoAccessToken: () => CognitoAccessToken, 41356 CognitoIdToken: () => CognitoIdToken, 41357 CognitoRefreshToken: () => CognitoRefreshToken, 41358 CognitoUser: () => CognitoUser, 41359 CognitoUserAttribute: () => CognitoUserAttribute, 41360 CognitoUserPool: () => CognitoUserPool, 41361 CognitoUserSession: () => CognitoUserSession, 41362 CookieStorage: () => CookieStorage, 41363 DateHelper: () => DateHelper, 41364 WordArray: () => WordArray, 41365 appendToCognitoUserAgent: () => appendToCognitoUserAgent 41366}); 41367var init_es = __esmMin((() => { 41368 init_AuthenticationDetails(); 41369 init_AuthenticationHelper(); 41370 init_CognitoAccessToken(); 41371 init_CognitoIdToken(); 41372 init_CognitoRefreshToken(); 41373 init_CognitoUser(); 41374 init_CognitoUserAttribute(); 41375 init_CognitoUserPool(); 41376 init_CognitoUserSession(); 41377 init_CookieStorage(); 41378 init_DateHelper(); 41379 init_UserAgent(); 41380 init_WordArray(); 41381})); 41382/*! 41383* Copyright 2016 Amazon.com, 41384* Inc. or its affiliates. All Rights Reserved. 41385* 41386* Licensed under the Amazon Software License (the "License"). 41387* You may not use this file except in compliance with the 41388* License. A copy of the License is located at 41389* 41390* http://aws.amazon.com/asl/ 41391* 41392* or in the "license" file accompanying this file. This file is 41393* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 41394* CONDITIONS OF ANY KIND, express or implied. See the License 41395* for the specific language governing permissions and 41396* limitations under the License. 41397*/ 41398//#endregion 41399//#region node_modules/@okta/okta-auth-js/dist/okta-auth-js.umd.js 41400var require_okta_auth_js_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => { 41401 /*! 41402 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 41403 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 41404 * 41405 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 41406 * Unless required by applicable law or agreed to in writing, software 41407 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 41408 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41409 * 41410 * See the License for the specific language governing permissions and limitations under the License. 41411 * 41412 */ 41413 (function(e, t) { 41414 "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.OktaAuth = t() : e.OktaAuth = t(); 41415 })(window, (function() { 41416 return function(e) { 41417 var t = {}; 41418 function n(r) { 41419 if (t[r]) return t[r].exports; 41420 var o = t[r] = { 41421 i: r, 41422 l: !1, 41423 exports: {} 41424 }; 41425 return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports; 41426 } 41427 return n.m = e, n.c = t, n.d = function(e, t, r) { 41428 n.o(e, t) || Object.defineProperty(e, t, { 41429 enumerable: !0, 41430 get: r 41431 }); 41432 }, n.r = function(e) { 41433 "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); 41434 }, n.t = function(e, t) { 41435 if (1 & t && (e = n(e)), 8 & t) return e; 41436 if (4 & t && "object" == typeof e && e && e.__esModule) return e; 41437 var r = Object.create(null); 41438 if (n.r(r), Object.defineProperty(r, "default", { 41439 enumerable: !0, 41440 value: e 41441 }), 2 & t && "string" != typeof e) for (var o in e) n.d(r, o, function(t) { 41442 return e[t]; 41443 }.bind(null, o)); 41444 return r; 41445 }, n.n = function(e) { 41446 var t = e && e.__esModule ? function() { 41447 return e.default; 41448 } : function() { 41449 return e; 41450 }; 41451 return n.d(t, "a", t), t; 41452 }, n.o = function(e, t) { 41453 return Object.prototype.hasOwnProperty.call(e, t); 41454 }, n.p = "", n(n.s = 27); 41455 }([ 41456 function(e, t) { 41457 e.exports = function(e, t) { 41458 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); 41459 }; 41460 }, 41461 function(e, t, n) { 41462 e.exports = n(14); 41463 }, 41464 function(e, t) { 41465 e.exports = function(e) { 41466 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 41467 return e; 41468 }; 41469 }, 41470 function(e, t) { 41471 function n(t) { 41472 return e.exports = n = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { 41473 return e.__proto__ || Object.getPrototypeOf(e); 41474 }, n(t); 41475 } 41476 e.exports = n; 41477 }, 41478 function(e, t) { 41479 function n(e, t) { 41480 for (var n = 0; n < t.length; n++) { 41481 var r = t[n]; 41482 r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); 41483 } 41484 } 41485 e.exports = function(e, t, r) { 41486 return t && n(e.prototype, t), r && n(e, r), e; 41487 }; 41488 }, 41489 function(e, t, n) { 41490 var r = n(9); 41491 e.exports = function(e, t) { 41492 if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
41493 e.prototype = Object.create(t && t.prototype, { constructor: { 41494 value: e, 41495 writable: !0, 41496 configurable: !0 41497 } }), t && r(e, t); 41498 }; 41499 }, 41500 function(e, t, n) { 41501 var r = n(7), o = n(2); 41502 e.exports = function(e, t) { 41503 return !t || "object" !== r(t) && "function" != typeof t ? o(e) : t; 41504 }; 41505 }, 41506 function(e, t) { 41507 function n(t) { 41508 return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? e.exports = n = function(e) { 41509 return typeof e; 41510 } : e.exports = n = function(e) { 41511 return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; 41512 }, n(t); 41513 } 41514 e.exports = n; 41515 }, 41516 function(e, t) { 41517 e.exports = function(e, t, n) { 41518 return t in e ? Object.defineProperty(e, t, { 41519 value: n, 41520 enumerable: !0, 41521 configurable: !0, 41522 writable: !0 41523 }) : e[t] = n, e; 41524 }; 41525 }, 41526 function(e, t) { 41527 function n(t, r) { 41528 return e.exports = n = Object.setPrototypeOf || function(e, t) { 41529 return e.__proto__ = t, e; 41530 }, n(t, r); 41531 } 41532 e.exports = n; 41533 }, 41534 function(e, t, n) { 41535 var r = n(3), o = n(9), i = n(15), a = n(16); 41536 function s(t) { 41537 var n = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; 41538 return e.exports = s = function(e) { 41539 if (null === e || !i(e)) return e; 41540 if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function"); 41541 if (void 0 !== n) { 41542 if (n.has(e)) return n.get(e); 41543 n.set(e, t); 41544 } 41545 function t() { 41546 return a(e, arguments, r(this).constructor); 41547 } 41548 return t.prototype = Object.create(e.prototype, { constructor: { 41549 value: t, 41550 enumerable: !1, 41551 writable: !0, 41552 configurable: !0 41553 } }), o(t, e); 41554 }, s(t); 41555 } 41556 e.exports = s; 41557 }, 41558 function(e, t, n) { 41559 "use strict"; 41560 (function(e) { 41561 var r = n(7), o = n.n(r), i = n(12), a = n.n(i); 41562 t.a = function(t, n, r) { 41563 var i = r.data, s = r.headers || {}; 41564 "application/json" === (s["Content-Type"] || s["content-type"] || "") && i && "string" != typeof i && (i = JSON.stringify(i)); 41565 var u = (e.fetch || a.a)(n, { 41566 method: t, 41567 headers: r.headers, 41568 body: i, 41569 credentials: r.withCredentials ? "include" : "omit" 41570 }); 41571 return u.finally || (u = Promise.resolve(u)), u.then((function(e) { 41572 var t = !e.ok, n = e.status; 41573 /*! 41574 * Copyright (c) 2018-present, Okta, Inc. and/or its affiliates. All rights reserved. 41575 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 41576 * 41577 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 41578 * Unless required by applicable law or agreed to in writing, software 41579 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 41580 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 41581 * 41582 * See the License for the specific language governing permissions and limitations under the License. 41583 */ 41584 return function(e) { 41585 return e.headers.get("Content-Type") && e.headers.get("Content-Type").toLowerCase().indexOf("application/json") >= 0 ? e.json().catch((function(e) { 41586 return { 41587 error: e, 41588 errorSummary: "Could not parse server response" 41589 }; 41590 })) : e.text(); 41591 }(e).then((function(e) { 41592 return function(e, t) { 41593 var n = "object" === o()(t), r = { 41594 responseText: n ? JSON.stringify(t) : t, 41595 status: e 41596 }; 41597 return n && (r.responseType = "json", r.responseJSON = t), r; 41598 }(n, e); 41599 })).then((function(e) { 41600 if (t) throw e; 41601 return e; 41602 })); 41603 })); 41604 }; 41605 }).call(this, n(18)); 41606 }, 41607 function(e, t) { 41608 var n = function(e) { 41609 function t() { 41610 this.fetch = !1, this.DOMException = e.DOMException; 41611 } 41612 return t.prototype = e, new t(); 41613 }("undefined" != typeof self ? self : this); 41614 (function(e) { 41615 (function(t) { 41616 var n = "URLSearchParams" in e, r = "Symbol" in e && "iterator" in Symbol, o = "FileReader" in e && "Blob" in e && function() { 41617 try { 41618 return new Blob(), !0; 41619 } catch (e) { 41620 return !1; 41621 } 41622 }(), i = "FormData" in e, a = "ArrayBuffer" in e; 41623 if (a) var s = [ 41624 "[object Int8Array]", 41625 "[object Uint8Array]", 41626 "[object Uint8ClampedArray]", 41627 "[object Int16Array]", 41628 "[object Uint16Array]", 41629 "[object Int32Array]", 41630 "[object Uint32Array]", 41631 "[object Float32Array]",
41632 "[object Float64Array]" 41633 ], u = ArrayBuffer.isView || function(e) { 41634 return e && s.indexOf(Object.prototype.toString.call(e)) > -1; 41635 }; 41636 function c(e) { 41637 if ("string" != typeof e && (e = String(e)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)) throw new TypeError("Invalid character in header field name"); 41638 return e.toLowerCase(); 41639 } 41640 function f(e) { 41641 return "string" != typeof e && (e = String(e)), e; 41642 } 41643 function l(e) { 41644 var t = { next: function() { 41645 var t = e.shift(); 41646 return { 41647 done: void 0 === t, 41648 value: t 41649 }; 41650 } }; 41651 return r && (t[Symbol.iterator] = function() { 41652 return t; 41653 }), t; 41654 } 41655 function h(e) { 41656 this.map = {}, e instanceof h ? e.forEach((function(e, t) { 41657 this.append(t, e); 41658 }), this) : Array.isArray(e) ? e.forEach((function(e) { 41659 this.append(e[0], e[1]); 41660 }), this) : e && Object.getOwnPropertyNames(e).forEach((function(t) { 41661 this.append(t, e[t]); 41662 }), this); 41663 } 41664 function d(e) { 41665 if (e.bodyUsed) return Promise.reject(/* @__PURE__ */ new TypeError("Already read")); 41666 e.bodyUsed = !0; 41667 } 41668 function p(e) { 41669 return new Promise((function(t, n) { 41670 e.onload = function() { 41671 t(e.result); 41672 }, e.onerror = function() { 41673 n(e.error); 41674 }; 41675 })); 41676 } 41677 function g(e) { 41678 var t = new FileReader(), n = p(t); 41679 return t.readAsArrayBuffer(e), n; 41680 } 41681 function v(e) { 41682 if (e.slice) return e.slice(0); 41683 var t = new Uint8Array(e.byteLength); 41684 return t.set(new Uint8Array(e)), t.buffer; 41685 } 41686 function y() { 41687 return this.bodyUsed = !1, this._initBody = function(e) { 41688 var t; 41689 this._bodyInit = e, e ? "string" == typeof e ? this._bodyText = e : o && Blob.prototype.isPrototypeOf(e) ? this._bodyBlob = e : i && FormData.prototype.isPrototypeOf(e) ? this._bodyFormData = e : n && URLSearchParams.prototype.isPrototypeOf(e) ? this._bodyText = e.toString() : a && o && (t = e) && DataView.prototype.isPrototypeOf(t) ? (this._bodyArrayBuffer = v(e.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a && (ArrayBuffer.prototype.isPrototypeOf(e) || u(e)) ? this._bodyArrayBuffer = v(e) : this._bodyText = e = Object.prototype.toString.call(e) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : n && URLSearchParams.prototype.isPrototypeOf(e) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8")); 41690 }, o && (this.blob = function() { 41691 var e = d(this); 41692 if (e) return e; 41693 if (this._bodyBlob) return Promise.resolve(this._bodyBlob); 41694 if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer])); 41695 if (this._bodyFormData) throw new Error("could not read FormData body as blob"); 41696 return Promise.resolve(new Blob([this._bodyText])); 41697 }, this.arrayBuffer = function() { 41698 return this._bodyArrayBuffer ? d(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(g); 41699 }), this.text = function() { 41700 var e, t, n, r = d(this); 41701 if (r) return r; 41702 if (this._bodyBlob) return e = this._bodyBlob, t = new FileReader(), n = p(t), t.readAsText(e), n; 41703 if (this._bodyArrayBuffer) return Promise.resolve(function(e) { 41704 for (var t = new Uint8Array(e), n = new Array(t.length), r = 0; r < t.length; r++) n[r] = String.fromCharCode(t[r]); 41705 return n.join(""); 41706 }(this._bodyArrayBuffer)); 41707 if (this._bodyFormData) throw new Error("could not read FormData body as text"); 41708 return Promise.resolve(this._bodyText); 41709 }, i && (this.formData = function() { 41710 return this.text().then(w); 41711 }), this.json = function() { 41712 return this.text().then(JSON.parse); 41713 }, this; 41714 } 41715 h.prototype.append = function(e, t) { 41716 e = c(e), t = f(t); 41717 var n = this.map[e]; 41718 this.map[e] = n ? n + ", " + t : t; 41719 }, h.prototype.delete = function(e) { 41720 delete this.map[c(e)]; 41721 }, h.prototype.get = function(e) { 41722 return e = c(e), this.has(e) ? this.map[e] : null; 41723 }, h.prototype.has = function(e) { 41724 return this.map.hasOwnProperty(c(e)); 41725 }, h.prototype.set = function(e, t) { 41726 this.map[c(e)] = f(t); 41727 }, h.prototype.forEach = function(e, t) { 41728 for (var n in this.map) this.map.hasOwnProperty(n) && e.call(t, this.map[n], n, this); 41729 }, h.prototype.keys = function() { 41730 var e = []; 41731 return this.forEach((function(t, n) { 41732 e.push(n); 41733 })), l(e); 41734 }, h.prototype.values = function() { 41735 var e = []; 41736 return this.forEach((function(t) { 41737 e.push(t); 41738 })), l(e); 41739 }, h.prototype.entries = function() { 41740 var e = []; 41741 return this.forEach((function(t, n) { 41742 e.push([n, t]); 41743 })), l(e); 41744 }, r && (h.prototype[Symbol.iterator] = h.prototype.entries); 41745 var m = [
41746 "DELETE", 41747 "GET", 41748 "HEAD", 41749 "OPTIONS", 41750 "POST", 41751 "PUT" 41752 ]; 41753 function k(e, t) { 41754 var n, r, o = (t = t || {}).body; 41755 if (e instanceof k) { 41756 if (e.bodyUsed) throw new TypeError("Already read"); 41757 this.url = e.url, this.credentials = e.credentials, t.headers || (this.headers = new h(e.headers)), this.method = e.method, this.mode = e.mode, this.signal = e.signal, o || null == e._bodyInit || (o = e._bodyInit, e.bodyUsed = !0); 41758 } else this.url = String(e); 41759 if (this.credentials = t.credentials || this.credentials || "same-origin", !t.headers && this.headers || (this.headers = new h(t.headers)), this.method = (n = t.method || this.method || "GET", r = n.toUpperCase(), m.indexOf(r) > -1 ? r : n), this.mode = t.mode || this.mode || null, this.signal = t.signal || this.signal, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && o) throw new TypeError("Body not allowed for GET or HEAD requests"); 41760 this._initBody(o); 41761 } 41762 function w(e) { 41763 var t = new FormData(); 41764 return e.trim().split("&").forEach((function(e) { 41765 if (e) { 41766 var n = e.split("="), r = n.shift().replace(/\+/g, " "), o = n.join("=").replace(/\+/g, " "); 41767 t.append(decodeURIComponent(r), decodeURIComponent(o)); 41768 } 41769 })), t; 41770 } 41771 function T(e, t) { 41772 t || (t = {}), this.type = "default", this.status = void 0 === t.status ? 200 : t.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in t ? t.statusText : "OK", this.headers = new h(t.headers), this.url = t.url || "", this._initBody(e); 41773 } 41774 k.prototype.clone = function() { 41775 return new k(this, { body: this._bodyInit }); 41776 }, y.call(k.prototype), y.call(T.prototype), T.prototype.clone = function() { 41777 return new T(this._bodyInit, { 41778 status: this.status, 41779 statusText: this.statusText, 41780 headers: new h(this.headers), 41781 url: this.url 41782 }); 41783 }, T.error = function() { 41784 var e = new T(null, { 41785 status: 0, 41786 statusText: "" 41787 }); 41788 return e.type = "error", e; 41789 }; 41790 var b = [ 41791 301, 41792 302, 41793 303, 41794 307, 41795 308 41796 ]; 41797 T.redirect = function(e, t) { 41798 if (-1 === b.indexOf(t)) throw new RangeError("Invalid status code"); 41799 return new T(null, { 41800 status: t, 41801 headers: { location: e } 41802 }); 41803 }, t.DOMException = e.DOMException; 41804 try { 41805 new t.DOMException(); 41806 } catch (e) { 41807 t.DOMException = function(e, t) { 41808 this.message = e, this.name = t; 41809 var n = Error(e); 41810 this.stack = n.stack; 41811 }, t.DOMException.prototype = Object.create(Error.prototype), t.DOMException.prototype.constructor = t.DOMException; 41812 } 41813 function S(e, n) { 41814 return new Promise((function(r, i) { 41815 var a = new k(e, n); 41816 if (a.signal && a.signal.aborted) return i(new t.DOMException("Aborted", "AbortError")); 41817 var s = new XMLHttpRequest(); 41818 function u() { 41819 s.abort(); 41820 } 41821 s.onload = function() { 41822 var e, t, n = { 41823 status: s.status, 41824 statusText: s.statusText, 41825 headers: (e = s.getAllResponseHeaders() || "", t = new h(), e.replace(/\r?\n[\t ]+/g, " ").split(/\r?\n/).forEach((function(e) { 41826 var n = e.split(":"), r = n.shift().trim(); 41827 if (r) { 41828 var o = n.join(":").trim(); 41829 t.append(r, o); 41830 } 41831 })), t) 41832 }; 41833 n.url = "responseURL" in s ? s.responseURL : n.headers.get("X-Request-URL"); 41834 r(new T("response" in s ? s.response : s.responseText, n)); 41835 }, s.onerror = function() { 41836 i(/* @__PURE__ */ new TypeError("Network request failed")); 41837 }, s.ontimeout = function() { 41838 i(/* @__PURE__ */ new TypeError("Network request failed")); 41839 }, s.onabort = function() { 41840 i(new t.DOMException("Aborted", "AbortError")); 41841 }, s.open(a.method, a.url, !0), "include" === a.credentials ? s.withCredentials = !0 : "omit" === a.credentials && (s.withCredentials = !1), "responseType" in s && o && (s.responseType = "blob"), a.headers.forEac
41841h((function(e, t) { 41842 s.setRequestHeader(t, e); 41843 })), a.signal && (a.signal.addEventListener("abort", u), s.onreadystatechange = function() { 41844 4 === s.readyState && a.signal.removeEventListener("abort", u); 41845 }), s.send(void 0 === a._bodyInit ? null : a._bodyInit); 41846 })); 41847 } 41848 S.polyfill = !0, e.fetch || (e.fetch = S, e.Headers = h, e.Request = k, e.Response = T), t.Headers = h, t.Request = k, t.Response = T, t.fetch = S; 41849 })({}); 41850 })(n), delete n.fetch.polyfill, (t = n.fetch).default = n.fetch, t.fetch = n.fetch, t.Headers = n.Headers, t.Request = n.Request, t.Response = n.Response, e.exports = t; 41851 }, 41852 function(e, t, n) { 41853 var r = n(20), o = n(21), i = n(22), a = n(24); 41854 e.exports = function(e, t) { 41855 return r(e) || o(e, t) || i(e, t) || a(); 41856 }; 41857 }, 41858 function(e, t, n) { 41859 var r = function(e) { 41860 "use strict"; 41861 var t = Object.prototype, n = t.hasOwnProperty, r = "function" == typeof Symbol ? Symbol : {}, o = r.iterator || "@@iterator", i = r.asyncIterator || "@@asyncIterator", a = r.toStringTag || "@@toStringTag"; 41862 function s(e, t, n, r) { 41863 var o = t && t.prototype instanceof f ? t : f, i = Object.create(o.prototype); 41864 return i._invoke = function(e, t, n) { 41865 var r = "suspendedStart"; 41866 return function(o, i) { 41867 if ("executing" === r) throw new Error("Generator is already running"); 41868 if ("completed" === r) { 41869 if ("throw" === o) throw i; 41870 return O(); 41871 } 41872 for (n.method = o, n.arg = i;;) { 41873 var a = n.delegate; 41874 if (a) { 41875 var s = k(a, n); 41876 if (s) { 41877 if (s === c) continue; 41878 return s; 41879 } 41880 } 41881 if ("next" === n.method) n.sent = n._sent = n.arg; 41882 else if ("throw" === n.method) { 41883 if ("suspendedStart" === r) throw r = "completed", n.arg; 41884 n.dispatchException(n.arg); 41885 } else "return" === n.method && n.abrupt("return", n.arg); 41886 r = "executing"; 41887 var f = u(e, t, n); 41888 if ("normal" === f.type) { 41889 if (r = n.done ? "completed" : "suspendedYield", f.arg === c) continue; 41890 return { 41891 value: f.arg, 41892 done: n.done 41893 }; 41894 } 41895 "throw" === f.type && (r = "completed", n.method = "throw", n.arg = f.arg); 41896 } 41897 }; 41898 }(e, n, new b(r || [])), i; 41899 } 41900 function u(e, t, n) { 41901 try { 41902 return { 41903 type: "normal", 41904 arg: e.call(t, n) 41905 }; 41906 } catch (e) { 41907 return { 41908 type: "throw", 41909 arg: e 41910 }; 41911 } 41912 } 41913 e.wrap = s; 41914 var c = {}; 41915 function f() {} 41916 function l() {} 41917 function h() {} 41918 var d = {}; 41919 d[o] = function() { 41920 return this; 41921 }; 41922 var p = Object.getPrototypeOf, g = p && p(p(S([]))); 41923 g && g !== t && n.call(g, o) && (d = g); 41924 var v = h.prototype = f.prototype = Object.create(d); 41925 function y(e) { 41926 [ 41927 "next", 41928 "throw", 41929 "return" 41930 ].forEach((function(t) { 41931 e[t] = function(e) { 41932 return this._invoke(t, e); 41933 }; 41934 })); 41935 } 41936 function m(e, t) { 41937 var r; 41938 this._invoke = function(o, i) { 41939 function a() { 41940 return new t((function(r, a) { 41941 (function r(o, i, a, s) { 41942 var c = u(e[o], e, i); 41943 if ("throw" !== c.type) { 41944 var f = c.arg, l = f.value; 41945 return l && "object" == typeof l && n.call(l, "__await") ? t.resolve(l.__await).then((function(e) { 41946 r("next", e, a, s); 41947 }), (function(e) { 41948 r("throw", e, a, s); 41949 })) : t.resolve(l).then((function(e) { 41950 f.value = e, a(f); 41951 }), (function(e) { 41952 return r("throw", e, a, s); 41953 })); 41954 } 41955 s(c.arg); 41956 })(o, i, r, a); 41957 })); 41958 } 41959 return r = r ? r.then(a, a) : a(); 41960 }; 41961 } 41962 function k(e, t) { 41963 var n = e.iterator[t.method]; 41964 if (void 0 === n) { 41965 if (t.delegate = null, "throw" === t.method) { 41966 if (e.iterator.return && (t.method = "return", t.arg = void 0, k(e, t), "throw" === t.method)) return c; 41967 t.method = "throw", t.arg = /* @__PURE__ */ new TypeError("The iterator does not provide a 'throw' method"); 41968 } 41969 return c; 41970 } 41971 var r = u(n, e.iterator, t.arg); 41972 if ("throw" === r.type) return t.method = "throw", t.arg = r.arg, t.delegate = null, c; 41973 var o = r.arg;
vendor: 5,349 bytes, lines 41974-42099
41974 return o ? o.done ? (t[e.resultName] = o.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = void 0), t.delegate = null, c) : o : (t.method = "throw", t.arg = /* @__PURE__ */ new TypeError("iterator result is not an object"), t.delegate = null, c); 41975 } 41976 function w(e) { 41977 var t = { tryLoc: e[0] }; 41978 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t); 41979 } 41980 function T(e) { 41981 var t = e.completion || {}; 41982 t.type = "normal", delete t.arg, e.completion = t; 41983 } 41984 function b(e) { 41985 this.tryEntries = [{ tryLoc: "root" }], e.forEach(w, this), this.reset(!0); 41986 } 41987 function S(e) { 41988 if (e) { 41989 var t = e[o]; 41990 if (t) return t.call(e); 41991 if ("function" == typeof e.next) return e; 41992 if (!isNaN(e.length)) { 41993 var r = -1, i = function t() { 41994 for (; ++r < e.length;) if (n.call(e, r)) return t.value = e[r], t.done = !1, t; 41995 return t.value = void 0, t.done = !0, t; 41996 }; 41997 return i.next = i; 41998 } 41999 } 42000 return { next: O }; 42001 } 42002 function O() { 42003 return { 42004 value: void 0, 42005 done: !0 42006 }; 42007 } 42008 return l.prototype = v.constructor = h, h.constructor = l, h[a] = l.displayName = "GeneratorFunction", e.isGeneratorFunction = function(e) { 42009 var t = "function" == typeof e && e.constructor; 42010 return !!t && (t === l || "GeneratorFunction" === (t.displayName || t.name)); 42011 }, e.mark = function(e) { 42012 return Object.setPrototypeOf ? Object.setPrototypeOf(e, h) : (e.__proto__ = h, a in e || (e[a] = "GeneratorFunction")), e.prototype = Object.create(v), e; 42013 }, e.awrap = function(e) { 42014 return { __await: e }; 42015 }, y(m.prototype), m.prototype[i] = function() { 42016 return this; 42017 }, e.AsyncIterator = m, e.async = function(t, n, r, o, i) { 42018 void 0 === i && (i = Promise); 42019 var a = new m(s(t, n, r, o), i); 42020 return e.isGeneratorFunction(n) ? a : a.next().then((function(e) { 42021 return e.done ? e.value : a.next(); 42022 })); 42023 }, y(v), v[a] = "Generator", v[o] = function() { 42024 return this; 42025 }, v.toString = function() { 42026 return "[object Generator]"; 42027 }, e.keys = function(e) { 42028 var t = []; 42029 for (var n in e) t.push(n); 42030 return t.reverse(), function n() { 42031 for (; t.length;) { 42032 var r = t.pop(); 42033 if (r in e) return n.value = r, n.done = !1, n; 42034 } 42035 return n.done = !0, n; 42036 }; 42037 }, e.values = S, b.prototype = { 42038 constructor: b, 42039 reset: function(e) { 42040 if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(T), !e) for (var t in this) "t" === t.charAt(0) && n.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0); 42041 }, 42042 stop: function() { 42043 this.done = !0; 42044 var e = this.tryEntries[0].completion; 42045 if ("throw" === e.type) throw e.arg; 42046 return this.rval; 42047 }, 42048 dispatchException: function(e) { 42049 if (this.done) throw e; 42050 var t = this; 42051 function r(n, r) { 42052 return a.type = "throw", a.arg = e, t.next = n, r && (t.method = "next", t.arg = void 0), !!r; 42053 } 42054 for (var o = this.tryEntries.length - 1; o >= 0; --o) { 42055 var i = this.tryEntries[o], a = i.completion; 42056 if ("root" === i.tryLoc) return r("end"); 42057 if (i.tryLoc <= this.prev) { 42058 var s = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); 42059 if (s && u) { 42060 if (this.prev < i.catchLoc) return r(i.catchLoc, !0); 42061 if (this.prev < i.finallyLoc) return r(i.finallyLoc); 42062 } else if (s) { 42063 if (this.prev < i.catchLoc) return r(i.catchLoc, !0); 42064 } else { 42065 if (!u) throw new Error("try statement without catch or finally"); 42066 if (this.prev < i.finallyLoc) return r(i.finallyLoc); 42067 } 42068 } 42069 } 42070 }, 42071 abrupt: function(e, t) { 42072 for (var r = this.tryEntries.length - 1; r >= 0; --r) { 42073 var o = this.tryEntries[r]; 42074 if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { 42075 var i = o; 42076 break; 42077 } 42078 } 42079 i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null); 42080 var a = i ? i.completion : {}; 42081 return a.type = e, a.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, c) : this.complete(a); 42082 }, 42083 complete: function(e, t) { 42084 if ("throw" === e.type) throw e.arg; 42085 return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), c; 42086 }, 42087 finish: function(e) { 42088 for (var t = this.tryEntries.length - 1; t >= 0; --t) { 42089 var n = this.tryEntries[t]; 42090 if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), T(n), c; 42091 } 42092 }, 42093 catch: function(e) { 42094 for (var t = this.tryEntries.length - 1; t >= 0; --t) { 42095 var n = this.tryEntries[t]; 42096 if (n.tryLoc === e) { 42097 var r = n.completion; 42098 if ("throw" === r.type) { 42099 var o = r.arg;
42100 T(n); 42101 } 42102 return o; 42103 } 42104 } 42105 throw new Error("illegal catch attempt"); 42106 }, 42107 delegateYield: function(e, t, n) { 42108 return this.delegate = { 42109 iterator: S(e), 42110 resultName: t, 42111 nextLoc: n 42112 }, "next" === this.method && (this.arg = void 0), c; 42113 } 42114 }, e; 42115 }(e.exports); 42116 try { 42117 regeneratorRuntime = r; 42118 } catch (e) { 42119 Function("r", "regeneratorRuntime = r")(r); 42120 } 42121 }, 42122 function(e, t) { 42123 e.exports = function(e) { 42124 return -1 !== Function.toString.call(e).indexOf("[native code]"); 42125 }; 42126 }, 42127 function(e, t, n) { 42128 var r = n(9), o = n(17); 42129 function i(t, n, a) { 42130 return o() ? e.exports = i = Reflect.construct : e.exports = i = function(e, t, n) { 42131 var o = [null]; 42132 o.push.apply(o, t); 42133 var i = new (Function.bind.apply(e, o))(); 42134 return n && r(i, n.prototype), i; 42135 }, i.apply(null, arguments); 42136 } 42137 e.exports = i; 42138 }, 42139 function(e, t) { 42140 e.exports = function() { 42141 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 42142 if (Reflect.construct.sham) return !1; 42143 if ("function" == typeof Proxy) return !0; 42144 try { 42145 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 42146 } catch (e) { 42147 return !1; 42148 } 42149 }; 42150 }, 42151 function(e, t) { 42152 var n = function() { 42153 return this; 42154 }(); 42155 try { 42156 n = n || new Function("return this")(); 42157 } catch (e) { 42158 "object" == typeof window && (n = window); 42159 } 42160 e.exports = n; 42161 }, 42162 function(e, t, n) { 42163 var r, o; 42164 /*! 42165 * JavaScript Cookie v2.2.1 42166 * https://github.com/js-cookie/js-cookie 42167 * 42168 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 42169 * Released under the MIT license 42170 */ (function(i) { 42171 if (void 0 === (o = "function" == typeof (r = i) ? r.call(t, n, t, e) : r) || (e.exports = o), e.exports = i(), false); 42172 })((function() { 42173 function e() { 42174 for (var e = 0, t = {}; e < arguments.length; e++) { 42175 var n = arguments[e]; 42176 for (var r in n) t[r] = n[r]; 42177 } 42178 return t; 42179 } 42180 function t(e) { 42181 return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); 42182 } 42183 return function n(r) { 42184 function o() {} 42185 function i(t, n, i) { 42186 if ("undefined" != typeof document) { 42187 "number" == typeof (i = e({ path: "/" }, o.defaults, i)).expires && (i.expires = /* @__PURE__ */ new Date(1 * /* @__PURE__ */ new Date() + 864e5 * i.expires)), i.expires = i.expires ? i.expires.toUTCString() : ""; 42188 try { 42189 var a = JSON.stringify(n); 42190 /^[\{\[]/.test(a) && (n = a); 42191 } catch (e) {} 42192 n = r.write ? r.write(n, t) : encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), t = encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); 42193 var s = ""; 42194 for (var u in i) i[u] && (s += "; " + u, !0 !== i[u] && (s += "=" + i[u].split(";")[0])); 42195 return document.cookie = t + "=" + n + s; 42196 } 42197 } 42198 function a(e, n) { 42199 if ("undefined" != typeof document) { 42200 for (var o = {}, i = document.cookie ? document.cookie.split("; ") : [], a = 0; a < i.length; a++) { 42201 var s = i[a].split("="), u = s.slice(1).join("="); 42202 n || "\"" !== u.charAt(0) || (u = u.slice(1, -1)); 42203 try { 42204 var c = t(s[0]); 42205 if (u = (r.read || r)(u, c) || t(u), n) try { 42206 u = JSON.parse(u); 42207 } catch (e) {} 42208 if (o[c] = u, e === c) break; 42209 } catch (e) {} 42210 } 42211 return e ? o[e] : o; 42212 } 42213 } 42214 return o.set = i, o.get = function(e) { 42215 return a(e, !1); 42216 }, o.getJSON = function(e) { 42217 return a(e, !0); 42218 }, o.remove = function(t, n) { 42219 i(t, "", e(n, { expires: -1 })); 42220 }, o.defaults = {}, o.withConverter = n, o; 42221 }((function() {})); 42222 })); 42223 }, 42224 function(e, t) { 42225 e.exports = function(e) { 42226 if (Array.isArray(e)) return e; 42227 }; 42228 }, 42229 function(e, t) { 42230 e.exports = function(e, t) { 42231 if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) { 42232 var n = [], r = !0, o = !1, i = void 0; 42233 try { 42234 for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (n.push(a.value), !t || n.length !== t); r = !0); 42235 } catch (e) { 42236 o = !0, i = e; 42237 } finally { 42238 try { 42239 r || null == s.return || s.return(); 42240 } finally { 42241 if (o) throw i; 42242 } 42243 } 42244 return n; 42245 } 42246 }; 42247 }, 42248 function(e, t, n) { 42249 var r = n(23); 42250 e.exports = function(e, t) { 42251 if (e) { 42252 if ("string" == typeof e) return r(e, t); 42253 var n = Object.prototype.toString.call(e).slice(8, -1); 42254 return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? r(e, t) : void 0; 42255 } 42256 }; 42257 }, 42258 function(e, t) { 42259 e.exports = function(e, t) { 42260 (null == t || t > e.length) && (t = e.length); 42261 for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; 42262 return r; 42263 }; 42264 }, 42265 function(e, t) { 42266 e.exports = function() {
42267 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 42268 }; 42269 }, 42270 function(e, t, n) { 42271 "use strict"; 42272 var r = n(0), o = n(4), i = n(5), a = n(6), s = n(3); 42273 function u(e, t) { 42274 var n; 42275 if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) { 42276 if (Array.isArray(e) || (n = function(e, t) { 42277 if (!e) return; 42278 if ("string" == typeof e) return c(e, t); 42279 var n = Object.prototype.toString.call(e).slice(8, -1); 42280 "Object" === n && e.constructor && (n = e.constructor.name); 42281 if ("Map" === n || "Set" === n) return Array.from(e); 42282 if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return c(e, t); 42283 }(e)) || t && e && "number" == typeof e.length) { 42284 n && (e = n); 42285 var r = 0, o = function() {}; 42286 return { 42287 s: o, 42288 n: function() { 42289 return r >= e.length ? { done: !0 } : { 42290 done: !1, 42291 value: e[r++] 42292 }; 42293 }, 42294 e: function(e) { 42295 throw e; 42296 }, 42297 f: o 42298 }; 42299 } 42300 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 42301 } 42302 var i, a = !0, s = !1; 42303 return { 42304 s: function() { 42305 n = e[Symbol.iterator](); 42306 }, 42307 n: function() { 42308 var e = n.next(); 42309 return a = e.done, e; 42310 }, 42311 e: function(e) { 42312 s = !0, i = e; 42313 }, 42314 f: function() { 42315 try { 42316 a || null == n.return || n.return(); 42317 } finally { 42318 if (s) throw i; 42319 } 42320 } 42321 }; 42322 } 42323 function c(e, t) { 42324 (null == t || t > e.length) && (t = e.length); 42325 for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; 42326 return r; 42327 } 42328 function f(e) { 42329 var t = function() { 42330 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 42331 if (Reflect.construct.sham) return !1; 42332 if ("function" == typeof Proxy) return !0; 42333 try { 42334 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 42335 } catch (e) { 42336 return !1; 42337 } 42338 }(); 42339 return function() { 42340 var n, r = s(e); 42341 if (t) { 42342 var o = s(this).constructor; 42343 n = Reflect.construct(r, arguments, o); 42344 } else n = r.apply(this, arguments); 42345 return a(this, n); 42346 }; 42347 } 42348 var l = function(e) { 42349 i(n, e); 42350 var t = f(n); 42351 function n(e) { 42352 var o; 42353 return r(this, n), (o = t.call(this, e || "Promise was canceled")).name = "CancelError", o; 42354 } 42355 return o(n, [{ 42356 key: "isCanceled", 42357 get: function() { 42358 return !0; 42359 } 42360 }]), n; 42361 }(n(10)(Error)), h = function() { 42362 function e(t) { 42363 var n = this; 42364 r(this, e), this._cancelHandlers = [], this._isPending = !0, this._isCanceled = !1, this._rejectOnCancel = !0, this._promise = new Promise((function(e, r) { 42365 n._reject = r; 42366 var o = function(e) { 42367 if (!n._isPending) throw new Error("The `onCancel` handler was attached after the promise settled."); 42368 n._cancelHandlers.push(e); 42369 }; 42370 return Object.defineProperties(o, { shouldReject: { 42371 get: function() { 42372 return n._rejectOnCancel; 42373 }, 42374 set: function(e) { 42375 n._rejectOnCancel = e; 42376 } 42377 } }), t((function(t) { 42378 n._isPending = !1, e(t); 42379 }), (function(e) { 42380 n._isPending = !1, r(e); 42381 }), o); 42382 })); 42383 } 42384 return o(e, null, [{ 42385 key: "fn", 42386 value: function(t) { 42387 return function() { 42388 for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++) r[o] = arguments[o]; 42389 return new e((function(e, n, o) { 42390 r.push(o), t.apply(void 0, r).then(e, n); 42391 })); 42392 }; 42393 } 42394 }]), o(e, [ 42395 { 42396 key: "then", 42397 value: function(e, t) { 42398 return this._promise.then(e, t); 42399 } 42400 }, 42401 { 42402 key: "catch", 42403 value: function(e) { 42404 return this._promise.catch(e); 42405 } 42406 }, 42407 { 42408 key: "finally", 42409 value: function(e) { 42410 return this._promise.finally(e); 42411 } 42412 }, 42413 { 42414 key: "cancel", 42415 value: function(e) { 42416 if (this._isPending && !this._isCanceled) { 42417 if (this._cancelHandlers.length > 0) try { 42418 var t, n = u(this._cancelHandlers); 42419 try { 42420 for (n.s(); !(t = n.n()).done;) (0, t.value)(); 42421 } catch (e) { 42422 n.e(e); 42423 } finally { 42424 n.f(); 42425 } 42426 } catch (e) { 42427 this._reject(e); 42428 } 42429 this._isCanceled = !0, this._rejectOnCancel && this._reject(new l(e)); 42430 } 42431 } 42432 }, 42433 { 42434 key: "isCanceled", 42435 get: function() { 42436 return this._isCanceled; 42437 } 42438 } 42439 ]), e; 42440 }(); 42441 Object.setPrototypeOf(h.prototype, Promise.prototype), e.exports = h, e.exports.CancelError = l; 42442 }, 42443 function(e, t) { 42444 function n() {} 42445 n.prototype = { 42446 on: function(e, t, n) { 42447 var r = this.e || (this.e = {}); 42448 return (r[e] || (r[e] = [])).push({ 42449 fn: t, 42450 ctx: n 42451 }), this; 42452 }, 42453 once: function(e, t, n) { 42454 var r = this; 42455 function o() { 42456 r.off(e, o), t.apply(n, arguments); 42457 } 42458 return o._ = t, this.on(e, o, n); 42459 }, 42460 emit: function(e) { 42461 for (var t = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[e] || []).slice(), r = 0, o = n.length; r < o; r++) n[r].fn.apply(n[r].ctx, t); 42462 return this; 42463 }, 42464 off: function(e, t) { 42465 var n = this.e || (this.e = {}), r = n[e], o = []; 42466 if (r && t) for (var i = 0, a = r.length; i < a; i++) r[i].fn !== t && r[i].fn._ !== t && o.push(r[i]); 42467 return o.length ? n[e] = o : delete n[e], this; 42468 } 42469 }, e.exports = n; 42470 }, 42471 function(e, t, n) { 42472 "use strict"; 42473 n.r(t), n.d(t, "OktaAuth", (function() { 42474 return hr; 42475 })), n.d(t, "STATE_TOKEN_KEY_NAME", (function() { 42476 return ie; 42477 })), n.d(t, "DEFAULT_POLLING_DELAY", (function() { 42478 return ae; 42479 })), n.d(t, "DEFAULT_MAX_CLOCK_SKEW", (function() { 42480 return se; 42481 })), n.d(t, "DEFAULT_CACHE_DURATION", (function() { 42482 return ue; 42483 })), n.d(t, "REDIRECT_OAUTH_PARAMS_NAME", (function() { 42484 return ce; 42485 })), n.d(t, "REDIRECT_STATE_COOKIE_NAME", (function() { 42486 return fe; 42487 })), n.d(t, "REDIRECT_NONCE_COOKIE_NAME", (function() { 42488 return le; 42489 })), n.d(t, "TOKEN_STORAGE_NAME", (function() { 42490 return he; 42491 })), n.d(t, "CACHE_STORAGE_NAME", (function() { 42492 return de; 42493 })), n.d(t, "PKCE_STORAGE_NAME", (function() { 42494 return pe; 42495 })), n.d(t, "TRANSACTION_STORAGE_NAME", (function() { 42496 return ge; 42497 })), n.d(t, "ACCESS_TOKEN_STORAGE_KEY", (function() { 42498 return ve; 42499 })), n.d(t, "ID_TOKEN_STORAGE_KEY", (function() { 42500 return ye; 42501 })), n.d(t, "REFRESH_TOKEN_STORAGE_KEY", (function() { 42502 return me; 42503 })), n.d(t, "REFERRER_PATH_STORAGE_KEY", (function() { 42504 return ke; 42505 })), n.d(t, "MIN_VERIFIER_LENGTH", (function() { 42506 return we; 42507 })), n.d(t, "MAX_VERIFIER_LENGTH", (function() { 42508 return Te; 42509 })), n.d(t, "DEFAULT_CODE_CHALLENGE_METHOD", (function() { 42510 return be; 42511 })), n.d(t, "isOAuthTransactionMeta", (function() { 42512 return Ve; 42513 })), n.d(t, "isPKCETransactionMeta", (function() { 42514 return Ye; 42515 })), n.d(t, "isIdxTransactionMeta", (function() { 42516 return Xe; 42517 })), n.d(t, "isCustomAuthTransactionMeta", (function() { 42518 return $e; 42519 })), n.d(t, "isTransactionMeta", (function() { 42520 return Qe; 42521 })), n.d(t, "isToken", (function() { 42522 return Ze; 42523 })), n.d(t, "isAccessToken", (function() { 42524 return et; 42525 })), n.d(t, "isIDToken", (function() { 42526 return tt; 42527 })), n.d(t, "isRefreshToken", (function() { 42528 return nt; 42529 })), n.d(t, "transactionStatus", (function() { 42530 return je; 42531 })), n.d(t, "resumeTransaction", (function() { 42532 return Ie; 42533 })), n.d(t, "transactionExists", (function() { 42534 return Le; 42535 })), n.d(t, "postToTransaction", (function() { 42536 return Ne; 42537 })), n.d(t, "introspect", (function() { 42538 return Me; 42539 })), n.d(t, "AuthTransaction", (function() { 42540 return Ce; 42541 })), n.d(t, "getPollFn", (function() { 42542 return Pe; 42543 })), n.d(t, "TransactionState", (function() { 42544 return De; 42545 })), n.d(t, "addStateToken", (function() { 42546 return _e; 42547 })), n.d(t, "getStateToken", (function() { 42548 return Ee; 42549 })), n.d(t, "AuthApiError", (function() { 42550 return oe; 42551 })), n.d(t, "AuthPollStopError", (function() { 42552 return xe; 42553 })), n.d(t, "AuthSdkError", (function() { 42554 return S; 42555 })), n.d(t, "OAuthError", (function() { 42556 return Ge; 42557 })), n.d(t, "convertTokenParamsToOAuthParams", (function() { 42558 return St; 42559 })), n.d(t, "buildAuthorizeParams", (function() { 42560 return Ot; 42561 })), n.d(t, "postToTokenEndpoint", (function() { 42562 return At; 42563 })), n.d(t, "postRefreshToken", (function() { 42564 return xt; 42565 }
42565)), n.d(t, "getWellKnown", (function() { 42566 return Pt; 42567 })), n.d(t, "getKey", (function() { 42568 return Ct; 42569 })), n.d(t, "addListener", (function() { 42570 return Rt; 42571 })), n.d(t, "removeListener", (function() { 42572 return Ut; 42573 })), n.d(t, "loadFrame", (function() { 42574 return jt; 42575 })), n.d(t, "loadPopup", (function() { 42576 return It; 42577 })), n.d(t, "addPostMessageListener", (function() { 42578 return Mt; 42579 })), n.d(t, "getDefaultTokenParams", (function() { 42580 return Ft; 42581 })), n.d(t, "isInteractionRequiredError", (function() { 42582 return Ht; 42583 })), n.d(t, "isAuthorizationCodeError", (function() { 42584 return Kt; 42585 })), n.d(t, "hasTokensInHash", (function() { 42586 return qt; 42587 })), n.d(t, "hasAuthorizationCode", (function() { 42588 return Bt; 42589 })), n.d(t, "hasInteractionCode", (function() { 42590 return Gt; 42591 })), n.d(t, "hasErrorInUrl", (function() { 42592 return Wt; 42593 })), n.d(t, "isRedirectUri", (function() { 42594 return zt; 42595 })), n.d(t, "isCodeFlow", (function() { 42596 return Jt; 42597 })), n.d(t, "getHashOrSearch", (function() { 42598 return Vt; 42599 })), n.d(t, "isLoginRedirect", (function() { 42600 return Yt; 42601 })), n.d(t, "isInteractionRequired", (function() { 42602 return Xt; 42603 })), n.d(t, "generateState", (function() { 42604 return Lt; 42605 })), n.d(t, "generateNonce", (function() { 42606 return Nt; 42607 })), n.d(t, "getOAuthUrls", (function() { 42608 return Dt; 42609 })), n.d(t, "pkce", (function() { 42610 return He; 42611 })), n.d(t, "prepareTokenParams", (function() { 42612 return $t; 42613 })), n.d(t, "urlParamsToObject", (function() { 42614 return Qt; 42615 })), n.d(t, "validateClaims", (function() { 42616 return Zt; 42617 })), n.d(t, "decodeToken", (function() { 42618 return en; 42619 })), n.d(t, "revokeToken", (function() { 42620 return tn; 42621 })), n.d(t, "renewToken", (function() { 42622 return fn; 42623 })), n.d(t, "renewTokensWithRefresh", (function() { 42624 return hn; 42625 })), n.d(t, "renewTokens", (function() { 42626 return dn; 42627 })), n.d(t, "verifyToken", (function() { 42628 return an; 42629 })), n.d(t, "getUserInfo", (function() { 42630 return gn; 42631 })), n.d(t, "handleOAuthResponse", (function() { 42632 return sn; 42633 })), n.d(t, "exchangeCodeForTokens", (function() { 42634 return nn; 42635 })), n.d(t, "getToken", (function() { 42636 return un; 42637 })), n.d(t, "getWithoutPrompt", (function() { 42638 return cn; 42639 })), n.d(t, "getWithPopup", (function() { 42640 return vn; 42641 })), n.d(t, "getWithRedirect", (function() { 42642 return yn; 42643 })), n.d(t, "parseFromUrl", (function() { 42644 return mn; 42645 })), n.d(t, "EVENT_EXPIRED", (function() { 42646 return Sn; 42647 })), n.d(t, "EVENT_RENEWED", (function() { 42648 return On; 42649 })), n.d(t, "EVENT_ADDED", (function() { 42650 return _n; 42651 })), n.d(t, "EVENT_REMOVED", (function() { 42652 return En; 42653 })), n.d(t, "EVENT_ERROR", (function() { 42654 return An; 42655 })), n.d(t, "TokenManager", (function() { 42656 return Zn; 42657 })), n.d(t, "stringToBase64Url", (function() { 42658 return _; 42659 })), n.d(t, "base64ToBase64Url", (function() { 42660 return E; 42661 })), n.d(t, "base64UrlToBase64", (function() { 42662 return A; 42663 })), n.d(t, "base64UrlToString", (function() { 42664 return x; 42665 })), n.d(t, "stringToBuffer", (function() { 42666 return P; 42667 })), n.d(t, "base64UrlDecode", (function() { 42668 return C; 42669 })), n.d(t, "bind", (function() { 42670 return R; 42671 })), n.d(t, "isAbsoluteUrl", (function() { 42672 return U; 42673 })), n.d(t, "toAbsoluteUrl", (function() { 42674 return j; 42675 })), n.d(t, "toRelativeUrl", (function() { 42676 return I; 42677 })), n.d(t, "isString", (function() { 42678 return M; 42679 })), n.d(t, "isObject", (function() { 42680 return L; 42681 })), n.d(t, "isNumber", (function() { 42682 return N; 42683 })), n.d(t, "isoToUTCString", (function() { 42684 return D; 42685 })), n.d(t, "toQueryString", (function() { 42686 return F; 42687 })), n.d(t, "genRandomString", (function() { 42688 return H; 42689 })), n.d(t, "extend", (function() { 42690 return K; 42691 })), n.d(t, "removeNils", (function() { 42692 return q; 42693 })), n.d(t, "clone", (function() { 42694 return B; 42695 })), n.d(t, "omit", (function() { 42696 return G; 42697 })), n.d(t, "find", (function() { 42698 return W; 42699 })), n.d(t, "getLink", (function() { 42700 return z; 42701 })), n.d(t, "getNativeConsole", (function() { 42702 return J; 42703 })), n.d(t, "getConsole", (function() { 42704 return V; 42705 })), n.d(t, "warn", (function() { 42706 return Y; 42707 })), n.d(t, "deprecate", (function() { 42708 return X; 42709 })), n.d(t, "deprecateWrap", (function() { 42710 return $; 42711 })), n.d(t, "removeTrailingSlash", (function() { 42712 return Q; 42713 })), n.d(t, "isIE11OrLess", (function() { 42714 return Z; 42715 })), n.d(t, "isFunction", (function() { 42716 return ee; 42717 })), n.d(t, "delay", (function() { 42718 return te; 42719 })), n.d(t, "isPromise", (function() { 42720 return ne; 42721 })); 42722 var r = {}; 42723 n.r(r), n.d(r, "STATE_TOKEN_KEY_NAME", (function() { 42724 return ie; 42725 })), n.d(r, "DEFAULT_POLLING_DELAY", (function() { 42726 return ae; 42727 })), n.d(r, "DEFAULT_MAX_CLOCK_SKEW", (function() { 42728 return se; 42729 })), n.d(r, "DEFAULT_CACHE_DURATION", (function() { 42730 return ue; 42731 })), n.d(r, "REDIRECT_OAUTH_PARAMS_NAME", (function() { 42732 return ce; 42733 })), n.d(r, "REDIRECT_STATE_COOKIE_NAME", (function() { 42734 return fe; 42735 })), n.d(r, "REDIRECT_NONCE_COOKIE_NAME", (function() { 42736 return le; 42737 })), n.d(r, "TOKEN_STORAGE_NAME", (function() { 42738 return he; 42739 })), n.d(r, "CACHE_STORAGE_NAME", (function() { 42740 return de; 42741 })), n.d(r, "PKCE_STORAGE_NAME", (function() { 42742 return pe; 42743 })), n.d(r, "TRANSACTION_STORAGE_NAME", (function() { 42744 return ge; 42745 })), n.d(r, "ACCESS_TOKEN_STORAGE_KEY", (function() { 42746 return ve; 42747 })), n.d(r, "ID_TOKEN_STORAGE_KEY", (function() { 42748 return ye; 42749 })), n.d(r, "REFRESH_TOKEN_STORAGE_KEY", (function() { 42750 return me; 42751 })), n.d(r, "REFERRER_PATH_STORAGE_KEY", (function() { 42752 return ke; 42753 })), n.d(r, "MIN_VERIFIER_LENGTH", (function() { 42754 return we; 42755 })), n.d(r, "MAX_VERIFIER_LENGTH", (function() { 42756 return Te; 42757 })), n.d(r, "DEFAULT_CODE_CHALLENGE_METHOD", (function() { 42758 return be; 42759 })); 42760 var o = {}; 42761 n.r(o), n.d(o, "getUserAgent", (function() { 42762 return at; 42763 })), n.d(o, "isFingerprintSupported", (function() { 42764 return st; 42765 })), n.d(o, "isPopupPostMessageSupported", (function() { 42766 return ut; 42767 })), n.d(o, "isTokenVerifySupported", (function() { 42768 return ct; 42769 })), n.d(o, "hasTextEncoder", (function() { 42770 return ft; 42771 })), n.d(o, "isPKCESupported", (function() { 42772 return lt; 42773 }
42773)), n.d(o, "isHTTPS", (function() { 42774 return ht; 42775 })), n.d(o, "isLocalhost", (function() { 42776 return dt; 42777 })); 42778 var i = n(1), a = n.n(i), s = n(0), u = n.n(s), c = n(4), f = n.n(c), l = n(2), h = n.n(l), d = n(5), p = n.n(d), g = n(6), v = n.n(g), y = n(3), m = n.n(y), k = n(10); 42779 function w(e) { 42780 var t = function() { 42781 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 42782 if (Reflect.construct.sham) return !1; 42783 if ("function" == typeof Proxy) return !0; 42784 try { 42785 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 42786 } catch (e) { 42787 return !1; 42788 } 42789 }(); 42790 /*! 42791 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 42792 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 42793 * 42794 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 42795 * Unless required by applicable law or agreed to in writing, software 42796 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 42797 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42798 * 42799 * See the License for the specific language governing permissions and limitations under the License. 42800 */ 42801 return function() { 42802 var n, r = m()(e); 42803 if (t) { 42804 var o = m()(this).constructor; 42805 n = Reflect.construct(r, arguments, o); 42806 } else n = r.apply(this, arguments); 42807 return v()(this, n); 42808 }; 42809 } 42810 var T = function(e) { 42811 p()(n, e); 42812 var t = w(n); 42813 function n(e) { 42814 var r; 42815 return u()(this, n), r = t.call(this, e), Object.setPrototypeOf(h()(r), (this instanceof n ? this.constructor : void 0).prototype), r; 42816 } 42817 return n; 42818 }(n.n(k)()(Error)); 42819 function b(e) { 42820 var t = function() { 42821 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 42822 if (Reflect.construct.sham) return !1; 42823 if ("function" == typeof Proxy) return !0; 42824 try { 42825 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 42826 } catch (e) { 42827 return !1; 42828 } 42829 }(); 42830 /*! 42831 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 42832 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 42833 * 42834 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 42835 * Unless required by applicable law or agreed to in writing, software 42836 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 42837 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42838 * 42839 * See the License for the specific language governing permissions and limitations under the License. 42840 */ 42841 return function() { 42842 var n, r = m()(e); 42843 if (t) { 42844 var o = m()(this).constructor; 42845 n = Reflect.construct(r, arguments, o); 42846 } else n = r.apply(this, arguments); 42847 return v()(this, n); 42848 }; 42849 } 42850 var S = function(e) { 42851 p()(n, e); 42852 var t = b(n); 42853 function n(e, r) { 42854 var o; 42855 return u()(this, n), (o = t.call(this, e)).name = "AuthSdkError", o.errorCode = "INTERNAL", o.errorSummary = e, o.errorLink = "INTERNAL", o.errorId = "INTERNAL", o.errorCauses = [], r && (o.xhr = r), o; 42856 } 42857 return n; 42858 }(T); 42859 /*! 42860 * Copyright (c) 2018-present, Okta, Inc. and/or its affiliates. All rights reserved. 42861 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 42862 * 42863 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 42864 * Unless required by applicable law or agreed to in writing, software 42865 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 42866 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42867 * 42868 * See the License for the specific language governing permissions and limitations under the License. 42869 */ function O(e, t) { 42870 var n = e.userAgent || {}; 42871 return n.value ? n.value : n.template ? n.template.replace("$OKTA_AUTH_JS", t) : t; 42872 } 42873 /*! 42874 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 42875 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 42876 * 42877 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 42878 * Unless required by applicable law or agreed to in writing, softw
42878are 42879 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 42880 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 42881 * 42882 * See the License for the specific language governing permissions and limitations under the License. 42883 */ function _(e) { 42884 return E(btoa(e)); 42885 } 42886 function E(e) { 42887 return e.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); 42888 } 42889 function A(e) { 42890 return e.replace(/-/g, "+").replace(/_/g, "/"); 42891 } 42892 function x(e) { 42893 var t = A(e); 42894 switch (t.length % 4) { 42895 case 0: break; 42896 case 2: 42897 t += "=="; 42898 break; 42899 case 3: 42900 t += "="; 42901 break; 42902 default: throw "Not a valid Base64Url"; 42903 } 42904 var n = atob(t); 42905 try { 42906 return decodeURIComponent(escape(n)); 42907 } catch (e) { 42908 return n; 42909 } 42910 } 42911 function P(e) { 42912 for (var t = new Uint8Array(e.length), n = 0; n < e.length; n++) t[n] = e.charCodeAt(n); 42913 return t; 42914 } 42915 function C(e) { 42916 return atob(A(e)); 42917 } 42918 function R(e, t) { 42919 var n = Array.prototype.slice.call(arguments, 2); 42920 return function() { 42921 var r = Array.prototype.slice.call(arguments); 42922 return r = n.concat(r), e.apply(t, r); 42923 }; 42924 } 42925 function U(e) { 42926 return /^(?:[a-z]+:)?\/\//i.test(e); 42927 } 42928 function j() { 42929 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", t = arguments.length > 1 ? arguments[1] : void 0; 42930 return U(e) ? e : (t = Q(t), "/" === e[0] ? "".concat(t).concat(e) : "".concat(t, "/").concat(e)); 42931 } 42932 function I() { 42933 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", t = arguments.length > 1 ? arguments[1] : void 0; 42934 return U(e) && (e = e.substring(t.length)), "/" === e[0] ? e : "/".concat(e); 42935 } 42936 function M(e) { 42937 return "[object String]" === Object.prototype.toString.call(e); 42938 } 42939 function L(e) { 42940 return "[object Object]" === Object.prototype.toString.call(e); 42941 } 42942 function N(e) { 42943 return "[object Number]" === Object.prototype.toString.call(e); 42944 } 42945 function D(e) { 42946 var t = e.match(/\d+/g), n = Date.UTC(t[0], t[1] - 1, t[2], t[3], t[4], t[5]); 42947 return new Date(n).toUTCString(); 42948 } 42949 function F(e) { 42950 var t = []; 42951 if (null !== e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && void 0 !== e[n] && null !== e[n] && t.push(n + "=" + encodeURIComponent(e[n])); 42952 return t.length ? "?" + t.join("&") : ""; 42953 } 42954 function H(e) { 42955 for (var t = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", n = "", r = 0, o = t.length; r < e; ++r) n += t[Math.floor(Math.random() * o)]; 42956 return n; 42957 } 42958 function K() { 42959 var e = arguments[0]; 42960 return [].slice.call(arguments, 1).forEach((function(t) { 42961 for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && void 0 !== t[n] && (e[n] = t[n]); 42962 })), e; 42963 } 42964 function q(e) { 42965 var t = {}; 42966 for (var n in e) if (Object.prototype.hasOwnProperty.call(e, n)) { 42967 var r = e[n]; 42968 null != r && (t[n] = r); 42969 } 42970 return t; 42971 } 42972 function B(e) { 42973 if (e) { 42974 var t = JSON.stringify(e); 42975 if (t) return JSON.parse(t); 42976 } 42977 return e; 42978 } 42979 function G(e) { 42980 for (var t = {}, n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) r[o - 1] = arguments[o]; 42981 for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && -1 == r.indexOf(i) && (t[i] = e[i]); 42982 return B(t); 42983 } 42984 function W(e, t) { 42985 for (var n = e.length; n--;) { 42986 var r = e[n], o = !0; 42987 for (var i in t) if (Object.prototype.hasOwnProperty.call(t, i) && r[i] !== t[i]) { 42988 o = !1; 42989 break; 42990 } 42991 if (o) return r; 42992 } 42993 } 42994 function z(e, t, n) { 42995 if (e && e._links) { 42996 var r = B(e._links[t]); 42997 return r && r.name && n ? r.name === n ? r : void 0 : r; 42998 } 42999 } 43000 function J() { 43001 return "undefined" != typeof window ? window.console : "undefined" != typeof console ? console : void 0; 43002 } 43003 function V() { 43004 var e = J(); 43005 return e && e.log ? e : { 43006 log: function() {}, 43007 warn: function() {}, 43008 group: function() {}, 43009 groupEnd: function() {} 43010 }; 43011 } 43012 function Y(e) { 43013 V().warn("[okta-auth-sdk] WARN: " + e); 43014 } 43015 function X(e) { 43016 V().warn("[okta-auth-sdk] DEPRECATION: " + e); 43017 } 43018 function $(e, t) { 43019 return function() { 43020 return X(e), t.apply(null, arguments); 43021 }; 43022 } 43023 function Q(e) { 43024 if (e) { 43025 var t = e.replace(/^\s+|\s+$/gm, ""); 43026 return t = t.replace(/\/+$/, ""); 43027 } 43028 } 43029 function Z() { 43030 return !!document.documentMode && document.documentMode <= 11; 43031 } 43032 function ee(e) { 43033 return !!e && "[object Function]" === {}.toString.call(e); 43034 } 43035 function te(e) { 43036 return new Promise((function(t) { 43037 setTimeout(t, e); 43038 })); 43039 } 43040 function ne(e) { 43041 return e && e.finally && "function" == typeof e.finally; 43042 } 43043 function re(e) { 43044 var t = function() { 43045 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 43046 if (Reflect.construct.sham) return !1; 43047 if ("function" == typeof Proxy) return !0; 43048 try { 43049 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 43050 } catch (e) { 43051 return !1; 43052 } 43053 }(); 43054 /*! 43055 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43056 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43057 * 43058 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43059 * Unless required by applicable law or agreed to in writing, softw
43059are 43060 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43061 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43062 * 43063 * See the License for the specific language governing permissions and limitations under the License. 43064 */ 43065 return function() { 43066 var n, r = m()(e); 43067 if (t) { 43068 var o = m()(this).constructor; 43069 n = Reflect.construct(r, arguments, o); 43070 } else n = r.apply(this, arguments); 43071 return v()(this, n); 43072 }; 43073 } 43074 var oe = function(e) { 43075 p()(n, e); 43076 var t = re(n); 43077 function n(e, r) { 43078 var o; 43079 u()(this, n); 43080 var i = e.errorSummary; 43081 return (o = t.call(this, i)).name = "AuthApiError", o.errorSummary = e.errorSummary, o.errorCode = e.errorCode, o.errorLink = e.errorLink, o.errorId = e.errorId, o.errorCauses = e.errorCauses, r && (o.xhr = r), o; 43082 } 43083 return n; 43084 }(T), ie = "oktaStateToken", ae = 500, se = 300, ue = 86400, ce = "okta-oauth-redirect-params", fe = "okta-oauth-state", le = "okta-oauth-nonce", he = "okta-token-storage", de = "okta-cache-storage", pe = "okta-pkce-storage", ge = "okta-transaction-storage", ve = "accessToken", ye = "idToken", me = "refreshToken", ke = "referrerPath", we = 43, Te = 128, be = "S256"; 43085 /*! 43086 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43087 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43088 * 43089 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43090 * Unless required by applicable law or agreed to in writing, software 43091 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43092 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43093 * 43094 * See the License for the specific language governing permissions and limitations under the License. 43095 */ 43096 /*! 43097 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43098 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43099 * 43100 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43101 * Unless required by applicable law or agreed to in writing, software 43102 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43103 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43104 * 43105 * See the License for the specific language governing permissions and limitations under the License. 43106 * 43107 */ 43108 function Se(e, t) { 43109 var n = (t = t || {}).url, r = t.method, o = t.args, i = t.saveAuthnState, a = t.accessToken, s = !1 !== t.withCredentials, u = e.options.storageUtil.storage, c = e.storageManager.getHttpCache(e.options.cookies); 43110 if (t.cacheResponse) { 43111 var f = c.getStorage()[n]; 43112 if (f && Date.now() / 1e3 < f.expiresAt) return Promise.resolve(f.response); 43113 } 43114 var l = { 43115 Accept: "application/json", 43116 "Content-Type": "application/json", 43117 "X-Okta-User-Agent-Extended": e.userAgent 43118 }; 43119 Object.assign(l, e.options.headers, t.headers), l = q(l), a && M(a) && (l.Authorization = "Bearer " + a); 43120 var h, d, p = { 43121 headers: l, 43122 data: o || void 0, 43123 withCredentials: s 43124 }; 43125 return e.options.httpRequestClient(r, n, p).then((function(r) { 43126 return (d = r.responseText) && M(d) && (d = JSON.parse(d)), i && (d.stateToken || u.delete(ie)), d && d.stateToken && d.expiresAt && u.set(ie, d.stateToken, d.expiresAt, e.options.cookies), d && t.cacheResponse && c.updateStorage(n, { 43127 expiresAt: Math.floor(Date.now() / 1e3) + ue, 43128 response: d 43129 }), d; 43130 })).catch((function(t) { 43131 var n = t.responseText || {}; 43132 if (M(n)) try { 43133 n = JSON.parse(n); 43134 } catch (e) { 43135 n = { errorSummary: "Unknown error" }; 43136 } 43137 throw t.status >= 500 && (n.errorSummary = "Unknown error"), e.options.transformErrorXHR && (t = e.options.transformErrorXHR(B(t))), "E0000011" === (h = new oe(n, t)).errorCode && u.delete(ie), h; 43138 })); 43139 } 43140 var Oe = { 43141 get: function(e, t, n) { 43142 var r = { 43143 url: t = U(t) ? t : e.getIssuerOrigin() + t, 43144 method: "GET" 43145 }; 43146 return Object.assign(r, n), Se(e, r); 43147 }, 43148 post: function(e, t, n, r) { 43149 var o = { 43150 url: t = U(t) ? t : e.getIssuerOrigin() + t, 43151 method: "POST", 43152 args: n, 43153 saveAuthnState: !0 43154 }; 43155 return Object.assign(o, r), Se(e, o); 43156 }, 43157 httpRequest: Se 43158 }; 43159 /*! 43160 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43161 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43162 * 43163 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43164 * Unless required by applicable law or agreed to in writing, softw
43164are 43165 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43166 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43167 * 43168 * See the License for the specific language governing permissions and limitations under the License. 43169 * 43170 */ function _e(e, t) { 43171 var n = {}; 43172 return Object.assign(n, t), !n.stateToken && e.stateToken && (n.stateToken = e.stateToken), n; 43173 } 43174 function Ee(e) { 43175 return _e(e); 43176 } 43177 function Ae(e) { 43178 var t = function() { 43179 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 43180 if (Reflect.construct.sham) return !1; 43181 if ("function" == typeof Proxy) return !0; 43182 try { 43183 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 43184 } catch (e) { 43185 return !1; 43186 } 43187 }(); 43188 /*! 43189 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43190 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43191 * 43192 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43193 * Unless required by applicable law or agreed to in writing, software 43194 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43195 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43196 * 43197 * See the License for the specific language governing permissions and limitations under the License. 43198 */ 43199 return function() { 43200 var n, r = m()(e); 43201 if (t) { 43202 var o = m()(this).constructor; 43203 n = Reflect.construct(r, arguments, o); 43204 } else n = r.apply(this, arguments); 43205 return v()(this, n); 43206 }; 43207 } 43208 var xe = function(e) { 43209 p()(n, e); 43210 var t = Ae(n); 43211 function n() { 43212 u()(this, n); 43213 return t.call(this, "The poll was stopped by the sdk"); 43214 } 43215 return n; 43216 }(T); 43217 /*! 43218 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43219 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43220 * 43221 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43222 * Unless required by applicable law or agreed to in writing, software 43223 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43224 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43225 * 43226 * See the License for the specific language governing permissions and limitations under the License. 43227 * 43228 */ function Pe(e, t, n) { 43229 return function(r) { 43230 var o, i, a, s; 43231 N(r) ? o = r : L(r) && (o = (r = r).delay, i = r.rememberDevice, a = r.autoPush, s = r.transactionCallBack), o || 0 === o || (o = ae); 43232 var u = z(t, "next", "poll"); 43233 n.isPolling = !0; 43234 var c = 0; 43235 return function r() { 43236 return n.isPolling ? function() { 43237 var n = {}; 43238 if ("function" == typeof a) try { 43239 n.autoPush = !!a(); 43240 } catch (e) { 43241 return Promise.reject(new S("AutoPush resulted in an error.")); 43242 } 43243 else null != a && (n.autoPush = !!a); 43244 if ("function" == typeof i) try { 43245 n.rememberDevice = !!i(); 43246 } catch (e) { 43247 return Promise.reject(new S("RememberDevice resulted in an error.")); 43248 } 43249 else null != i && (n.rememberDevice = !!i); 43250 var r = u.href + F(n); 43251 return Oe.post(e, r, Ee(t), { saveAuthnState: !1 }); 43252 }().then((function(t) { 43253 if (c = 0, t.factorResult && "WAITING" === t.factorResult) { 43254 if (!n.isPolling) throw new xe(); 43255 return "function" == typeof s && s(t), te(o).then(r); 43256 } 43257 return n.isPolling = !1, new Ce(e, t); 43258 })).catch((function(e) { 43259 if (e.xhr && (0 === e.xhr.status || 429 === e.xhr.status) && c <= 4) { 43260 var t = 1e3 * Math.pow(2, c); 43261 return c++, te(t).then(r); 43262 } 43263 throw e; 43264 })) : Promise.reject(new xe()); 43265 }().catch((function(e) { 43266 throw n.isPolling = !1, e; 43267 })); 43268 }; 43269 } 43270 /*! 43271 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43272 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43273 * 43274 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43275 * Unless required by applicable law or agreed to in writing, softw
43275are 43276 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43277 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43278 * 43279 * See the License for the specific language governing permissions and limitations under the License. 43280 * 43281 */ var Ce = function e(t) { 43282 var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; 43283 u()(this, e), n && (this.data = n, Object.assign(this, Ue(t, n, n, {})), delete this.stateToken, "RECOVERY_CHALLENGE" !== n.status || n._links || (this.cancel = function() { 43284 return Promise.resolve(new e(t)); 43285 })); 43286 }; 43287 function Re(e, t, n, r, o) { 43288 if (Array.isArray(r)) return function(i, a) { 43289 if (!i) throw new S("Must provide a link name"); 43290 var s = W(r, { name: i }); 43291 if (!s) throw new S("No link found for that name"); 43292 return Re(e, t, n, s, o)(a); 43293 }; 43294 if (r.hints && r.hints.allow && 1 === r.hints.allow.length) switch (r.hints.allow[0]) { 43295 case "GET": return function() { 43296 return Oe.get(e, r.href); 43297 }; 43298 case "POST": return function(i) { 43299 o && o.isPolling && (o.isPolling = !1); 43300 var a = _e(t, i); 43301 "MFA_ENROLL" !== t.status && "FACTOR_ENROLL" !== t.status || Object.assign(a, { 43302 factorType: n.factorType, 43303 provider: n.provider 43304 }); 43305 var s = {}, u = a.autoPush; 43306 if (void 0 !== u) { 43307 if ("function" == typeof u) try { 43308 s.autoPush = !!u(); 43309 } catch (e) { 43310 return Promise.reject(new S("AutoPush resulted in an error.")); 43311 } 43312 else null !== u && (s.autoPush = !!u); 43313 a = G(a, "autoPush"); 43314 } 43315 var c = a.rememberDevice; 43316 if (void 0 !== c) { 43317 if ("function" == typeof c) try { 43318 s.rememberDevice = !!c(); 43319 } catch (e) { 43320 return Promise.reject(new S("RememberDevice resulted in an error.")); 43321 } 43322 else null !== c && (s.rememberDevice = !!c); 43323 a = G(a, "rememberDevice"); 43324 } else a.profile && void 0 !== a.profile.updatePhone && (a.profile.updatePhone && (s.updatePhone = !0), a.profile = G(a.profile, "updatePhone")); 43325 return Ne(e, r.href + F(s), a); 43326 }; 43327 } 43328 } 43329 function Ue(e, t, n, r) { 43330 if (n = B(n = n || t), Array.isArray(n)) { 43331 for (var o = [], i = 0, a = n.length; i < a; i++) o.push(Ue(e, t, n[i], r)); 43332 return o; 43333 } 43334 var s = n._embedded || {}; 43335 for (var u in s) Object.prototype.hasOwnProperty.call(s, u) && (L(s[u]) || Array.isArray(s[u])) && (s[u] = Ue(e, t, s[u], r)); 43336 var c = function(e, t, n, r) { 43337 var o = {}; 43338 for (var i in n._links) if (Object.prototype.hasOwnProperty.call(n._links, i)) { 43339 var a = n._links[i]; 43340 if ("next" === i && (i = a.name), a.type) o[i] = a; 43341 else switch (i) { 43342 case "poll": 43343 o.poll = Pe(e, t, r); 43344 break; 43345 default: 43346 var s = Re(e, t, n, a, r); 43347 s && (o[i] = s); 43348 } 43349 } 43350 return o; 43351 }(e, t, n, r); 43352 return Object.assign(s, c), n = G(n, "_embedded", "_links"), Object.assign(n, s), n; 43353 } 43354 /*! 43355 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43356 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43357 * 43358 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43359 * Unless required by applicable law or agreed to in writing, software 43360 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43361 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43362 * 43363 * See the License for the specific language governing permissions and limitations under the License. 43364 * 43365 */ function je(e, t) { 43366 return t = _e(e, t), Oe.post(e, e.getIssuerOrigin() + "/api/v1/authn", t); 43367 } 43368 function Ie(e, t) { 43369 if (!t || !t.stateToken) { 43370 var n = e.tx.exists._get(ie); 43371 if (!n) return Promise.reject(new S("No transaction to resume")); 43372 t = { stateToken: n }; 43373 } 43374 return e.tx.status(t).then((function(t) { 43375 return new Ce(e, t); 43376 })); 43377 } 43378 function Me(e, t) { 43379 if (!t || !t.stateToken) { 43380 var n = e.tx.exists._get(ie); 43381 if (!n) return Promise.reject(new S("No transaction to evaluate")); 43382 t = { stateToken: n }; 43383 } 43384 return function(e, t) { 43385 return t = _e(e, t), Oe.post(e, e.getIssuerOrigin() + "/api/v1/authn/introspect", t); 43386 }(e, t).then((function(t) { 43387 return new Ce(e, t); 43388 })); 43389 } 43390 function Le(e) { 43391 return !!e.tx.exists._get(ie); 43392 } 43393 function Ne(e, t, n, r) { 43394 return Oe.post(e, t, n, r).then((function(t) { 43395 return new Ce(e, t); 43396 })); 43397 } 43398 var De = function e() { 43399 u()(this, e); 43400 }; 43401 /*! 43402 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43403 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43404 * 43405 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43406 * Unless required by applicable law or agreed to in writing, softw
43406are 43407 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43408 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43409 * 43410 * See the License for the specific language governing permissions and limitations under the License. 43411 * 43412 */ 43413 /*! 43414 * Copyright (c) 2019-present, Okta, Inc. and/or its affiliates. All rights reserved. 43415 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43416 * 43417 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43418 * Unless required by applicable law or agreed to in writing, software 43419 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43420 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43421 * 43422 * See the License for the specific language governing permissions and limitations under the License. 43423 * 43424 */ function Fe(e) { 43425 return ("0" + e.toString(16)).substr(-2); 43426 } 43427 var He = { 43428 DEFAULT_CODE_CHALLENGE_METHOD: be, 43429 generateVerifier: function(e) { 43430 var t, n, r = e || ""; 43431 return r.length < we && (r += (t = we - r.length, n = new Uint8Array(Math.ceil(t / 2)), crypto.getRandomValues(n), Array.from(n, Fe).join("").slice(0, t))), encodeURIComponent(r).slice(0, Te); 43432 }, 43433 computeChallenge: function(e) { 43434 var t = new TextEncoder().encode(e); 43435 return crypto.subtle.digest("SHA-256", t).then((function(e) { 43436 return _(String.fromCharCode.apply(null, new Uint8Array(e))); 43437 })); 43438 } 43439 }, Ke = function() { 43440 function e(t, n) { 43441 if (u()(this, e), !t) throw new S("\"storage\" is required"); 43442 if ("string" != typeof n || !n.length) throw new S("\"storageName\" is required"); 43443 this.storageName = n, this.storageProvider = t; 43444 } 43445 return f()(e, [ 43446 { 43447 key: "getItem", 43448 value: function(e) { 43449 return this.getStorage()[e]; 43450 } 43451 }, 43452 { 43453 key: "setItem", 43454 value: function(e, t) { 43455 return this.updateStorage(e, t); 43456 } 43457 }, 43458 { 43459 key: "removeItem", 43460 value: function(e) { 43461 return this.clearStorage(e); 43462 } 43463 }, 43464 { 43465 key: "getStorage", 43466 value: function() { 43467 var e = this.storageProvider.getItem(this.storageName); 43468 e = e || "{}"; 43469 try { 43470 return JSON.parse(e); 43471 } catch (e) { 43472 throw new S("Unable to parse storage string: " + this.storageName); 43473 } 43474 } 43475 }, 43476 { 43477 key: "setStorage", 43478 value: function(e) { 43479 try { 43480 var t = e ? JSON.stringify(e) : "{}"; 43481 this.storageProvider.setItem(this.storageName, t); 43482 } catch (e) { 43483 throw new S("Unable to set storage: " + this.storageName); 43484 } 43485 } 43486 }, 43487 { 43488 key: "clearStorage", 43489 value: function(e) { 43490 if (e) { 43491 var t = this.getStorage(); 43492 delete t[e], this.setStorage(t); 43493 } else this.storageProvider.removeItem ? this.storageProvider.removeItem(this.storageName) : this.setStorage(); 43494 } 43495 }, 43496 { 43497 key: "updateStorage", 43498 value: function(e, t) { 43499 var n = this.getStorage(); 43500 n[e] = t, this.setStorage(n); 43501 } 43502 } 43503 ]), e; 43504 }(), qe = function() { 43505 function e(t, n, r) { 43506 u()(this, e), this.storageManagerOptions = t, this.cookieOptions = n, this.storageUtil = r; 43507 } 43508 return f()(e, [ 43509 { 43510 key: "getOptionsForSection", 43511 value: function(e, t) { 43512 return Object.assign({}, this.storageManagerOptions[e], t); 43513 } 43514 }, 43515 { 43516 key: "getStorage", 43517 value: function(e) { 43518 if ((e = Object.assign({}, this.cookieOptions, e)).storageProvider) return e.storageProvider; 43519 var t = e, n = t.storageType, r = t.storageTypes; 43520 if (n && r) { 43521 var o = r.indexOf(n); 43522 o >= 0 && (r = r.slice(o), n = null); 43523 } 43524 return n || (n = this.storageUtil.findStorageType(r)), this.storageUtil.getStorageByType(n, e); 43525 } 43526 }, 43527 { 43528 key: "getTransactionStorage", 43529 value: function(e) { 43530 e = this.getOptionsForSection("transaction", e); 43531 return new Ke(this.getStorage(e), e.storageKey || ge); 43532 } 43533 }, 43534 { 43535 key: "getTokenStorage", 43536 value: function(e) { 43537 e = this.getOptionsForSection("token", e); 43538 return new Ke(this.getStorage(e), e.storageKey || he); 43539 } 43540 }, 43541 { 43542 key: "getHttpCache", 43543 value: function(e) { 43544 e = this.getOptionsForSection("cache", e); 43545 return new Ke(this.getStorage(e), e.storageKey || de); 43546 } 43547 }, 43548 { 43549 key: "getLegacyPKCEStorage", 43550 value: function(e) { 43551 e = this.getOptionsForSection("legacy-pkce", e); 43552 return new Ke(this.getStorage(e), e.storageKey || pe); 43553 } 43554 }, 43555 { 43556 key: "getLegacyOAuthParamsStorage", 43557 value: function(e) { 43558 e = this.getOptionsForSection("legacy-oauth-params", e); 43559 return new Ke(this.getStorage(e), e.storageKey || ce); 43560 } 43561 } 43562 ]), e; 43563 }(); 43564 /*! 43565 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43566 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43567 * 43568 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43569 * Unless required by applicable law or agreed to in writing, softw
43569are 43570 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43571 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43572 * 43573 * See the License for the specific language governing permissions and limitations under the License. 43574 * 43575 */ function Be(e) { 43576 var t = function() { 43577 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 43578 if (Reflect.construct.sham) return !1; 43579 if ("function" == typeof Proxy) return !0; 43580 try { 43581 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 43582 } catch (e) { 43583 return !1; 43584 } 43585 }(); 43586 /*! 43587 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43588 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43589 * 43590 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43591 * Unless required by applicable law or agreed to in writing, software 43592 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43593 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43594 * 43595 * See the License for the specific language governing permissions and limitations under the License. 43596 */ 43597 return function() { 43598 var n, r = m()(e); 43599 if (t) { 43600 var o = m()(this).constructor; 43601 n = Reflect.construct(r, arguments, o); 43602 } else n = r.apply(this, arguments); 43603 return v()(this, n); 43604 }; 43605 } 43606 var Ge = function(e) { 43607 p()(n, e); 43608 var t = Be(n); 43609 function n(e, r) { 43610 var o; 43611 return u()(this, n), (o = t.call(this, r)).name = "OAuthError", o.errorCode = e, o.errorSummary = r, o; 43612 } 43613 return n; 43614 }(T), We = n(7), ze = n.n(We); 43615 /*! 43616 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43617 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43618 * 43619 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43620 * Unless required by applicable law or agreed to in writing, software 43621 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43622 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43623 * 43624 * See the License for the specific language governing permissions and limitations under the License. 43625 */ 43626 /*! 43627 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43628 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43629 * 43630 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43631 * Unless required by applicable law or agreed to in writing, software 43632 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43633 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43634 * 43635 * See the License for the specific language governing permissions and limitations under the License. 43636 */ function Je(e) { 43637 return !(!e || "object" !== ze()(e) || 0 === Object.values(e).length); 43638 } 43639 function Ve(e) { 43640 return !!Je(e) && (!!e.redirectUri || !!e.responseType); 43641 } 43642 function Ye(e) { 43643 return !!Ve(e) && !!e.codeVerifier; 43644 } 43645 function Xe(e) { 43646 return !!Ye(e) && !!e.interactionHandle; 43647 } 43648 function $e(e) { 43649 return !!Je(e) && void 0 === Object.values(e).find((function(e) { 43650 return "string" != typeof e; 43651 })); 43652 } 43653 function Qe(e) { 43654 return !(!Ve(e) && !$e(e)); 43655 } 43656 /*! 43657 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43658 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43659 * 43660 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43661 * Unless required by applicable law or agreed to in writing, software 43662 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43663 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43664 * 43665 * See the License for the specific language governing permissions and limitations under the License. 43666 */ 43667 /*! 43668 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43669 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43670 * 43671 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43672 * Unless required by applicable law or agreed to in writing, softw
43672are 43673 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43674 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43675 * 43676 * See the License for the specific language governing permissions and limitations under the License. 43677 */ 43678 /*! 43679 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43680 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43681 * 43682 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43683 * Unless required by applicable law or agreed to in writing, software 43684 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43685 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43686 * 43687 * See the License for the specific language governing permissions and limitations under the License. 43688 */ 43689 /*! 43690 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43691 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43692 * 43693 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43694 * Unless required by applicable law or agreed to in writing, software 43695 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43696 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43697 * 43698 * See the License for the specific language governing permissions and limitations under the License. 43699 */ 43700 /*! 43701 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43702 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43703 * 43704 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43705 * Unless required by applicable law or agreed to in writing, software 43706 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43707 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43708 * 43709 * See the License for the specific language governing permissions and limitations under the License. 43710 */ 43711 /*! 43712 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43713 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43714 * 43715 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43716 * Unless required by applicable law or agreed to in writing, software 43717 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43718 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43719 * 43720 * See the License for the specific language governing permissions and limitations under the License. 43721 */ function Ze(e) { 43722 return !!(e && (e.accessToken || e.idToken || e.refreshToken) && Array.isArray(e.scopes)); 43723 } 43724 function et(e) { 43725 return e && e.accessToken; 43726 } 43727 function tt(e) { 43728 return e && e.idToken; 43729 } 43730 function nt(e) { 43731 return e && e.refreshToken; 43732 } 43733 /*! 43734 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43735 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43736 * 43737 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43738 * Unless required by applicable law or agreed to in writing, software 43739 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43740 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43741 * 43742 * See the License for the specific language governing permissions and limitations under the License. 43743 */ 43744 /*! 43745 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43746 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43747 * 43748 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43749 * Unless required by applicable law or agreed to in writing, softw
43749are 43750 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43751 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43752 * 43753 * See the License for the specific language governing permissions and limitations under the License. 43754 */ var rt = function() { 43755 function e(t) { 43756 u()(this, e), this.storageManager = t.storageManager, this.legacyWidgetSupport = !1 !== t.legacyWidgetSupport, this.saveNonceCookie = !1 !== t.saveNonceCookie, this.saveStateCookie = !1 !== t.saveStateCookie, this.saveParamsCookie = !1 !== t.saveParamsCookie, this.options = t; 43757 } 43758 return f()(e, [ 43759 { 43760 key: "clear", 43761 value: function() { 43762 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; 43763 this.storageManager.getTransactionStorage().clearStorage(), this.legacyWidgetSupport && (e.oauth && this.clearLegacyOAuthParams(), e.pkce && this.clearLegacyPKCE()); 43764 } 43765 }, 43766 { 43767 key: "save", 43768 value: function(e) { 43769 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = this.storageManager.getTransactionStorage(); 43770 if (Qe(n.getStorage()) && Y("a saved auth transaction exists in storage. This may indicate another auth flow is already in progress."), n.setStorage(e), t.oauth && (this.saveNonceCookie || this.saveStateCookie || this.saveParamsCookie)) { 43771 var o = this.storageManager.getStorage({ storageType: "cookie" }); 43772 if (this.saveParamsCookie) { 43773 var h = { 43774 responseType: e.responseType, 43775 state: e.state, 43776 nonce: e.nonce, 43777 scopes: e.scopes, 43778 clientId: e.clientId, 43779 urls: e.urls, 43780 ignoreSignature: e.ignoreSignature 43781 }; 43782 o.setItem(ce, JSON.stringify(h), null); 43783 } 43784 this.saveNonceCookie && e.nonce && o.setItem(le, e.nonce, null), this.saveStateCookie && e.state && o.setItem(fe, e.state, null); 43785 } 43786 } 43787 }, 43788 { 43789 key: "exists", 43790 value: function() { 43791 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; 43792 try { 43793 return !!this.load(e); 43794 } catch (e) { 43795 return !1; 43796 } 43797 } 43798 }, 43799 { 43800 key: "load", 43801 value: function() { 43802 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n = this.storageManager.getTransactionStorage().getStorage(); 43803 if (Qe(n)) return n; 43804 if (!this.legacyWidgetSupport) return null; 43805 if (e.oauth) try { 43806 var r = this.loadLegacyOAuthParams(); 43807 Object.assign(n, r); 43808 } finally { 43809 this.clearLegacyOAuthParams(); 43810 } 43811 if (e.pkce) try { 43812 var o = this.loadLegacyPKCE(); 43813 Object.assign(n, o); 43814 } finally { 43815 this.clearLegacyPKCE(); 43816 } 43817 return Qe(n) ? n : null; 43818 } 43819 }, 43820 { 43821 key: "clearLegacyPKCE", 43822 value: function() { 43823 this.storageManager.storageUtil.testStorageType("localStorage") && this.storageManager.getLegacyPKCEStorage({ storageType: "localStorage" }).clearStorage(), this.storageManager.storageUtil.testStorageType("sessionStorage") && this.storageManager.getLegacyPKCEStorage({ storageType: "sessionStorage" }).clearStorage(); 43824 } 43825 }, 43826 { 43827 key: "loadLegacyPKCE", 43828 value: function() { 43829 var e; 43830 if (this.storageManager.storageUtil.testStorageType("localStorage") && (e = this.storageManager.getLegacyPKCEStorage({ storageType: "localStorage" }).getStorage()) && e.codeVerifier) return e; 43831 if (this.storageManager.storageUtil.testStorageType("sessionStorage") && (e = this.storageManager.getLegacyPKCEStorage({ storageType: "sessionStorage" }).getStorage()) && e.codeVerifier) return e; 43832 throw new S("Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already completed or multiple auth flows are executing concurrently.", null); 43833 } 43834 }, 43835 { 43836 key: "clearLegacyOAuthParams", 43837 value: function() { 43838 this.storageManager.storageUtil.testStorageType("sessionStorage") && this.storageManager.getLegacyOAuthParamsStorage({ storageType: "sessionStorage" }).clearStorage(), this.storageManager.storageUtil.testStorageType("cookie") && this.storageManager.getLegacyOAuthParamsStorage({ storageType: "cookie" }).clearStorage(); 43839 } 43840 }, 43841 { 43842 key: "loadLegacyOAuthParams", 43843 value: function() { 43844 var e; 43845 if (this.storageManager.storageUtil.testStorageType("sessionStorage") && (e = this.storageManager.getLegacyOAuthParamsStorage({ storageType: "sessionStorage" }).getStorage()), Ve(e)) return e; 43846 if (this.storageManager.storageUtil.testStorageType("cookie") && (e = this.storageManager.getLegacyOAuthParamsStorage({ storageType: "cookie" }).getStorage()), Ve(e)) return e; 43847 throw new S("Unable to retrieve OAuth redirect params from storage"); 43848 } 43849 } 43850 ]), e; 43851 }(), ot = function() { 43852 function e(t) { 43853 u()(this, e), function(e) { 43854 var t = (e = e || {}).issuer; 43855 if (!t) throw new S("No issuer passed to constructor. Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com/oauth2/{authServerId}\"})");
43856 if (!(/* @__PURE__ */ new RegExp("^http?s?://.+")).test(e.issuer)) throw new S("Issuer must be a valid URL. Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com/oauth2/{authServerId}\"})"); 43857 if (-1 !== t.indexOf("-admin.")) throw new S("Issuer URL passed to constructor contains \"-admin\" in subdomain. Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com})"); 43858 var n = e.userAgent; 43859 if (n && n.template && -1 === n.template.indexOf("$OKTA_AUTH_JS")) throw new S("UserAgentTemplate must include \"$OKTA_AUTH_JS\" placeholder. Required usage: new OktaAuth({userAgentTemplate: \"xxx $OKTA_AUTH_JS xxx\"})"); 43860 }(t), this.options = { 43861 issuer: Q(t.issuer), 43862 tokenUrl: Q(t.tokenUrl), 43863 authorizeUrl: Q(t.authorizeUrl), 43864 userinfoUrl: Q(t.userinfoUrl), 43865 revokeUrl: Q(t.revokeUrl), 43866 logoutUrl: Q(t.logoutUrl), 43867 clientId: t.clientId, 43868 redirectUri: t.redirectUri, 43869 state: t.state, 43870 scopes: t.scopes, 43871 postLogoutRedirectUri: t.postLogoutRedirectUri, 43872 responseMode: t.responseMode, 43873 responseType: t.responseType, 43874 pkce: t.pkce, 43875 httpRequestClient: t.httpRequestClient, 43876 transformErrorXHR: t.transformErrorXHR, 43877 transformAuthState: t.transformAuthState, 43878 restoreOriginalUri: t.restoreOriginalUri, 43879 storageUtil: t.storageUtil, 43880 headers: t.headers, 43881 devMode: t.devMode || !1, 43882 storageManager: Object.assign({ 43883 token: {}, 43884 transaction: {} 43885 }, t.storageManager), 43886 cookies: t.cookies, 43887 ignoreSignature: !!t.ignoreSignature 43888 }; 43889 var n = this.options, r = n.storageManager, o = n.cookies, i = n.storageUtil; 43890 this.storageManager = new qe(r, o, i), this.transactionManager = new rt(Object.assign({ storageManager: this.storageManager }, t.transactionManager)), this.tx = { 43891 status: je.bind(null, this), 43892 resume: Ie.bind(null, this), 43893 exists: Object.assign(Le.bind(null, this), { _get: function(e) { 43894 return i.storage.get(e); 43895 } }), 43896 introspect: Me.bind(null, this) 43897 }, this.pkce = { 43898 DEFAULT_CODE_CHALLENGE_METHOD: He.DEFAULT_CODE_CHALLENGE_METHOD, 43899 generateVerifier: He.generateVerifier, 43900 computeChallenge: He.computeChallenge 43901 }; 43902 } 43903 return f()(e, [ 43904 { 43905 key: "signIn", 43906 value: function(e) { 43907 return Ne(this, "/api/v1/authn", e); 43908 } 43909 }, 43910 { 43911 key: "getIssuerOrigin", 43912 value: function() { 43913 return this.options.issuer.split("/oauth2/")[0]; 43914 } 43915 }, 43916 { 43917 key: "forgotPassword", 43918 value: function(e) { 43919 return Ne(this, "/api/v1/authn/recovery/password", e); 43920 } 43921 }, 43922 { 43923 key: "unlockAccount", 43924 value: function(e) { 43925 return Ne(this, "/api/v1/authn/recovery/unlock", e); 43926 } 43927 }, 43928 { 43929 key: "verifyRecoveryToken", 43930 value: function(e) { 43931 return Ne(this, "/api/v1/authn/recovery/token", e); 43932 } 43933 } 43934 ]), e; 43935 }(), it = /windows phone|iemobile|wpdesktop/i; 43936 /*! 43937 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 43938 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 43939 * 43940 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 43941 * Unless required by applicable law or agreed to in writing, software 43942 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 43943 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43944 * 43945 * See the License for the specific language governing permissions and limitations under the License. 43946 */ function at() { 43947 return navigator.userAgent; 43948 } 43949 function st() { 43950 var e = at(); 43951 return e && !it.test(e); 43952 } 43953 function ut() { 43954 var e = document.documentMode && document.documentMode < 10; 43955 return !(!window.postMessage || e); 43956 } 43957 function ct() { 43958 return "undefined" != typeof crypto && crypto.subtle && "undefined" != typeof Uint8Array; 43959 } 43960 function ft() { 43961 return "undefined" != typeof TextEncoder; 43962 } 43963 function lt() { 43964 return ct() && ft(); 43965 } 43966 function ht() { 43967 return "https:" === window.location.protocol; 43968 } 43969 function dt() { 43970 return "localhost" === window.location.hostname; 43971 } 43972 var pt = n(11), gt = n(19), vt = { 43973 getHttpCache: function() { 43974 return null; 43975 }, 43976 getPKCEStorage: function() { 43977 return null; 43978 }, 43979 browserHasLocalStorage: function() { 43980 try { 43981 var e = vt.getLocalStorage(); 43982 return vt.testStorage(e); 43983 } catch (e) { 43984 return !1; 43985 } 43986 }, 43987 browserHasSessionStorage: function() { 43988 try { 43989 var e = vt.getSessionStorage(); 43990 return vt.testStorage(e); 43991 } catch (e) { 43992 return !1; 43993 } 43994 }, 43995 testStorageType: function(e) { 43996 var t = !1; 43997 switch (e) { 43998 case "sessionStorage": 43999 t = vt.browserHasSessionStorage(); 44000 break; 44001 case "localStorage": 44002 t = vt.browserHasLocalStorage(); 44003 break; 44004 case "cookie": 44005 case "memory": 44006 t = !0; 44007 break; 44008 default: t = !1; 44009 } 44010 return t; 44011 }, 44012 getStorageByType: function(e, t) { 44013 var n = null; 44014 switch (e) { 44015 case "sessionStorage": 44016 n = vt.getSessionStorage(); 44017 break; 44018 case "localStorage": 44019 n = vt.getLocalStorage(); 44020 break; 44021 case "cookie": 44022 n = vt.getCookieStorage(t); 44023 break; 44024 case "memory": 44025 n = vt.getInMemoryStorage(); 44026 break; 44027 default: throw new S("Unrecognized storage option: ".concat(e)); 44028 } 44029 return n; 44030 }, 44031 findStorageType: function(e) { 44032 var t, n; 44033 return t = (e = e.slice()).shift(), (n = e.length ? e[0] : null) ? vt.testStorageType(t) ? t : (Y("This browser doesn't support ".concat(t, ". Switching to ").concat(n, ".")), vt.findStorageType(e)) : t; 44034 }, 44035 getLocalStorage: function() { 44036 return localStorage; 44037 }, 44038 getSessionStorage: function() { 44039 return sessionStorage; 44040 }, 44041 getCookieStorage: function(e) { 44042 var t = e.secure, n = e.sameSite; 44043 if (void 0 === t || void 0 === n) throw new S("getCookieStorage: \"secure\" and \"sameSite\" options must be provided"); 44044 var r = { 44045 getItem: vt.storage.get, 44046 setItem: function(e, r, o) { 44047 o = void 0 === o ? "2200-01-01T00:00:00.000Z" : o, vt.storage.set(e, r, o, { 44048 secure: t, 44049 sameSite: n 44050 }); 44051 }, 44052 removeItem: function(e) { 44053 vt.storage.delete(e); 44054 } 44055 }; 44056 return e.useMultipleCookies ? { 44057 getItem: function(e) { 44058 var t = r.getItem(), n = {}; 44059 return Object.keys(t).forEach((function(r) { 44060 0 === r.indexOf(e) && (n[r.replace("".concat(e, "_"), "")] = JSON.parse(t[r])); 44061 })), JSON.stringify(n); 44062 }, 44063 setItem: function(e, t) { 44064 var n = JSON.parse(this.getItem(e)); 44065 t = JSON.parse(t), Object.keys(t).forEach((function(o) { 44066 var i = e + "_" + o, a = JSON.stringify(t[o]); 44067 r.setItem(i, a), delete n[o]; 44068 }
44068)), Object.keys(n).forEach((function(t) { 44069 r.removeItem(e + "_" + t); 44070 })); 44071 }, 44072 removeItem: function(e) { 44073 var t = JSON.parse(this.getItem(e)); 44074 Object.keys(t).forEach((function(t) { 44075 r.removeItem(e + "_" + t); 44076 })); 44077 } 44078 } : r; 44079 }, 44080 getInMemoryStorage: function() { 44081 var e = {}; 44082 return { 44083 getItem: function(t) { 44084 return e[t]; 44085 }, 44086 setItem: function(t, n) { 44087 e[t] = n; 44088 } 44089 }; 44090 }, 44091 testStorage: function(e) { 44092 var t = "okta-test-storage"; 44093 try { 44094 return e.setItem(t, t), e.removeItem(t), !0; 44095 } catch (e) { 44096 return !1; 44097 } 44098 }, 44099 storage: { 44100 set: function(e, t, n, r) { 44101 var o = r.secure, i = r.sameSite; 44102 if (void 0 === o || void 0 === i) throw new S("storage.set: \"secure\" and \"sameSite\" options must be provided"); 44103 var a = { 44104 path: r.path || "/", 44105 secure: o, 44106 sameSite: i 44107 }; 44108 return Date.parse(n) && (a.expires = new Date(n)), gt.set(e, t, a), vt.storage.get(e); 44109 }, 44110 get: function(e) { 44111 return gt.get(e); 44112 }, 44113 delete: function(e) { 44114 return gt.remove(e, { path: "/" }); 44115 } 44116 } 44117 }, yt = vt; 44118 /*! 44119 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44120 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44121 * 44122 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44123 * Unless required by applicable law or agreed to in writing, software 44124 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44125 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44126 * 44127 * See the License for the specific language governing permissions and limitations under the License. 44128 * 44129 */ 44130 /*! 44131 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44132 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44133 * 44134 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44135 * Unless required by applicable law or agreed to in writing, software 44136 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44137 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44138 * 44139 * See the License for the specific language governing permissions and limitations under the License. 44140 * 44141 */ 44142 function mt(e) { 44143 return e.session.get().then((function(e) { 44144 return "ACTIVE" === e.status; 44145 })).catch((function() { 44146 return !1; 44147 })); 44148 } 44149 function kt(e) { 44150 return Oe.get(e, "/api/v1/sessions/me").then((function(t) { 44151 var n = G(t, "_links"); 44152 return n.refresh = function() { 44153 return Oe.post(e, z(t, "refresh").href); 44154 }, n.user = function() { 44155 return Oe.get(e, z(t, "user").href); 44156 }, n; 44157 })).catch((function() { 44158 return { status: "INACTIVE" }; 44159 })); 44160 } 44161 function wt(e) { 44162 return Oe.httpRequest(e, { 44163 url: e.getIssuerOrigin() + "/api/v1/sessions/me", 44164 method: "DELETE" 44165 }); 44166 } 44167 function Tt(e) { 44168 return Oe.post(e, "/api/v1/sessions/me/lifecycle/refresh"); 44169 } 44170 function bt(e, t, n) { 44171 n = n || window.location.href, window.location.assign(e.getIssuerOrigin() + "/login/sessionCookieRedirect" + F({ 44172 checkAccountSetupComplete: !0, 44173 token: t, 44174 redirectUrl: n 44175 })); 44176 } 44177 function St(e) { 44178 if (!e.clientId) throw new S("A clientId must be specified in the OktaAuth constructor to get a token"); 44179 if (M(e.responseType) && -1 !== e.responseType.indexOf(" ")) throw new S("Multiple OAuth responseTypes must be defined as an array"); 44180 var t = { 44181 client_id: e.clientId, 44182 code_challenge: e.codeChallenge, 44183 code_challenge_method: e.codeChallengeMethod, 44184 display: e.display, 44185 idp: e.idp, 44186 idp_scope: e.idpScope, 44187 login_hint: e.loginHint, 44188 max_age: e.maxAge, 44189 nonce: e.nonce, 44190 prompt: e.prompt, 44191 redirect_uri: e.redirectUri, 44192 response_mode: e.responseMode, 44193 response_type: e.responseType, 44194 sessionToken: e.sessionToken, 44195 state: e.state 44196 }; 44197 if (t = q(t), ["idp_scope", "response_type"].forEach((function(e) { 44198 Array.isArray(t[e]) && (t[e] = t[e].join(" ")); 44199 })), -1 !== e.responseType.indexOf("id_token") && -1 === e.scopes.indexOf("openid")) throw new S("openid scope must be specified in the scopes argument when requesting an id_token"); 44200 return t.scope = e.scopes.join(" "), t; 44201 } 44202 function Ot(e) { 44203 return F(St(e)); 44204 } 44205 var _t = n(13), Et = n.n(_t); 44206 function At(e, t, n) { 44207 (function(e) { 44208 if (!e.clientId) throw new S("A clientId must be specified in the OktaAuth constructor to get a token"); 44209 if (!e.redirectUri) throw new S("The redirectUri passed to /authorize must also be passed to /token"); 44210 if (!e.authorizationCode && !e.interactionCode) throw new S("An authorization code (returned from /authorize) must be passed to /token"); 44211 if (!e.codeVerifier) throw new S("The \"codeVerifier\" (generated and saved by your app) must be passed to /token"); 44212 })(t); 44213 var r = function(e) { 44214 var t = q({ 44215 client_id: e.clientId, 44216 redirect_uri: e.redirectUri, 44217 grant_type: e.interactionCode ? "interaction_code" : "authorization_code", 44218 code_verifier: e.codeVerifier 44219 }); 44220 return e.interactionCode ? t.interaction_code = e.interactionCode : e.authorizationCode && (t.code = e.authorizationCode), F(t).slice(1); 44221 }(t); 44222 return Oe.httpRequest(e, { 44223 url: n.tokenUrl, 44224 method: "POST", 44225 args: r, 44226 withCredentials: !1, 44227 headers: { "Content-Type": "application/x-www-form-urlencoded" } 44228 }); 44229 } 44230 function xt(e, t, n) { 44231 return Oe.httpRequest(e, { 44232 url: n.tokenUrl, 44233 method: "POST", 44234 withCredentials: !1, 44235 headers: { "Content-Type": "application/x-www-form-urlencoded" }, 44236 args: Object.entries({ 44237 client_id: t.clientId, 44238 grant_type: "refresh_token", 44239 scope: n.scopes.join(" "), 44240 refresh_token: n.refreshToken 44241 }).map((function(e) { 44242 var t = Et()(e, 2), n = t[0], r = t[1]; 44243 return n + "=" + encodeURIComponent(r); 44244 })).join("&") 44245 }); 44246 } 44247 /*! 44248 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44249 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44250 * 44251 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44252 * Unless required by applicable law or agreed to in writing, softw
44252are 44253 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44254 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44255 * 44256 * See the License for the specific language governing permissions and limitations under the License. 44257 * 44258 */ function Pt(e, t) { 44259 var n = t || e.options.issuer; 44260 return Oe.get(e, n + "/.well-known/openid-configuration", { cacheResponse: !0 }); 44261 } 44262 function Ct(e, t, n) { 44263 var r = e.storageManager.getHttpCache(e.options.cookies); 44264 return Pt(e, t).then((function(t) { 44265 var o = t.jwks_uri, i = r.getStorage()[o]; 44266 if (i && Date.now() / 1e3 < i.expiresAt) { 44267 var a = W(i.response.keys, { kid: n }); 44268 if (a) return a; 44269 } 44270 return r.clearStorage(o), Oe.get(e, o, { cacheResponse: !0 }).then((function(e) { 44271 var t = W(e.keys, { kid: n }); 44272 if (t) return t; 44273 throw new S("The key id, " + n + ", was not found in the server's keys"); 44274 })); 44275 })); 44276 } 44277 /*! 44278 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44279 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44280 * 44281 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44282 * Unless required by applicable law or agreed to in writing, software 44283 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44284 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44285 * 44286 * See the License for the specific language governing permissions and limitations under the License. 44287 * 44288 */ function Rt(e, t, n) { 44289 e.addEventListener ? e.addEventListener(t, n) : e.attachEvent("on" + t, n); 44290 } 44291 function Ut(e, t, n) { 44292 e.removeEventListener ? e.removeEventListener(t, n) : e.detachEvent("on" + t, n); 44293 } 44294 function jt(e) { 44295 var t = document.createElement("iframe"); 44296 return t.style.display = "none", t.src = e, document.body.appendChild(t); 44297 } 44298 function It(e, t) { 44299 var n = t.popupTitle || "External Identity Provider User Authentication", r = "toolbar=no, scrollbars=yes, resizable=yes, top=100, left=500, width=600, height=600"; 44300 if (Z()) { 44301 var o = window.open("/", n, r); 44302 return o.location.href = e, o; 44303 } 44304 return window.open(e, n, r); 44305 } 44306 function Mt(e, t, n) { 44307 var r, o; 44308 return new Promise((function(i, a) { 44309 r = function(t) { 44310 if (t.data && t.data.state === n) return t.origin !== e.getIssuerOrigin() ? a(new S("The request does not match client configuration")) : void i(t.data); 44311 }, Rt(window, "message", r), o = setTimeout((function() { 44312 a(new S("OAuth flow timed out")); 44313 }), t || 12e4); 44314 })).finally((function() { 44315 clearTimeout(o), Ut(window, "message", r); 44316 })); 44317 } 44318 /*! 44319 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44320 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44321 * 44322 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44323 * Unless required by applicable law or agreed to in writing, software 44324 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44325 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44326 * 44327 * See the License for the specific language governing permissions and limitations under the License. 44328 * 44329 */ function Lt() { 44330 return H(64); 44331 } 44332 function Nt() { 44333 return H(64); 44334 } 44335 function Dt(e, t) { 44336 if (arguments.length > 2) throw new S("As of version 3.0, \"getOAuthUrls\" takes only a single set of options"); 44337 var n = Q((t = t || {}).authorizeUrl) || e.options.authorizeUrl, r = Q(t.issuer) || e.options.issuer, o = Q(t.userinfoUrl) || e.options.userinfoUrl, i = Q(t.tokenUrl) || e.options.tokenUrl, a = Q(t.logoutUrl) || e.options.logoutUrl, s = Q(t.revokeUrl) || e.options.revokeUrl, u = r.indexOf("/oauth2") > 0 ? r : r + "/oauth2"; 44338 return { 44339 issuer: r, 44340 authorizeUrl: n = n || u + "/v1/authorize", 44341 userinfoUrl: o = o || u + "/v1/userinfo", 44342 tokenUrl: i = i || u + "/v1/token", 44343 revokeUrl: s = s || u + "/v1/revoke", 44344 logoutUrl: a = a || u + "/v1/logout" 44345 }; 44346 } 44347 /*! 44348 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44349 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44350 * 44351 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44352 * Unless required by applicable law or agreed to in writing, softw
44352are 44353 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44354 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44355 * 44356 * See the License for the specific language governing permissions and limitations under the License. 44357 * 44358 */ function Ft(e) { 44359 var t = e.options, n = t.pkce, r = t.clientId, o = t.redirectUri, i = t.responseType, a = t.responseMode, s = t.scopes, u = t.state, c = t.ignoreSignature; 44360 return { 44361 pkce: n, 44362 clientId: r, 44363 redirectUri: o || window.location.href, 44364 responseType: i || ["token", "id_token"], 44365 responseMode: a, 44366 state: u || Lt(), 44367 nonce: Nt(), 44368 scopes: s || ["openid", "email"], 44369 ignoreSignature: c 44370 }; 44371 } 44372 function Ht(e) { 44373 return "OAuthError" === e.name && "interaction_required" === e.errorCode; 44374 } 44375 function Kt(e, t) { 44376 if ("AuthApiError" !== t.name) return !1; 44377 var n = t.xhr, r = null == n ? void 0 : n.responseJSON; 44378 return e.options.pkce && "invalid_grant" === (null == r ? void 0 : r.error); 44379 } 44380 function qt(e) { 44381 return /((id|access)_token=)/i.test(e); 44382 } 44383 function Bt(e) { 44384 return /(code=)/i.test(e); 44385 } 44386 function Gt(e) { 44387 return /(interaction_code=)/i.test(e); 44388 } 44389 function Wt(e) { 44390 return /(error=)/i.test(e) || /(error_description)/i.test(e); 44391 } 44392 function zt(e, t) { 44393 var n = t.options; 44394 return e && 0 === e.indexOf(n.redirectUri); 44395 } 44396 function Jt(e) { 44397 return e.pkce || "code" === e.responseType || "query" === e.responseMode; 44398 } 44399 function Vt(e) { 44400 return Jt(e) && "fragment" !== e.responseMode ? window.location.search : window.location.hash; 44401 } 44402 function Yt(e) { 44403 if (!zt(window.location.href, e)) return !1; 44404 var t = Jt(e.options), n = Vt(e.options); 44405 return !!Wt(n) || (t ? Bt(n) || Gt(n) : qt(window.location.hash)); 44406 } 44407 function Xt(e) { 44408 if (!Yt(e)) return !1; 44409 var t = Vt(e.options); 44410 return /(error=interaction_required)/i.test(t); 44411 } 44412 /*! 44413 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44414 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44415 * 44416 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44417 * Unless required by applicable law or agreed to in writing, software 44418 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44419 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44420 * 44421 * See the License for the specific language governing permissions and limitations under the License. 44422 * 44423 */ function $t(e, t) { 44424 var n = Ft(e); 44425 if (!1 === (t = Object.assign({}, n, B(t))).pkce) return Promise.resolve(t); 44426 if (!e.features.isPKCESupported()) { 44427 var r = "PKCE requires a modern browser with encryption support running in a secure context."; 44428 return e.features.isHTTPS() || (r += "\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol."), e.features.hasTextEncoder() || (r += "\n\"TextEncoder\" is not defined. To use PKCE, you may need to include a polyfill/shim for this browser."), Promise.reject(new S(r)); 44429 } 44430 return t.codeChallengeMethod || (t.codeChallengeMethod = be), t.responseType = "code", Pt(e, null).then((function(e) { 44431 if (-1 === (e.code_challenge_methods_supported || []).indexOf(t.codeChallengeMethod)) throw new S("Invalid code_challenge_method"); 44432 })).then((function() { 44433 return t.codeVerifier || (t.codeVerifier = He.generateVerifier()), He.computeChallenge(t.codeVerifier); 44434 })).then((function(e) { 44435 var n = B(t) || {}; 44436 return Object.assign(n, t, { codeChallenge: e }), n; 44437 })); 44438 } 44439 /*! 44440 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44441 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44442 * 44443 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44444 * Unless required by applicable law or agreed to in writing, softw
44444are 44445 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44446 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44447 * 44448 * See the License for the specific language governing permissions and limitations under the License. 44449 * 44450 */ function Qt(e) { 44451 var t = /\+/g, n = /([^&=]+)=?([^&]*)/g, r = e; 44452 "#" === r.charAt(0) && "/" === r.charAt(1) && (r = r.substring(2)), "#" !== r.charAt(0) && "?" !== r.charAt(0) || (r = r.substring(1)); 44453 for (var o, i = {}; o = n.exec(r);) { 44454 var a = o[1], s = o[2]; 44455 i[a] = "id_token" === a || "access_token" === a || "code" === a ? s : decodeURIComponent(s.replace(t, " ")); 44456 } 44457 return i; 44458 } 44459 /*! 44460 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44461 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44462 * 44463 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44464 * Unless required by applicable law or agreed to in writing, software 44465 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44466 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44467 * 44468 * See the License for the specific language governing permissions and limitations under the License. 44469 * 44470 */ function Zt(e, t, n) { 44471 var r = n.clientId, o = n.issuer, i = n.nonce; 44472 if (!t || !o || !r) throw new S("The jwt, iss, and aud arguments are all required"); 44473 if (i && t.nonce !== i) throw new S("OAuth flow response nonce doesn't match request nonce"); 44474 var a = Math.floor(Date.now() / 1e3); 44475 if (t.iss !== o) throw new S("The issuer [" + t.iss + "] does not match [" + o + "]"); 44476 if (t.aud !== r) throw new S("The audience [" + t.aud + "] does not match [" + r + "]"); 44477 if (t.iat > t.exp) throw new S("The JWT expired before it was issued"); 44478 if (a - e.options.maxClockSkew > t.exp) throw new S("The JWT expired and is no longer valid"); 44479 if (t.iat > a + e.options.maxClockSkew) throw new S("The JWT was issued in the future"); 44480 } 44481 /*! 44482 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44483 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44484 * 44485 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44486 * Unless required by applicable law or agreed to in writing, software 44487 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44488 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44489 * 44490 * See the License for the specific language governing permissions and limitations under the License. 44491 * 44492 */ 44493 /*! 44494 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44495 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44496 * 44497 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44498 * Unless required by applicable law or agreed to in writing, software 44499 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44500 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44501 * 44502 * See the License for the specific language governing permissions and limitations under the License. 44503 * 44504 */ function en(e) { 44505 var t, n = e.split("."); 44506 try { 44507 t = { 44508 header: JSON.parse(x(n[0])), 44509 payload: JSON.parse(x(n[1])), 44510 signature: n[2] 44511 }; 44512 } catch (e) { 44513 throw new S("Malformed token"); 44514 } 44515 return t; 44516 } 44517 /*! 44518 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44519 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44520 * 44521 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44522 * Unless required by applicable law or agreed to in writing, softw
44522are 44523 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44524 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44525 * 44526 * See the License for the specific language governing permissions and limitations under the License. 44527 * 44528 */ function tn(e, t) { 44529 return Promise.resolve().then((function() { 44530 var n, r; 44531 if (t && (n = t.accessToken, r = t.refreshToken), !n && !r) throw new S("A valid access or refresh token object is required"); 44532 var o = e.options.clientId; 44533 if (!o) throw new S("A clientId must be specified in the OktaAuth constructor to revoke a token"); 44534 var i = Dt(e).revokeUrl, a = F({ 44535 token_type_hint: r ? "refresh_token" : "access_token", 44536 token: r || n 44537 }).slice(1), s = btoa(o); 44538 return Oe.post(e, i, a, { headers: { 44539 "Content-Type": "application/x-www-form-urlencoded", 44540 Authorization: "Basic " + s 44541 } }); 44542 })); 44543 } 44544 /*! 44545 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44546 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44547 * 44548 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44549 * Unless required by applicable law or agreed to in writing, software 44550 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44551 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44552 * 44553 * See the License for the specific language governing permissions and limitations under the License. 44554 * 44555 */ function nn(e, t, n) { 44556 n = n || Dt(e, t); 44557 var r = t = Object.assign({}, Ft(e), B(t)), o = r.authorizationCode, i = r.interactionCode, a = r.codeVerifier, s = r.clientId, u = r.redirectUri, c = r.scopes, f = r.ignoreSignature; 44558 return At(e, { 44559 clientId: s, 44560 redirectUri: u, 44561 authorizationCode: o, 44562 interactionCode: i, 44563 codeVerifier: a 44564 }, n).then((function(t) { 44565 var r = ["token"]; 44566 return -1 !== c.indexOf("openid") && r.push("id_token"), sn(e, { 44567 clientId: s, 44568 redirectUri: u, 44569 scopes: c, 44570 responseType: r, 44571 ignoreSignature: f 44572 }, t, n).then((function(e) { 44573 return e.code = o, e; 44574 })); 44575 })); 44576 } 44577 /*! 44578 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44579 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44580 * 44581 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44582 * Unless required by applicable law or agreed to in writing, software 44583 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44584 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44585 * 44586 * See the License for the specific language governing permissions and limitations under the License. 44587 */ function rn(e, t) { 44588 t = B(t); 44589 var n = { 44590 name: "RSASSA-PKCS1-v1_5", 44591 hash: { name: "SHA-256" } 44592 }; 44593 return delete t.use, crypto.subtle.importKey("jwk", t, n, !0, ["verify"]).then((function(t) { 44594 var r = e.split("."), o = P(r[0] + "." + r[1]), i = P(C(r[2])); 44595 return crypto.subtle.verify(n, t, i, o); 44596 })); 44597 } 44598 var on = function(e, t, n, r) { 44599 return new (n || (n = Promise))((function(o, i) { 44600 function a(e) { 44601 try { 44602 u(r.next(e)); 44603 } catch (e) { 44604 i(e); 44605 } 44606 } 44607 function s(e) { 44608 try { 44609 u(r.throw(e)); 44610 } catch (e) { 44611 i(e); 44612 } 44613 } 44614 function u(e) { 44615 var t; 44616 e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) { 44617 e(t); 44618 }))).then(a, s); 44619 } 44620 u((r = r.apply(e, t || [])).next()); 44621 })); 44622 }; 44623 /*! 44624 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44625 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44626 * 44627 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44628 * Unless required by applicable law or agreed to in writing, softw
44628are 44629 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44630 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44631 * 44632 * See the License for the specific language governing permissions and limitations under the License. 44633 * 44634 */ function an(e, t, n) { 44635 return on(this, void 0, void 0, a.a.mark((function r() { 44636 var o, i, s, u; 44637 return a.a.wrap((function(r) { 44638 for (;;) switch (r.prev = r.next) { 44639 case 0: 44640 if (t && t.idToken) { 44641 r.next = 2; 44642 break; 44643 } 44644 throw new S("Only idTokens may be verified"); 44645 case 2: return o = en(t.idToken), r.next = 5, Pt(e); 44646 case 5: 44647 if (i = r.sent, s = { 44648 issuer: i.issuer, 44649 clientId: e.options.clientId, 44650 ignoreSignature: e.options.ignoreSignature 44651 }, Object.assign(s, n), Zt(e, o.payload, s), 1 != s.ignoreSignature && e.features.isTokenVerifySupported()) { 44652 r.next = 11; 44653 break; 44654 } 44655 return r.abrupt("return", t); 44656 case 11: return r.next = 13, Ct(e, t.issuer, o.header.kid); 44657 case 13: return u = r.sent, r.next = 16, rn(t.idToken, u); 44658 case 16: 44659 if (r.sent) { 44660 r.next = 19; 44661 break; 44662 } 44663 throw new S("The token signature is not valid"); 44664 case 19: 44665 if (!(n && n.accessToken && t.claims.at_hash)) { 44666 r.next = 25; 44667 break; 44668 } 44669 return r.next = 22, a = n.accessToken, c = void 0, c = new TextEncoder().encode(a), crypto.subtle.digest("SHA-256", c).then((function(e) { 44670 var t = new Uint8Array(e).slice(0, 16); 44671 return _(String.fromCharCode.apply(null, t)); 44672 })); 44673 case 22: 44674 if (r.sent === t.claims.at_hash) { 44675 r.next = 25; 44676 break; 44677 } 44678 throw new S("Token hash verification failed"); 44679 case 25: return r.abrupt("return", t); 44680 case 26: 44681 case "end": return r.stop(); 44682 } 44683 var a, c; 44684 }), r); 44685 }))); 44686 } 44687 /*! 44688 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44689 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44690 * 44691 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44692 * Unless required by applicable law or agreed to in writing, software 44693 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44694 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44695 * 44696 * See the License for the specific language governing permissions and limitations under the License. 44697 * 44698 */ function sn(e, t, n, r) { 44699 if (!1 !== e.options.pkce && (n.code || n.interaction_code)) return nn(e, Object.assign({}, t, { 44700 authorizationCode: n.code, 44701 interactionCode: n.interaction_code 44702 }), r); 44703 t = t || Ft(e), r = r || Dt(e, t); 44704 var o, i = t.responseType; 44705 Array.isArray(i) || (i = [i]), o = n.scope ? n.scope.split(" ") : B(t.scopes); 44706 var a = t.clientId || e.options.clientId; 44707 return Promise.resolve().then((function() { 44708 (function(e, t) { 44709 if (e.error || e.error_description) throw new Ge(e.error, e.error_description); 44710 if (e.state !== t.state) throw new S("OAuth flow response state doesn't match request state"); 44711 })(n, t); 44712 })).then((function() { 44713 var i = {}, s = n.expires_in, u = n.token_type, c = n.access_token, f = n.id_token, l = n.refresh_token; 44714 if (c) i.accessToken = { 44715 value: c, 44716 accessToken: c, 44717 claims: e.token.decode(c).payload, 44718 expiresAt: Number(s) + Math.floor(Date.now() / 1e3), 44719 tokenType: u, 44720 scopes: o, 44721 authorizeUrl: r.authorizeUrl, 44722 userinfoUrl: r.userinfoUrl 44723 }; 44724 if (l && (i.refreshToken = { 44725 value: l, 44726 refreshToken: l, 44727 expiresAt: Number(s) + Math.floor(Date.now() / 1e3), 44728 scopes: o, 44729 tokenUrl: r.tokenUrl, 44730 authorizeUrl: r.authorizeUrl, 44731 issuer: r.issuer 44732 }), f) { 44733 var d = e.token.decode(f), p = { 44734 value: f, 44735 idToken: f, 44736 claims: d.payload, 44737 expiresAt: d.payload.exp, 44738 scopes: o, 44739 authorizeUrl: r.authorizeUrl, 44740 issuer: r.issuer, 44741 clientId: a 44742 }, g = { 44743 clientId: a, 44744 issuer: r.issuer, 44745 nonce: t.nonce, 44746 accessToken: c 44747 }; 44748 return void 0 !== t.ignoreSignature && (g.ignoreSignature = t.ignoreSignature), an(e, p, g).then((function() { 44749 return i.idToken = p, i; 44750 })); 44751 } 44752 return i; 44753 })).then((function(e) { 44754 if (-1 !== i.indexOf("token") && !e.accessToken) throw new S("Unable to parse OAuth flow response: response type \"token\" was requested but \"access_token\" was not returned."); 44755 if (-1 !== i.indexOf("id_token") && !e.idToken) throw new S("Unable to parse OAuth flow response: response type \"id_token\" was requested but \"id_token\" was not returned."); 44756 return { 44757 tokens: e, 44758 state: n.state, 44759 code: n.code 44760 }; 44761 })); 44762 } 44763 /*! 44764 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44765 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44766 * 44767 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44768 * Unless required by applicable law or agreed to in writing, softw
44768are 44769 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44770 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44771 * 44772 * See the License for the specific language governing permissions and limitations under the License. 44773 * 44774 */ function un(e, t) { 44775 return arguments.length > 2 ? Promise.reject(new S("As of version 3.0, \"getToken\" takes only a single set of options")) : $t(e, t = t || {}).then((function(n) { 44776 var r, o; 44777 switch (t.sessionToken ? Object.assign(n, { 44778 prompt: "none", 44779 responseMode: "okta_post_message", 44780 display: null 44781 }) : t.idp && Object.assign(n, { display: "popup" }), o = Dt(e, n), r = (t.codeVerifier ? o.tokenUrl : o.authorizeUrl) + Ot(n), n.sessionToken || null === n.display ? "IFRAME" : "popup" === n.display ? "POPUP" : "IMPLICIT") { 44782 case "IFRAME": 44783 var i = Mt(e, t.timeout, n.state), a = jt(r); 44784 return i.then((function(t) { 44785 return sn(e, n, t, o); 44786 })).finally((function() { 44787 document.body.contains(a) && a.parentElement.removeChild(a); 44788 })); 44789 case "POPUP": 44790 var s; 44791 if ("okta_post_message" === n.responseMode) { 44792 if (!e.features.isPopupPostMessageSupported()) throw new S("This browser doesn't have full postMessage support"); 44793 s = Mt(e, t.timeout, n.state); 44794 } 44795 var u = It(r, { popupTitle: t.popupTitle }); 44796 return new Promise((function(e, t) { 44797 var n = setInterval((function() { 44798 u && !u.closed || (clearInterval(n), t(new S("Unable to parse OAuth flow response"))); 44799 }), 100); 44800 s.then((function(t) { 44801 clearInterval(n), e(t); 44802 })).catch((function(e) { 44803 clearInterval(n), t(e); 44804 })); 44805 })).then((function(t) { 44806 return sn(e, n, t, o); 44807 })).finally((function() { 44808 u && !u.closed && u.close(); 44809 })); 44810 default: throw new S("The full page redirect flow is not supported"); 44811 } 44812 })); 44813 } 44814 /*! 44815 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44816 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44817 * 44818 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44819 * Unless required by applicable law or agreed to in writing, software 44820 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44821 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44822 * 44823 * See the License for the specific language governing permissions and limitations under the License. 44824 * 44825 */ function cn(e, t) { 44826 return arguments.length > 2 ? Promise.reject(new S("As of version 3.0, \"getWithoutPrompt\" takes only a single set of options")) : (t = B(t) || {}, Object.assign(t, { 44827 prompt: "none", 44828 responseMode: "okta_post_message", 44829 display: null 44830 }), un(e, t)); 44831 } 44832 /*! 44833 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44834 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44835 * 44836 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44837 * Unless required by applicable law or agreed to in writing, software 44838 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44839 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44840 * 44841 * See the License for the specific language governing permissions and limitations under the License. 44842 * 44843 */ function fn(e, t) { 44844 return Ze(t) ? cn(e, { 44845 responseType: e.options.pkce ? "code" : et(t) ? "token" : "id_token", 44846 scopes: t.scopes, 44847 authorizeUrl: t.authorizeUrl, 44848 userinfoUrl: t.userinfoUrl, 44849 issuer: t.issuer 44850 }).then((function(e) { 44851 var n = e.tokens; 44852 return tt(t) ? n.idToken : n.accessToken; 44853 })) : Promise.reject(new S("Renew must be passed a token with an array of scopes and an accessToken or idToken")); 44854 } 44855 var ln = function(e, t, n, r) { 44856 return new (n || (n = Promise))((function(o, i) { 44857 function a(e) { 44858 try { 44859 u(r.next(e)); 44860 } catch (e) { 44861 i(e); 44862 } 44863 } 44864 function s(e) { 44865 try { 44866 u(r.throw(e)); 44867 } catch (e) { 44868 i(e); 44869 } 44870 } 44871 function u(e) { 44872 var t; 44873 e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) { 44874 e(t); 44875 }))).then(a, s); 44876 } 44877 u((r = r.apply(e, t || [])).next()); 44878 })); 44879 }; 44880 /*! 44881 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44882 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44883 * 44884 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44885 * Unless required by applicable law or agreed to in writing, softw
44885are 44886 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44887 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44888 * 44889 * See the License for the specific language governing permissions and limitations under the License. 44890 * 44891 */ function hn(e, t, n) { 44892 return ln(this, void 0, void 0, a.a.mark((function r() { 44893 var o, i, s, u, c, f; 44894 return a.a.wrap((function(r) { 44895 for (;;) switch (r.prev = r.next) { 44896 case 0: 44897 if (o = e.options.clientId) { 44898 r.next = 3; 44899 break; 44900 } 44901 throw new S("A clientId must be specified in the OktaAuth constructor to renew tokens"); 44902 case 3: return i = Object.assign({}, t, { clientId: o }), r.next = 6, xt(e, i, n); 44903 case 6: return s = r.sent, u = Dt(e, t), r.next = 10, sn(e, i, s, u); 44904 case 10: return c = r.sent, f = c.tokens, r.abrupt("return", f); 44905 case 13: 44906 case "end": return r.stop(); 44907 } 44908 }), r); 44909 }))); 44910 } 44911 function dn(e, t) { 44912 return e.tokenManager.getTokens().then((function(e) { 44913 return e.refreshToken; 44914 })).then((function(n) { 44915 if (n) return hn(e, t, n); 44916 if (t = Object.assign({ 44917 scopes: e.options.scopes, 44918 authorizeUrl: e.options.authorizeUrl, 44919 userinfoUrl: e.options.userinfoUrl, 44920 issuer: e.options.issuer 44921 }, t), e.options.pkce) t.responseType = "code"; 44922 else { 44923 var r = Ft(e).responseType; 44924 t.responseType = r; 44925 } 44926 return cn(e, t).then((function(e) { 44927 return e.tokens; 44928 })); 44929 })); 44930 } 44931 var pn = function(e, t, n, r) { 44932 return new (n || (n = Promise))((function(o, i) { 44933 function a(e) { 44934 try { 44935 u(r.next(e)); 44936 } catch (e) { 44937 i(e); 44938 } 44939 } 44940 function s(e) { 44941 try { 44942 u(r.throw(e)); 44943 } catch (e) { 44944 i(e); 44945 } 44946 } 44947 function u(e) { 44948 var t; 44949 e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) { 44950 e(t); 44951 }))).then(a, s); 44952 } 44953 u((r = r.apply(e, t || [])).next()); 44954 })); 44955 }; 44956 /*! 44957 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 44958 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 44959 * 44960 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 44961 * Unless required by applicable law or agreed to in writing, software 44962 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 44963 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44964 * 44965 * See the License for the specific language governing permissions and limitations under the License. 44966 * 44967 */ function gn(e, t, n) { 44968 return pn(this, void 0, void 0, a.a.mark((function r() { 44969 return a.a.wrap((function(r) { 44970 for (;;) switch (r.prev = r.next) { 44971 case 0: 44972 if (t) { 44973 r.next = 4; 44974 break; 44975 } 44976 return r.next = 3, e.tokenManager.getTokens(); 44977 case 3: t = r.sent.accessToken; 44978 case 4: 44979 if (n) { 44980 r.next = 8; 44981 break; 44982 } 44983 return r.next = 7, e.tokenManager.getTokens(); 44984 case 7: n = r.sent.idToken; 44985 case 8: 44986 if (t && et(t)) { 44987 r.next = 10; 44988 break; 44989 } 44990 return r.abrupt("return", Promise.reject(new S("getUserInfo requires an access token object"))); 44991 case 10: 44992 if (n && tt(n)) { 44993 r.next = 12; 44994 break; 44995 } 44996 return r.abrupt("return", Promise.reject(new S("getUserInfo requires an ID token object"))); 44997 case 12: return r.abrupt("return", Oe.httpRequest(e, { 44998 url: t.userinfoUrl, 44999 method: "GET", 45000 accessToken: t.accessToken 45001 }).then((function(e) { 45002 return e.sub === n.claims.sub ? e : Promise.reject(new S("getUserInfo request was rejected due to token mismatch")); 45003 })).catch((function(e) { 45004 var t; 45005 if (e.xhr && (401 === e.xhr.status || 403 === e.xhr.status) && (e.xhr.headers && ee(e.xhr.headers.get) && e.xhr.headers.get("WWW-Authenticate") ? t = e.xhr.headers.get("WWW-Authenticate") : ee(e.xhr.getResponseHeader) && (t = e.xhr.getResponseHeader("WWW-Authenticate")), t)) { 45006 var n = t.match(/error="(.*?)"/) || [], r = t.match(/error_description="(.*?)"/) || [], o = n[1], i = r[1]; 45007 o && i && (e = new Ge(o, i)); 45008 } 45009 throw e; 45010 }))); 45011 case 13: 45012 case "end": return r.stop(); 45013 } 45014 }), r); 45015 }
45015))); 45016 } 45017 /*! 45018 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 45019 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 45020 * 45021 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 45022 * Unless required by applicable law or agreed to in writing, software 45023 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45024 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45025 * 45026 * See the License for the specific language governing permissions and limitations under the License. 45027 * 45028 */ function vn(e, t) { 45029 return arguments.length > 2 ? Promise.reject(new S("As of version 3.0, \"getWithPopup\" takes only a single set of options")) : (t = B(t) || {}, Object.assign(t, { 45030 display: "popup", 45031 responseMode: "okta_post_message" 45032 }), un(e, t)); 45033 } 45034 /*! 45035 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 45036 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 45037 * 45038 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 45039 * Unless required by applicable law or agreed to in writing, software 45040 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45041 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45042 * 45043 * See the License for the specific language governing permissions and limitations under the License. 45044 * 45045 */ function yn(e, t) { 45046 return arguments.length > 2 ? Promise.reject(new S("As of version 3.0, \"getWithRedirect\" takes only a single set of options")) : (t = B(t) || {}, $t(e, t).then((function(n) { 45047 var r = Dt(e, t), o = r.authorizeUrl + Ot(n), i = { 45048 responseType: n.responseType, 45049 state: n.state, 45050 nonce: n.nonce, 45051 scopes: n.scopes, 45052 clientId: n.clientId, 45053 urls: r, 45054 ignoreSignature: n.ignoreSignature, 45055 redirectUri: n.redirectUri, 45056 codeVerifier: n.codeVerifier, 45057 codeChallenge: n.codeChallenge, 45058 codeChallengeMethod: n.codeChallengeMethod 45059 }; 45060 e.transactionManager.save(i, { oauth: !0 }), e.token.getWithRedirect._setLocation(o); 45061 }))); 45062 } 45063 /*! 45064 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 45065 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 45066 * 45067 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 45068 * Unless required by applicable law or agreed to in writing, software 45069 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45070 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45071 * 45072 * See the License for the specific language governing permissions and limitations under the License. 45073 * 45074 */ function mn(e, t) { 45075 t = M(t = t || {}) ? { url: t } : t; 45076 var n, r = e.options.pkce ? "query" : "fragment", o = t.url, i = t.responseMode || e.options.responseMode || r, a = e.token.parseFromUrl._getLocation(); 45077 if (!(n = "query" === i ? o ? o.substring(o.indexOf("?")) : a.search : o ? o.substring(o.indexOf("#")) : a.hash)) return Promise.reject(new S("Unable to parse a token from the url")); 45078 var s = e.transactionManager.load({ 45079 oauth: !0, 45080 pkce: e.options.pkce 45081 }), u = s.urls; 45082 return delete s.urls, Promise.resolve(Qt(n)).then((function(t) { 45083 return o || ("query" === i ? function(e) { 45084 var t = e.token.parseFromUrl._getHistory(), n = e.token.parseFromUrl._getDocument(), r = e.token.parseFromUrl._getLocation(); 45085 t && t.replaceState ? t.replaceState(null, n.title, r.pathname + r.hash) : r.search = ""; 45086 }(e) : function(e) { 45087 var t = e.token.parseFromUrl._getHistory(), n = e.token.parseFromUrl._getDocument(), r = e.token.parseFromUrl._getLocation(); 45088 t && t.replaceState ? t.replaceState(null, n.title, r.pathname + r.search) : r.hash = ""; 45089 }(e)), sn(e, s, t, u).catch((function(t) { 45090 throw Ht(t) || e.transactionManager.clear(), t; 45091 })).then((function(t) { 45092 return e.transactionManager.clear(), t; 45093 })); 45094 })); 45095 } 45096 /*! 45097 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 45098 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 45099 * 45100 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 45101 * Unless required by applicable law or agreed to in writing, softw
45101are 45102 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45103 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45104 * 45105 * See the License for the specific language governing permissions and limitations under the License. 45106 * 45107 */ var kn = n(8), wn = n.n(kn), Tn = function() { 45108 function e(t) { 45109 u()(this, e), this.localOffset = parseInt(t || 0); 45110 } 45111 return f()(e, [{ 45112 key: "now", 45113 value: function() { 45114 return (Date.now() + this.localOffset) / 1e3; 45115 } 45116 }], [{ 45117 key: "create", 45118 value: function() { 45119 return new e(0); 45120 } 45121 }]), e; 45122 }(), bn = { 45123 autoRenew: !0, 45124 autoRemove: !0, 45125 storage: "localStorage", 45126 expireEarlySeconds: 30, 45127 storageKey: he, 45128 _storageEventDelay: 0 45129 }, Sn = "expired", On = "renewed", _n = "added", En = "removed", An = "error"; 45130 function xn(e, t) { 45131 return t.expiresAt - e.options.expireEarlySeconds; 45132 } 45133 function Pn(e, t) { 45134 return xn(e, t) <= e.clock.now(); 45135 } 45136 function Cn(e, t, n) { 45137 e.emitter.emit(_n, t, n); 45138 } 45139 function Rn(e, t, n) { 45140 e.emitter.emit(En, t, n); 45141 } 45142 function Un(e, t) { 45143 e.emitter.emit(An, t); 45144 } 45145 function jn(e, t, n) { 45146 var r = Qn(n), o = Qn(t); 45147 Object.keys(o).forEach((function(t) { 45148 var n = r[t], i = o[t]; 45149 JSON.stringify(n) !== JSON.stringify(i) && Cn(e, t, i); 45150 })), Object.keys(r).forEach((function(t) { 45151 var n = r[t]; 45152 o[t] || Rn(e, t, n); 45153 })); 45154 } 45155 function In(e, t) { 45156 clearTimeout(e.expireTimeouts[t]), delete e.expireTimeouts[t], delete e.renewPromise[t]; 45157 } 45158 function Mn(e) { 45159 var t = e.expireTimeouts; 45160 for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && In(e, n); 45161 } 45162 function Ln(e, t, n, r) { 45163 var o = xn(t, r), i = 1e3 * Math.max(o - t.clock.now(), 0); 45164 In(t, n); 45165 var a = setTimeout((function() { 45166 (function(e, t, n) { 45167 e.emitter.emit(Sn, t, n); 45168 })(t, n, r); 45169 }), i); 45170 t.expireTimeouts[n] = a; 45171 } 45172 function Nn(e, t, n) { 45173 try { 45174 var r = n.getStorage(); 45175 } catch (e) { 45176 Un(t, e); 45177 return; 45178 } 45179 for (var o in r) if (Object.prototype.hasOwnProperty.call(r, o)) Ln(0, t, o, r[o]); 45180 } 45181 function Dn(e, t, n) { 45182 Mn(t), Nn(0, t, n); 45183 } 45184 function Fn(e) { 45185 if (!L(e) || !e.scopes || !e.expiresAt && 0 !== e.expiresAt || !tt(e) && !et(e) && !nt(e)) throw new S("Token must be an Object with scopes, expiresAt, and one of: an idToken, accessToken, or refreshToken property"); 45186 } 45187 function Hn(e, t, n, r, o) { 45188 var i = n.getStorage(); 45189 Fn(o), i[r] = o, n.setStorage(i), Cn(t, r, o), Ln(0, t, r, o); 45190 } 45191 function Kn(e, t, n, r, o) { 45192 e.features.isLocalhost() && Y("Use setTokens() instead if you want to add a set of tokens at same time.\nIt prevents current tab from emitting unnecessary StorageEvent,\nwhich may cause false-positive authState change cross tabs."), Hn(0, t, n, r, o); 45193 } 45194 function qn(e, t) { 45195 return e.getStorage()[t]; 45196 } 45197 function Bn(e, t) { 45198 var n = e.getStorage(); 45199 return Object.keys(n).filter((function(e) { 45200 var r = n[e]; 45201 return et(r) && "accessToken" === t || tt(r) && "idToken" === t || nt(r) && "refreshToken" === t; 45202 }))[0]; 45203 } 45204 function Gn(e, t) { 45205 return new Promise((function(n) { 45206 return n(qn(e, t)); 45207 })); 45208 } 45209 function Wn(e) { 45210 var t = {}, n = e.getStorage(); 45211 return Object.keys(n).forEach((function(e) { 45212 var r = n[e]; 45213 et(r) ? t.accessToken = r : tt(r) ? t.idToken = r : nt(r) && (t.refreshToken = r); 45214 })), t; 45215 } 45216 function zn(e) { 45217 return new Promise((function(t) { 45218 return t(Wn(e)); 45219 })); 45220 } 45221 function Jn(e, t, n, r, o, i, a) { 45222 var s = r.accessToken, u = r.idToken, c = r.refreshToken, f = function(e, n, r) { 45223 Cn(t, e, n), Ln(0, t, e, n), r && r(e, n); 45224 }, l = function(e, n, r) { 45225 In(t, e), Rn(t, e, n), r && r(e, n); 45226 }; 45227 u && Fn(u), s && Fn(s); 45228 var h = Bn(n, "idToken") || ye, d = Bn(n, "accessToken") || ve, p = Bn(n, "refreshToken") || me, g = Object.assign(Object.assign(Object.assign({}, u && wn()({}, h, u)), s && wn()({}, d, s)), c && wn()({}, p, c)); 45229 n.setStorage(g); 45230 var v = Wn(n); 45231 u ? f(h, u, i) : v.idToken && l(h, v.idToken, i), s ? f(d, s, o) : v.accessToken && l(d, v.accessToken, o), c ? f(p, c, a) : v.refreshToken && l(p, v.refreshToken, a); 45232 } 45233 function Vn(e, t, n) { 45234 In(e, n); 45235 var r = t.getStorage(), o = r[n]; 45236 delete r[n], t.setStorage(r), Rn(e, n, o); 45237 } 45238 function Yn(e, t) { 45239 return this.getTokens().then((function(e) { 45240 return e.refreshToken; 45241 })).then((function(n) { 45242 return n ? e.token.renewTokensWithRefresh({ scopes: t.scopes }, n).then((function(e) {
45243 return tt(t) ? e.idToken : e.accessToken; 45244 })) : e.token.renew(t); 45245 })); 45246 } 45247 function Xn(e, t, n, r) { 45248 var o = t.renewPromise[r]; 45249 if (o) return o; 45250 try { 45251 var i = qn(n, r); 45252 if (!i) throw new S("The tokenManager has no token for the key: " + r); 45253 } catch (e) { 45254 return Promise.reject(e); 45255 } 45256 return In(t, r), t.renewPromise[r] = Yn.call(this, e, i).then((function(e) { 45257 var o = n.getStorage(); 45258 return Vn(t, n, r), Hn(0, t, n, r, e), function(e, t, n, r) { 45259 e.emitter.emit(On, t, n, r); 45260 }(t, r, e, o[r]), e; 45261 })).catch((function(e) { 45262 if ("OAuthError" === e.name || "AuthSdkError" === e.name) { 45263 var o = n.getStorage(), i = o[r]; 45264 i && Pn(t, i) ? (delete o[r], In(t, r), n.setStorage(o), Rn(t, r, i)) : Rn(t, r), e.tokenKey = r, Un(t, e); 45265 } 45266 throw e; 45267 })).finally((function() { 45268 delete t.renewPromise[r]; 45269 })), t.renewPromise[r]; 45270 } 45271 function $n(e, t) { 45272 Mn(e), t.clearStorage(); 45273 } 45274 function Qn(e) { 45275 var t; 45276 try { 45277 t = JSON.parse(e) || {}; 45278 } catch (e) { 45279 t = {}; 45280 } 45281 return t; 45282 } 45283 var Zn = function e(t, n) { 45284 var r = this; 45285 u()(this, e), n = Object.assign({}, bn, q(n)); 45286 var o = t.emitter; 45287 if (!o) throw new S("Emitter should be initialized before TokenManager"); 45288 Z() && (n._storageEventDelay = n._storageEventDelay || 1e3); 45289 var i = q({ 45290 storageKey: n.storageKey, 45291 secure: n.secure 45292 }); 45293 "object" === ze()(n.storage) ? i.storageProvider = n.storage : n.storage && (i.storageType = n.storage); 45294 var a = t.storageManager.getTokenStorage(i), s = { 45295 clock: Tn.create(), 45296 options: n, 45297 emitter: o, 45298 expireTimeouts: {}, 45299 renewPromise: {} 45300 }; 45301 this.add = Kn.bind(this, t, s, a), this.get = Gn.bind(this, a), this.remove = Vn.bind(this, s, a), this.clear = $n.bind(this, s, a), this.renew = Xn.bind(this, t, s, a), this.on = s.emitter.on.bind(s.emitter), this.off = s.emitter.off.bind(s.emitter), this.hasExpired = Pn.bind(this, s), this.getTokens = zn.bind(this, a), this.setTokens = Jn.bind(this, t, s, a), this._getStorageKeyByType = Bn.bind(this, a), this._clearExpireEventTimeoutAll = Mn.bind(this, s), this._getOptions = function() { 45302 return B(n); 45303 }, this._resetExpireEventTimeoutAll = Dn.bind(this, t, s, a), this._emitEventsForCrossTabsStorageUpdate = jn.bind(this, s); 45304 var c = []; 45305 this.on(Sn, (function(e) { 45306 if (n.autoRenew) if (function(e) { 45307 var t = !1; 45308 if (e.push(Date.now()), e.length >= 10) { 45309 var n = e.shift(); 45310 t = e[e.length - 1] - n < 3e4; 45311 } 45312 return t; 45313 }(c)) Un(s, new S("Too many token renew requests")); 45314 else r.renew(e).catch((function() {})); 45315 else n.autoRemove && r.remove(e); 45316 })), Nn(0, s, a), window.addEventListener("storage", (function(e) { 45317 var t = e.key, o = e.newValue, i = e.oldValue; 45318 (!t || t === n.storageKey && o !== i) && setTimeout((function() { 45319 r._resetExpireEventTimeoutAll(), r._emitEventsForCrossTabsStorageUpdate(o, i); 45320 }), n._storageEventDelay); 45321 })); 45322 }, er = function() { 45323 function e() { 45324 u()(this, e), this.queue = [], this.running = !1; 45325 } 45326 return f()(e, [{ 45327 key: "push", 45328 value: function(e, t) { 45329 for (var n = this, r = arguments.length, o = new Array(r > 2 ? r - 2 : 0), i = 2; i < r; i++) o[i - 2] = arguments[i]; 45330 return new Promise((function(r, i) { 45331 n.queue.push({ 45332 method: e, 45333 thisObject: t, 45334 args: o, 45335 resolve: r, 45336 reject: i 45337 }), n.run(); 45338 })); 45339 } 45340 }, {
45341 key: "run", 45342 value: function() { 45343 var e = this; 45344 if (!this.running && 0 !== this.queue.length) { 45345 this.running = !0; 45346 var t = this.queue.shift(), n = t.method.apply(t.thisObject, t.args); 45347 ne(n) ? n.then(t.resolve, t.reject).finally((function() { 45348 e.running = !1, e.run(); 45349 })) : (t.resolve(n), this.running = !1, this.run()); 45350 } 45351 } 45352 }]), e; 45353 }(); 45354 /*! 45355 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 45356 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 45357 * 45358 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 45359 * Unless required by applicable law or agreed to in writing, software 45360 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45361 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45362 * 45363 * See the License for the specific language governing permissions and limitations under the License. 45364 */ function tr(e, t) { 45365 return t = t || {}, st() ? new Promise((function(i, a) { 45366 (r = document.createElement("iframe")).style.display = "none", o = function(t) { 45367 if (t && t.data && t.origin === e.getIssuerOrigin()) { 45368 try { 45369 var n = JSON.parse(t.data); 45370 } catch (e) { 45371 return; 45372 } 45373 if (n) return "FingerprintAvailable" === n.type ? i(n.fingerprint) : void ("FingerprintServiceReady" === n.type && t.source.postMessage(JSON.stringify({ type: "GetFingerprint" }), t.origin)); 45374 } 45375 }, Rt(window, "message", o), r.src = e.getIssuerOrigin() + "/auth/services/devicefingerprint", document.body.appendChild(r), n = setTimeout((function() { 45376 a(new S("Fingerprinting timed out")); 45377 }), t.timeout || 15e3); 45378 })).finally((function() { 45379 clearTimeout(n), Ut(window, "message", o), document.body.contains(r) && r.parentElement.removeChild(r); 45380 })) : Promise.reject(new S("Fingerprinting is not supported on this device")); 45381 var n, r, o; 45382 } 45383 var nr = n(25), rr = { 45384 isPending: !0, 45385 isAuthenticated: !1, 45386 idToken: null, 45387 accessToken: null, 45388 refreshToken: null 45389 }, or = { 45390 updateAuthStatePromise: null, 45391 canceledTimes: 0 45392 }, ir = function() { 45393 function e(t) { 45394 var n = this; 45395 if (u()(this, e), !t.emitter) throw new S("Emitter should be initialized before AuthStateManager"); 45396 this._sdk = t, this._pending = Object.assign({}, or), this._authState = Object.assign({}, rr), this._logOptions = {}, t.tokenManager.on(_n, (function(e, t) { 45397 n._setLogOptions({ 45398 event: _n, 45399 key: e, 45400 token: t 45401 }), n.updateAuthState(); 45402 })), t.tokenManager.on(En, (function(e, t) { 45403 n._setLogOptions({ 45404 event: En, 45405 key: e, 45406 token: t 45407 }), n.updateAuthState(); 45408 })); 45409 } 45410 return f()(e, [ 45411 { 45412 key: "_setLogOptions", 45413 value: function(e) { 45414 this._logOptions = e; 45415 } 45416 }, 45417 { 45418 key: "getAuthState", 45419 value: function() { 45420 return this._authState; 45421 } 45422 }, 45423 { 45424 key: "updateAuthState", 45425 value: function() { 45426 var e = this; 45427 this._sdk.emitter.e && this._sdk.emitter.e.authStateChange && this._sdk.emitter.e.authStateChange.length || Y("updateAuthState is an asynchronous method with no return, please subscribe to the latest authState update with authStateManager.subscribe(handler) method before calling updateAuthState."); 45428 var t = this._sdk.options, n = t.transformAuthState, r = t.devMode, o = this._sdk.tokenManager._getOptions(), i = o.autoRenew, a = o.autoRemove, s = function(t) { 45429 var n = e._logOptions, r = n.event, o = n.key, i = n.token; 45430 V().group("OKTA-AUTH-JS:updateAuthState: Event:".concat(r, " Status:").concat(t)), V().log(o, i), V().log("Current authState", e._authState), V().groupEnd(), e._logOptions = {}; 45431 }, u = function(t) { 45432 var n, o; 45433 (n = e._authState, o = t, n.isPending !== o.isPending || n.isAuthenticated !== o.isAuthenticated || JSON.stringify(n.idToken) !== JSON.stringify(o.idToken) || JSON.stringify(n.accessToken) !== JSON.stringify(o.accessToken) || n.error !== o.error) ? (e._authState = t, e._sdk.emitter.emit("authStateChange", Object.assign({}, t)), r && s("emitted")) : r && s("unchanged"); 45434 }, c = function() { 45435 return i || a; 45436 };
45437 if (this._pending.updateAuthStatePromise) { 45438 if (this._pending.canceledTimes >= 10) return void (r && s("terminated")); 45439 this._pending.updateAuthStatePromise.cancel(); 45440 } 45441 var f = new nr((function(t, o, i) { 45442 i.shouldReject = !1, i((function() { 45443 e._pending.updateAuthStatePromise = null, e._pending.canceledTimes = e._pending.canceledTimes + 1, r && s("canceled"); 45444 })); 45445 var a = function(n) { 45446 f.isCanceled || (u(n), e._pending = Object.assign({}, or)), t(); 45447 }; 45448 e._sdk.tokenManager.getTokens().then((function(r) { 45449 var o = r.accessToken, i = r.idToken, s = r.refreshToken; 45450 if (f.isCanceled) t(); 45451 else { 45452 var u = !1; 45453 o && e._sdk.tokenManager.hasExpired(o) && ((u = c()) || (o = null)), i && e._sdk.tokenManager.hasExpired(i) && ((u = c()) || (i = null)); 45454 var l = { 45455 accessToken: o, 45456 idToken: i, 45457 refreshToken: s, 45458 isPending: u, 45459 isAuthenticated: !(!o || !i) 45460 }; 45461 (n ? n(e._sdk, l) : Promise.resolve(l)).then((function(e) { 45462 return a(e); 45463 })).catch((function(e) { 45464 return a({ 45465 accessToken: o, 45466 idToken: i, 45467 refreshToken: s, 45468 isAuthenticated: !1, 45469 isPending: !1, 45470 error: e 45471 }); 45472 })); 45473 } 45474 })); 45475 })); 45476 this._pending.updateAuthStatePromise = f; 45477 } 45478 }, 45479 { 45480 key: "subscribe", 45481 value: function(e) { 45482 this._sdk.emitter.on("authStateChange", e); 45483 } 45484 }, 45485 { 45486 key: "unsubscribe", 45487 value: function(e) { 45488 this._sdk.emitter.off("authStateChange", e); 45489 } 45490 } 45491 ]), e; 45492 }(); 45493 function ar(e) { 45494 var t = function() { 45495 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 45496 if (Reflect.construct.sham) return !1; 45497 if ("function" == typeof Proxy) return !0; 45498 try { 45499 return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}))), !0; 45500 } catch (e) { 45501 return !1; 45502 } 45503 }(); 45504 /*! 45505 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 45506 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 45507 * 45508 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 45509 * Unless required by applicable law or agreed to in writing, software 45510 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 45511 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45512 * 45513 * See the License for the specific language governing permissions and limitations under the License. 45514 */ 45515 return function() { 45516 var n, r = m()(e); 45517 if (t) { 45518 var o = m()(this).constructor; 45519 n = Reflect.construct(r, arguments, o); 45520 } else n = r.apply(this, arguments); 45521 return v()(this, n); 45522 }; 45523 } 45524 var sr = function(e, t, n, r) { 45525 return new (n || (n = Promise))((function(o, i) { 45526 function a(e) { 45527 try { 45528 u(r.next(e)); 45529 } catch (e) { 45530 i(e); 45531 } 45532 } 45533 function s(e) { 45534 try { 45535 u(r.throw(e)); 45536 } catch (e) { 45537 i(e); 45538 } 45539 } 45540 function u(e) { 45541 var t; 45542 e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) { 45543 e(t); 45544 }))).then(a, s); 45545 } 45546 u((r = r.apply(e, t || [])).next()); 45547 })); 45548 }, ur = function(e, t) { 45549 var n = {}; 45550 for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); 45551 if (null != e && "function" == typeof Object.getOwnPropertySymbols) { 45552 var o = 0; 45553 for (r = Object.getOwnPropertySymbols(e); o < r.length; o++) t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]); 45554 } 45555 return n; 45556 }, cr = n(26); 45557 function fr() { 45558 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0, n = e.cookies || {}; 45559 return void 0 === n.secure && (n.secure = t), void 0 === n.sameSite && (n.sameSite = n.secure ? "none" : "lax"), n.secure && !t && (Y("The current page is not being served with the HTTPS protocol.\nFor security reasons, we strongly recommend using HTTPS.\nIf you cannot use HTTPS, set \"cookies.secure\" option to fal
45559se."), n.secure = !1), "none" !== n.sameSite || n.secure || (n.sameSite = "lax"), n; 45560 } 45561 var lr = function(e) { 45562 p()(n, e); 45563 var t = ar(n); 45564 function n() { 45565 var e, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; 45566 u()(this, n), e = t.call(this, Object.assign({ 45567 httpRequestClient: pt.a, 45568 storageUtil: r.storageUtil || yt, 45569 cookies: fr(r, n.features.isHTTPS()), 45570 storageManager: Object.assign({ 45571 token: { 45572 storageTypes: [ 45573 "localStorage", 45574 "sessionStorage", 45575 "cookie" 45576 ], 45577 useMultipleCookies: !0 45578 }, 45579 cache: { storageTypes: [ 45580 "localStorage", 45581 "sessionStorage", 45582 "cookie" 45583 ] }, 45584 transaction: { storageTypes: [ 45585 "sessionStorage", 45586 "localStorage", 45587 "cookie" 45588 ] } 45589 }, r.storageManager) 45590 }, r)), Object.assign(e.options.storageUtil, { 45591 getPKCEStorage: e.storageManager.getLegacyPKCEStorage.bind(e.storageManager), 45592 getHttpCache: e.storageManager.getHttpCache.bind(e.storageManager) 45593 }), e._pending = { handleLogin: !1 }, e.options = Object.assign(e.options, { 45594 pkce: !1 !== r.pkce, 45595 redirectUri: j(r.redirectUri, window.location.origin) 45596 }), e.userAgent = O(r, "okta-auth-js/".concat("4.9.2")), r.maxClockSkew || 0 === r.maxClockSkew ? e.options.maxClockSkew = r.maxClockSkew : e.options.maxClockSkew = se, e.session = { 45597 close: wt.bind(null, h()(e)), 45598 exists: mt.bind(null, h()(e)), 45599 get: kt.bind(null, h()(e)), 45600 refresh: Tt.bind(null, h()(e)), 45601 setCookieAndRedirect: bt.bind(null, h()(e)) 45602 }, e._tokenQueue = new er(), e.token = { 45603 prepareTokenParams: $t.bind(null, h()(e)), 45604 exchangeCodeForTokens: nn.bind(null, h()(e)), 45605 getWithoutPrompt: cn.bind(null, h()(e)), 45606 getWithPopup: vn.bind(null, h()(e)), 45607 getWithRedirect: yn.bind(null, h()(e)), 45608 parseFromUrl: mn.bind(null, h()(e)), 45609 decode: en, 45610 revoke: tn.bind(null, h()(e)), 45611 renew: fn.bind(null, h()(e)), 45612 renewTokensWithRefresh: hn.bind(null, h()(e)), 45613 renewTokens: dn.bind(null, h()(e)), 45614 getUserInfo: gn.bind(null, h()(e)), 45615 verify: an.bind(null, h()(e)), 45616 isLoginRedirect: Yt.bind(null, h()(e)) 45617 }; 45618 var o = ["decode", "isLoginRedirect"]; 45619 return Object.keys(e.token).forEach((function(t) { 45620 if (!(o.indexOf(t) >= 0)) { 45621 var n = e.token[t]; 45622 e.token[t] = er.prototype.push.bind(e._tokenQueue, n, null); 45623 } 45624 })), Object.assign(e.token.getWithRedirect, { _setLocation: function(e) { 45625 window.location = e; 45626 } }), Object.assign(e.token.parseFromUrl, { 45627 _getHistory: function() { 45628 return window.history; 45629 }, 45630 _getLocation: function() { 45631 return window.location; 45632 }, 45633 _getDocument: function() { 45634 return window.document; 45635 } 45636 }), e.fingerprint = tr.bind(null, h()(e)), e.emitter = new cr(), e.tokenManager = new Zn(h()(e), r.tokenManager), e.authStateManager = new ir(h()(e)), e; 45637 } 45638 return f()(n, [ 45639 { 45640 key: "isInteractionRequired", 45641 value: function() { 45642 return Xt(this); 45643 } 45644 }, 45645 { 45646 key: "isInteractionRequiredError", 45647 value: function(e) { 45648 return Ht(e); 45649 } 45650 }, 45651 { 45652 key: "signIn", 45653 value: function(e) { 45654 return this.features.isLocalhost() && X("This method has been deprecated, please use signInWithCredentials() instead."), this.signInWithCredentials(e); 45655 } 45656 }, 45657 { 45658 key: "signInWithCredentials", 45659 value: function(e) { 45660 var t = this; 45661 e = B(e || {}); 45662 var n = function(n) { 45663 return delete e.sendFingerprint, Ne(t, "/api/v1/authn", e, n); 45664 }; 45665 return e.sendFingerprint ? this.fingerprint().then((function(e) { 45666 return n({ headers: { "X-Device-Fingerprint": e } }); 45667 })) : n(); 45668 } 45669 }, 45670 { 45671 key: "signInWithRedirect", 45672 value: function() { 45673 var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; 45674 return sr(this, void 0, void 0, a.a.mark((function t() { 45675 var n, r, o; 45676 return a.a.wrap((function(t) { 45677 for (;;) switch (t.prev = t.next) { 45678 case 0: 45679 if (n = e.originalUri, r = ur(e, ["originalUri"]), !this._pe
45679nding.handleLogin) { 45680 t.next = 3; 45681 break; 45682 } 45683 return t.abrupt("return"); 45684 case 3: return this._pending.handleLogin = !0, t.prev = 4, n && this.setOriginalUri(n), o = Object.assign({ scopes: this.options.scopes || [ 45685 "openid", 45686 "email", 45687 "profile" 45688 ] }, r), t.next = 9, this.token.getWithRedirect(o); 45689 case 9: return t.prev = 9, this._pending.handleLogin = !1, t.finish(9); 45690 case 12: 45691 case "end": return t.stop(); 45692 } 45693 }), t, this, [[ 45694 4, 45695 , 45696 9, 45697 12 45698 ]]); 45699 }))); 45700 } 45701 }, 45702 { 45703 key: "closeSession", 45704 value: function() { 45705 return this.tokenManager.clear(), this.session.close().catch((function(e) { 45706 if ("AuthApiError" === e.name && "E0000007" === e.errorCode) return null; 45707 throw e; 45708 })); 45709 } 45710 }, 45711 { 45712 key: "revokeAccessToken", 45713 value: function(e) { 45714 return sr(this, void 0, void 0, a.a.mark((function t() { 45715 var n; 45716 return a.a.wrap((function(t) { 45717 for (;;) switch (t.prev = t.next) { 45718 case 0: 45719 if (e) { 45720 t.next = 6; 45721 break; 45722 } 45723 return t.next = 3, this.tokenManager.getTokens(); 45724 case 3: e = t.sent.accessToken, n = this.tokenManager._getStorageKeyByType("accessToken"), this.tokenManager.remove(n); 45725 case 6: 45726 if (e) { 45727 t.next = 8; 45728 break; 45729 } 45730 return t.abrupt("return", Promise.resolve(null)); 45731 case 8: return t.abrupt("return", this.token.revoke(e)); 45732 case 9: 45733 case "end": return t.stop(); 45734 } 45735 }), t, this); 45736 }))); 45737 } 45738 }, 45739 { 45740 key: "revokeRefreshToken", 45741 value: function(e) { 45742 return sr(this, void 0, void 0, a.a.mark((function t() { 45743 var n; 45744 return a.a.wrap((function(t) { 45745 for (;;) switch (t.prev = t.next) { 45746 case 0: 45747 if (e) { 45748 t.next = 6; 45749 break; 45750 } 45751 return t.next = 3, this.tokenManager.getTokens(); 45752 case 3: e = t.sent.refreshToken, n = this.tokenManager._getStorageKeyByType("refreshToken"), this.tokenManager.remove(n); 45753 case 6: 45754 if (e) { 45755 t.next = 8; 45756 break; 45757 } 45758 return t.abrupt("return", Promise.resolve(null)); 45759 case 8: return t.abrupt("return", this.token.revoke(e)); 45760 case 9: 45761 case "end": return t.stop(); 45762 } 45763 }), t, this); 45764 }))); 45765 } 45766 }, 45767 { 45768 key: "signOut", 45769 value: function(e) { 45770 return sr(this, void 0, void 0, a.a.mark((function t() { 45771 var n, r, o, i, s, u, c, f, l, h, d, p; 45772 return a.a.wrap((function(t) { 45773 for (;;) switch (t.prev = t.next) { 45774 case 0: 45775 if (e = Object.assign({}, e), n = window.location.origin, r = window.location.href, o = e.postLogoutRedirectUri || this.options.postLogoutRedirectUri || n, i = e.accessToken, s = e.refreshToken, u = !1 !== e.revokeAccessToken, c = !1 !== e.revokeRefreshToken, f = e.idToken, l = Dt(this).logoutUrl, void 0 !== f) { 45776 t.next = 14; 45777 break; 45778 } 45779 return t.next = 13, this.tokenManager.getTokens(); 45780 case 13: f = t.sent.idToken; 45781 case 14: 45782 if (!c || void 0 !== s) { 45783 t.next = 18; 45784 break; 45785 } 45786 return t.next = 17, this.tokenManager.getTokens(); 45787 case 17: s = t.sent.refreshToken; 45788 case 18: 45789 if (!u || void 0 !== i) { 45790 t.next = 22; 45791 break; 45792 } 45793 return t.next = 21, this.tokenManager.getTokens(); 45794 case 21: i = t.sent.accessToken; 45795 case 22: 45796 if (this.tokenManager.clear(), !c || !s) { 45797 t.next = 26; 45798 break; 45799 } 45800 return t.next = 26, this.revokeRefreshToken(s); 45801 case 26: 45802 if (!u || !i) { 45803 t.next = 29; 45804 break; 45805 } 45806 return t.next = 29, this.revokeAccessToken(i); 45807 case 29: 45808 if (f) { 45809 t.next = 31; 45810 break; 45811 } 45812 return t.abrupt("return", this.closeSession().then((function() { 45813 o === r ? window.location.reload() : window.location.assign(o); 45814 }))); 45815 case 31: h = e.state, d = f.idToken, p = l + "?id_token_hint=" + encodeURIComponent(d) + "&post_logout_redirect_uri=" + encodeURIComponent(o), h && (p += "&state=" + encodeURIComponent(h)), window.location.assign(p); 45816 case 36: 45817 case "end": return t.stop(); 45818 } 45819 }), t, this); 45820 }))); 45821 } 45822 }, 45823 { 45824 key: "webfinger", 45825 value: function(e) { 45826 var t = "/.well-known/webfinger" + F(e); 45827 return Oe.get(this, t, { headers: { Accept: "application/jrd+json" } }); 45828 } 45829 }, 45830 { 45831 key: "isAuthenticated", 45832 value: function(e) { 45833 return sr(this, void 0, void 0, a.a.mark((function t() { 45834 var n, r, o, i, s = this; 45835 return a.a.wrap((function(t) { 45836 for (;;) switch (t.prev = t.next) { 45837 case 0: 45838 if ((n = this.authStateManager.getAuthState()).isPending) { 45839 t.next = 3; 45840 break; 45841 } 45842 return t.abrupt("return", Promise.resolve(n.isAuthenticated)); 45843 case 3: return t.abrupt("return", new Promise((function(t) { 45844 r = function() { 45845 s.authStateManager.unsubscribe(o), clearTimeout(i); 45846 }, o = function(e) { 45847 var n = e.isAuthenticated; 45848 e.isPending || (t(n), r()); 45849 }, i = setTimeout((function() { 45850 t(!1), r(); 45851 }), e || 6e4), s.authStateManager.subscribe(o), s.authStateManager.updateAuthState(); 45852 }))); 45853 case 4: 45854 case "end": return t.stop(); 45855 } 45856 }), t, this); 45857 }))); 45858 } 45859 }, 45860 { 45861 key: "getUser", 45862 value: function() { 45863 return sr(this, void 0, void 0, a.a.mark((function e() { 45864 var t, n, r; 45865 return a.a.wrap((function(e) { 45866 for (;;) switch (e.prev = e.next) { 45867 case 0: return t = this.authStateManager.getAuthState(), n = t.idToken, r = t.accessToken, e.abrupt("return", this.token.getUserInfo(r, n)); 45868 case 2: 45869 case "end": return e.stop(); 45870 } 45871 }), e, this); 45872 }))); 45873 } 45874 }, 45875 { 45876 key: "getIdToken", 45877 value: function() { 45878 var e = this.authStateManager.getAuthState().idToken; 45879 return e ? e.idToken : void 0; 45880 } 45881 }, 45882 { 45883 key: "getAccessToken", 45884 value: function() { 45885 var e = this.authStateManager.getAuthState().accessToken; 45886 return e ? e.accessToken : void 0; 45887 } 45888 }, 45889 { 45890 key: "getRefreshToken", 45891 value: function() { 45892 var e = this.authStateManager.getAuthState().refreshToken; 45893 return e ? e.refreshToken : void 0; 45894 } 45895 }, 45896 { 45897 key: "storeTokensFromRedirect", 45898 value: function() { 45899 return sr(this, void 0, void 0, a.a.mark((function e() { 45900 var t, n; 45901 return a.a.wrap((function(e) { 45902 for (;;) switch (e.prev = e.next) { 45903 case 0: return e.next = 2, this.token.parseFromUrl(); 45904 case 2: t = e.sent, n = t.tokens, this.tokenManager.setTokens(n); 45905 case 5: 45906 case "end": return e.stop(); 45907 } 45908 }), e, this); 45909 }))); 45910 } 45911 }, 45912 { 45913 key: "setOriginalUri", 45914 value: function(e) { 45915 e = e || window.location.href, yt.getSessionStorage().setItem(ke, e); 45916 } 45917 }, 45918 { 45919 key: "getOriginalUri", 45920 value: function() { 45921 return yt.getSessionStorage().getItem(ke) || window.location.origin; 45922 } 45923 }, 45924 { 45925 key: "removeOriginalUri", 45926 value: function() { 45927 yt.getSessionStorage().removeItem(ke); 45928 } 45929 }, 45930 { 45931 key: "isLoginRedirect", 45932 value: function() { 45933 return Yt(this); 45934 } 45935 }, 45936 { 45937 key: "handleLoginRedirect", 45938 value: function(e) { 45939 return sr(this, void 0, void 0, a.a.mark((function t() { 45940 var n, r = this; 45941 return a.a.wrap((function(t) { 45942 for (;;) switch (t.prev = t.next) { 45943 case 0: 45944 if (n = function e(t) { 45945 var n = t.isPending; 45946 return sr(r, void 0, void 0, a.a.mark((function t() { 45947 var r, o; 45948 return a.a.wrap((function(t) { 45949 for (;;) switch (t.prev = t.next) { 45950 case 0: 45951 if (!n) { 45952 t.next = 2; 45953 break; 45954 } 45955 return t.abrupt("return"); 45956 case 2: 45957 if (this.authStateManager.unsubscribe(e), r = this.getOriginalUri(), this.removeOriginalUri(), !(o = this.options.restoreOriginalUri)) { 45958 t.next = 11; 45959 break; 45960 } 45961 return t.next = 9, o(this, r); 45962 case 9: 45963 t.next = 12; 45964 break; 45965 case 11: window.location.replace(r); 45966 case 12: 45967 case "end": return t.stop(); 45968 } 45969 }), t, this); 45970 }))); 45971 }, this.authStateManager.subscribe(n), !e) { 45972 t.next = 6; 45973 break; 45974 } 45975 this.tokenManager.setTokens(e), t.next = 19; 45976 break; 45977 case 6: 45978 if (!this.isLoginRedirect()) { 45979 t.next = 18; 45980 break; 45981 } 45982 return t.prev = 7, t.next = 10, this.storeTokensFromRedirect(); 45983 case 10: 45984 t.next = 16; 45985 break; 45986 case 12: throw t.prev = 12, t.t0 = t.catch(7), this.authStateManager.unsubscribe(n), t.t0; 45987 case 16: 45988 t.next = 19; 45989 break; 45990 case 18: this.authStateManager.unsubscribe(n); 45991 case 19: 45992 case "end": return t.stop(); 45993 } 45994 }), t, this, [[7, 12]]); 45995 }))); 45996 } 45997 }, 45998 { 45999 key: "isPKCE", 46000 value: function() { 46001 return !!this.options.pkce; 46002 } 46003 }, 46004 { 46005 key: "hasResponseType", 46006 value: function(e) { 46007 var t = !1; 46008 return t = Array.isArray(this.options.responseType) && this.options.responseType.length ? this.options.responseType.indexOf(e) >= 0 : this.options.responseType === e, t; 46009 } 46010 }, 46011 { 46012 key: "isAuthorizationCodeFlow", 46013 value: function() { 46014 return this.hasResponseType("code"); 46015 } 46016 } 46017 ]), n; 46018 }(ot); 46019 lr.features = lr.prototype.features = o, Object.assign(lr, { 46020 constants: r, 46021 isInteractionRequiredError: Ht 46022 }); 46023 var hr = lr; 46024 /*! 46025 * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved. 46026 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") 46027 * 46028 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 46029 * Unless required by applicable law or agreed to in writing, softw
46029are 46030 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 46031 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 46032 * 46033 * See the License for the specific language governing permissions and limitations under the License. 46034 * 46035 */ } 46036 ]); 46037 })); 46038})); 46039//#endregion 46040//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/errors.js 46041var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => { 46042 Object.defineProperty(exports, "__esModule", { value: true }); 46043 exports.isOAuthError = exports.errors = void 0; 46044 var okta_auth_js_1 = require_okta_auth_js_umd(); 46045 exports.errors = { 46046 userNotLoggedIn: "No user is logged in", 46047 newPasswordRequired: "New password required", 46048 failedToInitService: "Failed to init service" 46049 }; 46050 var isOAuthError = (e) => e instanceof okta_auth_js_1.OAuthError; 46051 exports.isOAuthError = isOAuthError; 46052})); 46053//#endregion 46054//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/cognito/SskyCognitoService.js 46055var require_SskyCognitoService = /* @__PURE__ */ __commonJSMin(((exports) => { 46056 var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { 46057 function adopt(value) { 46058 return value instanceof P ? value : new P(function(resolve) { 46059 resolve(value); 46060 }); 46061 } 46062 return new (P || (P = Promise))(function(resolve, reject) { 46063 function fulfilled(value) { 46064 try { 46065 step(generator.next(value)); 46066 } catch (e) { 46067 reject(e); 46068 } 46069 } 46070 function rejected(value) { 46071 try { 46072 step(generator["throw"](value)); 46073 } catch (e) { 46074 reject(e); 46075 } 46076 } 46077 function step(result) { 46078 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); 46079 } 46080 step((generator = generator.apply(thisArg, _arguments || [])).next()); 46081 }); 46082 }; 46083 Object.defineProperty(exports, "__esModule", { value: true }); 46084 exports.SskyCognitoService = void 0; 46085 var amazon_cognito_identity_js_1 = (init_es(), __toCommonJS(es_exports)); 46086 var authService_1 = require_authService(); 46087 var errors_1 = require_errors(); 46088 var utils_1 = require_utils(); 46089 var SskyCognitoService = class { 46090 constructor(config) { 46091 this.userPool = new amazon_cognito_identity_js_1.CognitoUserPool(config); 46092 this.CognitoUser = this.userPool.getCurrentUser(); 46093 this.identityPoolId = config.IdentityPoolId; 46094 } 46095 init() { 46096 return __awaiter(this, void 0, void 0, function* () { 46097 if (this.CognitoUser) return new Promise((resolve) => { 46098 this.CognitoUser.getSession((err, result) => __awaiter(this, void 0, void 0, function* () { 46099 if (result) try { 46100 this.jwtIdToken = result.getIdToken().getJwtToken(); 46101 resolve(); 46102 } catch (err) { 46103 resolve(); 46104 } 46105 else resolve(); 46106 })); 46107 }); 46108 }); 46109 } 46110 isFirstLogin() { 46111 return __awaiter(this, void 0, void 0, function* () { 46112 throw new Error("Not implemented"); 46113 }); 46114 } 46115 isUserDeactivated() { 46116 return __awaiter(this, void 0, void 0, function* () { 46117 throw new Error("Not implemented"); 46118 }); 46119 } 46120 shouldInitiateForgotPassword() { 46121 return __awaiter(this, void 0, void 0, function* () { 46122 throw new Error("Not implemented"); 46123 }); 46124 } 46125 isNewPasswordRequired() { 46126 return __awaiter(this, void 0, void 0, function* () { 46127 throw new Error("Not implemented"); 46128 }); 46129 } 46130 login(user, password) { 46131 return __awaiter(this, void 0, void 0, function* () { 46132 const normalizedUsername = (0, utils_1.normalizeUsername)(user); 46133 const authenticationData = { 46134 Username: normalizedUsername, 46135 Password: password 46136 }; 46137 const authenticationDetails = new amazon_cognito_identity_js_1.AuthenticationDetails(authenticationData); 46138 const cognitoUser = this._getCognitoUser(normalizedUsername); 46139 return new Promise((resolve, reject) => { 46140 cognitoUser.authenticateUser(authenticationDetails, { 46141 onSuccess: (result) => { 46142 this.jwtIdToken = result.getIdToken().getJwtToken(); 46143 resolve(); 46144 }, 46145 onFailure: reject, 46146 newPasswordRequired: () => { 46147 reject(errors_1.errors.newPasswordRequired); 46148 } 46149 }); 46150 }); 46151 }); 46152 } 46153 loginWithRedirect() { 46154 return __awaiter(this, void 0, void 0, function* () { 46155 throw new Error("Not implemented"); 46156 }); 46157 } 46158 loginWithPopup() { 46159 return __awaiter(this, void 0, void 0, function* () { 46160 throw new Error("Not implemented"); 46161 }); 46162 } 46163 logout() { 46164 return __awaiter(this, void 0, void 0, function* () { 46165 var _a; 46166 (_a = this.CognitoUser) === null || _a === void 0 || _a.signOut(); 46167 }); 46168 } 46169 isUserManaged() { 46170 return __awaiter(this, void 0, void 0, function* () { 46171 return true; 46172 }); 46173 } 46174 getUserAccessToken() { 46175 return new Promise((resolve, reject) => { 46176 let cognitoUser = this._getCognitoUser(); 46177 if (!cognitoUser) resolve(""); 46178 else cognitoUser.getSession((err, session) => { 46179 if (err) reject(errors_1.errors.userNotLoggedIn); 46180 else resolve(session.getAccessToken().getJwtToken()); 46181 }); 46182 }); 46183 } 46184 getUserIdToken() { 46185 return new Promise((resolve, reject) => { 46186 const cognitoUser = this._getCognitoUser(); 46187 if (!cognitoUser) resolve(""); 46188 else cognitoUser.getSession((err, session) => __awaiter(this, void 0, void 0, function* () { 46189 if (err) reject(errors_1.errors.userNotLoggedIn); 46190 else resolve(session.getIdToken().getJwtToken()); 46191 })); 46192 }); 46193 } 46194 getUserName() { 46195 var _a; 46196 return (_a = this.CognitoUser) === null || _a === void 0 ? void 0 : _a.getUsername(); 46197 } 46198 initiateForgotPassword(username, _recaptchaToken) { 46199 const usernameLowerCase = username.toLowerCase(); 46200 return new Promise((resolve, reject) => { 46201 this._getCognitoUser(usernameLowerCase).forgotPassword({ 46202 onSuccess: resolve, 46203 onFailure: reject 46204 }); 46205 }); 46206 } 46207 confirmForgotPassword(username, verificationCode, newPassword) { 46208 return new Promise((resolve, reject) => { 46209 this._getCognitoUser(username.toLowerCase()).confirmPassword(verificationCode.trim(), newPassword, { 46210 onSuccess: resolve, 46211 onFailure: reject 46212 }); 46213 }); 46214 } 46215 changePassword(user, oldPassword, newPassword) { 46216 return __awaiter(this, void 0, void 0, function* () { 46217 yield this._completeNewPasswordChallenge(user, newPassword); 46218 yield this.login(user, newPassword); 46219 }); 46220 } 46221 _completeNewPasswordChallenge(username, newPassword) { 46222 return new Promise((resolve, reject) => { 46223 const userAttributes = { name: username.toLowerCase() }; 46224 this._getCognitoUser().completeNewPasswordChallenge(newPassword, userAttributes, { 46225 onSuccess: () => resolve(), 46226 onFailure: reject 46227 }); 46228 }); 46229 } 46230 _changePassword(user, oldPassword, newPassword) { 46231 let userName = user.toLowerCase(); 46232 return new Promise((resolve, reject) => { 46233 let cognitoUser = this._getCognitoUser(userName); 46234 let authenticatedUserPromise; 46235 if (cognitoUser.Session) authenticatedUserPromise = Promise.resolve(); 46236 else authenticatedUserPromise = this.login(userName, oldPassword); 46237 authenticatedUserPromise.then(() => { 46238 cognitoUser.changePassword(oldPassword, newPassword, (err) => { 46239 if (err) reject(err); 46240 else resolve(); 46241 }); 46242 }).catch(reject); 46243 }); 46244 } 46245 _getCognitoUser(user) { 46246 var _a, _b; 46247 let userName = (_a = user === null || user === void 0 ? void 0 : user.toLowerCase()) !== null && _a !== void 0 ? _a : null; 46248 if (userName && ((_b = this.CognitoUser) === null || _b === void 0 ? void 0 : _b.getUsername()) !== userName) { 46249 const userData = { 46250 Username: userName.toLowerCase(), 46251 Pool: this.userPool 46252 }; 46253 this.CognitoUser = new amazon_cognito_identity_js_1.CognitoUser(userData); 46254 } 46255 return this.CognitoUser; 46256 } 46257 subscribe(callback) {} 46258 getAuthServiceType() { 46259 return authService_1.AuthServiceType.COGNITO; 46260 } 46261 }; 46262 exports.SskyCognitoService = SskyCognitoService; 46263})); 46264//#endregion 46265//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/cognito/index.js 46266var require_cognito = /* @__PURE__ */ __commonJSMin(((exports) => { 46267 var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { 46268 if (k2 === void 0) k2 = k; 46269 var desc = Object.getOwnPropertyDescriptor(m, k); 46270 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = { 46271 enumerable: true, 46272 get: function() { 46273 return m[k]; 46274 } 46275 }; 46276 Object.defineProperty(o, k2, desc); 46277 }) : (function(o, m, k, k2) { 46278 if (k2 === void 0) k2 = k; 46279 o[k2] = m[k]; 46280 })); 46281 var __exportStar = exports && exports.__exportStar || function(m, exports$3) { 46282 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$3, p)) __createBinding(exports$3, m, p); 46283 }; 46284 Object.defineProperty(exports, "__esModule", { value: true });
46285 __exportStar(require_SskyCognitoService(), exports); 46286})); 46287//#endregion 46288//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/authService.js 46289var require_authService = /* @__PURE__ */ __commonJSMin(((exports) => { 46290 var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { 46291 function adopt(value) { 46292 return value instanceof P ? value : new P(function(resolve) { 46293 resolve(value); 46294 }); 46295 } 46296 return new (P || (P = Promise))(function(resolve, reject) { 46297 function fulfilled(value) { 46298 try { 46299 step(generator.next(value)); 46300 } catch (e) { 46301 reject(e); 46302 } 46303 } 46304 function rejected(value) { 46305 try { 46306 step(generator["throw"](value)); 46307 } catch (e) { 46308 reject(e); 46309 } 46310 } 46311 function step(result) { 46312 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); 46313 } 46314 step((generator = generator.apply(thisArg, _arguments || [])).next()); 46315 }); 46316 }; 46317 Object.defineProperty(exports, "__esModule", { value: true }); 46318 exports.AuthService = exports.AuthServiceType = void 0; 46319 var auth0_1 = require_auth0(); 46320 var cognito_1 = require_cognito(); 46321 var AuthServiceType; 46322 (function(AuthServiceType) { 46323 AuthServiceType["COGNITO"] = "COGNITO"; 46324 AuthServiceType["AUTH0"] = "AUTH0"; 46325 })(AuthServiceType || (exports.AuthServiceType = AuthServiceType = {})); 46326 var AuthService = class { 46327 /** 46328 * Creates the auth service 46329 * @param sskyCognitoConfig configuration for cognito 46330 * @param sskyOktaConfig configuration for okta 46331 * @param sskyAuth0Config configuration for auth0 46332 * @param getServiceTypeForUser callback to get user's service type and last login 46333 */ 46334 constructor(sskyCognitoConfig, sskyAuth0Config, getServiceTypeForUser) { 46335 if (sskyCognitoConfig) this.cognitoService = new cognito_1.SskyCognitoService(sskyCognitoConfig); 46336 if (sskyAuth0Config) this.auth0Service = new auth0_1.SskyAuth0Service(sskyAuth0Config); 46337 this.getServiceTypeForUser = getServiceTypeForUser; 46338 } 46339 init() { 46340 return __awaiter(this, void 0, void 0, function* () { 46341 if (this.cognitoService) { 46342 yield this.cognitoService.init(); 46343 const cognitoUsername = yield this.getExistingUserName(this.cognitoService); 46344 if (cognitoUsername) yield this.updateUserAuthServiceType(cognitoUsername); 46345 } 46346 if (this.userAuthServiceType === AuthServiceType.COGNITO) return; 46347 if (this.auth0Service) { 46348 yield this.auth0Service.init(); 46349 const auth0Username = yield this.getExistingUserName(this.auth0Service); 46350 if (auth0Username) yield this.updateUserAuthServiceType(auth0Username); 46351 } 46352 if (this.userAuthServiceType === AuthServiceType.AUTH0) return; 46353 }); 46354 } 46355 isFirstLogin(user) { 46356 return __awaiter(this, void 0, void 0, function* () { 46357 if (!this.userAuthServiceType) yield this.updateUserAuthServiceType(user); 46358 return this.userFirstLogin; 46359 }); 46360 } 46361 isUserDeactivated(user_1) { 46362 return __awaiter(this, arguments, void 0, function* (user, force = false) { 46363 if (force || !this.userAuthServiceType) yield this.updateUserAuthServiceType(user); 46364 return this.userDeactivated; 46365 }); 46366 } 46367 shouldInitiateForgotPassword(user_1) { 46368 return __awaiter(this, arguments, void 0, function* (user, force = false) { 46369 if (force || !this.userAuthServiceType) yield this.updateUserAuthServiceType(user); 46370 return this.userInitiateForgotPassword; 46371 }); 46372 } 46373 isNewPasswordRequired(user, force) { 46374 return __awaiter(this, void 0, void 0, function* () { 46375 if (force || !this.userAuthServiceType) yield this.updateUserAuthServiceType(user); 46376 return this.newPasswordRequired; 46377 }); 46378 } 46379 login(user, password) { 46380 return __awaiter(this, void 0, void 0, function* () { 46381 var _a; 46382 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.login(user, password); 46383 }); 46384 } 46385 loginWithRedirect(user) { 46386 return __awaiter(this, void 0, void 0, function* () { 46387 var _a; 46388 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.loginWithRedirect(user); 46389 }); 46390 } 46391 loginWithPopup(user) { 46392 return __awaiter(this, void 0, void 0, function* () { 46393 var _a; 46394 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.loginWithPopup(user); 46395 }); 46396 } 46397 logout() { 46398 return __awaiter(this, void 0, void 0, function* () { 46399 var _a; 46400 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.logout(); 46401 }); 46402 } 46403 isUserManaged(user, force) { 46404 return __awaiter(this, void 0, void 0, function* () { 46405 var _a; 46406 if (force || !this.userAuthServiceType) yield this.updateUserAuthServiceType(user); 46407 if (this.userManaged !== null) return this.userManaged; 46408 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.isUserManaged(user, force); 46409 }); 46410 } 46411 getUserAccessToken() { 46412 return __awaiter(this, void 0, void 0, function* () { 46413 var _a;
46414 try { 46415 return yield (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.getUserAccessToken(); 46416 } catch (e) { 46417 return null; 46418 } 46419 }); 46420 } 46421 getUserIdToken() { 46422 return __awaiter(this, void 0, void 0, function* () { 46423 var _a; 46424 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.getUserIdToken(); 46425 }); 46426 } 46427 getUserName() { 46428 var _a; 46429 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.getUserName(); 46430 } 46431 initiateForgotPassword(user, recaptchaToken) { 46432 return __awaiter(this, void 0, void 0, function* () { 46433 var _a; 46434 yield this.updateUserAuthServiceType(user); 46435 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.initiateForgotPassword(user, recaptchaToken); 46436 }); 46437 } 46438 confirmForgotPassword(username, verificationCode, newPassword) { 46439 return __awaiter(this, void 0, void 0, function* () { 46440 var _a; 46441 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.confirmForgotPassword(username, verificationCode, newPassword); 46442 }); 46443 } 46444 changePassword(user, oldPassword, newPassword) { 46445 return __awaiter(this, void 0, void 0, function* () { 46446 var _a; 46447 return (_a = this.getAuthService()) === null || _a === void 0 ? void 0 : _a.changePassword(user, oldPassword, newPassword); 46448 }); 46449 } 46450 getAuthService() { 46451 switch (this.userAuthServiceType) { 46452 case AuthServiceType.COGNITO: return this.cognitoService; 46453 case AuthServiceType.AUTH0: return this.auth0Service; 46454 } 46455 } 46456 /** 46457 * Checks for existing username on service 46458 */ 46459 getExistingUserName(service) { 46460 return __awaiter(this, void 0, void 0, function* () { 46461 try { 46462 return (yield service === null || service === void 0 ? void 0 : service.getUserAccessToken()) && (service === null || service === void 0 ? void 0 : service.getUserName()); 46463 } catch (e) {} 46464 }); 46465 } 46466 /** 46467 * Check and set the appropriate authentication service type for a user and its last login info 46468 * @param {string} username 46469 */ 46470 updateUserAuthServiceType(username) { 46471 return __awaiter(this, void 0, void 0, function* () { 46472 const { authServiceType, isFirstLogin, isUserDeactivated, isManaged, shouldInitiateForgotPassword, newPasswordRequired, useCustomDomain } = yield this.getServiceTypeForUser(username); 46473 this.userAuthServiceType = authServiceType; 46474 this.userFirstLogin = isFirstLogin; 46475 this.userDeactivated = isUserDeactivated; 46476 this.userManaged = isManaged; 46477 this.userInitiateForgotPassword = shouldInitiateForgotPassword; 46478 this.newPasswordRequired = newPasswordRequired; 46479 if (authServiceType === AuthServiceType.AUTH0) this.auth0Service.useCustomDomain(useCustomDomain); 46480 }); 46481 } 46482 subscribe(callback) { 46483 if (this.cognitoService) this.cognitoService.subscribe(callback); 46484 if (this.auth0Service) this.auth0Service.subscribe(callback); 46485 } 46486 getAuthServiceType() { 46487 return this.getAuthService().getAuthServiceType(); 46488 } 46489 }; 46490 exports.AuthService = AuthService; 46491})); 46492//#endregion 46493//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/okta/SskyOktaService.js 46494var require_SskyOktaService = /* @__PURE__ */ __commonJSMin(((exports) => { 46495 var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { 46496 function adopt(value) { 46497 return value instanceof P ? value : new P(function(resolve) { 46498 resolve(value); 46499 }); 46500 } 46501 return new (P || (P = Promise))(function(resolve, reject) { 46502 function fulfilled(value) { 46503 try { 46504 step(generator.next(value)); 46505 } catch (e) { 46506 reject(e); 46507 } 46508 } 46509 function rejected(value) { 46510 try { 46511 step(generator["throw"](value)); 46512 } catch (e) { 46513 reject(e); 46514 } 46515 } 46516 function step(result) { 46517 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); 46518 } 46519 step((generator = generator.apply(thisArg, _arguments || [])).next()); 46520 }); 46521 }; 46522 var __rest = exports && exports.__rest || function(s, e) { 46523 var t = {}; 46524 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; 46525 if (s != null && typeof Object.getOwnPropertySymbols === "function") { 46526 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; 46527 } 46528 return t; 46529 }; 46530 Object.defineProperty(exports, "__esModule", { value: true }); 46531 exports.SskyOktaService = exports.TRANSACTION_STATUS = void 0; 46532 var okta_auth_js_1 = require_okta_auth_js_umd(); 46533 var errors_1 = require_errors(); 46534 var utils_1 = require_utils(); 46535 var TRANSACTION_STATUS; 46536 (function(TRANSACTION_STATUS) { 46537 TRANSACTION_STATUS["lockedOut"] = "LOCKED_OUT"; 46538 TRANSACTION_STATUS["passwordExpired"] = "PASSWORD_EXPIRED"; 46539 TRANSACTION_STATUS["passwordReset"] = "PASSWORD_RESET"; 46540 TRANSACTION_STATUS["passwordWarn"] = "PASSWORD_WARN"; 46541 TRANSACTION_STATUS["recovery"] = "RECOVERY"; 46542 TRANSACTION_STATUS["recoveryChallenge"] = "RECOVERY_CHALLENGE"; 46543 TRANSACTION_STATUS["mfaEnroll"] = "MFA_ENROLL"; 46544 TRANSACTION_STATUS["mfaEnrollActivate"] = "MFA_ENROLL_ACTIVATE"; 46545 TRANSACTION_STATUS["mfaRequired"] = "MFA_REQUIRED"; 46546 TRANSACTION_STATUS["mfaChallenge"] = "MFA_CHALLENGE"; 46547 TRANSACTION_STATUS["success"] = "SUCCESS"; 46548 })(TRANSACTION_STATUS || (exports.TRANSACTION_STATUS = TRANSACTION_STATUS = {})); 46549 var SskyOktaService = class { 46550 constructor(config) { 46551 const { initiateForgotPasswordCB, confirmForgotPasswordCB, shouldRedirectToGetTokens } = config, oktaAuthOptions = __rest(config, [ 46552 "initiateForgotPasswordCB", 46553 "confirmForgotPasswordCB", 46554 "shouldRedirectToGetTokens" 46555 ]); 46556 this.oktaAuthOptions = oktaAuthOptions; 46557 this.authClient = new okta_auth_js_1.OktaAuth(Object.assign(Object.assign({}, oktaAuthOptions), { transformAuthState: this.transformAuthState.bind(this) })); 46558 this.authClient.authStateManager.subscribe(this.authStateChangeHandler.bind(this)); 46559 this.initiateForgotPasswordCB = initiateForgotPasswordCB; 46560 this.confirmForgotPasswordCB = confirmForgotPasswordCB; 46561 this.shouldRedirectToGetTokens = shouldRedirectToGetTokens; 46562 this.transaction = { 46563 status: "", 46564 data: {} 46565 }; 46566 } 46567 init() { 46568 return __awaiter(this, void 0, void 0, function* () { 46569 const initPromise = new Promise((resolve) => { 46570 this.initPromiseResolve = resolve; 46571 }); 46572 if (this.authClient.token.isLoginRedirect()) yield this.authClient.handleLoginRedirect(); 46573 else this.authClient.authStateManager.updateAuthState(); 46574 yield initPromise; 46575 }); 46576 } 46577 isFirstLogin() { 46578 return __awaiter(this, void 0, void 0, function* () { 46579 throw new Error("Not implemented"); 46580 }); 46581 } 46582 isUserDeactivated() { 46583 return __awaiter(this, void 0, void 0, function* () { 46584 throw new Error("Not implemented"); 46585 }); 46586 } 46587 shouldInitiateForgotPassword() { 46588 return __awaiter(this, void 0, void 0, function* () { 46589 throw new Error("Not implemented"); 46590 }); 46591 } 46592 isNewPasswordRequired() { 46593 return __awaiter(this, void 0, void 0, function* () { 46594 throw new Error("Not implemented"); 46595 }); 46596 } 46597 login(user, password) { 46598 return __awaiter(this, void 0, void 0, function* () { 46599 const username = (0, utils_1.normalizeUsername)(user);
46600 try { 46601 this.transaction = yield this.authClient.signInWithCredentials({ 46602 username, 46603 password 46604 }); 46605 switch (this.transaction.status) { 46606 case TRANSACTION_STATUS.success: 46607 yield this.getAndSetTokensWithoutPrompt(this.transaction.sessionToken); 46608 this.userName = username; 46609 break; 46610 case TRANSACTION_STATUS.passwordExpired: 46611 this._raiseError(errors_1.errors.newPasswordRequired); 46612 break; 46613 default: this._raiseError(`Transaction status ${this.transaction.status} not handled`); 46614 } 46615 } catch (err) { 46616 this._raiseError(err); 46617 } 46618 }); 46619 } 46620 loginWithRedirect(user) { 46621 return __awaiter(this, void 0, void 0, function* () { 46622 yield this.authClient.token.getWithRedirect({ 46623 state: JSON.stringify({ 46624 issuer: this.oktaAuthOptions.issuer, 46625 clientId: this.oktaAuthOptions.clientId, 46626 storage: this.oktaAuthOptions.tokenManager.storage, 46627 scopes: this.oktaAuthOptions.scopes.join(" "), 46628 flow: "redirect", 46629 requireUserSession: "true" 46630 }), 46631 loginHint: user 46632 }); 46633 }); 46634 } 46635 loginWithPopup(user) { 46636 return __awaiter(this, void 0, void 0, function* () { 46637 try { 46638 const tokenResponse = yield this.authClient.token.getWithPopup({ 46639 state: JSON.stringify({ 46640 issuer: this.oktaAuthOptions.issuer, 46641 clientId: this.oktaAuthOptions.clientId, 46642 storage: this.oktaAuthOptions.tokenManager.storage, 46643 scopes: this.oktaAuthOptions.scopes.join(" "), 46644 requireUserSession: "true" 46645 }), 46646 loginHint: user 46647 }); 46648 this.authClient.tokenManager.setTokens(tokenResponse.tokens); 46649 this.authClient.authStateManager.updateAuthState(); 46650 } catch (err) { 46651 this._raiseError(err); 46652 } 46653 }); 46654 } 46655 logout() { 46656 return __awaiter(this, void 0, void 0, function* () { 46657 this.userInfo = null; 46658 yield this.authClient.signOut(); 46659 try { 46660 yield this.authClient.session.get(); 46661 this.userName = void 0; 46662 } catch (err) { 46663 this._raiseError(err); 46664 } 46665 }); 46666 } 46667 isUserManaged(user) { 46668 return __awaiter(this, void 0, void 0, function* () { 46669 var _a, _b, _c; 46670 const webFingerResponse = yield this.authClient.webfinger({ resource: `acct:${user}` }); 46671 this.userManaged = !((_c = (_b = (_a = webFingerResponse === null || webFingerResponse === void 0 ? void 0 : webFingerResponse["links"]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c["okta:idp:id"]); 46672 return this.userManaged; 46673 }); 46674 } 46675 getUserAccessToken() { 46676 return __awaiter(this, void 0, void 0, function* () { 46677 const authState = this.authClient.authStateManager.getAuthState(); 46678 if (authState.accessToken) return authState.accessToken.accessToken; 46679 this._raiseError(errors_1.errors.userNotLoggedIn); 46680 }); 46681 } 46682 getUserIdToken() { 46683 return __awaiter(this, void 0, void 0, function* () { 46684 const authState = this.authClient.authStateManager.getAuthState(); 46685 if (authState.idToken) return authState.idToken.idToken; 46686 this._raiseError(errors_1.errors.userNotLoggedIn); 46687 }); 46688 } 46689 getUserName() { 46690 var _a; 46691 return (_a = this.userInfo) === null || _a === void 0 ? void 0 : _a.email; 46692 } 46693 initiateForgotPassword(user, recaptchaToken) { 46694 return __awaiter(this, void 0, void 0, function* () { 46695 try { 46696 yield this.initiateForgotPasswordCB(user, recaptchaToken); 46697 } catch (err) { 46698 this._raiseError(err); 46699 } 46700 }); 46701 } 46702 confirmForgotPassword(user, verificationCode, newPassword) { 46703 return __awaiter(this, void 0, void 0, function* () { 46704 try { 46705 yield this.confirmForgotPasswordCB(user, verificationCode.trim(), newPassword); 46706 yield this.login(user, newPassword); 46707 } catch (err) { 46708 this._raiseError(err); 46709 } 46710 }); 46711 } 46712 changePassword(user, oldPassword, newPassword) { 46713 return __awaiter(this, void 0, void 0, function* () { 46714 yield this.transaction.changePassword({ 46715 oldPassword, 46716 newPassword 46717 }); 46718 yield this.login(user, newPassword); 46719 }); 46720 } 46721 getAndSetTokensWithoutPrompt(sessionToken) { 46722 return __awaiter(this, void 0, void 0, function* () { 46723 try { 46724 const tokenResponse = yield this.authClient.token.getWithoutPrompt({ 46725 sessionToken, 46726 scopes: [ 46727 "openid", 46728 "email", 46729 "profile" 46730 ] 46731 }); 46732 this.authClient.tokenManager.setTokens(tokenResponse.tokens); 46733 this.authClient.authStateManager.updateAuthState(); 46734 } catch (err) { 46735 this._raiseError(err); 46736 } 46737 }); 46738 } 46739 /** 46740 * When updateAuthState is called, a new authState object is produced. 46741 * `transformAuthState` can modify this object before it is stored and emitted. 46742 * By default, `updateAuthState` will set `isAuthenticated` to true if unex
46742pired tokens are available from tokenManager. 46743 * We use it to also require a valid Okta SSO. 46744 * 46745 * @param _authClient AuthClient (unused) 46746 * @param authState {AuthState} authState 46747 * @private 46748 */ 46749 transformAuthState(_authClient, authState) { 46750 return __awaiter(this, void 0, void 0, function* () { 46751 let responseAuthState = authState; 46752 if (responseAuthState.accessToken && responseAuthState.idToken) { 46753 if (!this.userInfo) this.userInfo = yield _authClient.token.getUserInfo(); 46754 responseAuthState = Object.assign(Object.assign({}, responseAuthState), { isAuthenticated: responseAuthState.isAuthenticated && !!this.userInfo }); 46755 } 46756 return responseAuthState; 46757 }); 46758 } 46759 /** 46760 * Handler for authState change event. Logic based on authState is done here. 46761 * @param authState 46762 * @private 46763 */ 46764 authStateChangeHandler(authState) { 46765 if (!authState.isAuthenticated) { 46766 this.userInfo = null; 46767 if (!authState.isPending && this.shouldRedirectToGetTokens) this.authClient.token.getWithRedirect({ 46768 state: JSON.stringify({ 46769 issuer: this.oktaAuthOptions.issuer, 46770 clientId: this.oktaAuthOptions.clientId, 46771 storage: this.oktaAuthOptions.tokenManager.storage, 46772 scopes: this.oktaAuthOptions.scopes.join(" "), 46773 flow: "redirect", 46774 requireUserSession: "true" 46775 }), 46776 prompt: "none" 46777 }).then(() => {}).catch(() => { 46778 this.resolveInit(); 46779 }); 46780 else this.resolveInit(); 46781 } else this.resolveInit(); 46782 } 46783 resolveInit() { 46784 if (this.initPromiseResolve) { 46785 this.initPromiseResolve(); 46786 this.initPromiseResolve = void 0; 46787 } 46788 } 46789 _raiseError(err) { 46790 throw err; 46791 } 46792 subscribe(callback) { 46793 this.authClient.authStateManager.subscribe((state) => callback({ 46794 isPending: state.isPending, 46795 isAuthenticated: state.isAuthenticated 46796 })); 46797 } 46798 getAuthServiceType() { 46799 return "OKTA"; 46800 } 46801 }; 46802 exports.SskyOktaService = SskyOktaService; 46803})); 46804//#endregion 46805//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/okta/index.js 46806var require_okta = /* @__PURE__ */ __commonJSMin(((exports) => { 46807 var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { 46808 if (k2 === void 0) k2 = k; 46809 var desc = Object.getOwnPropertyDescriptor(m, k); 46810 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = { 46811 enumerable: true, 46812 get: function() { 46813 return m[k]; 46814 } 46815 }; 46816 Object.defineProperty(o, k2, desc); 46817 }) : (function(o, m, k, k2) { 46818 if (k2 === void 0) k2 = k; 46819 o[k2] = m[k]; 46820 })); 46821 var __exportStar = exports && exports.__exportStar || function(m, exports$2) { 46822 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$2, p)) __createBinding(exports$2, m, p); 46823 }; 46824 Object.defineProperty(exports, "__esModule", { value: true }); 46825 __exportStar(require_SskyOktaService(), exports); 46826})); 46827//#endregion 46828//#region node_modules/@sundaysky/smartvideo-hub-auth/dist/index.js 46829var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => { 46830 var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { 46831 if (k2 === void 0) k2 = k; 46832 var desc = Object.getOwnPropertyDescriptor(m, k); 46833 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = { 46834 enumerable: true, 46835 get: function() { 46836 return m[k]; 46837 } 46838 }; 46839 Object.defineProperty(o, k2, desc); 46840 }) : (function(o, m, k, k2) { 46841 if (k2 === void 0) k2 = k; 46842 o[k2] = m[k]; 46843 })); 46844 var __exportStar = exports && exports.__exportStar || function(m, exports$1) { 46845 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p); 46846 }; 46847 Object.defineProperty(exports, "__esModule", { value: true }); 46848 __exportStar(require_authServiceInterface(), exports); 46849 __exportStar(require_authService(), exports); 46850 __exportStar(require_errors(), exports); 46851 __exportStar(require_cognito(), exports); 46852 __exportStar(require_okta(), exports); 46853 __exportStar(require_utils(), exports); 46854 __exportStar(require_auth0(), exports); 46855})); 46856//#endregion 46857export { require_abs as A, require_browser$13 as B, require_es_define_property as C, require_min as D, require_pow as E, require_string_decoder as F, require_buffer$1 as H, require_browser$11 as I, require___vite_browser_external as L, require_range as M, require_es_object_atoms as N, require_max as O, require_type as P, require_events as R, require_shams$1 as S, require_isNaN as T, require_browser$14 as V, require_call_bound as _, require_stream_browserify as a, require_get_proto as b, require_which_typed_array as c, require_has_property_descriptors as d, require_define_data_property as f, require_is_callable as g, require_for_each as h, require_crypto_browserify as i, require_syntax as j, require_floor as k, require_shams as l, require_possible_typed_array_names as m, require_createBrowserHistory as n, require_typed_array_buffer as o, require_available_typed_arrays as p, require_ua_parser as r, require_is_typed_array as s, require_dist as t, require_call_bind as u, require_get_intrinsic as v, require_gopd as w, require_has_symbols as x, require_hasown as y, require_inherits_browser as z }; 46858 46859//# sourceMappingURL=vendor~index~newNavigation~AccountTierManagementPage~AdminContainer~AISystemPromptManager~C~f6d7pve6.Df2s7yft.js.map 46860//# debugId=05712183-3e0c-5867-9604-61ae680444f1
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.