vendor: 5,589 bytes, lines 1-184
1var ajaxloadmore; 2/******/ (function() { // webpackBootstrap 3/******/ var __webpack_modules__ = ({ 4 5/***/ 19: 6/***/ (function(module, exports, __webpack_require__) { 7 8;(function (root, factory, undef) { 9 if (true) { 10 // CommonJS 11 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(3009), __webpack_require__(1025)); 12 } 13 else // removed by dead control flow 14{} 15}(this, function (CryptoJS) { 16 17 (function () { 18 // Shortcuts 19 var C = CryptoJS; 20 var C_lib = C.lib; 21 var Base = C_lib.Base; 22 var WordArray = C_lib.WordArray; 23 var C_algo = C.algo; 24 var SHA256 = C_algo.SHA256; 25 var HMAC = C_algo.HMAC; 26 27 /** 28 * Password-Based Key Derivation Function 2 algorithm. 29 */ 30 var PBKDF2 = C_algo.PBKDF2 = Base.extend({ 31 /** 32 * Configuration options. 33 * 34 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) 35 * @property {Hasher} hasher The hasher to use. Default: SHA256 36 * @property {number} iterations The number of iterations to perform. Default: 250000 37 */ 38 cfg: Base.extend({ 39 keySize: 128/32, 40 hasher: SHA256, 41 iterations: 250000 42 }), 43 44 /** 45 * Initializes a newly created key derivation function. 46 * 47 * @param {Object} cfg (Optional) The configuration options to use for the derivation. 48 * 49 * @example 50 * 51 * var kdf = CryptoJS.algo.PBKDF2.create(); 52 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); 53 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); 54 */ 55 init: function (cfg) { 56 this.cfg = this.cfg.extend(cfg); 57 }, 58 59 /** 60 * Computes the Password-Based Key Derivation Function 2. 61 * 62 * @param {WordArray|string} password The password. 63 * @param {WordArray|string} salt A salt. 64 * 65 * @return {WordArray} The derived key. 66 * 67 * @example 68 * 69 * var key = kdf.compute(password, salt); 70 */ 71 compute: function (password, salt) { 72 // Shortcut 73 var cfg = this.cfg; 74 75 // Init HMAC 76 var hmac = HMAC.create(cfg.hasher, password); 77 78 // Initial values 79 var derivedKey = WordArray.create(); 80 var blockIndex = WordArray.create([0x00000001]); 81 82 // Shortcuts 83 var derivedKeyWords = derivedKey.words; 84 var blockIndexWords = blockIndex.words; 85 var keySize = cfg.keySize; 86 var iterations = cfg.iterations; 87 88 // Generate key 89 while (derivedKeyWords.length < keySize) { 90 var block = hmac.update(salt).finalize(blockIndex); 91 hmac.reset(); 92 93 // Shortcuts 94 var blockWords = block.words; 95 var blockWordsLength = blockWords.length; 96 97 // Iterations 98 var intermediate = block; 99 for (var i = 1; i < iterations; i++) { 100 intermediate = hmac.finalize(intermediate); 101 hmac.reset(); 102 103 // Shortcut 104 var intermediateWords = intermediate.words; 105 106 // XOR intermediate with block 107 for (var j = 0; j < blockWordsLength; j++) { 108 blockWords[j] ^= intermediateWords[j]; 109 } 110 } 111 112 derivedKey.concat(block); 113 blockIndexWords[0]++; 114 } 115 derivedKey.sigBytes = keySize * 4; 116 117 return derivedKey; 118 } 119 }); 120 121 /** 122 * Computes the Password-Based Key Derivation Function 2. 123 * 124 * @param {WordArray|string} password The password. 125 * @param {WordArray|string} salt A salt. 126 * @param {Object} cfg (Optional) The configuration options to use for this computation. 127 * 128 * @return {WordArray} The derived key. 129 * 130 * @static 131 * 132 * @example 133 * 134 * var key = CryptoJS.PBKDF2(password, salt); 135 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); 136 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); 137 */ 138 C.PBKDF2 = function (password, salt, cfg) { 139 return PBKDF2.create(cfg).compute(password, salt); 140 }; 141 }()); 142 143 144 return CryptoJS.PBKDF2; 145 146})); 147 148/***/ }), 149 150/***/ 25: 151/***/ (function(module, exports, __webpack_require__) { 152 153;(function (root, factory, undef) { 154 if (true) { 155 // CommonJS 156 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 157 } 158 else // removed by dead control flow 159{} 160}(this, function (CryptoJS) { 161 162 (function (undefined) { 163 // Shortcuts 164 var C = CryptoJS; 165 var C_lib = C.lib; 166 var CipherParams = C_lib.CipherParams; 167 var C_enc = C.enc; 168 var Hex = C_enc.Hex; 169 var C_format = C.format; 170 171 var HexFormatter = C_format.Hex = { 172 /** 173 * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. 174 * 175 * @param {CipherParams} cipherParams The cipher params object. 176 * 177 * @return {string} The hexadecimally encoded string. 178 * 179 * @static 180 * 181 * @example 182 * 183 * var hexString = CryptoJS.format.Hex.stringify(cipherParams); 184 */
vendor: 7,079 bytes, lines 185-390
185 stringify: function (cipherParams) { 186 return cipherParams.ciphertext.toString(Hex); 187 }, 188 189 /** 190 * Converts a hexadecimally encoded ciphertext string to a cipher params object. 191 * 192 * @param {string} input The hexadecimally encoded string. 193 * 194 * @return {CipherParams} The cipher params object. 195 * 196 * @static 197 * 198 * @example 199 * 200 * var cipherParams = CryptoJS.format.Hex.parse(hexString); 201 */ 202 parse: function (input) { 203 var ciphertext = Hex.parse(input); 204 return CipherParams.create({ ciphertext: ciphertext }); 205 } 206 }; 207 }()); 208 209 210 return CryptoJS.format.Hex; 211 212})); 213 214/***/ }), 215 216/***/ 76: 217/***/ (function(module) { 218 219"use strict"; 220 221 222/** @type {import('./functionCall')} */ 223module.exports = Function.prototype.call; 224 225 226/***/ }), 227 228/***/ 414: 229/***/ (function(module) { 230 231"use strict"; 232 233 234/** @type {import('./round')} */ 235module.exports = Math.round; 236 237 238/***/ }), 239 240/***/ 453: 241/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 242 243"use strict"; 244 245 246var undefined; 247 248var $Object = __webpack_require__(9612); 249 250var $Error = __webpack_require__(9383); 251var $EvalError = __webpack_require__(1237); 252var $RangeError = __webpack_require__(9290); 253var $ReferenceError = __webpack_require__(9538); 254var $SyntaxError = __webpack_require__(8068); 255var $TypeError = __webpack_require__(9675); 256var $URIError = __webpack_require__(5345); 257 258var abs = __webpack_require__(1514); 259var floor = __webpack_require__(8968); 260var max = __webpack_require__(6188); 261var min = __webpack_require__(8002); 262var pow = __webpack_require__(5880); 263var round = __webpack_require__(414); 264var sign = __webpack_require__(3093); 265 266var $Function = Function; 267 268// eslint-disable-next-line consistent-return 269var getEvalledConstructor = function (expressionSyntax) { 270 try { 271 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 272 } catch (e) {} 273}; 274 275var $gOPD = __webpack_require__(5795); 276var $defineProperty = __webpack_require__(655); 277 278var throwTypeError = function () { 279 throw new $TypeError(); 280}; 281var ThrowTypeError = $gOPD 282 ? (function () { 283 try { 284 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 285 arguments.callee; // IE 8 does not throw here 286 return throwTypeError; 287 } catch (calleeThrows) { 288 try { 289 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 290 return $gOPD(arguments, 'callee').get; 291 } catch (gOPDthrows) { 292 return throwTypeError; 293 } 294 } 295 }()) 296 : throwTypeError; 297 298var hasSymbols = __webpack_require__(4039)(); 299 300var getProto = __webpack_require__(3628); 301var $ObjectGPO = __webpack_require__(1064); 302var $ReflectGPO = __webpack_require__(8648); 303 304var $apply = __webpack_require__(1002); 305var $call = __webpack_require__(76); 306 307var needsEval = {}; 308 309var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); 310 311var INTRINSICS = { 312 __proto__: null, 313 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 314 '%Array%': Array, 315 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 316 '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, 317 '%AsyncFromSyncIteratorPrototype%': undefined, 318 '%AsyncFunction%': needsEval, 319 '%AsyncGenerator%': needsEval, 320 '%AsyncGeneratorFunction%': needsEval, 321 '%AsyncIteratorPrototype%': needsEval, 322 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 323 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 324 '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, 325 '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, 326 '%Boolean%': Boolean, 327 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 328 '%Date%': Date, 329 '%decodeURI%': decodeURI, 330 '%decodeURIComponent%': decodeURIComponent, 331 '%encodeURI%': encodeURI, 332 '%encodeURIComponent%': encodeURIComponent, 333 '%Error%': $Error, 334 '%eval%': eval, // eslint-disable-line no-eval 335 '%EvalError%': $EvalError, 336 '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, 337 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 338 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 339 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 340 '%Function%': $Function, 341 '%GeneratorFunction%': needsEval, 342 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 343 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 344 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 345 '%isFinite%': isFinite, 346 '%isNaN%': isNaN, 347 '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, 348 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 349 '%Map%': typeof Map === 'undefined' ? undefined : Map, 350 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), 351 '%Math%': Math, 352 '%Number%': Number, 353 '%Object%': $Object, 354 '%Object.getOwnPropertyDescriptor%': $gOPD, 355 '%parseFloat%': parseFloat, 356 '%parseInt%': parseInt, 357 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 358 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 359 '%RangeError%': $RangeError, 360 '%ReferenceError%': $ReferenceError, 361 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 362 '%RegExp%': RegExp, 363 '%Set%': typeof Set === 'undefined' ? undefined : Set, 364 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), 365 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 366 '%String%': String, 367 '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, 368 '%Symbol%': hasSymbols ? Symbol : undefined, 369 '%SyntaxError%': $SyntaxError, 370 '%ThrowTypeError%': ThrowTypeError, 371 '%TypedArray%': TypedArray, 372 '%TypeError%': $TypeError, 373 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 374 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 375 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 376 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 377 '%URIError%': $URIError, 378 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 379 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 380 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, 381 382 '%Function.prototype.call%': $call, 383 '%Function.prototype.apply%': $apply, 384 '%Object.defineProperty%': $defineProperty, 385 '%Object.getPrototypeOf%': $ObjectGPO, 386 '%Math.abs%': abs, 387 '%Math.floor%': floor, 388 '%Math.max%': max, 389 '%Math.min%': min, 390 '%Math.pow%': pow,
vendor: 5,527 bytes, lines 391-526
391 '%Math.round%': round, 392 '%Math.sign%': sign, 393 '%Reflect.getPrototypeOf%': $ReflectGPO 394}; 395 396if (getProto) { 397 try { 398 null.error; // eslint-disable-line no-unused-expressions 399 } catch (e) { 400 // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 401 var errorProto = getProto(getProto(e)); 402 INTRINSICS['%Error.prototype%'] = errorProto; 403 } 404} 405 406var doEval = function doEval(name) { 407 var value; 408 if (name === '%AsyncFunction%') { 409 value = getEvalledConstructor('async function () {}'); 410 } else if (name === '%GeneratorFunction%') { 411 value = getEvalledConstructor('function* () {}'); 412 } else if (name === '%AsyncGeneratorFunction%') { 413 value = getEvalledConstructor('async function* () {}'); 414 } else if (name === '%AsyncGenerator%') { 415 var fn = doEval('%AsyncGeneratorFunction%'); 416 if (fn) { 417 value = fn.prototype; 418 } 419 } else if (name === '%AsyncIteratorPrototype%') { 420 var gen = doEval('%AsyncGenerator%'); 421 if (gen && getProto) { 422 value = getProto(gen.prototype); 423 } 424 } 425 426 INTRINSICS[name] = value; 427 428 return value; 429}; 430 431var LEGACY_ALIASES = { 432 __proto__: null, 433 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 434 '%ArrayPrototype%': ['Array', 'prototype'], 435 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 436 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 437 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 438 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 439 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 440 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 441 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 442 '%BooleanPrototype%': ['Boolean', 'prototype'], 443 '%DataViewPrototype%': ['DataView', 'prototype'], 444 '%DatePrototype%': ['Date', 'prototype'], 445 '%ErrorPrototype%': ['Error', 'prototype'], 446 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 447 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 448 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 449 '%FunctionPrototype%': ['Function', 'prototype'], 450 '%Generator%': ['GeneratorFunction', 'prototype'], 451 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 452 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 453 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 454 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 455 '%JSONParse%': ['JSON', 'parse'], 456 '%JSONStringify%': ['JSON', 'stringify'], 457 '%MapPrototype%': ['Map', 'prototype'], 458 '%NumberPrototype%': ['Number', 'prototype'], 459 '%ObjectPrototype%': ['Object', 'prototype'], 460 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 461 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 462 '%PromisePrototype%': ['Promise', 'prototype'], 463 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 464 '%Promise_all%': ['Promise', 'all'], 465 '%Promise_reject%': ['Promise', 'reject'], 466 '%Promise_resolve%': ['Promise', 'resolve'], 467 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 468 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 469 '%RegExpPrototype%': ['RegExp', 'prototype'], 470 '%SetPrototype%': ['Set', 'prototype'], 471 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 472 '%StringPrototype%': ['String', 'prototype'], 473 '%SymbolPrototype%': ['Symbol', 'prototype'], 474 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 475 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 476 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 477 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 478 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 479 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 480 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 481 '%URIErrorPrototype%': ['URIError', 'prototype'], 482 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 483 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 484}; 485 486var bind = __webpack_require__(6743); 487var hasOwn = __webpack_require__(9957); 488var $concat = bind.call($call, Array.prototype.concat); 489var $spliceApply = bind.call($apply, Array.prototype.splice); 490var $replace = bind.call($call, String.prototype.replace); 491var $strSlice = bind.call($call, String.prototype.slice); 492var $exec = bind.call($call, RegExp.prototype.exec); 493 494/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 495var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 496var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 497var stringToPath = function stringToPath(string) { 498 var first = $strSlice(string, 0, 1); 499 var last = $strSlice(string, -1); 500 if (first === '%' && last !== '%') { 501 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 502 } else if (last === '%' && first !== '%') { 503 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 504 } 505 var result = []; 506 $replace(string, rePropName, function (match, number, quote, subString) { 507 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 508 }); 509 return result; 510}; 511/* end adaptation */ 512 513var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 514 var intrinsicName = name; 515 var alias; 516 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 517 alias = LEGACY_ALIASES[intrinsicName]; 518 intrinsicName = '%' + alias[0] + '%'; 519 } 520 521 if (hasOwn(INTRINSICS, intrinsicName)) { 522 var value = INTRINSICS[intrinsicName]; 523 if (value === needsEval) { 524 value = doEval(intrinsicName); 525 } 526 if (typeof value === 'undefined' && !allowMissing) {
vendor: 12,206 bytes, lines 527-985
527 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 528 } 529 530 return { 531 alias: alias, 532 name: intrinsicName, 533 value: value 534 }; 535 } 536 537 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 538}; 539 540module.exports = function GetIntrinsic(name, allowMissing) { 541 if (typeof name !== 'string' || name.length === 0) { 542 throw new $TypeError('intrinsic name must be a non-empty string'); 543 } 544 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 545 throw new $TypeError('"allowMissing" argument must be a boolean'); 546 } 547 548 if ($exec(/^%?[^%]*%?$/, name) === null) { 549 throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); 550 } 551 var parts = stringToPath(name); 552 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 553 554 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 555 var intrinsicRealName = intrinsic.name; 556 var value = intrinsic.value; 557 var skipFurtherCaching = false; 558 559 var alias = intrinsic.alias; 560 if (alias) { 561 intrinsicBaseName = alias[0]; 562 $spliceApply(parts, $concat([0, 1], alias)); 563 } 564 565 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 566 var part = parts[i]; 567 var first = $strSlice(part, 0, 1); 568 var last = $strSlice(part, -1); 569 if ( 570 ( 571 (first === '"' || first === "'" || first === '`') 572 || (last === '"' || last === "'" || last === '`') 573 ) 574 && first !== last 575 ) { 576 throw new $SyntaxError('property names with quotes must have matching quotes'); 577 } 578 if (part === 'constructor' || !isOwn) { 579 skipFurtherCaching = true; 580 } 581 582 intrinsicBaseName += '.' + part; 583 intrinsicRealName = '%' + intrinsicBaseName + '%'; 584 585 if (hasOwn(INTRINSICS, intrinsicRealName)) { 586 value = INTRINSICS[intrinsicRealName]; 587 } else if (value != null) { 588 if (!(part in value)) { 589 if (!allowMissing) { 590 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 591 } 592 return void undefined; 593 } 594 if ($gOPD && (i + 1) >= parts.length) { 595 var desc = $gOPD(value, part); 596 isOwn = !!desc; 597 598 // By convention, when a data property is converted to an accessor 599 // property to emulate a data property that does not suffer from 600 // the override mistake, that accessor's getter is marked with 601 // an `originalValue` property. Here, when we detect this, we 602 // uphold the illusion by pretending to see that original data 603 // property, i.e., returning the value rather than the getter 604 // itself. 605 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 606 value = desc.get; 607 } else { 608 value = value[part]; 609 } 610 } else { 611 isOwn = hasOwn(value, part); 612 value = value[part]; 613 } 614 615 if (isOwn && !skipFurtherCaching) { 616 INTRINSICS[intrinsicRealName] = value; 617 } 618 } 619 } 620 return value; 621}; 622 623 624/***/ }), 625 626/***/ 477: 627/***/ (function() { 628 629/* (ignored) */ 630 631/***/ }), 632 633/***/ 482: 634/***/ (function(module, exports, __webpack_require__) { 635 636;(function (root, factory, undef) { 637 if (true) { 638 // CommonJS 639 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 640 } 641 else // removed by dead control flow 642{} 643}(this, function (CryptoJS) { 644 645 /** 646 * ISO/IEC 9797-1 Padding Method 2. 647 */ 648 CryptoJS.pad.Iso97971 = { 649 pad: function (data, blockSize) { 650 // Add 0x80 byte 651 data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); 652 653 // Zero pad the rest 654 CryptoJS.pad.ZeroPadding.pad(data, blockSize); 655 }, 656 657 unpad: function (data) { 658 // Remove zero padding 659 CryptoJS.pad.ZeroPadding.unpad(data); 660 661 // Remove one more byte -- the 0x80 byte 662 data.sigBytes--; 663 } 664 }; 665 666 667 return CryptoJS.pad.Iso97971; 668 669})); 670 671/***/ }), 672 673/***/ 507: 674/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 675 676"use strict"; 677 678 679var GetIntrinsic = __webpack_require__(453); 680var callBound = __webpack_require__(6556); 681var inspect = __webpack_require__(8859); 682 683var $TypeError = __webpack_require__(9675); 684var $Map = GetIntrinsic('%Map%', true); 685 686/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */ 687var $mapGet = callBound('Map.prototype.get', true); 688/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */ 689var $mapSet = callBound('Map.prototype.set', true); 690/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 691var $mapHas = callBound('Map.prototype.has', true); 692/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 693var $mapDelete = callBound('Map.prototype.delete', true); 694/** @type {<K, V>(thisArg: Map<K, V>) => number} */ 695var $mapSize = callBound('Map.prototype.size', true); 696 697/** @type {import('.')} */ 698module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() { 699 /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */ 700 /** @typedef {Parameters<Channel['get']>[0]} K */ 701 /** @typedef {Parameters<Channel['set']>[1]} V */ 702 703 /** @type {Map<K, V> | undefined} */ var $m; 704 705 /** @type {Channel} */ 706 var channel = { 707 assert: function (key) { 708 if (!channel.has(key)) { 709 throw new $TypeError('Side channel does not contain ' + inspect(key)); 710 } 711 }, 712 'delete': function (key) { 713 if ($m) { 714 var result = $mapDelete($m, key); 715 if ($mapSize($m) === 0) { 716 $m = void undefined; 717 } 718 return result; 719 } 720 return false; 721 }, 722 get: function (key) { // eslint-disable-line consistent-return 723 if ($m) { 724 return $mapGet($m, key); 725 } 726 }, 727 has: function (key) { 728 if ($m) { 729 return $mapHas($m, key); 730 } 731 return false; 732 }, 733 set: function (key, value) { 734 if (!$m) { 735 // @ts-expect-error TS can't handle narrowing a variable inside a closure 736 $m = new $Map(); 737 } 738 $mapSet($m, key, value); 739 } 740 }; 741 742 // @ts-expect-error TODO: figure out why TS is erroring here 743 return channel; 744}; 745 746 747/***/ }), 748 749/***/ 540: 750/***/ (function(module) { 751 752"use strict"; 753 754 755/* istanbul ignore next */ 756function insertStyleElement(options) { 757 var element = document.createElement("style"); 758 options.setAttributes(element, options.attributes); 759 options.insert(element, options.options); 760 return element; 761} 762module.exports = insertStyleElement; 763 764/***/ }), 765 766/***/ 655: 767/***/ (function(module) { 768 769"use strict"; 770 771 772/** @type {import('.')} */ 773var $defineProperty = Object.defineProperty || false; 774if ($defineProperty) { 775 try { 776 $defineProperty({}, 'a', { value: 1 }); 777 } catch (e) { 778 // IE 8 has a broken defineProperty 779 $defineProperty = false; 780 } 781} 782 783module.exports = $defineProperty; 784 785 786/***/ }), 787 788/***/ 754: 789/***/ (function(module, exports, __webpack_require__) { 790 791;(function (root, factory) { 792 if (true) { 793 // CommonJS 794 module.exports = exports = factory(__webpack_require__(9021)); 795 } 796 else // removed by dead control flow 797{} 798}(this, function (CryptoJS) { 799 800 (function () { 801 // Shortcuts 802 var C = CryptoJS; 803 var C_lib = C.lib; 804 var WordArray = C_lib.WordArray; 805 var C_enc = C.enc; 806 807 /** 808 * Base64 encoding strategy. 809 */ 810 var Base64 = C_enc.Base64 = { 811 /** 812 * Converts a word array to a Base64 string. 813 * 814 * @param {WordArray} wordArray The word array. 815 * 816 * @return {string} The Base64 string. 817 * 818 * @static 819 * 820 * @example 821 * 822 * var base64String = CryptoJS.enc.Base64.stringify(wordArray); 823 */ 824 stringify: function (wordArray) { 825 // Shortcuts 826 var words = wordArray.words; 827 var sigBytes = wordArray.sigBytes; 828 var map = this._map; 829 830 // Clamp excess bits 831 wordArray.clamp(); 832 833 // Convert 834 var base64Chars = []; 835 for (var i = 0; i < sigBytes; i += 3) { 836 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 837 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; 838 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; 839 840 var triplet = (byte1 << 16) | (byte2 << 8) | byte3; 841 842 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { 843 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); 844 } 845 } 846 847 // Add padding 848 var paddingChar = map.charAt(64); 849 if (paddingChar) { 850 while (base64Chars.length % 4) { 851 base64Chars.push(paddingChar); 852 } 853 } 854 855 return base64Chars.join(''); 856 }, 857 858 /** 859 * Converts a Base64 string to a word array. 860 * 861 * @param {string} base64Str The Base64 string. 862 * 863 * @return {WordArray} The word array. 864 * 865 * @static 866 * 867 * @example 868 * 869 * var wordArray = CryptoJS.enc.Base64.parse(base64String); 870 */ 871 parse: function (base64Str) { 872 // Shortcuts 873 var base64StrLength = base64Str.length; 874 var map = this._map; 875 var reverseMap = this._reverseMap; 876 877 if (!reverseMap) { 878 reverseMap = this._reverseMap = []; 879 for (var j = 0; j < map.length; j++) { 880 reverseMap[map.charCodeAt(j)] = j; 881 } 882 } 883 884 // Ignore padding 885 var paddingChar = map.charAt(64); 886 if (paddingChar) { 887 var paddingIndex = base64Str.indexOf(paddingChar); 888 if (paddingIndex !== -1) { 889 base64StrLength = paddingIndex; 890 } 891 } 892 893 // Convert 894 return parseLoop(base64Str, base64StrLength, reverseMap); 895 896 }, 897 898 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' 899 }; 900 901 function parseLoop(base64Str, base64StrLength, reverseMap) { 902 var words = []; 903 var nBytes = 0; 904 for (var i = 0; i < base64StrLength; i++) { 905 if (i % 4) { 906 var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); 907 var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); 908 var bitsCombined = bits1 | bits2; 909 words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); 910 nBytes++; 911 } 912 } 913 return WordArray.create(words, nBytes); 914 } 915 }()); 916 917 918 return CryptoJS.enc.Base64; 919 920})); 921 922/***/ }), 923 924/***/ 920: 925/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 926 927"use strict"; 928 929 930var $TypeError = __webpack_require__(9675); 931var inspect = __webpack_require__(8859); 932var getSideChannelList = __webpack_require__(4803); 933var getSideChannelMap = __webpack_require__(507); 934var getSideChannelWeakMap = __webpack_require__(2271); 935 936var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; 937 938/** @type {import('.')} */ 939module.exports = function getSideChannel() { 940 /** @typedef {ReturnType<typeof getSideChannel>} Channel */ 941 942 /** @type {Channel | undefined} */ var $channelData; 943 944 /** @type {Channel} */ 945 var channel = { 946 assert: function (key) { 947 if (!channel.has(key)) { 948 throw new $TypeError('Side channel does not contain ' + inspect(key)); 949 } 950 }, 951 'delete': function (key) { 952 return !!$channelData && $channelData['delete'](key); 953 }, 954 get: function (key) { 955 return $channelData && $channelData.get(key); 956 }, 957 has: function (key) { 958 return !!$channelData && $channelData.has(key); 959 }, 960 set: function (key, value) { 961 if (!$channelData) { 962 $channelData = makeChannel(); 963 } 964 965 $channelData.set(key, value); 966 } 967 }; 968 // @ts-expect-error TODO: figure out why this is erroring 969 return channel; 970}; 971 972 973/***/ }), 974 975/***/ 955: 976/***/ (function(module, exports, __webpack_require__) { 977 978;(function (root, factory, undef) { 979 if (true) { 980 // CommonJS 981 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(754), __webpack_require__(4636), __webpack_require__(9506), __webpack_require__(7165)); 982 } 983 else // removed by dead control flow 984{} 985}(this
vendor: 8,196 bytes, lines 985-1205
985, function (CryptoJS) { 986 987 (function () { 988 // Shortcuts 989 var C = CryptoJS; 990 var C_lib = C.lib; 991 var BlockCipher = C_lib.BlockCipher; 992 var C_algo = C.algo; 993 994 // Lookup tables 995 var SBOX = []; 996 var INV_SBOX = []; 997 var SUB_MIX_0 = []; 998 var SUB_MIX_1 = []; 999 var SUB_MIX_2 = []; 1000 var SUB_MIX_3 = []; 1001 var INV_SUB_MIX_0 = []; 1002 var INV_SUB_MIX_1 = []; 1003 var INV_SUB_MIX_2 = []; 1004 var INV_SUB_MIX_3 = []; 1005 1006 // Compute lookup tables 1007 (function () { 1008 // Compute double table 1009 var d = []; 1010 for (var i = 0; i < 256; i++) { 1011 if (i < 128) { 1012 d[i] = i << 1; 1013 } else { 1014 d[i] = (i << 1) ^ 0x11b; 1015 } 1016 } 1017 1018 // Walk GF(2^8) 1019 var x = 0; 1020 var xi = 0; 1021 for (var i = 0; i < 256; i++) { 1022 // Compute sbox 1023 var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); 1024 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; 1025 SBOX[x] = sx; 1026 INV_SBOX[sx] = x; 1027 1028 // Compute multiplication 1029 var x2 = d[x]; 1030 var x4 = d[x2]; 1031 var x8 = d[x4]; 1032 1033 // Compute sub bytes, mix columns tables 1034 var t = (d[sx] * 0x101) ^ (sx * 0x1010100); 1035 SUB_MIX_0[x] = (t << 24) | (t >>> 8); 1036 SUB_MIX_1[x] = (t << 16) | (t >>> 16); 1037 SUB_MIX_2[x] = (t << 8) | (t >>> 24); 1038 SUB_MIX_3[x] = t; 1039 1040 // Compute inv sub bytes, inv mix columns tables 1041 var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); 1042 INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); 1043 INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); 1044 INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); 1045 INV_SUB_MIX_3[sx] = t; 1046 1047 // Compute next counter 1048 if (!x) { 1049 x = xi = 1; 1050 } else { 1051 x = x2 ^ d[d[d[x8 ^ x2]]]; 1052 xi ^= d[d[xi]]; 1053 } 1054 } 1055 }()); 1056 1057 // Precomputed Rcon lookup 1058 var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; 1059 1060 /** 1061 * AES block cipher algorithm. 1062 */ 1063 var AES = C_algo.AES = BlockCipher.extend({ 1064 _doReset: function () { 1065 var t; 1066 1067 // Skip reset of nRounds has been set before and key did not change 1068 if (this._nRounds && this._keyPriorReset === this._key) { 1069 return; 1070 } 1071 1072 // Shortcuts 1073 var key = this._keyPriorReset = this._key; 1074 var keyWords = key.words; 1075 var keySize = key.sigBytes / 4; 1076 1077 // Compute number of rounds 1078 var nRounds = this._nRounds = keySize + 6; 1079 1080 // Compute number of key schedule rows 1081 var ksRows = (nRounds + 1) * 4; 1082 1083 // Compute key schedule 1084 var keySchedule = this._keySchedule = []; 1085 for (var ksRow = 0; ksRow < ksRows; ksRow++) { 1086 if (ksRow < keySize) { 1087 keySchedule[ksRow] = keyWords[ksRow]; 1088 } else { 1089 t = keySchedule[ksRow - 1]; 1090 1091 if (!(ksRow % keySize)) { 1092 // Rot word 1093 t = (t << 8) | (t >>> 24); 1094 1095 // Sub word 1096 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; 1097 1098 // Mix Rcon 1099 t ^= RCON[(ksRow / keySize) | 0] << 24; 1100 } else if (keySize > 6 && ksRow % keySize == 4) { 1101 // Sub word 1102 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; 1103 } 1104 1105 keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; 1106 } 1107 } 1108 1109 // Compute inv key schedule 1110 var invKeySchedule = this._invKeySchedule = []; 1111 for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { 1112 var ksRow = ksRows - invKsRow; 1113 1114 if (invKsRow % 4) { 1115 var t = keySchedule[ksRow]; 1116 } else { 1117 var t = keySchedule[ksRow - 4]; 1118 } 1119 1120 if (invKsRow < 4 || ksRow <= 4) { 1121 invKeySchedule[invKsRow] = t; 1122 } else { 1123 invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ 1124 INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; 1125 } 1126 } 1127 }, 1128 1129 encryptBlock: function (M, offset) { 1130 this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); 1131 }, 1132 1133 decryptBlock: function (M, offset) { 1134 // Swap 2nd and 4th rows 1135 var t = M[offset + 1]; 1136 M[offset + 1] = M[offset + 3]; 1137 M[offset + 3] = t; 1138 1139 this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); 1140 1141 // Inv swap 2nd and 4th rows 1142 var t = M[offset + 1]; 1143 M[offset + 1] = M[offset + 3]; 1144 M[offset + 3] = t; 1145 }, 1146 1147 _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { 1148 // Shortcut 1149 var nRounds = this._nRounds; 1150 1151 // Get input, add round key 1152 var s0 = M[offset] ^ keySchedule[0]; 1153 var s1 = M[offset + 1] ^ keySchedule[1]; 1154 var s2 = M[offset + 2] ^ keySchedule[2]; 1155 var s3 = M[offset + 3] ^ keySchedule[3]; 1156 1157 // Key schedule row counter 1158 var ksRow = 4; 1159 1160 // Rounds 1161 for (var round = 1; round < nRounds; round++) { 1162 // Shift rows, sub bytes, mix columns, add round key 1163 var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; 1164 var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; 1165 var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; 1166 var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; 1167 1168 // Update state 1169 s0 = t0; 1170 s1 = t1; 1171 s2 = t2; 1172 s3 = t3; 1173 } 1174 1175 // Shift rows, sub bytes, add round key 1176 var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; 1177 var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; 1178 var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; 1179 var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; 1180 1181 // Set output 1182 M[offset] = t0; 1183 M[offset + 1] = t1; 1184 M[offset + 2] = t2; 1185 M[offset + 3] = t3; 1186 }, 1187 1188 keySize: 256/32 1189 }); 1190 1191 /** 1192 * Shortcut functions to the cipher's object interface. 1193 * 1194 * @example 1195 * 1196 * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); 1197 * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); 1198 */ 1199 C.AES = BlockCipher._createHelper(AES); 1200 }()); 1201 1202 1203 return CryptoJS.AES; 1204 1205}));
1206 1207/***/ }), 1208 1209/***/ 1002: 1210/***/ (function(module) { 1211 1212"use strict"; 1213 1214 1215/** @type {import('./functionApply')}
vendor: 7,059 bytes, lines 1215-1474
1215 */ 1216module.exports = Function.prototype.apply; 1217 1218 1219/***/ }), 1220 1221/***/ 1025: 1222/***/ (function(module, exports, __webpack_require__) { 1223 1224;(function (root, factory) { 1225 if (true) { 1226 // CommonJS 1227 module.exports = exports = factory(__webpack_require__(9021)); 1228 } 1229 else // removed by dead control flow 1230{} 1231}(this, function (CryptoJS) { 1232 1233 (function () { 1234 // Shortcuts 1235 var C = CryptoJS; 1236 var C_lib = C.lib; 1237 var Base = C_lib.Base; 1238 var C_enc = C.enc; 1239 var Utf8 = C_enc.Utf8; 1240 var C_algo = C.algo; 1241 1242 /** 1243 * HMAC algorithm. 1244 */ 1245 var HMAC = C_algo.HMAC = Base.extend({ 1246 /** 1247 * Initializes a newly created HMAC. 1248 * 1249 * @param {Hasher} hasher The hash algorithm to use. 1250 * @param {WordArray|string} key The secret key. 1251 * 1252 * @example 1253 * 1254 * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); 1255 */ 1256 init: function (hasher, key) { 1257 // Init hasher 1258 hasher = this._hasher = new hasher.init(); 1259 1260 // Convert string to WordArray, else assume WordArray already 1261 if (typeof key == 'string') { 1262 key = Utf8.parse(key); 1263 } 1264 1265 // Shortcuts 1266 var hasherBlockSize = hasher.blockSize; 1267 var hasherBlockSizeBytes = hasherBlockSize * 4; 1268 1269 // Allow arbitrary length keys 1270 if (key.sigBytes > hasherBlockSizeBytes) { 1271 key = hasher.finalize(key); 1272 } 1273 1274 // Clamp excess bits 1275 key.clamp(); 1276 1277 // Clone key for inner and outer pads 1278 var oKey = this._oKey = key.clone(); 1279 var iKey = this._iKey = key.clone(); 1280 1281 // Shortcuts 1282 var oKeyWords = oKey.words; 1283 var iKeyWords = iKey.words; 1284 1285 // XOR keys with pad constants 1286 for (var i = 0; i < hasherBlockSize; i++) { 1287 oKeyWords[i] ^= 0x5c5c5c5c; 1288 iKeyWords[i] ^= 0x36363636; 1289 } 1290 oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; 1291 1292 // Set initial values 1293 this.reset(); 1294 }, 1295 1296 /** 1297 * Resets this HMAC to its initial state. 1298 * 1299 * @example 1300 * 1301 * hmacHasher.reset(); 1302 */ 1303 reset: function () { 1304 // Shortcut 1305 var hasher = this._hasher; 1306 1307 // Reset 1308 hasher.reset(); 1309 hasher.update(this._iKey); 1310 }, 1311 1312 /** 1313 * Updates this HMAC with a message. 1314 * 1315 * @param {WordArray|string} messageUpdate The message to append. 1316 * 1317 * @return {HMAC} This HMAC instance. 1318 * 1319 * @example 1320 * 1321 * hmacHasher.update('message'); 1322 * hmacHasher.update(wordArray); 1323 */ 1324 update: function (messageUpdate) { 1325 this._hasher.update(messageUpdate); 1326 1327 // Chainable 1328 return this; 1329 }, 1330 1331 /** 1332 * Finalizes the HMAC computation. 1333 * Note that the finalize operation is effectively a destructive, read-once operation. 1334 * 1335 * @param {WordArray|string} messageUpdate (Optional) A final message update. 1336 * 1337 * @return {WordArray} The HMAC. 1338 * 1339 * @example 1340 * 1341 * var hmac = hmacHasher.finalize(); 1342 * var hmac = hmacHasher.finalize('message'); 1343 * var hmac = hmacHasher.finalize(wordArray); 1344 */ 1345 finalize: function (messageUpdate) { 1346 // Shortcut 1347 var hasher = this._hasher; 1348 1349 // Compute HMAC 1350 var innerHash = hasher.finalize(messageUpdate); 1351 hasher.reset(); 1352 var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); 1353 1354 return hmac; 1355 } 1356 }); 1357 }()); 1358 1359 1360})); 1361 1362/***/ }), 1363 1364/***/ 1064: 1365/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1366 1367"use strict"; 1368 1369 1370var $Object = __webpack_require__(9612); 1371 1372/** @type {import('./Object.getPrototypeOf')} */ 1373module.exports = $Object.getPrototypeOf || null; 1374 1375 1376/***/ }), 1377 1378/***/ 1113: 1379/***/ (function(module) { 1380 1381"use strict"; 1382 1383 1384/* istanbul ignore next */ 1385function styleTagTransform(css, styleElement) { 1386 if (styleElement.styleSheet) { 1387 styleElement.styleSheet.cssText = css; 1388 } else { 1389 while (styleElement.firstChild) { 1390 styleElement.removeChild(styleElement.firstChild); 1391 } 1392 styleElement.appendChild(document.createTextNode(css)); 1393 } 1394} 1395module.exports = styleTagTransform; 1396 1397/***/ }), 1398 1399/***/ 1237: 1400/***/ (function(module) { 1401 1402"use strict"; 1403 1404 1405/** @type {import('./eval')} */ 1406module.exports = EvalError; 1407 1408 1409/***/ }), 1410 1411/***/ 1333: 1412/***/ (function(module) { 1413 1414"use strict"; 1415 1416 1417/** @type {import('./shams')} */ 1418/* eslint complexity: [2, 18], max-statements: [2, 33] */ 1419module.exports = function hasSymbols() { 1420 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 1421 if (typeof Symbol.iterator === 'symbol') { return true; } 1422 1423 /** @type {{ [k in symbol]?: unknown }} */ 1424 var obj = {}; 1425 var sym = Symbol('test'); 1426 var symObj = Object(sym); 1427 if (typeof sym === 'string') { return false; } 1428 1429 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 1430 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 1431 1432 // temp disabled per https://github.com/ljharb/object.assign/issues/17 1433 // if (sym instanceof Symbol) { return false; } 1434 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 1435 // if (!(symObj instanceof Symbol)) { return false; } 1436 1437 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 1438 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 1439 1440 var symVal = 42; 1441 obj[sym] = symVal; 1442 for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 1443 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 1444 1445 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 1446 1447 var syms = Object.getOwnPropertySymbols(obj); 1448 if (syms.length !== 1 || syms[0] !== sym) { return false; } 1449 1450 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 1451 1452 if (typeof Object.getOwnPropertyDescriptor === 'function') { 1453 // eslint-disable-next-line no-extra-parens 1454 var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); 1455 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 1456 } 1457 1458 return true; 1459}; 1460 1461 1462/***/ }), 1463 1464/***/ 1380: 1465/***/ (function(module, exports, __webpack_require__) { 1466 1467;(function (root, factory, undef) { 1468 if (true) { 1469 // CommonJS 1470 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(3240)); 1471 } 1472 else // removed by dead control flow 1473{} 1474}(this
vendor: 13,123 bytes, lines 1474-1786
1474, function (CryptoJS) { 1475 1476 (function () { 1477 // Shortcuts 1478 var C = CryptoJS; 1479 var C_lib = C.lib; 1480 var Hasher = C_lib.Hasher; 1481 var C_x64 = C.x64; 1482 var X64Word = C_x64.Word; 1483 var X64WordArray = C_x64.WordArray; 1484 var C_algo = C.algo; 1485 1486 function X64Word_create() { 1487 return X64Word.create.apply(X64Word, arguments); 1488 } 1489 1490 // Constants 1491 var K = [ 1492 X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), 1493 X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), 1494 X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), 1495 X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), 1496 X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), 1497 X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), 1498 X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), 1499 X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), 1500 X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), 1501 X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), 1502 X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), 1503 X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), 1504 X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), 1505 X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), 1506 X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), 1507 X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), 1508 X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), 1509 X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), 1510 X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), 1511 X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), 1512 X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), 1513 X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), 1514 X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), 1515 X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), 1516 X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), 1517 X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), 1518 X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), 1519 X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), 1520 X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), 1521 X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), 1522 X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), 1523 X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), 1524 X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), 1525 X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), 1526 X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), 1527 X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), 1528 X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), 1529 X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), 1530 X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), 1531 X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) 1532 ]; 1533 1534 // Reusable objects 1535 var W = []; 1536 (function () { 1537 for (var i = 0; i < 80; i++) { 1538 W[i] = X64Word_create(); 1539 } 1540 }()); 1541 1542 /** 1543 * SHA-512 hash algorithm. 1544 */ 1545 var SHA512 = C_algo.SHA512 = Hasher.extend({ 1546 _doReset: function () { 1547 this._hash = new X64WordArray.init([ 1548 new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), 1549 new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), 1550 new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), 1551 new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) 1552 ]); 1553 }, 1554 1555 _doProcessBlock: function (M, offset) { 1556 // Shortcuts 1557 var H = this._hash.words; 1558 1559 var H0 = H[0]; 1560 var H1 = H[1]; 1561 var H2 = H[2]; 1562 var H3 = H[3]; 1563 var H4 = H[4]; 1564 var H5 = H[5]; 1565 var H6 = H[6]; 1566 var H7 = H[7]; 1567 1568 var H0h = H0.high; 1569 var H0l = H0.low; 1570 var H1h = H1.high; 1571 var H1l = H1.low; 1572 var H2h = H2.high; 1573 var H2l = H2.low; 1574 var H3h = H3.high; 1575 var H3l = H3.low; 1576 var H4h = H4.high; 1577 var H4l = H4.low; 1578 var H5h = H5.high; 1579 var H5l = H5.low; 1580 var H6h = H6.high; 1581 var H6l = H6.low; 1582 var H7h = H7.high; 1583 var H7l = H7.low; 1584 1585 // Working variables 1586 var ah = H0h; 1587 var al = H0l; 1588 var bh = H1h; 1589 var bl = H1l; 1590 var ch = H2h; 1591 var cl = H2l; 1592 var dh = H3h; 1593 var dl = H3l; 1594 var eh = H4h; 1595 var el = H4l; 1596 var fh = H5h; 1597 var fl = H5l; 1598 var gh = H6h; 1599 var gl = H6l; 1600 var hh = H7h; 1601 var hl = H7l; 1602 1603 // Rounds 1604 for (var i = 0; i < 80; i++) { 1605 var Wil; 1606 var Wih; 1607 1608 // Shortcut 1609 var Wi = W[i]; 1610 1611 // Extend message 1612 if (i < 16) { 1613 Wih = Wi.high = M[offset + i * 2] | 0; 1614 Wil = Wi.low = M[offset + i * 2 + 1] | 0; 1615 } else { 1616 // Gamma0 1617 var gamma0x = W[i - 15]; 1618 var gamma0xh = gamma0x.high; 1619 var gamma0xl = gamma0x.low; 1620 var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); 1621 var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); 1622 1623 // Gamma1 1624 var gamma1x = W[i - 2]; 1625 var gamma1xh = gamma1x.high; 1626 var gamma1xl = gamma1x.low; 1627 var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); 1628 var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); 1629 1630 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] 1631 var Wi7 = W[i - 7]; 1632 var Wi7h = Wi7.high; 1633 var Wi7l = Wi7.low; 1634 1635 var Wi16 = W[i - 16]; 1636 var Wi16h = Wi16.high; 1637 var Wi16l = Wi16.low; 1638 1639 Wil = gamma0l + Wi7l; 1640 Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); 1641 Wil = Wil + gamma1l; 1642 Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); 1643 Wil = Wil + Wi16l; 1644 Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); 1645 1646 Wi.high = Wih; 1647 Wi.low = Wil; 1648 } 1649 1650 var chh = (eh & fh) ^ (~eh & gh); 1651 var chl = (el & fl) ^ (~el & gl); 1652 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); 1653 var majl = (al & bl) ^ (al & cl) ^ (bl & cl); 1654 1655 var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); 1656 var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); 1657 var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); 1658 var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); 1659 1660 // t1 = h + sigma1 + ch + K[i] + W[i] 1661 var Ki = K[i]; 1662 var Kih = Ki.high; 1663 var Kil = Ki.low; 1664 1665 var t1l = hl + sigma1l; 1666 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); 1667 var t1l = t1l + chl; 1668 var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); 1669 var t1l = t1l + Kil; 1670 var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); 1671 var t1l = t1l + Wil; 1672 var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); 1673 1674 // t2 = sigma0 + maj 1675 var t2l = sigma0l + majl; 1676 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); 1677 1678 // Update working variables 1679 hh = gh; 1680 hl = gl; 1681 gh = fh; 1682 gl = fl; 1683 fh = eh; 1684 fl = el; 1685 el = (dl + t1l) | 0; 1686 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; 1687 dh = ch; 1688 dl = cl; 1689 ch = bh; 1690 cl = bl; 1691 bh = ah; 1692 bl = al; 1693 al = (t1l + t2l) | 0; 1694 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; 1695 } 1696 1697 // Intermediate hash value 1698 H0l = H0.low = (H0l + al); 1699 H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); 1700 H1l = H1.low = (H1l + bl); 1701 H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); 1702 H2l = H2.low = (H2l + cl); 1703 H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); 1704 H3l = H3.low = (H3l + dl); 1705 H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); 1706 H4l = H4.low = (H4l + el); 1707 H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); 1708 H5l = H5.low = (H5l + fl); 1709 H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); 1710 H6l = H6.low = (H6l + gl); 1711 H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); 1712 H7l = H7.low = (H7l + hl); 1713 H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); 1714 }, 1715 1716 _doFinalize: function () { 1717 // Shortcuts 1718 var data = this._data; 1719 var dataWords = data.words; 1720 1721 var nBitsTotal = this._nDataBytes * 8; 1722 var nBitsLeft = data.sigBytes * 8; 1723 1724 // Add padding 1725 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 1726 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); 1727 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; 1728 data.sigBytes = dataWords.length * 4; 1729 1730 // Hash final blocks 1731 this._process(); 1732 1733 // Convert hash to 32-bit word array before returning 1734 var hash = this._hash.toX32(); 1735 1736 // Return final computed hash 1737 return hash; 1738 }, 1739 1740 clone: function () { 1741 var clone = Hasher.clone.call(this); 1742 clone._hash = this._hash.clone(); 1743 1744 return clone; 1745 }, 1746 1747 blockSize: 1024/32 1748 }); 1749 1750 /** 1751 * Shortcut function to the hasher's object interface. 1752 * 1753 * @param {WordArray|string} message The message to hash. 1754 * 1755 * @return {WordArray} The hash. 1756 * 1757 * @static 1758 * 1759 * @example 1760 * 1761 * var hash = CryptoJS.SHA512('message'); 1762 * var hash = CryptoJS.SHA512(wordArray); 1763 */ 1764 C.SHA512 = Hasher._createHelper(SHA512); 1765 1766 /** 1767 * Shortcut function to the HMAC's object interface. 1768 * 1769 * @param {WordArray|string} message The message to hash. 1770 * @param {WordArray|string} key The secret key. 1771 * 1772 * @return {WordArray} The HMAC. 1773 * 1774 * @static 1775 * 1776 * @example 1777 * 1778 * var hmac = CryptoJS.HmacSHA512(message, key); 1779 */ 1780 C.HmacSHA512 = Hasher._createHmacHelper(SHA512); 1781 }()); 1782 1783 1784 return CryptoJS.SHA512; 1785 1786}));
vendor: 2,295 bytes, lines 1787-1853
1787 1788/***/ }), 1789 1790/***/ 1396: 1791/***/ (function(module, exports, __webpack_require__) { 1792 1793;(function (root, factory, undef) { 1794 if (true) { 1795 // CommonJS 1796 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(3240), __webpack_require__(6440), __webpack_require__(5503), __webpack_require__(754), __webpack_require__(4725), __webpack_require__(4636), __webpack_require__(5471), __webpack_require__(3009), __webpack_require__(6308), __webpack_require__(1380), __webpack_require__(9557), __webpack_require__(5953), __webpack_require__(8056), __webpack_require__(1025), __webpack_require__(19), __webpack_require__(9506), __webpack_require__(7165), __webpack_require__(2169), __webpack_require__(6939), __webpack_require__(6372), __webpack_require__(3797), __webpack_require__(8454), __webpack_require__(2073), __webpack_require__(4905), __webpack_require__(482), __webpack_require__(2155), __webpack_require__(8124), __webpack_require__(25), __webpack_require__(955), __webpack_require__(7628), __webpack_require__(7193), __webpack_require__(6298), __webpack_require__(2696), __webpack_require__(3128)); 1797 } 1798 else // removed by dead control flow 1799{} 1800}(this, function (CryptoJS) { 1801 1802 return CryptoJS; 1803 1804})); 1805 1806/***/ }), 1807 1808/***/ 1514: 1809/***/ (function(module) { 1810 1811"use strict"; 1812 1813 1814/** @type {import('./abs')} */ 1815module.exports = Math.abs; 1816 1817 1818/***/ }), 1819 1820/***/ 2073: 1821/***/ (function(module, exports, __webpack_require__) { 1822 1823;(function (root, factory, undef) { 1824 if (true) { 1825 // CommonJS 1826 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 1827 } 1828 else // removed by dead control flow 1829{} 1830}(this, function (CryptoJS) { 1831 1832 /** 1833 * ANSI X.923 padding strategy. 1834 */ 1835 CryptoJS.pad.AnsiX923 = { 1836 pad: function (data, blockSize) { 1837 // Shortcuts 1838 var dataSigBytes = data.sigBytes; 1839 var blockSizeBytes = blockSize * 4; 1840 1841 // Count padding bytes 1842 var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; 1843 1844 // Compute last byte position 1845 var lastBytePos = dataSigBytes + nPaddingBytes - 1; 1846 1847 // Pad 1848 data.clamp(); 1849 data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); 1850 data.sigBytes += nPaddingBytes; 1851 }, 1852 1853 unpad: function (data) {
1854 // Get number of padding bytes from last byte 1855 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; 1856 1857 // Remove padding 1858 data.sigBytes -= nPaddingBytes; 1859 } 1860 }; 1861 1862 1863 return CryptoJS.pad.Ansix923; 1864 1865})); 1866 1867/***/ }), 1868 1869/***/ 2137: 1870/***/ (function(module, exports, __webpack_require__) { 1871 1872var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1873 * EvEmitter v1.1.0 1874 * Lil' event emitter 1875 * MIT License 1876 */ 1877 1878/* jshint unused: true, undef: true, strict: true */ 1879 1880( function( global, factory ) { 1881 // universal module definition 1882 /* jshint strict: false */ /* globals define, module, window */ 1883 if ( true ) { 1884 // AMD - RequireJS 1885 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1886 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1887 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 1888 __WEBPACK_AMD_DEFINE_FACTORY__), 1889 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1890 } else // removed by dead control flow 1891{} 1892 1893}( typeof window != 'undefined' ? window : this, function() { 1894 1895"use strict"; 1896 1897function EvEmitter() {} 1898 1899var proto = EvEmitter.prototype; 1900 1901proto.on = function( eventName, listener ) { 1902 if ( !eventName || !listener ) { 1903 return; 1904 } 1905 // set events hash 1906 var events = this._events = this._events || {}; 1907 // set listeners array 1908 var listeners = events[ eventName ] = events[ eventName ] || []; 1909 // only add once 1910 if ( listeners.indexOf( listener ) == -1 ) { 1911 listeners.push( listener ); 1912 } 1913 1914 return this; 1915}; 1916 1917proto.once = function( eventName, listener ) { 1918 if ( !eventName || !listener ) { 1919 return; 1920 } 1921 // add event 1922 this.on( eventName, listener ); 1923 // set once flag 1924 // set onceEvents hash 1925 var onceEvents = this._onceEvents = this._onceEvents || {}; 1926 // set onceListeners object 1927 var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; 1928 // set flag 1929 onceListeners[ listener ] = true; 1930 1931 return this; 1932}; 1933 1934proto.off = function( eventName, listener ) { 1935 var listeners = this._events && this._events[ eventName ]; 1936 if ( !listeners || !listeners.length ) { 1937 return; 1938 } 1939 var index = listeners.indexOf( listener ); 1940 if ( index != -1 ) { 1941 listeners.splice( index, 1 ); 1942 } 1943 1944 return this; 1945}; 1946 1947proto.emitEvent = function( eventName, args ) { 1948 var listeners = this._events && this._events[ eventName ]; 1949 if ( !listeners || !listeners.length ) { 1950 return; 1951 } 1952 // copy over to avoid interference if .off() in listener 1953 listeners = listeners.slice(0); 1954 args = args || []; 1955 // once stuff 1956 var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 1957 1958 for ( var i=0; i < listeners.length; i++ ) { 1959 var listener = listeners[i] 1960 var isOnce = onceListeners && onceListeners[ listener ]; 1961 if ( isOnce ) { 1962 // remove listener 1963 // remove before trigger to prevent recursion 1964 this.off( eventName, listener ); 1965 // unset once flag 1966 delete onceListeners[ listener ]; 1967 } 1968 // trigger listener 1969 listener.apply( this, args ); 1970 } 1971 1972 return this; 1973}; 1974 1975proto.allOff = function() { 1976 delete this._events; 1977 delete this._onceEvents; 1978}; 1979 1980return EvEmitter; 1981 1982})); 1983 1984 1985/***/ }), 1986 1987/***/ 2155: 1988/***/ (function(module, exports, __webpack_require__) { 1989 1990;(function (root, factory, undef) { 1991 if (true) { 1992 // CommonJS 1993 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 1994 } 1995 else // removed by dead control flow 1996{} 1997}(this, function (CryptoJS) { 1998 1999 /** 2000 * Zero padding strategy. 2001 */ 2002 CryptoJS.pad.ZeroPadding = { 2003 pad: function (data, blockSize) { 2004 // Shortcut 2005 var blockSizeBytes = blockSize * 4; 2006 2007 // Pad 2008 data.clamp(); 2009 data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); 2010 }, 2011 2012 unpad: function (data) { 2013 // Shortcut 2014 var dataWords = data.words; 2015 2016 // Unpad 2017 var i = data.sigBytes - 1; 2018 for (var i = data.sigBytes - 1; i >= 0; i--) { 2019 if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { 2020 data.sigBytes = i + 1; 2021 break; 2022 } 2023 } 2024 } 2025 }; 2026 2027 2028 return CryptoJS.pad.ZeroPadding; 2029 2030})); 2031 2032/***/ }), 2033 2034/***/ 2169: 2035/***/ (function(module, exports, __webpack_require__) { 2036 2037;(function (root, factory, undef) { 2038 if (true) { 2039 // CommonJS 2040 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 2041 } 2042 else // removed by dead control flow 2043{} 2044}(this, function (CryptoJS) { 2045 2046 /** 2047 * Cipher Feedback block mode. 2048 */ 2049 CryptoJS.mode.CFB = (function () { 2050 var CFB = CryptoJS.lib.BlockCipherMode.extend(); 2051 2052 CFB.Encryptor = CFB.extend({ 2053 processBlock: function (words, offset) { 2054 // Shortcuts 2055 var cipher = this._cipher; 2056 var blockSize = cipher.blockSize; 2057 2058 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); 2059 2060 // Remember this block to use with next block 2061 this._prevBlock = words.slice(offset, offset + blockSize); 2062 } 2063 }); 2064 2065 CFB.Decryptor = CFB.extend({ 2066 processBlock: function (words, offset) { 2067 // Shortcuts 2068 var cipher = this._cipher; 2069 var blockSize = cipher.blockSize; 2070 2071 // Remember this block to use with next block 2072 var thisBlock = words.slice(offset, offset + blockSize); 2073 2074 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); 2075 2076 // This block becomes the previous block 2077 this._prevBlock = thisBlock; 2078 } 2079 }); 2080 2081 function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { 2082 var keystream; 2083 2084 // Shortcut 2085 var iv = this._iv; 2086 2087 // Generate keystream 2088 if (iv) { 2089 keystream = iv.slice(0); 2090 2091 // Remove IV for subsequent blocks 2092 this._iv = undefined; 2093 } else { 2094 keystream = this._prevBlock; 2095 } 2096 cipher.encryptBlock(keystream, 0); 2097 2098 // Encrypt 2099 for (var i = 0; i < blockSize; i++) { 2100 words[offset + i] ^= keystream[i]; 2101 } 2102 } 2103 2104 return CFB; 2105 }()); 2106 2107 2108 return CryptoJS.mode.CFB; 2109 2110})); 2111 2112/***/ }), 2113 2114/***/ 2271: 2115/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2116 2117"use strict"; 2118 2119 2120var GetIntrinsic = __webpack_require__(453); 2121var callBound = __webpack_require__(6556); 2122var inspect = __webpack_require__(8859); 2123var getSideChannelMap = __webpack_require__(507); 2124 2125var $TypeError = __webpack_require__(9675); 2126var $WeakMap = GetIntrinsic('%WeakMap%', true); 2127 2128/** @type {<K extends object, V>(thisArg: WeakMap<K, V>
vendor: 12,971 bytes, lines 2128-2527
2128, key: K) => V} */ 2129var $weakMapGet = callBound('WeakMap.prototype.get', true); 2130/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */ 2131var $weakMapSet = callBound('WeakMap.prototype.set', true); 2132/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 2133var $weakMapHas = callBound('WeakMap.prototype.has', true); 2134/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 2135var $weakMapDelete = callBound('WeakMap.prototype.delete', true); 2136 2137/** @type {import('.')} */ 2138module.exports = $WeakMap 2139 ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() { 2140 /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */ 2141 /** @typedef {Parameters<Channel['get']>[0]} K */ 2142 /** @typedef {Parameters<Channel['set']>[1]} V */ 2143 2144 /** @type {WeakMap<K & object, V> | undefined} */ var $wm; 2145 /** @type {Channel | undefined} */ var $m; 2146 2147 /** @type {Channel} */ 2148 var channel = { 2149 assert: function (key) { 2150 if (!channel.has(key)) { 2151 throw new $TypeError('Side channel does not contain ' + inspect(key)); 2152 } 2153 }, 2154 'delete': function (key) { 2155 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 2156 if ($wm) { 2157 return $weakMapDelete($wm, key); 2158 } 2159 } else if (getSideChannelMap) { 2160 if ($m) { 2161 return $m['delete'](key); 2162 } 2163 } 2164 return false; 2165 }, 2166 get: function (key) { 2167 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 2168 if ($wm) { 2169 return $weakMapGet($wm, key); 2170 } 2171 } 2172 return $m && $m.get(key); 2173 }, 2174 has: function (key) { 2175 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 2176 if ($wm) { 2177 return $weakMapHas($wm, key); 2178 } 2179 } 2180 return !!$m && $m.has(key); 2181 }, 2182 set: function (key, value) { 2183 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 2184 if (!$wm) { 2185 $wm = new $WeakMap(); 2186 } 2187 $weakMapSet($wm, key, value); 2188 } else if (getSideChannelMap) { 2189 if (!$m) { 2190 $m = getSideChannelMap(); 2191 } 2192 // eslint-disable-next-line no-extra-parens 2193 /** @type {NonNullable<typeof $m>} */ ($m).set(key, value); 2194 } 2195 } 2196 }; 2197 2198 // @ts-expect-error TODO: figure out why this is erroring 2199 return channel; 2200 } 2201 : getSideChannelMap; 2202 2203 2204/***/ }), 2205 2206/***/ 2634: 2207/***/ (function() { 2208 2209/* (ignored) */ 2210 2211/***/ }), 2212 2213/***/ 2642: 2214/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2215 2216"use strict"; 2217 2218 2219var utils = __webpack_require__(7720); 2220 2221var has = Object.prototype.hasOwnProperty; 2222var isArray = Array.isArray; 2223 2224var defaults = { 2225 allowDots: false, 2226 allowEmptyArrays: false, 2227 allowPrototypes: false, 2228 allowSparse: false, 2229 arrayLimit: 20, 2230 charset: 'utf-8', 2231 charsetSentinel: false, 2232 comma: false, 2233 decodeDotInKeys: false, 2234 decoder: utils.decode, 2235 delimiter: '&', 2236 depth: 5, 2237 duplicates: 'combine', 2238 ignoreQueryPrefix: false, 2239 interpretNumericEntities: false, 2240 parameterLimit: 1000, 2241 parseArrays: true, 2242 plainObjects: false, 2243 strictDepth: false, 2244 strictNullHandling: false, 2245 throwOnLimitExceeded: false 2246}; 2247 2248var interpretNumericEntities = function (str) { 2249 return str.replace(/&#(\d+);/g, function ($0, numberStr) { 2250 return String.fromCharCode(parseInt(numberStr, 10)); 2251 }); 2252}; 2253 2254var parseArrayValue = function (val, options, currentArrayLength) { 2255 if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { 2256 return val.split(','); 2257 } 2258 2259 if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { 2260 throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); 2261 } 2262 2263 return val; 2264}; 2265 2266// This is what browsers will submit when the ✓ character occurs in an 2267// application/x-www-form-urlencoded body and the encoding of the page containing 2268// the form is iso-8859-1, or when the submitted form has an accept-charset 2269// attribute of iso-8859-1. Presumably also with other charsets that do not contain 2270// the ✓ character, such as us-ascii. 2271var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') 2272 2273// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. 2274var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') 2275 2276var parseValues = function parseQueryStringValues(str, options) { 2277 var obj = { __proto__: null }; 2278 2279 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; 2280 cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); 2281 2282 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; 2283 var parts = cleanStr.split( 2284 options.delimiter, 2285 options.throwOnLimitExceeded ? limit + 1 : limit 2286 ); 2287 2288 if (options.throwOnLimitExceeded && parts.length > limit) { 2289 throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); 2290 } 2291 2292 var skipIndex = -1; // Keep track of where the utf8 sentinel was found 2293 var i; 2294 2295 var charset = options.charset; 2296 if (options.charsetSentinel) { 2297 for (i = 0; i < parts.length; ++i) { 2298 if (parts[i].indexOf('utf8=') === 0) { 2299 if (parts[i] === charsetSentinel) { 2300 charset = 'utf-8'; 2301 } else if (parts[i] === isoSentinel) { 2302 charset = 'iso-8859-1'; 2303 } 2304 skipIndex = i; 2305 i = parts.length; // The eslint settings do not allow break; 2306 } 2307 } 2308 } 2309 2310 for (i = 0; i < parts.length; ++i) { 2311 if (i === skipIndex) { 2312 continue; 2313 } 2314 var part = parts[i]; 2315 2316 var bracketEqualsPos = part.indexOf(']='); 2317 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; 2318 2319 var key; 2320 var val; 2321 if (pos === -1) { 2322 key = options.decoder(part, defaults.decoder, charset, 'key'); 2323 val = options.strictNullHandling ? null : ''; 2324 } else { 2325 key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); 2326 2327 if (key !== null) { 2328 val = utils.maybeMap( 2329 parseArrayValue( 2330 part.slice(pos + 1), 2331 options, 2332 isArray(obj[key]) ? obj[key].length : 0 2333 ), 2334 function (encodedVal) { 2335 return options.decoder(encodedVal, defaults.decoder, charset, 'value'); 2336 } 2337 ); 2338 } 2339 } 2340 2341 if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { 2342 val = interpretNumericEntities(String(val)); 2343 } 2344 2345 if (part.indexOf('[]=') > -1) { 2346 val = isArray(val) ? [val] : val; 2347 } 2348 2349 if (key !== null) { 2350 var existing = has.call(obj, key); 2351 if (existing && options.duplicates === 'combine') { 2352 obj[key] = utils.combine( 2353 obj[key], 2354 val, 2355 options.arrayLimit, 2356 options.plainObjects 2357 ); 2358 } else if (!existing || options.duplicates === 'last') { 2359 obj[key] = val; 2360 } 2361 } 2362 } 2363 2364 return obj; 2365}; 2366 2367var parseObject = function (chain, val, options, valuesParsed) { 2368 var currentArrayLength = 0; 2369 if (chain.length > 0 && chain[chain.length - 1] === '[]') { 2370 var parentKey = chain.slice(0, -1).join(''); 2371 currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; 2372 } 2373 2374 var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); 2375 2376 for (var i = chain.length - 1; i >= 0; --i) { 2377 var obj; 2378 var root = chain[i]; 2379 2380 if (root === '[]' && options.parseArrays) { 2381 if (utils.isOverflow(leaf)) { 2382 // leaf is already an overflow object, preserve it 2383 obj = leaf; 2384 } else { 2385 obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) 2386 ? [] 2387 : utils.combine( 2388 [], 2389 leaf, 2390 options.arrayLimit, 2391 options.plainObjects 2392 ); 2393 } 2394 } else { 2395 obj = options.plainObjects ? { __proto__: null } : {}; 2396 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; 2397 var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; 2398 var index = parseInt(decodedRoot, 10); 2399 if (!options.parseArrays && decodedRoot === '') { 2400 obj = { 0: leaf }; 2401 } else if ( 2402 !isNaN(index) 2403 && root !== decodedRoot 2404 && String(index) === decodedRoot 2405 && index >= 0 2406 && (options.parseArrays && index <= options.arrayLimit) 2407 ) { 2408 obj = []; 2409 obj[index] = leaf; 2410 } else if (decodedRoot !== '__proto__') { 2411 obj[decodedRoot] = leaf; 2412 } 2413 } 2414 2415 leaf = obj; 2416 } 2417 2418 return leaf; 2419}; 2420 2421var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) { 2422 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; 2423 2424 if (options.depth <= 0) { 2425 if (!options.plainObjects && has.call(Object.prototype, key)) { 2426 if (!options.allowPrototypes) { 2427 return; 2428 } 2429 } 2430 2431 return [key]; 2432 } 2433 2434 var brackets = /(\[[^[\]]*])/; 2435 var child = /(\[[^[\]]*])/g; 2436 2437 var segment = brackets.exec(key); 2438 var parent = segment ? key.slice(0, segment.index) : key; 2439 2440 var keys = []; 2441 2442 if (parent) { 2443 if (!options.plainObjects && has.call(Object.prototype, parent)) { 2444 if (!options.allowPrototypes) { 2445 return; 2446 } 2447 } 2448 2449 keys.push(parent); 2450 } 2451 2452 var i = 0; 2453 while ((segment = child.exec(key)) !== null && i < options.depth) { 2454 i += 1; 2455 2456 var segmentContent = segment[1].slice(1, -1); 2457 if (!options.plainObjects && has.call(Object.prototype, segmentContent)) { 2458 if (!options.allowPrototypes) { 2459 return; 2460 } 2461 } 2462 2463 keys.push(segment[1]); 2464 } 2465 2466 if (segment) { 2467 if (options.strictDepth === true) { 2468 throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); 2469 } 2470 2471 keys.push('[' + key.slice(segment.index) + ']'); 2472 } 2473 2474 return keys; 2475}; 2476 2477var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { 2478 if (!givenKey) { 2479 return; 2480 } 2481 2482 var keys = splitKeyIntoSegments(givenKey, options); 2483 2484 if (!keys) { 2485 return; 2486 } 2487 2488 return parseObject(keys, val, options, valuesParsed); 2489}; 2490 2491var normalizeParseOptions = function normalizeParseOptions(opts) { 2492 if (!opts) { 2493 return defaults; 2494 } 2495 2496 if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { 2497 throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); 2498 } 2499 2500 if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { 2501 throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); 2502 } 2503 2504 if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { 2505 throw new TypeError('Decoder has to be a function.'); 2506 } 2507 2508 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 2509 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 2510 } 2511 2512 if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { 2513 throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); 2514 } 2515 2516 var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; 2517 2518 var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; 2519 2520 if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { 2521 throw new TypeError('The duplicates option must be either combine, first, or last'); 2522 } 2523 2524 var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; 2525 2526 return { 2527 allowDots: allowDots,
vendor: 3,922 bytes, lines 2528-2616
2528 allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 2529 allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, 2530 allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, 2531 arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, 2532 charset: charset, 2533 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 2534 comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, 2535 decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, 2536 decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, 2537 delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, 2538 // eslint-disable-next-line no-implicit-coercion, no-extra-parens 2539 depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, 2540 duplicates: duplicates, 2541 ignoreQueryPrefix: opts.ignoreQueryPrefix === true, 2542 interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, 2543 parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, 2544 parseArrays: opts.parseArrays !== false, 2545 plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, 2546 strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, 2547 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, 2548 throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false 2549 }; 2550}; 2551 2552module.exports = function (str, opts) { 2553 var options = normalizeParseOptions(opts); 2554 2555 if (str === '' || str === null || typeof str === 'undefined') { 2556 return options.plainObjects ? { __proto__: null } : {}; 2557 } 2558 2559 var tempObj = typeof str === 'string' ? parseValues(str, options) : str; 2560 var obj = options.plainObjects ? { __proto__: null } : {}; 2561 2562 // Iterate over the keys and setup the new object 2563 2564 var keys = Object.keys(tempObj); 2565 for (var i = 0; i < keys.length; ++i) { 2566 var key = keys[i]; 2567 var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); 2568 obj = utils.merge(obj, newObj, options); 2569 } 2570 2571 if (options.allowSparse === true) { 2572 return obj; 2573 } 2574 2575 return utils.compact(obj); 2576}; 2577 2578 2579/***/ }), 2580 2581/***/ 2696: 2582/***/ (function(module, exports, __webpack_require__) { 2583 2584;(function (root, factory, undef) { 2585 if (true) { 2586 // CommonJS 2587 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(754), __webpack_require__(4636), __webpack_require__(9506), __webpack_require__(7165)); 2588 } 2589 else // removed by dead control flow 2590{} 2591}(this, function (CryptoJS) { 2592 2593 (function () { 2594 // Shortcuts 2595 var C = CryptoJS; 2596 var C_lib = C.lib; 2597 var StreamCipher = C_lib.StreamCipher; 2598 var C_algo = C.algo; 2599 2600 // Reusable objects 2601 var S = []; 2602 var C_ = []; 2603 var G = []; 2604 2605 /** 2606 * Rabbit stream cipher algorithm. 2607 * 2608 * This is a legacy version that neglected to convert the key to little-endian. 2609 * This error doesn't affect the cipher's security, 2610 * but it does affect its compatibility with other implementations. 2611 */ 2612 var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ 2613 _doReset: function () { 2614 // Shortcuts 2615 var K = this._key.words; 2616 var iv = this.cfg.iv;
vendor: 5,524 bytes, lines 2616-2767
2616 2617 2618 // Generate initial state values 2619 var X = this._X = [ 2620 K[0], (K[3] << 16) | (K[2] >>> 16), 2621 K[1], (K[0] << 16) | (K[3] >>> 16), 2622 K[2], (K[1] << 16) | (K[0] >>> 16), 2623 K[3], (K[2] << 16) | (K[1] >>> 16) 2624 ]; 2625 2626 // Generate initial counter values 2627 var C = this._C = [ 2628 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), 2629 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), 2630 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), 2631 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) 2632 ]; 2633 2634 // Carry bit 2635 this._b = 0; 2636 2637 // Iterate the system four times 2638 for (var i = 0; i < 4; i++) { 2639 nextState.call(this); 2640 } 2641 2642 // Modify the counters 2643 for (var i = 0; i < 8; i++) { 2644 C[i] ^= X[(i + 4) & 7]; 2645 } 2646 2647 // IV setup 2648 if (iv) { 2649 // Shortcuts 2650 var IV = iv.words; 2651 var IV_0 = IV[0]; 2652 var IV_1 = IV[1]; 2653 2654 // Generate four subvectors 2655 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); 2656 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); 2657 var i1 = (i0 >>> 16) | (i2 & 0xffff0000); 2658 var i3 = (i2 << 16) | (i0 & 0x0000ffff); 2659 2660 // Modify counter values 2661 C[0] ^= i0; 2662 C[1] ^= i1; 2663 C[2] ^= i2; 2664 C[3] ^= i3; 2665 C[4] ^= i0; 2666 C[5] ^= i1; 2667 C[6] ^= i2; 2668 C[7] ^= i3; 2669 2670 // Iterate the system four times 2671 for (var i = 0; i < 4; i++) { 2672 nextState.call(this); 2673 } 2674 } 2675 }, 2676 2677 _doProcessBlock: function (M, offset) { 2678 // Shortcut 2679 var X = this._X; 2680 2681 // Iterate the system 2682 nextState.call(this); 2683 2684 // Generate four keystream words 2685 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); 2686 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); 2687 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); 2688 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); 2689 2690 for (var i = 0; i < 4; i++) { 2691 // Swap endian 2692 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | 2693 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); 2694 2695 // Encrypt 2696 M[offset + i] ^= S[i]; 2697 } 2698 }, 2699 2700 blockSize: 128/32, 2701 2702 ivSize: 64/32 2703 }); 2704 2705 function nextState() { 2706 // Shortcuts 2707 var X = this._X; 2708 var C = this._C; 2709 2710 // Save old counter values 2711 for (var i = 0; i < 8; i++) { 2712 C_[i] = C[i]; 2713 } 2714 2715 // Calculate new counter values 2716 C[0] = (C[0] + 0x4d34d34d + this._b) | 0; 2717 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; 2718 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; 2719 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; 2720 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; 2721 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; 2722 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; 2723 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; 2724 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; 2725 2726 // Calculate the g-values 2727 for (var i = 0; i < 8; i++) { 2728 var gx = X[i] + C[i]; 2729 2730 // Construct high and low argument for squaring 2731 var ga = gx & 0xffff; 2732 var gb = gx >>> 16; 2733 2734 // Calculate high and low result of squaring 2735 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; 2736 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); 2737 2738 // High XOR low 2739 G[i] = gh ^ gl; 2740 } 2741 2742 // Calculate new state values 2743 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; 2744 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; 2745 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; 2746 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; 2747 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; 2748 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; 2749 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; 2750 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; 2751 } 2752 2753 /** 2754 * Shortcut functions to the cipher's object interface. 2755 * 2756 * @example 2757 * 2758 * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); 2759 * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); 2760 */ 2761 C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); 2762 }()); 2763 2764 2765 return CryptoJS.RabbitLegacy; 2766 2767}));
vendor: 6,809 bytes, lines 2768-3022
2768 2769/***/ }), 2770 2771/***/ 3009: 2772/***/ (function(module, exports, __webpack_require__) { 2773 2774;(function (root, factory) { 2775 if (true) { 2776 // CommonJS 2777 module.exports = exports = factory(__webpack_require__(9021)); 2778 } 2779 else // removed by dead control flow 2780{} 2781}(this, function (CryptoJS) { 2782 2783 (function (Math) { 2784 // Shortcuts 2785 var C = CryptoJS; 2786 var C_lib = C.lib; 2787 var WordArray = C_lib.WordArray; 2788 var Hasher = C_lib.Hasher; 2789 var C_algo = C.algo; 2790 2791 // Initialization and round constants tables 2792 var H = []; 2793 var K = []; 2794 2795 // Compute constants 2796 (function () { 2797 function isPrime(n) { 2798 var sqrtN = Math.sqrt(n); 2799 for (var factor = 2; factor <= sqrtN; factor++) { 2800 if (!(n % factor)) { 2801 return false; 2802 } 2803 } 2804 2805 return true; 2806 } 2807 2808 function getFractionalBits(n) { 2809 return ((n - (n | 0)) * 0x100000000) | 0; 2810 } 2811 2812 var n = 2; 2813 var nPrime = 0; 2814 while (nPrime < 64) { 2815 if (isPrime(n)) { 2816 if (nPrime < 8) { 2817 H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); 2818 } 2819 K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); 2820 2821 nPrime++; 2822 } 2823 2824 n++; 2825 } 2826 }()); 2827 2828 // Reusable object 2829 var W = []; 2830 2831 /** 2832 * SHA-256 hash algorithm. 2833 */ 2834 var SHA256 = C_algo.SHA256 = Hasher.extend({ 2835 _doReset: function () { 2836 this._hash = new WordArray.init(H.slice(0)); 2837 }, 2838 2839 _doProcessBlock: function (M, offset) { 2840 // Shortcut 2841 var H = this._hash.words; 2842 2843 // Working variables 2844 var a = H[0]; 2845 var b = H[1]; 2846 var c = H[2]; 2847 var d = H[3]; 2848 var e = H[4]; 2849 var f = H[5]; 2850 var g = H[6]; 2851 var h = H[7]; 2852 2853 // Computation 2854 for (var i = 0; i < 64; i++) { 2855 if (i < 16) { 2856 W[i] = M[offset + i] | 0; 2857 } else { 2858 var gamma0x = W[i - 15]; 2859 var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ 2860 ((gamma0x << 14) | (gamma0x >>> 18)) ^ 2861 (gamma0x >>> 3); 2862 2863 var gamma1x = W[i - 2]; 2864 var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ 2865 ((gamma1x << 13) | (gamma1x >>> 19)) ^ 2866 (gamma1x >>> 10); 2867 2868 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; 2869 } 2870 2871 var ch = (e & f) ^ (~e & g); 2872 var maj = (a & b) ^ (a & c) ^ (b & c); 2873 2874 var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); 2875 var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); 2876 2877 var t1 = h + sigma1 + ch + K[i] + W[i]; 2878 var t2 = sigma0 + maj; 2879 2880 h = g; 2881 g = f; 2882 f = e; 2883 e = (d + t1) | 0; 2884 d = c; 2885 c = b; 2886 b = a; 2887 a = (t1 + t2) | 0; 2888 } 2889 2890 // Intermediate hash value 2891 H[0] = (H[0] + a) | 0; 2892 H[1] = (H[1] + b) | 0; 2893 H[2] = (H[2] + c) | 0; 2894 H[3] = (H[3] + d) | 0; 2895 H[4] = (H[4] + e) | 0; 2896 H[5] = (H[5] + f) | 0; 2897 H[6] = (H[6] + g) | 0; 2898 H[7] = (H[7] + h) | 0; 2899 }, 2900 2901 _doFinalize: function () { 2902 // Shortcuts 2903 var data = this._data; 2904 var dataWords = data.words; 2905 2906 var nBitsTotal = this._nDataBytes * 8; 2907 var nBitsLeft = data.sigBytes * 8; 2908 2909 // Add padding 2910 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 2911 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); 2912 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; 2913 data.sigBytes = dataWords.length * 4; 2914 2915 // Hash final blocks 2916 this._process(); 2917 2918 // Return final computed hash 2919 return this._hash; 2920 }, 2921 2922 clone: function () { 2923 var clone = Hasher.clone.call(this); 2924 clone._hash = this._hash.clone(); 2925 2926 return clone; 2927 } 2928 }); 2929 2930 /** 2931 * Shortcut function to the hasher's object interface. 2932 * 2933 * @param {WordArray|string} message The message to hash. 2934 * 2935 * @return {WordArray} The hash. 2936 * 2937 * @static 2938 * 2939 * @example 2940 * 2941 * var hash = CryptoJS.SHA256('message'); 2942 * var hash = CryptoJS.SHA256(wordArray); 2943 */ 2944 C.SHA256 = Hasher._createHelper(SHA256); 2945 2946 /** 2947 * Shortcut function to the HMAC's object interface. 2948 * 2949 * @param {WordArray|string} message The message to hash. 2950 * @param {WordArray|string} key The secret key. 2951 * 2952 * @return {WordArray} The HMAC. 2953 * 2954 * @static 2955 * 2956 * @example 2957 * 2958 * var hmac = CryptoJS.HmacSHA256(message, key); 2959 */ 2960 C.HmacSHA256 = Hasher._createHmacHelper(SHA256); 2961 }(Math)); 2962 2963 2964 return CryptoJS.SHA256; 2965 2966})); 2967 2968/***/ }), 2969 2970/***/ 3093: 2971/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2972 2973"use strict"; 2974 2975 2976var $isNaN = __webpack_require__(4459); 2977 2978/** @type {import('./sign')} */ 2979module.exports = function sign(number) { 2980 if ($isNaN(number) || number === 0) { 2981 return number; 2982 } 2983 return number < 0 ? -1 : +1; 2984}; 2985 2986 2987/***/ }), 2988 2989/***/ 3126: 2990/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 2991 2992"use strict"; 2993 2994 2995var bind = __webpack_require__(6743); 2996var $TypeError = __webpack_require__(9675); 2997 2998var $call = __webpack_require__(76); 2999var $actualApply = __webpack_require__(3144); 3000 3001/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ 3002module.exports = function callBindBasic(args) { 3003 if (args.length < 1 || typeof args[0] !== 'function') { 3004 throw new $TypeError('a function is required'); 3005 } 3006 return $actualApply(bind, $call, args); 3007}; 3008 3009 3010/***/ }), 3011 3012/***/ 3128: 3013/***/ (function(module, exports, __webpack_require__) { 3014 3015;(function (root, factory, undef) { 3016 if (true) { 3017 // CommonJS 3018 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(754), __webpack_require__(4636), __webpack_require__(9506), __webpack_require__(7165)); 3019 } 3020 else // removed by dead control flow 3021{} 3022}(this, function (CryptoJS) {
vendor: 20,583 bytes, lines 3022-3477
3022 3023 3024 (function () { 3025 // Shortcuts 3026 var C = CryptoJS; 3027 var C_lib = C.lib; 3028 var BlockCipher = C_lib.BlockCipher; 3029 var C_algo = C.algo; 3030 3031 const N = 16; 3032 3033 //Origin pbox and sbox, derived from PI 3034 const ORIG_P = [ 3035 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 3036 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, 3037 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, 3038 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, 3039 0x9216D5D9, 0x8979FB1B 3040 ]; 3041 3042 const ORIG_S = [ 3043 [ 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 3044 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, 3045 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, 3046 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 3047 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, 3048 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, 3049 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 3050 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, 3051 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, 3052 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 3053 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, 3054 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, 3055 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 3056 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, 3057 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, 3058 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 3059 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, 3060 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, 3061 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 3062 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, 3063 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, 3064 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 3065 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, 3066 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, 3067 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 3068 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, 3069 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, 3070 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 3071 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, 3072 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, 3073 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 3074 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, 3075 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, 3076 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 3077 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, 3078 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, 3079 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 3080 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, 3081 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, 3082 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 3083 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, 3084 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, 3085 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 3086 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, 3087 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, 3088 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 3089 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, 3090 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, 3091 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 3092 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, 3093 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, 3094 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 3095 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, 3096 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, 3097 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 3098 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, 3099 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, 3100 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 3101 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, 3102 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, 3103 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 3104 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, 3105 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, 3106 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A ], 3107 [ 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 3108 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, 3109 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, 3110 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, 3111 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, 3112 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 3113 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, 3114 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, 3115 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, 3116 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, 3117 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, 3118 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, 3119 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, 3120 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, 3121 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, 3122 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, 3123 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, 3124 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, 3125 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, 3126 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, 3127 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, 3128 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, 3129 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, 3130 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, 3131 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, 3132 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, 3133 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, 3134 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, 3135 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, 3136 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, 3137 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, 3138 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, 3139 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, 3140 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, 3141 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, 3142 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, 3143 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, 3144 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, 3145 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, 3146 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, 3147 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, 3148 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, 3149 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, 3150 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, 3151 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, 3152 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, 3153 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, 3154 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, 3155 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, 3156 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, 3157 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, 3158 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, 3159 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, 3160 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, 3161 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, 3162 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, 3163 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, 3164 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, 3165 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, 3166 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, 3167 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, 3168 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, 3169 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, 3170 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 ], 3171 [ 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 3172 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 3173 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, 3174 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, 3175 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, 3176 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, 3177 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, 3178 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, 3179 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, 3180 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, 3181 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 3182 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, 3183 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, 3184 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, 3185 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, 3186 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, 3187 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, 3188 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, 3189 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, 3190 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, 3191 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, 3192 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, 3193 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, 3194 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, 3195 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, 3196 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, 3197 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, 3198 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, 3199 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, 3200 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, 3201 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, 3202 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, 3203 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, 3204 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, 3205 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, 3206 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, 3207 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, 3208 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, 3209 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, 3210 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, 3211 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, 3212 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, 3213 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, 3214 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, 3215 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, 3216 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, 3217 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, 3218 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, 3219 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, 3220 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, 3221 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, 3222 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, 3223 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, 3224 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, 3225 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, 3226 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, 3227 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, 3228 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, 3229 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, 3230 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, 3231 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, 3232 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, 3233 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, 3234 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 ], 3235 [ 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 3236 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, 3237 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, 3238 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 3239 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, 3240 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, 3241 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 3242 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, 3243 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, 3244 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 3245 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, 3246 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, 3247 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, 3248 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, 3249 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, 3250 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 3251 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, 3252 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, 3253 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, 3254 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, 3255 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, 3256 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, 3257 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, 3258 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, 3259 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, 3260 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, 3261 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, 3262 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, 3263 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, 3264 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, 3265 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 3266 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, 3267 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, 3268 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, 3269 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, 3270 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, 3271 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, 3272 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, 3273 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, 3274 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, 3275 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, 3276 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, 3277 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, 3278 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, 3279 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, 3280 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 3281 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, 3282 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, 3283 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, 3284 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, 3285 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, 3286 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 3287 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, 3288 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, 3289 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, 3290 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, 3291 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, 3292 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, 3293 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, 3294 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, 3295 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 3296 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, 3297 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, 3298 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 ] 3299 ]; 3300 3301 var BLOWFISH_CTX = { 3302 pbox: [], 3303 sbox: [] 3304 } 3305 3306 function F(ctx, x){ 3307 let a = (x >> 24) & 0xFF; 3308 let b = (x >> 16) & 0xFF; 3309 let c = (x >> 8) & 0xFF; 3310 let d = x & 0xFF; 3311 3312 let y = ctx.sbox[0][a] + ctx.sbox[1][b]; 3313 y = y ^ ctx.sbox[2][c]; 3314 y = y + ctx.sbox[3][d]; 3315 3316 return y; 3317 } 3318 3319 function BlowFish_Encrypt(ctx, left, right){ 3320 let Xl = left; 3321 let Xr = right; 3322 let temp; 3323 3324 for(let i = 0; i < N; ++i){ 3325 Xl = Xl ^ ctx.pbox[i]; 3326 Xr = F(ctx, Xl) ^ Xr; 3327 3328 temp = Xl; 3329 Xl = Xr; 3330 Xr = temp; 3331 } 3332 3333 temp = Xl; 3334 Xl = Xr; 3335 Xr = temp; 3336 3337 Xr = Xr ^ ctx.pbox[N]; 3338 Xl = Xl ^ ctx.pbox[N + 1]; 3339 3340 return {left: Xl, right: Xr}; 3341 } 3342 3343 function BlowFish_Decrypt(ctx, left, right){ 3344 let Xl = left; 3345 let Xr = right; 3346 let temp; 3347 3348 for(let i = N + 1; i > 1; --i){ 3349 Xl = Xl ^ ctx.pbox[i]; 3350 Xr = F(ctx, Xl) ^ Xr; 3351 3352 temp = Xl; 3353 Xl = Xr; 3354 Xr = temp; 3355 } 3356 3357 temp = Xl; 3358 Xl = Xr; 3359 Xr = temp; 3360 3361 Xr = Xr ^ ctx.pbox[1]; 3362 Xl = Xl ^ ctx.pbox[0]; 3363 3364 return {left: Xl, right: Xr}; 3365 } 3366 3367 /** 3368 * Initialization ctx's pbox and sbox. 3369 * 3370 * @param {Object} ctx The object has pbox and sbox. 3371 * @param {Array} key An array of 32-bit words. 3372 * @param {int} keysize The length of the key. 3373 * 3374 * @example 3375 * 3376 * BlowFishInit(BLOWFISH_CTX, key, 128/32); 3377 */ 3378 function BlowFishInit(ctx, key, keysize) 3379 { 3380 for(let Row = 0; Row < 4; Row++) 3381 { 3382 ctx.sbox[Row] = []; 3383 for(let Col = 0; Col < 256; Col++) 3384 { 3385 ctx.sbox[Row][Col] = ORIG_S[Row][Col]; 3386 } 3387 } 3388 3389 let keyIndex = 0; 3390 for(let index = 0; index < N + 2; index++) 3391 { 3392 ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex]; 3393 keyIndex++; 3394 if(keyIndex >= keysize) 3395 { 3396 keyIndex = 0; 3397 } 3398 } 3399 3400 let Data1 = 0; 3401 let Data2 = 0; 3402 let res = 0; 3403 for(let i = 0; i < N + 2; i += 2) 3404 { 3405 res = BlowFish_Encrypt(ctx, Data1, Data2); 3406 Data1 = res.left; 3407 Data2 = res.right; 3408 ctx.pbox[i] = Data1; 3409 ctx.pbox[i + 1] = Data2; 3410 } 3411 3412 for(let i = 0; i < 4; i++) 3413 { 3414 for(let j = 0; j < 256; j += 2) 3415 { 3416 res = BlowFish_Encrypt(ctx, Data1, Data2); 3417 Data1 = res.left; 3418 Data2 = res.right; 3419 ctx.sbox[i][j] = Data1; 3420 ctx.sbox[i][j + 1] = Data2; 3421 } 3422 } 3423 3424 return true; 3425 } 3426 3427 /** 3428 * Blowfish block cipher algorithm. 3429 */ 3430 var Blowfish = C_algo.Blowfish = BlockCipher.extend({ 3431 _doReset: function () { 3432 // Skip reset of nRounds has been set before and key did not change 3433 if (this._keyPriorReset === this._key) { 3434 return; 3435 } 3436 3437 // Shortcuts 3438 var key = this._keyPriorReset = this._key; 3439 var keyWords = key.words; 3440 var keySize = key.sigBytes / 4; 3441 3442 //Initialization pbox and sbox 3443 BlowFishInit(BLOWFISH_CTX, keyWords, keySize); 3444 }, 3445 3446 encryptBlock: function (M, offset) { 3447 var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); 3448 M[offset] = res.left; 3449 M[offset + 1] = res.right; 3450 }, 3451 3452 decryptBlock: function (M, offset) { 3453 var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); 3454 M[offset] = res.left; 3455 M[offset + 1] = res.right; 3456 }, 3457 3458 blockSize: 64/32, 3459 3460 keySize: 128/32, 3461 3462 ivSize: 64/32 3463 }); 3464 3465 /** 3466 * Shortcut functions to the cipher's object interface. 3467 * 3468 * @example 3469 * 3470 * var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg); 3471 * var plaintext = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg); 3472 */ 3473 C.Blowfish = BlockCipher._createHelper(Blowfish); 3474 }()); 3475 3476 3477 return CryptoJS
vendor: 14,647 bytes, lines 3477-4012
3477.Blowfish; 3478 3479})); 3480 3481/***/ }), 3482 3483/***/ 3144: 3484/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3485 3486"use strict"; 3487 3488 3489var bind = __webpack_require__(6743); 3490 3491var $apply = __webpack_require__(1002); 3492var $call = __webpack_require__(76); 3493var $reflectApply = __webpack_require__(7119); 3494 3495/** @type {import('./actualApply')} */ 3496module.exports = $reflectApply || bind.call($call, $apply); 3497 3498 3499/***/ }), 3500 3501/***/ 3240: 3502/***/ (function(module, exports, __webpack_require__) { 3503 3504;(function (root, factory) { 3505 if (true) { 3506 // CommonJS 3507 module.exports = exports = factory(__webpack_require__(9021)); 3508 } 3509 else // removed by dead control flow 3510{} 3511}(this, function (CryptoJS) { 3512 3513 (function (undefined) { 3514 // Shortcuts 3515 var C = CryptoJS; 3516 var C_lib = C.lib; 3517 var Base = C_lib.Base; 3518 var X32WordArray = C_lib.WordArray; 3519 3520 /** 3521 * x64 namespace. 3522 */ 3523 var C_x64 = C.x64 = {}; 3524 3525 /** 3526 * A 64-bit word. 3527 */ 3528 var X64Word = C_x64.Word = Base.extend({ 3529 /** 3530 * Initializes a newly created 64-bit word. 3531 * 3532 * @param {number} high The high 32 bits. 3533 * @param {number} low The low 32 bits. 3534 * 3535 * @example 3536 * 3537 * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); 3538 */ 3539 init: function (high, low) { 3540 this.high = high; 3541 this.low = low; 3542 } 3543 3544 /** 3545 * Bitwise NOTs this word. 3546 * 3547 * @return {X64Word} A new x64-Word object after negating. 3548 * 3549 * @example 3550 * 3551 * var negated = x64Word.not(); 3552 */ 3553 // not: function () { 3554 // var high = ~this.high; 3555 // var low = ~this.low; 3556 3557 // return X64Word.create(high, low); 3558 // }, 3559 3560 /** 3561 * Bitwise ANDs this word with the passed word. 3562 * 3563 * @param {X64Word} word The x64-Word to AND with this word. 3564 * 3565 * @return {X64Word} A new x64-Word object after ANDing. 3566 * 3567 * @example 3568 * 3569 * var anded = x64Word.and(anotherX64Word); 3570 */ 3571 // and: function (word) { 3572 // var high = this.high & word.high; 3573 // var low = this.low & word.low; 3574 3575 // return X64Word.create(high, low); 3576 // }, 3577 3578 /** 3579 * Bitwise ORs this word with the passed word. 3580 * 3581 * @param {X64Word} word The x64-Word to OR with this word. 3582 * 3583 * @return {X64Word} A new x64-Word object after ORing. 3584 * 3585 * @example 3586 * 3587 * var ored = x64Word.or(anotherX64Word); 3588 */ 3589 // or: function (word) { 3590 // var high = this.high | word.high; 3591 // var low = this.low | word.low; 3592 3593 // return X64Word.create(high, low); 3594 // }, 3595 3596 /** 3597 * Bitwise XORs this word with the passed word. 3598 * 3599 * @param {X64Word} word The x64-Word to XOR with this word. 3600 * 3601 * @return {X64Word} A new x64-Word object after XORing. 3602 * 3603 * @example 3604 * 3605 * var xored = x64Word.xor(anotherX64Word); 3606 */ 3607 // xor: function (word) { 3608 // var high = this.high ^ word.high; 3609 // var low = this.low ^ word.low; 3610 3611 // return X64Word.create(high, low); 3612 // }, 3613 3614 /** 3615 * Shifts this word n bits to the left. 3616 * 3617 * @param {number} n The number of bits to shift. 3618 * 3619 * @return {X64Word} A new x64-Word object after shifting. 3620 * 3621 * @example 3622 * 3623 * var shifted = x64Word.shiftL(25); 3624 */ 3625 // shiftL: function (n) { 3626 // if (n < 32) { 3627 // var high = (this.high << n) | (this.low >>> (32 - n)); 3628 // var low = this.low << n; 3629 // } else { 3630 // var high = this.low << (n - 32); 3631 // var low = 0; 3632 // } 3633 3634 // return X64Word.create(high, low); 3635 // }, 3636 3637 /** 3638 * Shifts this word n bits to the right. 3639 * 3640 * @param {number} n The number of bits to shift. 3641 * 3642 * @return {X64Word} A new x64-Word object after shifting. 3643 * 3644 * @example 3645 * 3646 * var shifted = x64Word.shiftR(7); 3647 */ 3648 // shiftR: function (n) { 3649 // if (n < 32) { 3650 // var low = (this.low >>> n) | (this.high << (32 - n)); 3651 // var high = this.high >>> n; 3652 // } else { 3653 // var low = this.high >>> (n - 32); 3654 // var high = 0; 3655 // } 3656 3657 // return X64Word.create(high, low); 3658 // }, 3659 3660 /** 3661 * Rotates this word n bits to the left. 3662 * 3663 * @param {number} n The number of bits to rotate. 3664 * 3665 * @return {X64Word} A new x64-Word object after rotating. 3666 * 3667 * @example 3668 * 3669 * var rotated = x64Word.rotL(25); 3670 */ 3671 // rotL: function (n) { 3672 // return this.shiftL(n).or(this.shiftR(64 - n)); 3673 // }, 3674 3675 /** 3676 * Rotates this word n bits to the right. 3677 * 3678 * @param {number} n The number of bits to rotate. 3679 * 3680 * @return {X64Word} A new x64-Word object after rotating. 3681 * 3682 * @example 3683 * 3684 * var rotated = x64Word.rotR(7); 3685 */ 3686 // rotR: function (n) { 3687 // return this.shiftR(n).or(this.shiftL(64 - n)); 3688 // }, 3689 3690 /** 3691 * Adds this word with the passed word. 3692 * 3693 * @param {X64Word} word The x64-Word to add with this word. 3694 * 3695 * @return {X64Word} A new x64-Word object after adding. 3696 * 3697 * @example 3698 * 3699 * var added = x64Word.add(anotherX64Word); 3700 */ 3701 // add: function (word) { 3702 // var low = (this.low + word.low) | 0; 3703 // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; 3704 // var high = (this.high + word.high + carry) | 0; 3705 3706 // return X64Word.create(high, low); 3707 // } 3708 }); 3709 3710 /** 3711 * An array of 64-bit words. 3712 * 3713 * @property {Array} words The array of CryptoJS.x64.Word objects. 3714 * @property {number} sigBytes The number of significant bytes in this word array. 3715 */ 3716 var X64WordArray = C_x64.WordArray = Base.extend({ 3717 /** 3718 * Initializes a newly created word array. 3719 * 3720 * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. 3721 * @param {number} sigBytes (Optional) The number of significant bytes in the words. 3722 * 3723 * @example 3724 * 3725 * var wordArray = CryptoJS.x64.WordArray.create(); 3726 * 3727 * var wordArray = CryptoJS.x64.WordArray.create([ 3728 * CryptoJS.x64.Word.create(0x00010203, 0x04050607), 3729 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) 3730 * ]); 3731 * 3732 * var wordArray = CryptoJS.x64.WordArray.create([ 3733 * CryptoJS.x64.Word.create(0x00010203, 0x04050607), 3734 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) 3735 * ], 10); 3736 */ 3737 init: function (words, sigBytes) { 3738 words = this.words = words || []; 3739 3740 if (sigBytes != undefined) { 3741 this.sigBytes = sigBytes; 3742 } else { 3743 this.sigBytes = words.length * 8; 3744 } 3745 }, 3746 3747 /** 3748 * Converts this 64-bit word array to a 32-bit word array. 3749 * 3750 * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. 3751 * 3752 * @example 3753 * 3754 * var x32WordArray = x64WordArray.toX32(); 3755 */ 3756 toX32: function () { 3757 // Shortcuts 3758 var x64Words = this.words; 3759 var x64WordsLength = x64Words.length; 3760 3761 // Convert 3762 var x32Words = []; 3763 for (var i = 0; i < x64WordsLength; i++) { 3764 var x64Word = x64Words[i]; 3765 x32Words.push(x64Word.high); 3766 x32Words.push(x64Word.low); 3767 } 3768 3769 return X32WordArray.create(x32Words, this.sigBytes); 3770 }, 3771 3772 /** 3773 * Creates a copy of this word array. 3774 * 3775 * @return {X64WordArray} The clone. 3776 * 3777 * @example 3778 * 3779 * var clone = x64WordArray.clone(); 3780 */ 3781 clone: function () { 3782 var clone = Base.clone.call(this); 3783 3784 // Clone "words" array 3785 var words = clone.words = this.words.slice(0); 3786 3787 // Clone each X64Word object 3788 var wordsLength = words.length; 3789 for (var i = 0; i < wordsLength; i++) { 3790 words[i] = words[i].clone(); 3791 } 3792 3793 return clone; 3794 } 3795 }); 3796 }()); 3797 3798 3799 return CryptoJS; 3800 3801})); 3802 3803/***/ }), 3804 3805/***/ 3628: 3806/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3807 3808"use strict"; 3809 3810 3811var reflectGetProto = __webpack_require__(8648); 3812var originalGetProto = __webpack_require__(1064); 3813 3814var getDunderProto = __webpack_require__(7176); 3815 3816/** @type {import('.')} */ 3817module.exports = reflectGetProto 3818 ? function getProto(O) { 3819 // @ts-expect-error TS can't narrow inside a closure, for some reason 3820 return reflectGetProto(O); 3821 } 3822 : originalGetProto 3823 ? function getProto(O) { 3824 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 3825 throw new TypeError('getProto: not an object'); 3826 } 3827 // @ts-expect-error TS can't narrow inside a closure, for some reason 3828 return originalGetProto(O); 3829 } 3830 : getDunderProto 3831 ? function getProto(O) { 3832 // @ts-expect-error TS can't narrow inside a closure, for some reason 3833 return getDunderProto(O); 3834 } 3835 : null; 3836 3837 3838/***/ }), 3839 3840/***/ 3797: 3841/***/ (function(module, exports, __webpack_require__) { 3842 3843;(function (root, factory, undef) { 3844 if (true) { 3845 // CommonJS 3846 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 3847 } 3848 else // removed by dead control flow 3849{} 3850}(this, function (CryptoJS) { 3851 3852 /** 3853 * Output Feedback block mode. 3854 */ 3855 CryptoJS.mode.OFB = (function () { 3856 var OFB = CryptoJS.lib.BlockCipherMode.extend(); 3857 3858 var Encryptor = OFB.Encryptor = OFB.extend({ 3859 processBlock: function (words, offset) { 3860 // Shortcuts 3861 var cipher = this._cipher 3862 var blockSize = cipher.blockSize; 3863 var iv = this._iv; 3864 var keystream = this._keystream; 3865 3866 // Generate keystream 3867 if (iv) { 3868 keystream = this._keystream = iv.slice(0); 3869 3870 // Remove IV for subsequent blocks 3871 this._iv = undefined; 3872 } 3873 cipher.encryptBlock(keystream, 0); 3874 3875 // Encrypt 3876 for (var i = 0; i < blockSize; i++) { 3877 words[offset + i] ^= keystream[i]; 3878 } 3879 } 3880 }); 3881 3882 OFB.Decryptor = Encryptor; 3883 3884 return OFB; 3885 }()); 3886 3887 3888 return CryptoJS.mode.OFB; 3889 3890})); 3891 3892/***/ }), 3893 3894/***/ 4039: 3895/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 3896 3897"use strict"; 3898 3899 3900var origSymbol = typeof Symbol !== 'undefined' && Symbol; 3901var hasSymbolSham = __webpack_require__(1333); 3902 3903/** @type {import('.')} */ 3904module.exports = function hasNativeSymbols() { 3905 if (typeof origSymbol !== 'function') { return false; } 3906 if (typeof Symbol !== 'function') { return false; } 3907 if (typeof origSymbol('foo') !== 'symbol') { return false; } 3908 if (typeof Symbol('bar') !== 'symbol') { return false; } 3909 3910 return hasSymbolSham(); 3911}; 3912 3913 3914/***/ }), 3915 3916/***/ 4459: 3917/***/ (function(module) { 3918 3919"use strict"; 3920 3921 3922/** @type {import('./isNaN')} */ 3923module.exports = Number.isNaN || function isNaN(a) { 3924 return a !== a; 3925}; 3926 3927 3928/***/ }), 3929 3930/***/ 4636: 3931/***/ (function(module, exports, __webpack_require__) { 3932 3933;(function (root, factory) { 3934 if (true) { 3935 // CommonJS 3936 module.exports = exports = factory(__webpack_require__(9021)); 3937 } 3938 else // removed by dead control flow 3939{} 3940}(this, function (CryptoJS) { 3941 3942 (function (Math) { 3943 // Shortcuts 3944 var C = CryptoJS; 3945 var C_lib = C.lib; 3946 var WordArray = C_lib.WordArray; 3947 var Hasher = C_lib.Hasher; 3948 var C_algo = C.algo; 3949 3950 // Constants table 3951 var T = []; 3952 3953 // Compute constants 3954 (function () { 3955 for (var i = 0; i < 64; i++) { 3956 T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; 3957 } 3958 }()); 3959 3960 /** 3961 * MD5 hash algorithm. 3962 */ 3963 var MD5 = C_algo.MD5 = Hasher.extend({ 3964 _doReset: function () { 3965 this._hash = new WordArray.init([ 3966 0x67452301, 0xefcdab89, 3967 0x98badcfe, 0x10325476 3968 ]); 3969 }, 3970 3971 _doProcessBlock: function (M, offset) { 3972 // Swap endian 3973 for (var i = 0; i < 16; i++) { 3974 // Shortcuts 3975 var offset_i = offset + i; 3976 var M_offset_i = M[offset_i]; 3977 3978 M[offset_i] = ( 3979 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | 3980 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) 3981 ); 3982 } 3983 3984 // Shortcuts 3985 var H = this._hash.words; 3986 3987 var M_offset_0 = M[offset + 0]; 3988 var M_offset_1 = M[offset + 1]; 3989 var M_offset_2 = M[offset + 2]; 3990 var M_offset_3 = M[offset + 3]; 3991 var M_offset_4 = M[offset + 4]; 3992 var M_offset_5 = M[offset + 5]; 3993 var M_offset_6 = M[offset + 6]; 3994 var M_offset_7 = M[offset + 7]; 3995 var M_offset_8 = M[offset + 8]; 3996 var M_offset_9 = M[offset + 9]; 3997 var M_offset_10 = M[offset + 10]; 3998 var M_offset_11 = M[offset + 11]; 3999 var M_offset_12 = M[offset + 12]; 4000 var M_offset_13 = M[offset + 13]; 4001 var M_offset_14 = M[offset + 14]; 4002 var M_offset_15 = M[offset + 15]; 4003 4004 // Working variables 4005 var a = H[0]; 4006 var b = H[1]; 4007 var c = H[2]; 4008 var d = H[3]; 4009 4010 // Computation 4011 a = FF(a, b, c, d, M_offset_0, 7, T[0]); 4012 d = FF(d, a, b, c, M_offset_1, 12, T[1]);
vendor: 7,502 bytes, lines 4013-4224
4013 c = FF(c, d, a, b, M_offset_2, 17, T[2]); 4014 b = FF(b, c, d, a, M_offset_3, 22, T[3]); 4015 a = FF(a, b, c, d, M_offset_4, 7, T[4]); 4016 d = FF(d, a, b, c, M_offset_5, 12, T[5]); 4017 c = FF(c, d, a, b, M_offset_6, 17, T[6]); 4018 b = FF(b, c, d, a, M_offset_7, 22, T[7]); 4019 a = FF(a, b, c, d, M_offset_8, 7, T[8]); 4020 d = FF(d, a, b, c, M_offset_9, 12, T[9]); 4021 c = FF(c, d, a, b, M_offset_10, 17, T[10]); 4022 b = FF(b, c, d, a, M_offset_11, 22, T[11]); 4023 a = FF(a, b, c, d, M_offset_12, 7, T[12]); 4024 d = FF(d, a, b, c, M_offset_13, 12, T[13]); 4025 c = FF(c, d, a, b, M_offset_14, 17, T[14]); 4026 b = FF(b, c, d, a, M_offset_15, 22, T[15]); 4027 4028 a = GG(a, b, c, d, M_offset_1, 5, T[16]); 4029 d = GG(d, a, b, c, M_offset_6, 9, T[17]); 4030 c = GG(c, d, a, b, M_offset_11, 14, T[18]); 4031 b = GG(b, c, d, a, M_offset_0, 20, T[19]); 4032 a = GG(a, b, c, d, M_offset_5, 5, T[20]); 4033 d = GG(d, a, b, c, M_offset_10, 9, T[21]); 4034 c = GG(c, d, a, b, M_offset_15, 14, T[22]); 4035 b = GG(b, c, d, a, M_offset_4, 20, T[23]); 4036 a = GG(a, b, c, d, M_offset_9, 5, T[24]); 4037 d = GG(d, a, b, c, M_offset_14, 9, T[25]); 4038 c = GG(c, d, a, b, M_offset_3, 14, T[26]); 4039 b = GG(b, c, d, a, M_offset_8, 20, T[27]); 4040 a = GG(a, b, c, d, M_offset_13, 5, T[28]); 4041 d = GG(d, a, b, c, M_offset_2, 9, T[29]); 4042 c = GG(c, d, a, b, M_offset_7, 14, T[30]); 4043 b = GG(b, c, d, a, M_offset_12, 20, T[31]); 4044 4045 a = HH(a, b, c, d, M_offset_5, 4, T[32]); 4046 d = HH(d, a, b, c, M_offset_8, 11, T[33]); 4047 c = HH(c, d, a, b, M_offset_11, 16, T[34]); 4048 b = HH(b, c, d, a, M_offset_14, 23, T[35]); 4049 a = HH(a, b, c, d, M_offset_1, 4, T[36]); 4050 d = HH(d, a, b, c, M_offset_4, 11, T[37]); 4051 c = HH(c, d, a, b, M_offset_7, 16, T[38]); 4052 b = HH(b, c, d, a, M_offset_10, 23, T[39]); 4053 a = HH(a, b, c, d, M_offset_13, 4, T[40]); 4054 d = HH(d, a, b, c, M_offset_0, 11, T[41]); 4055 c = HH(c, d, a, b, M_offset_3, 16, T[42]); 4056 b = HH(b, c, d, a, M_offset_6, 23, T[43]); 4057 a = HH(a, b, c, d, M_offset_9, 4, T[44]); 4058 d = HH(d, a, b, c, M_offset_12, 11, T[45]); 4059 c = HH(c, d, a, b, M_offset_15, 16, T[46]); 4060 b = HH(b, c, d, a, M_offset_2, 23, T[47]); 4061 4062 a = II(a, b, c, d, M_offset_0, 6, T[48]); 4063 d = II(d, a, b, c, M_offset_7, 10, T[49]); 4064 c = II(c, d, a, b, M_offset_14, 15, T[50]); 4065 b = II(b, c, d, a, M_offset_5, 21, T[51]); 4066 a = II(a, b, c, d, M_offset_12, 6, T[52]); 4067 d = II(d, a, b, c, M_offset_3, 10, T[53]); 4068 c = II(c, d, a, b, M_offset_10, 15, T[54]); 4069 b = II(b, c, d, a, M_offset_1, 21, T[55]); 4070 a = II(a, b, c, d, M_offset_8, 6, T[56]); 4071 d = II(d, a, b, c, M_offset_15, 10, T[57]); 4072 c = II(c, d, a, b, M_offset_6, 15, T[58]); 4073 b = II(b, c, d, a, M_offset_13, 21, T[59]); 4074 a = II(a, b, c, d, M_offset_4, 6, T[60]); 4075 d = II(d, a, b, c, M_offset_11, 10, T[61]); 4076 c = II(c, d, a, b, M_offset_2, 15, T[62]); 4077 b = II(b, c, d, a, M_offset_9, 21, T[63]); 4078 4079 // Intermediate hash value 4080 H[0] = (H[0] + a) | 0; 4081 H[1] = (H[1] + b) | 0; 4082 H[2] = (H[2] + c) | 0; 4083 H[3] = (H[3] + d) | 0; 4084 }, 4085 4086 _doFinalize: function () { 4087 // Shortcuts 4088 var data = this._data; 4089 var dataWords = data.words; 4090 4091 var nBitsTotal = this._nDataBytes * 8; 4092 var nBitsLeft = data.sigBytes * 8; 4093 4094 // Add padding 4095 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 4096 4097 var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); 4098 var nBitsTotalL = nBitsTotal; 4099 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( 4100 (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | 4101 (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) 4102 ); 4103 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( 4104 (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | 4105 (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) 4106 ); 4107 4108 data.sigBytes = (dataWords.length + 1) * 4; 4109 4110 // Hash final blocks 4111 this._process(); 4112 4113 // Shortcuts 4114 var hash = this._hash; 4115 var H = hash.words; 4116 4117 // Swap endian 4118 for (var i = 0; i < 4; i++) { 4119 // Shortcut 4120 var H_i = H[i]; 4121 4122 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | 4123 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); 4124 } 4125 4126 // Return final computed hash 4127 return hash; 4128 }, 4129 4130 clone: function () { 4131 var clone = Hasher.clone.call(this); 4132 clone._hash = this._hash.clone(); 4133 4134 return clone; 4135 } 4136 }); 4137 4138 function FF(a, b, c, d, x, s, t) { 4139 var n = a + ((b & c) | (~b & d)) + x + t; 4140 return ((n << s) | (n >>> (32 - s))) + b; 4141 } 4142 4143 function GG(a, b, c, d, x, s, t) { 4144 var n = a + ((b & d) | (c & ~d)) + x + t; 4145 return ((n << s) | (n >>> (32 - s))) + b; 4146 } 4147 4148 function HH(a, b, c, d, x, s, t) { 4149 var n = a + (b ^ c ^ d) + x + t; 4150 return ((n << s) | (n >>> (32 - s))) + b; 4151 } 4152 4153 function II(a, b, c, d, x, s, t) { 4154 var n = a + (c ^ (b | ~d)) + x + t; 4155 return ((n << s) | (n >>> (32 - s))) + b; 4156 } 4157 4158 /** 4159 * Shortcut function to the hasher's object interface. 4160 * 4161 * @param {WordArray|string} message The message to hash. 4162 * 4163 * @return {WordArray} The hash. 4164 * 4165 * @static 4166 * 4167 * @example 4168 * 4169 * var hash = CryptoJS.MD5('message'); 4170 * var hash = CryptoJS.MD5(wordArray); 4171 */ 4172 C.MD5 = Hasher._createHelper(MD5); 4173 4174 /** 4175 * Shortcut function to the HMAC's object interface. 4176 * 4177 * @param {WordArray|string} message The message to hash. 4178 * @param {WordArray|string} key The secret key. 4179 * 4180 * @return {WordArray} The HMAC. 4181 * 4182 * @static 4183 * 4184 * @example 4185 * 4186 * var hmac = CryptoJS.HmacMD5(message, key); 4187 */ 4188 C.HmacMD5 = Hasher._createHmacHelper(MD5); 4189 }(Math)); 4190 4191 4192 return CryptoJS.MD5; 4193 4194})); 4195 4196/***/ }), 4197 4198/***/ 4725: 4199/***/ (function(module, exports, __webpack_require__) { 4200 4201;(function (root, factory) { 4202 if (true) { 4203 // CommonJS 4204 module.exports = exports = factory(__webpack_require__(9021)); 4205 } 4206 else // removed by dead control flow 4207{} 4208}(this, function (CryptoJS) { 4209 4210 (function () { 4211 // Shortcuts 4212 var C = CryptoJS; 4213 var C_lib = C.lib; 4214 var WordArray = C_lib.WordArray; 4215 var C_enc = C.enc; 4216 4217 /** 4218 * Base64url encoding strategy. 4219 */ 4220 var Base64url = C_enc.Base64url = { 4221 /** 4222 * Converts a word array to a Base64url string. 4223 * 4224 * @param {WordArray} wordArray The word array.
vendor: 4,099 bytes, lines 4225-4357
4225 * 4226 * @param {boolean} urlSafe Whether to use url safe 4227 * 4228 * @return {string} The Base64url string. 4229 * 4230 * @static 4231 * 4232 * @example 4233 * 4234 * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); 4235 */ 4236 stringify: function (wordArray, urlSafe) { 4237 if (urlSafe === undefined) { 4238 urlSafe = true 4239 } 4240 // Shortcuts 4241 var words = wordArray.words; 4242 var sigBytes = wordArray.sigBytes; 4243 var map = urlSafe ? this._safe_map : this._map; 4244 4245 // Clamp excess bits 4246 wordArray.clamp(); 4247 4248 // Convert 4249 var base64Chars = []; 4250 for (var i = 0; i < sigBytes; i += 3) { 4251 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 4252 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; 4253 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; 4254 4255 var triplet = (byte1 << 16) | (byte2 << 8) | byte3; 4256 4257 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { 4258 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); 4259 } 4260 } 4261 4262 // Add padding 4263 var paddingChar = map.charAt(64); 4264 if (paddingChar) { 4265 while (base64Chars.length % 4) { 4266 base64Chars.push(paddingChar); 4267 } 4268 } 4269 4270 return base64Chars.join(''); 4271 }, 4272 4273 /** 4274 * Converts a Base64url string to a word array. 4275 * 4276 * @param {string} base64Str The Base64url string. 4277 * 4278 * @param {boolean} urlSafe Whether to use url safe 4279 * 4280 * @return {WordArray} The word array. 4281 * 4282 * @static 4283 * 4284 * @example 4285 * 4286 * var wordArray = CryptoJS.enc.Base64url.parse(base64String); 4287 */ 4288 parse: function (base64Str, urlSafe) { 4289 if (urlSafe === undefined) { 4290 urlSafe = true 4291 } 4292 4293 // Shortcuts 4294 var base64StrLength = base64Str.length; 4295 var map = urlSafe ? this._safe_map : this._map; 4296 var reverseMap = this._reverseMap; 4297 4298 if (!reverseMap) { 4299 reverseMap = this._reverseMap = []; 4300 for (var j = 0; j < map.length; j++) { 4301 reverseMap[map.charCodeAt(j)] = j; 4302 } 4303 } 4304 4305 // Ignore padding 4306 var paddingChar = map.charAt(64); 4307 if (paddingChar) { 4308 var paddingIndex = base64Str.indexOf(paddingChar); 4309 if (paddingIndex !== -1) { 4310 base64StrLength = paddingIndex; 4311 } 4312 } 4313 4314 // Convert 4315 return parseLoop(base64Str, base64StrLength, reverseMap); 4316 4317 }, 4318 4319 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', 4320 _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', 4321 }; 4322 4323 function parseLoop(base64Str, base64StrLength, reverseMap) { 4324 var words = []; 4325 var nBytes = 0; 4326 for (var i = 0; i < base64StrLength; i++) { 4327 if (i % 4) { 4328 var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); 4329 var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); 4330 var bitsCombined = bits1 | bits2; 4331 words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); 4332 nBytes++; 4333 } 4334 } 4335 return WordArray.create(words, nBytes); 4336 } 4337 }()); 4338 4339 4340 return CryptoJS.enc.Base64url; 4341 4342})); 4343 4344/***/ }), 4345 4346/***/ 4765: 4347/***/ (function(module) { 4348 4349"use strict"; 4350 4351 4352var replace = String.prototype.replace; 4353var percentTwenties = /%20/g; 4354 4355var Format = { 4356 RFC1738: 'RFC1738', 4357 RFC3986: 'RFC3986'
vendor: 4,623 bytes, lines 4358-4526
4358}; 4359 4360module.exports = { 4361 'default': Format.RFC3986, 4362 formatters: { 4363 RFC1738: function (value) { 4364 return replace.call(value, percentTwenties, '+'); 4365 }, 4366 RFC3986: function (value) { 4367 return String(value); 4368 } 4369 }, 4370 RFC1738: Format.RFC1738, 4371 RFC3986: Format.RFC3986 4372}; 4373 4374 4375/***/ }), 4376 4377/***/ 4803: 4378/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4379 4380"use strict"; 4381 4382 4383var inspect = __webpack_require__(8859); 4384 4385var $TypeError = __webpack_require__(9675); 4386 4387/* 4388* This function traverses the list returning the node corresponding to the given key. 4389* 4390* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. 4391* By doing so, all the recently used nodes can be accessed relatively quickly. 4392*/ 4393/** @type {import('./list.d.ts').listGetNode} */ 4394// eslint-disable-next-line consistent-return 4395var listGetNode = function (list, key, isDelete) { 4396 /** @type {typeof list | NonNullable<(typeof list)['next']>} */ 4397 var prev = list; 4398 /** @type {(typeof list)['next']} */ 4399 var curr; 4400 // eslint-disable-next-line eqeqeq 4401 for (; (curr = prev.next) != null; prev = curr) { 4402 if (curr.key === key) { 4403 prev.next = curr.next; 4404 if (!isDelete) { 4405 // eslint-disable-next-line no-extra-parens 4406 curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next); 4407 list.next = curr; // eslint-disable-line no-param-reassign 4408 } 4409 return curr; 4410 } 4411 } 4412}; 4413 4414/** @type {import('./list.d.ts').listGet} */ 4415var listGet = function (objects, key) { 4416 if (!objects) { 4417 return void undefined; 4418 } 4419 var node = listGetNode(objects, key); 4420 return node && node.value; 4421}; 4422/** @type {import('./list.d.ts').listSet} */ 4423var listSet = function (objects, key, value) { 4424 var node = listGetNode(objects, key); 4425 if (node) { 4426 node.value = value; 4427 } else { 4428 // Prepend the new node to the beginning of the list 4429 objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens 4430 key: key, 4431 next: objects.next, 4432 value: value 4433 }); 4434 } 4435}; 4436/** @type {import('./list.d.ts').listHas} */ 4437var listHas = function (objects, key) { 4438 if (!objects) { 4439 return false; 4440 } 4441 return !!listGetNode(objects, key); 4442}; 4443/** @type {import('./list.d.ts').listDelete} */ 4444// eslint-disable-next-line consistent-return 4445var listDelete = function (objects, key) { 4446 if (objects) { 4447 return listGetNode(objects, key, true); 4448 } 4449}; 4450 4451/** @type {import('.')} */ 4452module.exports = function getSideChannelList() { 4453 /** @typedef {ReturnType<typeof getSideChannelList>} Channel */ 4454 /** @typedef {Parameters<Channel['get']>[0]} K */ 4455 /** @typedef {Parameters<Channel['set']>[1]} V */ 4456 4457 /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o; 4458 4459 /** @type {Channel} */ 4460 var channel = { 4461 assert: function (key) { 4462 if (!channel.has(key)) { 4463 throw new $TypeError('Side channel does not contain ' + inspect(key)); 4464 } 4465 }, 4466 'delete': function (key) { 4467 var root = $o && $o.next; 4468 var deletedNode = listDelete($o, key); 4469 if (deletedNode && root && root === deletedNode) { 4470 $o = void undefined; 4471 } 4472 return !!deletedNode; 4473 }, 4474 get: function (key) { 4475 return listGet($o, key); 4476 }, 4477 has: function (key) { 4478 return listHas($o, key); 4479 }, 4480 set: function (key, value) { 4481 if (!$o) { 4482 // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head 4483 $o = { 4484 next: void undefined 4485 }; 4486 } 4487 // eslint-disable-next-line no-extra-parens 4488 listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value); 4489 } 4490 }; 4491 // @ts-expect-error TODO: figure out why this is erroring 4492 return channel; 4493}; 4494 4495 4496/***/ }), 4497 4498/***/ 4905: 4499/***/ (function(module, exports, __webpack_require__) { 4500 4501;(function (root, factory, undef) { 4502 if (true) { 4503 // CommonJS 4504 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 4505 } 4506 else // removed by dead control flow 4507{} 4508}(this, function (CryptoJS) { 4509 4510 /** 4511 * ISO 10126 padding strategy. 4512 */ 4513 CryptoJS.pad.Iso10126 = { 4514 pad: function (data, blockSize) { 4515 // Shortcut 4516 var blockSizeBytes = blockSize * 4; 4517 4518 // Count padding bytes 4519 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; 4520 4521 // Pad 4522 data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). 4523 concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); 4524 }, 4525 4526 unpad: function (data) {
4527 // Get number of padding bytes from last byte 4528 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; 4529 4530 // Remove padding 4531 data.sigBytes -= nPaddingBytes; 4532 } 4533 }; 4534 4535 4536 return CryptoJS.pad.Iso10126; 4537 4538})); 4539 4540/***/ }), 4541 4542/***/ 5056: 4543/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4544 4545"use strict"; 4546 4547 4548/* istanbul ignore next */ 4549function setAttributesWithoutAttributes(styleElement) { 4550 var nonce = true ? __webpack_require__.nc : 0; 4551 if (nonce) { 4552 styleElement.setAttribute("nonce", nonce); 4553 } 4554} 4555module.exports = setAttributesWithoutAttributes; 4556 4557/***/ }), 4558 4559/***/ 5072: 4560/***/ (function(module) { 4561 4562"use strict"; 4563 4564 4565var stylesInDOM = []; 4566function getIndexByIdentifier(identifier) { 4567 var result = -1; 4568 for (var i = 0; i < stylesInDOM.length; i++) { 4569 if (stylesInDOM[i].identifier === identifier) { 4570 result = i; 4571 break; 4572 } 4573 } 4574 return result; 4575} 4576function modulesToDom(list, options) { 4577 var idCountMap = {}; 4578 var identifiers = []; 4579 for (var i = 0; i < list.length; i++) { 4580 var item = list[i]; 4581 var id = options.base ? item[0] + options.base : item[0]; 4582 var count = idCountMap[id] || 0; 4583 var identifier = "".concat(id, " ").concat(count); 4584 idCountMap[id] = count + 1; 4585 var indexByIdentifier = getIndexByIdentifier(identifier); 4586 var obj = { 4587 css: item[1], 4588 media: item[2], 4589 sourceMap: item[3], 4590 supports: item[4], 4591 layer: item[5] 4592 }; 4593 if (indexByIdentifier !== -1) { 4594 stylesInDOM[indexByIdentifier].references++; 4595 stylesInDOM[indexByIdentifier].updater(obj); 4596 } else { 4597 var updater = addElementStyle(obj, options); 4598 options.byIndex = i; 4599 stylesInDOM.splice(i, 0, { 4600 identifier: identifier, 4601 updater: updater, 4602 references: 1 4603 }); 4604 } 4605 identifiers.push(identifier); 4606 } 4607 return identifiers; 4608} 4609function addElementStyle(obj, options) { 4610 var api = options.domAPI(options); 4611 api.update(obj); 4612 var updater = function updater(newObj) { 4613 if (newObj) { 4614 if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) { 4615 return; 4616 } 4617 api.update(obj = newObj); 4618 } else { 4619 api.remove(); 4620 } 4621 }; 4622 return updater; 4623} 4624module.exports = function (list, options) { 4625 options = options || {}; 4626 list = list || []; 4627 var lastIdentifiers = modulesToDom(list, options); 4628 return function update(newList) { 4629 newList = newList || []; 4630 for (var i = 0; i < lastIdentifiers.length; i++) { 4631 var identifier = lastIdentifiers[i]; 4632 var index = getIndexByIdentifier(identifier); 4633 stylesInDOM[index].references--; 4634 } 4635 var newLastIdentifiers = modulesToDom(newList, options); 4636 for (var _i = 0; _i < lastIdentifiers.length; _i++) { 4637 var _identifier = lastIdentifiers[_i]; 4638 var _index = getIndexByIdentifier(_identifier); 4639 if (stylesInDOM[_index].references === 0) { 4640 stylesInDOM[_index].updater(); 4641 stylesInDOM.splice(_index, 1); 4642 } 4643 } 4644 lastIdentifiers = newLastIdentifiers; 4645 }; 4646}; 4647 4648/***/ }), 4649 4650/***/ 5345: 4651/***/ (function(module) { 4652 4653"use strict"; 4654 4655 4656/** @type {import('./uri')} */ 4657module.exports = URIError; 4658 4659 4660/***/ }), 4661 4662/***/ 5373: 4663/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4664 4665"use strict"; 4666 4667 4668var stringify = __webpack_require__(8636); 4669var parse = __webpack_require__(2642); 4670var formats = __webpack_require__(4765); 4671 4672module.exports = { 4673 formats: formats, 4674 parse: parse, 4675 stringify: stringify 4676}; 4677 4678 4679/***/ }), 4680 4681/***/ 5471: 4682/***/ (function(module, exports, __webpack_require__) { 4683 4684;(function (root, factory) { 4685 if (true) { 4686 // CommonJS 4687 module.exports = exports = factory(__webpack_require__(9021)); 4688 } 4689 else // removed by dead control flow 4690{} 4691}(this, function (CryptoJS) { 4692 4693 (function () { 4694 // Shortcuts 4695 var C = CryptoJS; 4696 var C_lib = C.lib; 4697 var WordArray = C_lib.WordArray; 4698 var Hasher = C_lib.Hasher; 4699 var C_algo = C.algo; 4700 4701 // Reusable object 4702 var W = []; 4703 4704 /** 4705 * SHA-1 hash algorithm. 4706 */ 4707 var SHA1 = C_algo.SHA1 = Hasher.extend({ 4708 _doReset: function () { 4709 this._hash = new WordArray.init([ 4710 0x67452301, 0xefcdab89, 4711 0x98badcfe, 0x10325476, 4712 0xc3d2e1f0 4713 ]); 4714 }, 4715 4716 _doProcessBlock: function (M, offset) { 4717 // Shortcut 4718 var H = this._hash.words; 4719 4720 // Working variables 4721 var a = H[0]; 4722 var b = H[1]; 4723 var c = H[2]; 4724 var d = H[3]; 4725 var e = H[4]; 4726 4727 // Computation 4728 for (var i = 0; i < 80; i++) { 4729 if (i < 16) { 4730 W[i] = M[offset + i] | 0; 4731 } else { 4732 var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; 4733 W[i] = (n << 1) | (n >>> 31); 4734 } 4735 4736 var t = ((a << 5) | (a >>> 27)) + e + W[i]; 4737 if (i < 20) { 4738 t += ((b & c) | (~b & d)) + 0x5a827999; 4739 } else if (i < 40) { 4740 t += (b ^ c ^ d) + 0x6ed9eba1; 4741 } else if (i < 60) {
vendor: 19,642 bytes, lines 4742-5417
4742 t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; 4743 } else /* if (i < 80) */ { 4744 t += (b ^ c ^ d) - 0x359d3e2a; 4745 } 4746 4747 e = d; 4748 d = c; 4749 c = (b << 30) | (b >>> 2); 4750 b = a; 4751 a = t; 4752 } 4753 4754 // Intermediate hash value 4755 H[0] = (H[0] + a) | 0; 4756 H[1] = (H[1] + b) | 0; 4757 H[2] = (H[2] + c) | 0; 4758 H[3] = (H[3] + d) | 0; 4759 H[4] = (H[4] + e) | 0; 4760 }, 4761 4762 _doFinalize: function () { 4763 // Shortcuts 4764 var data = this._data; 4765 var dataWords = data.words; 4766 4767 var nBitsTotal = this._nDataBytes * 8; 4768 var nBitsLeft = data.sigBytes * 8; 4769 4770 // Add padding 4771 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 4772 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); 4773 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; 4774 data.sigBytes = dataWords.length * 4; 4775 4776 // Hash final blocks 4777 this._process(); 4778 4779 // Return final computed hash 4780 return this._hash; 4781 }, 4782 4783 clone: function () { 4784 var clone = Hasher.clone.call(this); 4785 clone._hash = this._hash.clone(); 4786 4787 return clone; 4788 } 4789 }); 4790 4791 /** 4792 * Shortcut function to the hasher's object interface. 4793 * 4794 * @param {WordArray|string} message The message to hash. 4795 * 4796 * @return {WordArray} The hash. 4797 * 4798 * @static 4799 * 4800 * @example 4801 * 4802 * var hash = CryptoJS.SHA1('message'); 4803 * var hash = CryptoJS.SHA1(wordArray); 4804 */ 4805 C.SHA1 = Hasher._createHelper(SHA1); 4806 4807 /** 4808 * Shortcut function to the HMAC's object interface. 4809 * 4810 * @param {WordArray|string} message The message to hash. 4811 * @param {WordArray|string} key The secret key. 4812 * 4813 * @return {WordArray} The HMAC. 4814 * 4815 * @static 4816 * 4817 * @example 4818 * 4819 * var hmac = CryptoJS.HmacSHA1(message, key); 4820 */ 4821 C.HmacSHA1 = Hasher._createHmacHelper(SHA1); 4822 }()); 4823 4824 4825 return CryptoJS.SHA1; 4826 4827})); 4828 4829/***/ }), 4830 4831/***/ 5503: 4832/***/ (function(module, exports, __webpack_require__) { 4833 4834;(function (root, factory) { 4835 if (true) { 4836 // CommonJS 4837 module.exports = exports = factory(__webpack_require__(9021)); 4838 } 4839 else // removed by dead control flow 4840{} 4841}(this, function (CryptoJS) { 4842 4843 (function () { 4844 // Shortcuts 4845 var C = CryptoJS; 4846 var C_lib = C.lib; 4847 var WordArray = C_lib.WordArray; 4848 var C_enc = C.enc; 4849 4850 /** 4851 * UTF-16 BE encoding strategy. 4852 */ 4853 var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { 4854 /** 4855 * Converts a word array to a UTF-16 BE string. 4856 * 4857 * @param {WordArray} wordArray The word array. 4858 * 4859 * @return {string} The UTF-16 BE string. 4860 * 4861 * @static 4862 * 4863 * @example 4864 * 4865 * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); 4866 */ 4867 stringify: function (wordArray) { 4868 // Shortcuts 4869 var words = wordArray.words; 4870 var sigBytes = wordArray.sigBytes; 4871 4872 // Convert 4873 var utf16Chars = []; 4874 for (var i = 0; i < sigBytes; i += 2) { 4875 var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; 4876 utf16Chars.push(String.fromCharCode(codePoint)); 4877 } 4878 4879 return utf16Chars.join(''); 4880 }, 4881 4882 /** 4883 * Converts a UTF-16 BE string to a word array. 4884 * 4885 * @param {string} utf16Str The UTF-16 BE string. 4886 * 4887 * @return {WordArray} The word array. 4888 * 4889 * @static 4890 * 4891 * @example 4892 * 4893 * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); 4894 */ 4895 parse: function (utf16Str) { 4896 // Shortcut 4897 var utf16StrLength = utf16Str.length; 4898 4899 // Convert 4900 var words = []; 4901 for (var i = 0; i < utf16StrLength; i++) { 4902 words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); 4903 } 4904 4905 return WordArray.create(words, utf16StrLength * 2); 4906 } 4907 }; 4908 4909 /** 4910 * UTF-16 LE encoding strategy. 4911 */ 4912 C_enc.Utf16LE = { 4913 /** 4914 * Converts a word array to a UTF-16 LE string. 4915 * 4916 * @param {WordArray} wordArray The word array. 4917 * 4918 * @return {string} The UTF-16 LE string. 4919 * 4920 * @static 4921 * 4922 * @example 4923 * 4924 * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); 4925 */ 4926 stringify: function (wordArray) { 4927 // Shortcuts 4928 var words = wordArray.words; 4929 var sigBytes = wordArray.sigBytes; 4930 4931 // Convert 4932 var utf16Chars = []; 4933 for (var i = 0; i < sigBytes; i += 2) { 4934 var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); 4935 utf16Chars.push(String.fromCharCode(codePoint)); 4936 } 4937 4938 return utf16Chars.join(''); 4939 }, 4940 4941 /** 4942 * Converts a UTF-16 LE string to a word array. 4943 * 4944 * @param {string} utf16Str The UTF-16 LE string. 4945 * 4946 * @return {WordArray} The word array. 4947 * 4948 * @static 4949 * 4950 * @example 4951 * 4952 * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); 4953 */ 4954 parse: function (utf16Str) { 4955 // Shortcut 4956 var utf16StrLength = utf16Str.length; 4957 4958 // Convert 4959 var words = []; 4960 for (var i = 0; i < utf16StrLength; i++) { 4961 words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); 4962 } 4963 4964 return WordArray.create(words, utf16StrLength * 2); 4965 } 4966 }; 4967 4968 function swapEndian(word) { 4969 return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); 4970 } 4971 }()); 4972 4973 4974 return CryptoJS.enc.Utf16; 4975 4976})); 4977 4978/***/ }), 4979 4980/***/ 5795: 4981/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 4982 4983"use strict"; 4984 4985 4986/** @type {import('.')} */ 4987var $gOPD = __webpack_require__(6549); 4988 4989if ($gOPD) { 4990 try { 4991 $gOPD([], 'length'); 4992 } catch (e) { 4993 // IE 8 has a broken gOPD 4994 $gOPD = null; 4995 } 4996} 4997 4998module.exports = $gOPD; 4999 5000 5001/***/ }), 5002 5003/***/ 5880: 5004/***/ (function(module) { 5005 5006"use strict"; 5007 5008 5009/** @type {import('./pow')} */ 5010module.exports = Math.pow; 5011 5012 5013/***/ }), 5014 5015/***/ 5953: 5016/***/ (function(module, exports, __webpack_require__) { 5017 5018;(function (root, factory, undef) { 5019 if (true) { 5020 // CommonJS 5021 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(3240)); 5022 } 5023 else // removed by dead control flow 5024{} 5025}(this, function (CryptoJS) { 5026 5027 (function (Math) { 5028 // Shortcuts 5029 var C = CryptoJS; 5030 var C_lib = C.lib; 5031 var WordArray = C_lib.WordArray; 5032 var Hasher = C_lib.Hasher; 5033 var C_x64 = C.x64; 5034 var X64Word = C_x64.Word; 5035 var C_algo = C.algo; 5036 5037 // Constants tables 5038 var RHO_OFFSETS = []; 5039 var PI_INDEXES = []; 5040 var ROUND_CONSTANTS = []; 5041 5042 // Compute Constants 5043 (function () { 5044 // Compute rho offset constants 5045 var x = 1, y = 0; 5046 for (var t = 0; t < 24; t++) { 5047 RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; 5048 5049 var newX = y % 5; 5050 var newY = (2 * x + 3 * y) % 5; 5051 x = newX; 5052 y = newY; 5053 } 5054 5055 // Compute pi index constants 5056 for (var x = 0; x < 5; x++) { 5057 for (var y = 0; y < 5; y++) { 5058 PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; 5059 } 5060 } 5061 5062 // Compute round constants 5063 var LFSR = 0x01; 5064 for (var i = 0; i < 24; i++) { 5065 var roundConstantMsw = 0; 5066 var roundConstantLsw = 0; 5067 5068 for (var j = 0; j < 7; j++) { 5069 if (LFSR & 0x01) { 5070 var bitPosition = (1 << j) - 1; 5071 if (bitPosition < 32) { 5072 roundConstantLsw ^= 1 << bitPosition; 5073 } else /* if (bitPosition >= 32) */ { 5074 roundConstantMsw ^= 1 << (bitPosition - 32); 5075 } 5076 } 5077 5078 // Compute next LFSR 5079 if (LFSR & 0x80) { 5080 // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 5081 LFSR = (LFSR << 1) ^ 0x71; 5082 } else { 5083 LFSR <<= 1; 5084 } 5085 } 5086 5087 ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); 5088 } 5089 }()); 5090 5091 // Reusable objects for temporary values 5092 var T = []; 5093 (function () { 5094 for (var i = 0; i < 25; i++) { 5095 T[i] = X64Word.create(); 5096 } 5097 }()); 5098 5099 /** 5100 * SHA-3 hash algorithm. 5101 */ 5102 var SHA3 = C_algo.SHA3 = Hasher.extend({ 5103 /** 5104 * Configuration options. 5105 * 5106 * @property {number} outputLength 5107 * The desired number of bits in the output hash. 5108 * Only values permitted are: 224, 256, 384, 512. 5109 * Default: 512 5110 */ 5111 cfg: Hasher.cfg.extend({ 5112 outputLength: 512 5113 }), 5114 5115 _doReset: function () { 5116 var state = this._state = [] 5117 for (var i = 0; i < 25; i++) { 5118 state[i] = new X64Word.init(); 5119 } 5120 5121 this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; 5122 }, 5123 5124 _doProcessBlock: function (M, offset) { 5125 // Shortcuts 5126 var state = this._state; 5127 var nBlockSizeLanes = this.blockSize / 2; 5128 5129 // Absorb 5130 for (var i = 0; i < nBlockSizeLanes; i++) { 5131 // Shortcuts 5132 var M2i = M[offset + 2 * i]; 5133 var M2i1 = M[offset + 2 * i + 1]; 5134 5135 // Swap endian 5136 M2i = ( 5137 (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | 5138 (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) 5139 ); 5140 M2i1 = ( 5141 (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | 5142 (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) 5143 ); 5144 5145 // Absorb message into state 5146 var lane = state[i]; 5147 lane.high ^= M2i1; 5148 lane.low ^= M2i; 5149 } 5150 5151 // Rounds 5152 for (var round = 0; round < 24; round++) { 5153 // Theta 5154 for (var x = 0; x < 5; x++) { 5155 // Mix column lanes 5156 var tMsw = 0, tLsw = 0; 5157 for (var y = 0; y < 5; y++) { 5158 var lane = state[x + 5 * y]; 5159 tMsw ^= lane.high; 5160 tLsw ^= lane.low; 5161 } 5162 5163 // Temporary values 5164 var Tx = T[x]; 5165 Tx.high = tMsw; 5166 Tx.low = tLsw; 5167 } 5168 for (var x = 0; x < 5; x++) { 5169 // Shortcuts 5170 var Tx4 = T[(x + 4) % 5]; 5171 var Tx1 = T[(x + 1) % 5]; 5172 var Tx1Msw = Tx1.high; 5173 var Tx1Lsw = Tx1.low; 5174 5175 // Mix surrounding columns 5176 var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); 5177 var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); 5178 for (var y = 0; y < 5; y++) { 5179 var lane = state[x + 5 * y]; 5180 lane.high ^= tMsw; 5181 lane.low ^= tLsw; 5182 } 5183 } 5184 5185 // Rho Pi 5186 for (var laneIndex = 1; laneIndex < 25; laneIndex++) { 5187 var tMsw; 5188 var tLsw; 5189 5190 // Shortcuts 5191 var lane = state[laneIndex]; 5192 var laneMsw = lane.high; 5193 var laneLsw = lane.low; 5194 var rhoOffset = RHO_OFFSETS[laneIndex]; 5195 5196 // Rotate lanes 5197 if (rhoOffset < 32) { 5198 tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); 5199 tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); 5200 } else /* if (rhoOffset >= 32) */ { 5201 tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); 5202 tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); 5203 } 5204 5205 // Transpose lanes 5206 var TPiLane = T[PI_INDEXES[laneIndex]]; 5207 TPiLane.high = tMsw; 5208 TPiLane.low = tLsw; 5209 } 5210 5211 // Rho pi at x = y = 0 5212 var T0 = T[0]; 5213 var state0 = state[0]; 5214 T0.high = state0.high; 5215 T0.low = state0.low; 5216 5217 // Chi 5218 for (var x = 0; x < 5; x++) { 5219 for (var y = 0; y < 5; y++) { 5220 // Shortcuts 5221 var laneIndex = x + 5 * y; 5222 var lane = state[laneIndex]; 5223 var TLane = T[laneIndex]; 5224 var Tx1Lane = T[((x + 1) % 5) + 5 * y]; 5225 var Tx2Lane = T[((x + 2) % 5) + 5 * y]; 5226 5227 // Mix rows 5228 lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); 5229 lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); 5230 } 5231 } 5232 5233 // Iota 5234 var lane = state[0]; 5235 var roundConstant = ROUND_CONSTANTS[round]; 5236 lane.high ^= roundConstant.high; 5237 lane.low ^= roundConstant.low; 5238 } 5239 }, 5240 5241 _doFinalize: function () { 5242 // Shortcuts 5243 var data = this._data; 5244 var dataWords = data.words; 5245 var nBitsTotal = this._nDataBytes * 8; 5246 var nBitsLeft = data.sigBytes * 8; 5247 var blockSizeBits = this.blockSize * 32; 5248 5249 // Add padding 5250 dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); 5251 dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; 5252 data.sigBytes = dataWords.length * 4; 5253 5254 // Hash final blocks 5255 this._process(); 5256 5257 // Shortcuts 5258 var state = this._state; 5259 var outputLengthBytes = this.cfg.outputLength / 8; 5260 var outputLengthLanes = outputLengthBytes / 8; 5261 5262 // Squeeze 5263 var hashWords = []; 5264 for (var i = 0; i < outputLengthLanes; i++) { 5265 // Shortcuts 5266 var lane = state[i]; 5267 var laneMsw = lane.high; 5268 var laneLsw = lane.low; 5269 5270 // Swap endian 5271 laneMsw = ( 5272 (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | 5273 (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) 5274 ); 5275 laneLsw = ( 5276 (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | 5277 (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) 5278 ); 5279 5280 // Squeeze state to retrieve hash 5281 hashWords.push(laneLsw); 5282 hashWords.push(laneMsw); 5283 } 5284 5285 // Return final computed hash 5286 return new WordArray.init(hashWords, outputLengthBytes); 5287 }, 5288 5289 clone: function () { 5290 var clone = Hasher.clone.call(this); 5291 5292 var state = clone._state = this._state.slice(0); 5293 for (var i = 0; i < 25; i++) { 5294 state[i] = state[i].clone(); 5295 } 5296 5297 return clone; 5298 } 5299 }); 5300 5301 /** 5302 * Shortcut function to the hasher's object interface. 5303 * 5304 * @param {WordArray|string} message The message to hash. 5305 * 5306 * @return {WordArray} The hash. 5307 * 5308 * @static 5309 * 5310 * @example 5311 * 5312 * var hash = CryptoJS.SHA3('message'); 5313 * var hash = CryptoJS.SHA3(wordArray); 5314 */ 5315 C.SHA3 = Hasher._createHelper(SHA3); 5316 5317 /** 5318 * Shortcut function to the HMAC's object interface. 5319 * 5320 * @param {WordArray|string} message The message to hash. 5321 * @param {WordArray|string} key The secret key. 5322 * 5323 * @return {WordArray} The HMAC. 5324 * 5325 * @static 5326 * 5327 * @example 5328 * 5329 * var hmac = CryptoJS.HmacSHA3(message, key); 5330 */ 5331 C.HmacSHA3 = Hasher._createHmacHelper(SHA3); 5332 }(Math)); 5333 5334 5335 return CryptoJS.SHA3; 5336 5337})); 5338 5339/***/ }), 5340 5341/***/ 6188: 5342/***/ (function(module) { 5343 5344"use strict"; 5345 5346 5347/** @type {import('./max')} */ 5348module.exports = Math.max; 5349 5350 5351/***/ }), 5352 5353/***/ 6298: 5354/***/ (function(module, exports, __webpack_require__) { 5355 5356;(function (root, factory, undef) { 5357 if (true) { 5358 // CommonJS 5359 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(754), __webpack_require__(4636), __webpack_require__(9506), __webpack_require__(7165)); 5360 } 5361 else // removed by dead control flow 5362{} 5363}(this, function (CryptoJS) { 5364 5365 (function () { 5366 // Shortcuts 5367 var C = CryptoJS; 5368 var C_lib = C.lib; 5369 var StreamCipher = C_lib.StreamCipher; 5370 var C_algo = C.algo; 5371 5372 // Reusable objects 5373 var S = []; 5374 var C_ = []; 5375 var G = []; 5376 5377 /** 5378 * Rabbit stream cipher algorithm 5379 */ 5380 var Rabbit = C_algo.Rabbit = StreamCipher.extend({ 5381 _doReset: function () { 5382 // Shortcuts 5383 var K = this._key.words; 5384 var iv = this.cfg.iv; 5385 5386 // Swap endian 5387 for (var i = 0; i < 4; i++) { 5388 K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | 5389 (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); 5390 } 5391 5392 // Generate initial state values 5393 var X = this._X = [ 5394 K[0], (K[3] << 16) | (K[2] >>> 16), 5395 K[1], (K[0] << 16) | (K[3] >>> 16), 5396 K[2], (K[1] << 16) | (K[0] >>> 16), 5397 K[3], (K[2] << 16) | (K[1] >>> 16) 5398 ]; 5399 5400 // Generate initial counter values 5401 var C = this._C = [ 5402 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), 5403 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), 5404 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), 5405 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) 5406 ]; 5407 5408 // Carry bit 5409 this._b = 0; 5410 5411 // Iterate the system four times 5412 for (var i = 0; i < 4; i++) { 5413 nextState.call(this); 5414 } 5415 5416 // Modify the counters 5417 for (var i = 0; i < 8; i++) {
vendor: 4,360 bytes, lines 5418-5534
5418 C[i] ^= X[(i + 4) & 7]; 5419 } 5420 5421 // IV setup 5422 if (iv) { 5423 // Shortcuts 5424 var IV = iv.words; 5425 var IV_0 = IV[0]; 5426 var IV_1 = IV[1]; 5427 5428 // Generate four subvectors 5429 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); 5430 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); 5431 var i1 = (i0 >>> 16) | (i2 & 0xffff0000); 5432 var i3 = (i2 << 16) | (i0 & 0x0000ffff); 5433 5434 // Modify counter values 5435 C[0] ^= i0; 5436 C[1] ^= i1; 5437 C[2] ^= i2; 5438 C[3] ^= i3; 5439 C[4] ^= i0; 5440 C[5] ^= i1; 5441 C[6] ^= i2; 5442 C[7] ^= i3; 5443 5444 // Iterate the system four times 5445 for (var i = 0; i < 4; i++) { 5446 nextState.call(this); 5447 } 5448 } 5449 }, 5450 5451 _doProcessBlock: function (M, offset) { 5452 // Shortcut 5453 var X = this._X; 5454 5455 // Iterate the system 5456 nextState.call(this); 5457 5458 // Generate four keystream words 5459 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); 5460 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); 5461 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); 5462 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); 5463 5464 for (var i = 0; i < 4; i++) { 5465 // Swap endian 5466 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | 5467 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); 5468 5469 // Encrypt 5470 M[offset + i] ^= S[i]; 5471 } 5472 }, 5473 5474 blockSize: 128/32, 5475 5476 ivSize: 64/32 5477 }); 5478 5479 function nextState() { 5480 // Shortcuts 5481 var X = this._X; 5482 var C = this._C; 5483 5484 // Save old counter values 5485 for (var i = 0; i < 8; i++) { 5486 C_[i] = C[i]; 5487 } 5488 5489 // Calculate new counter values 5490 C[0] = (C[0] + 0x4d34d34d + this._b) | 0; 5491 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; 5492 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; 5493 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; 5494 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; 5495 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; 5496 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; 5497 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; 5498 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; 5499 5500 // Calculate the g-values 5501 for (var i = 0; i < 8; i++) { 5502 var gx = X[i] + C[i]; 5503 5504 // Construct high and low argument for squaring 5505 var ga = gx & 0xffff; 5506 var gb = gx >>> 16; 5507 5508 // Calculate high and low result of squaring 5509 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; 5510 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); 5511 5512 // High XOR low 5513 G[i] = gh ^ gl; 5514 } 5515 5516 // Calculate new state values 5517 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; 5518 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; 5519 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; 5520 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; 5521 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; 5522 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; 5523 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; 5524 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; 5525 } 5526 5527 /** 5528 * Shortcut functions to the cipher's object interface. 5529 * 5530 * @example 5531 * 5532 * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); 5533 * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); 5534 */
vendor: 9,018 bytes, lines 5535-5932
5535 C.Rabbit = StreamCipher._createHelper(Rabbit); 5536 }()); 5537 5538 5539 return CryptoJS.Rabbit; 5540 5541})); 5542 5543/***/ }), 5544 5545/***/ 6308: 5546/***/ (function(module, exports, __webpack_require__) { 5547 5548;(function (root, factory, undef) { 5549 if (true) { 5550 // CommonJS 5551 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(3009)); 5552 } 5553 else // removed by dead control flow 5554{} 5555}(this, function (CryptoJS) { 5556 5557 (function () { 5558 // Shortcuts 5559 var C = CryptoJS; 5560 var C_lib = C.lib; 5561 var WordArray = C_lib.WordArray; 5562 var C_algo = C.algo; 5563 var SHA256 = C_algo.SHA256; 5564 5565 /** 5566 * SHA-224 hash algorithm. 5567 */ 5568 var SHA224 = C_algo.SHA224 = SHA256.extend({ 5569 _doReset: function () { 5570 this._hash = new WordArray.init([ 5571 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 5572 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 5573 ]); 5574 }, 5575 5576 _doFinalize: function () { 5577 var hash = SHA256._doFinalize.call(this); 5578 5579 hash.sigBytes -= 4; 5580 5581 return hash; 5582 } 5583 }); 5584 5585 /** 5586 * Shortcut function to the hasher's object interface. 5587 * 5588 * @param {WordArray|string} message The message to hash. 5589 * 5590 * @return {WordArray} The hash. 5591 * 5592 * @static 5593 * 5594 * @example 5595 * 5596 * var hash = CryptoJS.SHA224('message'); 5597 * var hash = CryptoJS.SHA224(wordArray); 5598 */ 5599 C.SHA224 = SHA256._createHelper(SHA224); 5600 5601 /** 5602 * Shortcut function to the HMAC's object interface. 5603 * 5604 * @param {WordArray|string} message The message to hash. 5605 * @param {WordArray|string} key The secret key. 5606 * 5607 * @return {WordArray} The HMAC. 5608 * 5609 * @static 5610 * 5611 * @example 5612 * 5613 * var hmac = CryptoJS.HmacSHA224(message, key); 5614 */ 5615 C.HmacSHA224 = SHA256._createHmacHelper(SHA224); 5616 }()); 5617 5618 5619 return CryptoJS.SHA224; 5620 5621})); 5622 5623/***/ }), 5624 5625/***/ 6372: 5626/***/ (function(module, exports, __webpack_require__) { 5627 5628;(function (root, factory, undef) { 5629 if (true) { 5630 // CommonJS 5631 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 5632 } 5633 else // removed by dead control flow 5634{} 5635}(this, function (CryptoJS) { 5636 5637 /** @preserve 5638 * Counter block mode compatible with Dr Brian Gladman fileenc.c 5639 * derived from CryptoJS.mode.CTR 5640 * Jan Hruby [email protected] 5641 */ 5642 CryptoJS.mode.CTRGladman = (function () { 5643 var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); 5644 5645 function incWord(word) 5646 { 5647 if (((word >> 24) & 0xff) === 0xff) { //overflow 5648 var b1 = (word >> 16)&0xff; 5649 var b2 = (word >> 8)&0xff; 5650 var b3 = word & 0xff; 5651 5652 if (b1 === 0xff) // overflow b1 5653 { 5654 b1 = 0; 5655 if (b2 === 0xff) 5656 { 5657 b2 = 0; 5658 if (b3 === 0xff) 5659 { 5660 b3 = 0; 5661 } 5662 else 5663 { 5664 ++b3; 5665 } 5666 } 5667 else 5668 { 5669 ++b2; 5670 } 5671 } 5672 else 5673 { 5674 ++b1; 5675 } 5676 5677 word = 0; 5678 word += (b1 << 16); 5679 word += (b2 << 8); 5680 word += b3; 5681 } 5682 else 5683 { 5684 word += (0x01 << 24); 5685 } 5686 return word; 5687 } 5688 5689 function incCounter(counter) 5690 { 5691 if ((counter[0] = incWord(counter[0])) === 0) 5692 { 5693 // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 5694 counter[1] = incWord(counter[1]); 5695 } 5696 return counter; 5697 } 5698 5699 var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ 5700 processBlock: function (words, offset) { 5701 // Shortcuts 5702 var cipher = this._cipher 5703 var blockSize = cipher.blockSize; 5704 var iv = this._iv; 5705 var counter = this._counter; 5706 5707 // Generate keystream 5708 if (iv) { 5709 counter = this._counter = iv.slice(0); 5710 5711 // Remove IV for subsequent blocks 5712 this._iv = undefined; 5713 } 5714 5715 incCounter(counter); 5716 5717 var keystream = counter.slice(0); 5718 cipher.encryptBlock(keystream, 0); 5719 5720 // Encrypt 5721 for (var i = 0; i < blockSize; i++) { 5722 words[offset + i] ^= keystream[i]; 5723 } 5724 } 5725 }); 5726 5727 CTRGladman.Decryptor = Encryptor; 5728 5729 return CTRGladman; 5730 }()); 5731 5732 5733 5734 5735 return CryptoJS.mode.CTRGladman; 5736 5737})); 5738 5739/***/ }), 5740 5741/***/ 6440: 5742/***/ (function(module, exports, __webpack_require__) { 5743 5744;(function (root, factory) { 5745 if (true) { 5746 // CommonJS 5747 module.exports = exports = factory(__webpack_require__(9021)); 5748 } 5749 else // removed by dead control flow 5750{} 5751}(this, function (CryptoJS) { 5752 5753 (function () { 5754 // Check if typed arrays are supported 5755 if (typeof ArrayBuffer != 'function') { 5756 return; 5757 } 5758 5759 // Shortcuts 5760 var C = CryptoJS; 5761 var C_lib = C.lib; 5762 var WordArray = C_lib.WordArray; 5763 5764 // Reference original init 5765 var superInit = WordArray.init; 5766 5767 // Augment WordArray.init to handle typed arrays 5768 var subInit = WordArray.init = function (typedArray) { 5769 // Convert buffers to uint8 5770 if (typedArray instanceof ArrayBuffer) { 5771 typedArray = new Uint8Array(typedArray); 5772 } 5773 5774 // Convert other array views to uint8 5775 if ( 5776 typedArray instanceof Int8Array || 5777 (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || 5778 typedArray instanceof Int16Array || 5779 typedArray instanceof Uint16Array || 5780 typedArray instanceof Int32Array || 5781 typedArray instanceof Uint32Array || 5782 typedArray instanceof Float32Array || 5783 typedArray instanceof Float64Array 5784 ) { 5785 typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); 5786 } 5787 5788 // Handle Uint8Array 5789 if (typedArray instanceof Uint8Array) { 5790 // Shortcut 5791 var typedArrayByteLength = typedArray.byteLength; 5792 5793 // Extract bytes 5794 var words = []; 5795 for (var i = 0; i < typedArrayByteLength; i++) { 5796 words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); 5797 } 5798 5799 // Initialize this word array 5800 superInit.call(this, words, typedArrayByteLength); 5801 } else { 5802 // Else call normal init 5803 superInit.apply(this, arguments); 5804 } 5805 }; 5806 5807 subInit.prototype = WordArray; 5808 }()); 5809 5810 5811 return CryptoJS.lib.WordArray; 5812 5813})); 5814 5815/***/ }), 5816 5817/***/ 6549: 5818/***/ (function(module) { 5819 5820"use strict"; 5821 5822 5823/** @type {import('./gOPD')} */ 5824module.exports = Object.getOwnPropertyDescriptor; 5825 5826 5827/***/ }), 5828 5829/***/ 6556: 5830/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5831 5832"use strict"; 5833 5834 5835var GetIntrinsic = __webpack_require__(453); 5836 5837var callBindBasic = __webpack_require__(3126); 5838 5839/** @type {(thisArg: string, searchString: string, position?: number) => number} */ 5840var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); 5841 5842/** @type {import('.')} */ 5843module.exports = function callBoundIntrinsic(name, allowMissing) { 5844 /* eslint no-extra-parens: 0 */ 5845 5846 var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); 5847 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 5848 return callBindBasic(/** @type {const} */ ([intrinsic])); 5849 } 5850 return intrinsic; 5851}; 5852 5853 5854/***/ }), 5855 5856/***/ 6743: 5857/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 5858 5859"use strict"; 5860 5861 5862var implementation = __webpack_require__(9353); 5863 5864module.exports = Function.prototype.bind || implementation; 5865 5866 5867/***/ }), 5868 5869/***/ 6939: 5870/***/ (function(module, exports, __webpack_require__) { 5871 5872;(function (root, factory, undef) { 5873 if (true) { 5874 // CommonJS 5875 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 5876 } 5877 else // removed by dead control flow 5878{} 5879}(this, function (CryptoJS) { 5880 5881 /** 5882 * Counter block mode. 5883 */ 5884 CryptoJS.mode.CTR = (function () { 5885 var CTR = CryptoJS.lib.BlockCipherMode.extend(); 5886 5887 var Encryptor = CTR.Encryptor = CTR.extend({ 5888 processBlock: function (words, offset) { 5889 // Shortcuts 5890 var cipher = this._cipher 5891 var blockSize = cipher.blockSize; 5892 var iv = this._iv; 5893 var counter = this._counter; 5894 5895 // Generate keystream 5896 if (iv) { 5897 counter = this._counter = iv.slice(0); 5898 5899 // Remove IV for subsequent blocks 5900 this._iv = undefined; 5901 } 5902 var keystream = counter.slice(0); 5903 cipher.encryptBlock(keystream, 0); 5904 5905 // Increment counter 5906 counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 5907 5908 // Encrypt 5909 for (var i = 0; i < blockSize; i++) { 5910 words[offset + i] ^= keystream[i]; 5911 } 5912 } 5913 }); 5914 5915 CTR.Decryptor = Encryptor; 5916 5917 return CTR; 5918 }()); 5919 5920 5921 return CryptoJS.mode.CTR; 5922 5923})); 5924 5925/***/ }), 5926 5927/***/ 7119: 5928/***/ (function(module) { 5929 5930"use strict"; 5931 5932
5933/** @type {import('./reflectApply')} */ 5934module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; 5935 5936 5937/***/ }), 5938 5939/***/ 7165: 5940/***/ (function(module, exports, __webpack_require__) { 5941 5942;(function (root, factory, undef) { 5943 if (true) { 5944 // CommonJS 5945 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(9506)); 5946 } 5947 else // removed by dead control flow 5948{
vendor: 17,896 bytes, lines 5948-6515
5948} 5949}(this, function (CryptoJS) { 5950 5951 /** 5952 * Cipher core components. 5953 */ 5954 CryptoJS.lib.Cipher || (function (undefined) { 5955 // Shortcuts 5956 var C = CryptoJS; 5957 var C_lib = C.lib; 5958 var Base = C_lib.Base; 5959 var WordArray = C_lib.WordArray; 5960 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; 5961 var C_enc = C.enc; 5962 var Utf8 = C_enc.Utf8; 5963 var Base64 = C_enc.Base64; 5964 var C_algo = C.algo; 5965 var EvpKDF = C_algo.EvpKDF; 5966 5967 /** 5968 * Abstract base cipher template. 5969 * 5970 * @property {number} keySize This cipher's key size. Default: 4 (128 bits) 5971 * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) 5972 * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. 5973 * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. 5974 */ 5975 var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ 5976 /** 5977 * Configuration options. 5978 * 5979 * @property {WordArray} iv The IV to use for this operation. 5980 */ 5981 cfg: Base.extend(), 5982 5983 /** 5984 * Creates this cipher in encryption mode. 5985 * 5986 * @param {WordArray} key The key. 5987 * @param {Object} cfg (Optional) The configuration options to use for this operation. 5988 * 5989 * @return {Cipher} A cipher instance. 5990 * 5991 * @static 5992 * 5993 * @example 5994 * 5995 * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); 5996 */ 5997 createEncryptor: function (key, cfg) { 5998 return this.create(this._ENC_XFORM_MODE, key, cfg); 5999 }, 6000 6001 /** 6002 * Creates this cipher in decryption mode. 6003 * 6004 * @param {WordArray} key The key. 6005 * @param {Object} cfg (Optional) The configuration options to use for this operation. 6006 * 6007 * @return {Cipher} A cipher instance. 6008 * 6009 * @static 6010 * 6011 * @example 6012 * 6013 * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); 6014 */ 6015 createDecryptor: function (key, cfg) { 6016 return this.create(this._DEC_XFORM_MODE, key, cfg); 6017 }, 6018 6019 /** 6020 * Initializes a newly created cipher. 6021 * 6022 * @param {number} xformMode Either the encryption or decryption transormation mode constant. 6023 * @param {WordArray} key The key. 6024 * @param {Object} cfg (Optional) The configuration options to use for this operation. 6025 * 6026 * @example 6027 * 6028 * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); 6029 */ 6030 init: function (xformMode, key, cfg) { 6031 // Apply config defaults 6032 this.cfg = this.cfg.extend(cfg); 6033 6034 // Store transform mode and key 6035 this._xformMode = xformMode; 6036 this._key = key; 6037 6038 // Set initial values 6039 this.reset(); 6040 }, 6041 6042 /** 6043 * Resets this cipher to its initial state. 6044 * 6045 * @example 6046 * 6047 * cipher.reset(); 6048 */ 6049 reset: function () { 6050 // Reset data buffer 6051 BufferedBlockAlgorithm.reset.call(this); 6052 6053 // Perform concrete-cipher logic 6054 this._doReset(); 6055 }, 6056 6057 /** 6058 * Adds data to be encrypted or decrypted. 6059 * 6060 * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. 6061 * 6062 * @return {WordArray} The data after processing. 6063 * 6064 * @example 6065 * 6066 * var encrypted = cipher.process('data'); 6067 * var encrypted = cipher.process(wordArray); 6068 */ 6069 process: function (dataUpdate) { 6070 // Append 6071 this._append(dataUpdate); 6072 6073 // Process available blocks 6074 return this._process(); 6075 }, 6076 6077 /** 6078 * Finalizes the encryption or decryption process. 6079 * Note that the finalize operation is effectively a destructive, read-once operation. 6080 * 6081 * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. 6082 * 6083 * @return {WordArray} The data after final processing. 6084 * 6085 * @example 6086 * 6087 * var encrypted = cipher.finalize(); 6088 * var encrypted = cipher.finalize('data'); 6089 * var encrypted = cipher.finalize(wordArray); 6090 */ 6091 finalize: function (dataUpdate) { 6092 // Final data update 6093 if (dataUpdate) { 6094 this._append(dataUpdate); 6095 } 6096 6097 // Perform concrete-cipher logic 6098 var finalProcessedData = this._doFinalize(); 6099 6100 return finalProcessedData; 6101 }, 6102 6103 keySize: 128/32, 6104 6105 ivSize: 128/32, 6106 6107 _ENC_XFORM_MODE: 1, 6108 6109 _DEC_XFORM_MODE: 2, 6110 6111 /** 6112 * Creates shortcut functions to a cipher's object interface. 6113 * 6114 * @param {Cipher} cipher The cipher to create a helper for. 6115 * 6116 * @return {Object} An object with encrypt and decrypt shortcut functions. 6117 * 6118 * @static 6119 * 6120 * @example 6121 * 6122 * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); 6123 */ 6124 _createHelper: (function () { 6125 function selectCipherStrategy(key) { 6126 if (typeof key == 'string') { 6127 return PasswordBasedCipher; 6128 } else { 6129 return SerializableCipher; 6130 } 6131 } 6132 6133 return function (cipher) { 6134 return { 6135 encrypt: function (message, key, cfg) { 6136 return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); 6137 }, 6138 6139 decrypt: function (ciphertext, key, cfg) { 6140 return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); 6141 } 6142 }; 6143 }; 6144 }()) 6145 }); 6146 6147 /** 6148 * Abstract base stream cipher template. 6149 * 6150 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) 6151 */ 6152 var StreamCipher = C_lib.StreamCipher = Cipher.extend({ 6153 _doFinalize: function () { 6154 // Process partial blocks 6155 var finalProcessedBlocks = this._process(!!'flush'); 6156 6157 return finalProcessedBlocks; 6158 }, 6159 6160 blockSize: 1 6161 }); 6162 6163 /** 6164 * Mode namespace. 6165 */ 6166 var C_mode = C.mode = {}; 6167 6168 /** 6169 * Abstract base block cipher mode template. 6170 */ 6171 var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ 6172 /** 6173 * Creates this mode for encryption. 6174 * 6175 * @param {Cipher} cipher A block cipher instance. 6176 * @param {Array} iv The IV words. 6177 * 6178 * @static 6179 * 6180 * @example 6181 * 6182 * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); 6183 */ 6184 createEncryptor: function (cipher, iv) { 6185 return this.Encryptor.create(cipher, iv); 6186 }, 6187 6188 /** 6189 * Creates this mode for decryption. 6190 * 6191 * @param {Cipher} cipher A block cipher instance. 6192 * @param {Array} iv The IV words. 6193 * 6194 * @static 6195 * 6196 * @example 6197 * 6198 * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); 6199 */ 6200 createDecryptor: function (cipher, iv) { 6201 return this.Decryptor.create(cipher, iv); 6202 }, 6203 6204 /** 6205 * Initializes a newly created mode. 6206 * 6207 * @param {Cipher} cipher A block cipher instance. 6208 * @param {Array} iv The IV words. 6209 * 6210 * @example 6211 * 6212 * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); 6213 */ 6214 init: function (cipher, iv) { 6215 this._cipher = cipher; 6216 this._iv = iv; 6217 } 6218 }); 6219 6220 /** 6221 * Cipher Block Chaining mode. 6222 */ 6223 var CBC = C_mode.CBC = (function () { 6224 /** 6225 * Abstract base CBC mode. 6226 */ 6227 var CBC = BlockCipherMode.extend(); 6228 6229 /** 6230 * CBC encryptor. 6231 */ 6232 CBC.Encryptor = CBC.extend({ 6233 /** 6234 * Processes the data block at offset. 6235 * 6236 * @param {Array} words The data words to operate on. 6237 * @param {number} offset The offset where the block starts. 6238 * 6239 * @example 6240 * 6241 * mode.processBlock(data.words, offset); 6242 */ 6243 processBlock: function (words, offset) { 6244 // Shortcuts 6245 var cipher = this._cipher; 6246 var blockSize = cipher.blockSize; 6247 6248 // XOR and encrypt 6249 xorBlock.call(this, words, offset, blockSize); 6250 cipher.encryptBlock(words, offset); 6251 6252 // Remember this block to use with next block 6253 this._prevBlock = words.slice(offset, offset + blockSize); 6254 } 6255 }); 6256 6257 /** 6258 * CBC decryptor. 6259 */ 6260 CBC.Decryptor = CBC.extend({ 6261 /** 6262 * Processes the data block at offset. 6263 * 6264 * @param {Array} words The data words to operate on. 6265 * @param {number} offset The offset where the block starts. 6266 * 6267 * @example 6268 * 6269 * mode.processBlock(data.words, offset); 6270 */ 6271 processBlock: function (words, offset) { 6272 // Shortcuts 6273 var cipher = this._cipher; 6274 var blockSize = cipher.blockSize; 6275 6276 // Remember this block to use with next block 6277 var thisBlock = words.slice(offset, offset + blockSize); 6278 6279 // Decrypt and XOR 6280 cipher.decryptBlock(words, offset); 6281 xorBlock.call(this, words, offset, blockSize); 6282 6283 // This block becomes the previous block 6284 this._prevBlock = thisBlock; 6285 } 6286 }); 6287 6288 function xorBlock(words, offset, blockSize) { 6289 var block; 6290 6291 // Shortcut 6292 var iv = this._iv; 6293 6294 // Choose mixing block 6295 if (iv) { 6296 block = iv; 6297 6298 // Remove IV for subsequent blocks 6299 this._iv = undefined; 6300 } else { 6301 block = this._prevBlock; 6302 } 6303 6304 // XOR blocks 6305 for (var i = 0; i < blockSize; i++) { 6306 words[offset + i] ^= block[i]; 6307 } 6308 } 6309 6310 return CBC; 6311 }()); 6312 6313 /** 6314 * Padding namespace. 6315 */ 6316 var C_pad = C.pad = {}; 6317 6318 /** 6319 * PKCS #5/7 padding strategy. 6320 */ 6321 var Pkcs7 = C_pad.Pkcs7 = { 6322 /** 6323 * Pads data using the algorithm defined in PKCS #5/7. 6324 * 6325 * @param {WordArray} data The data to pad. 6326 * @param {number} blockSize The multiple that the data should be padded to. 6327 * 6328 * @static 6329 * 6330 * @example 6331 * 6332 * CryptoJS.pad.Pkcs7.pad(wordArray, 4); 6333 */ 6334 pad: function (data, blockSize) { 6335 // Shortcut 6336 var blockSizeBytes = blockSize * 4; 6337 6338 // Count padding bytes 6339 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; 6340 6341 // Create padding word 6342 var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; 6343 6344 // Create padding 6345 var paddingWords = []; 6346 for (var i = 0; i < nPaddingBytes; i += 4) { 6347 paddingWords.push(paddingWord); 6348 } 6349 var padding = WordArray.create(paddingWords, nPaddingBytes); 6350 6351 // Add padding 6352 data.concat(padding); 6353 }, 6354 6355 /** 6356 * Unpads data that had been padded using the algorithm defined in PKCS #5/7. 6357 * 6358 * @param {WordArray} data The data to unpad. 6359 * 6360 * @static 6361 * 6362 * @example 6363 * 6364 * CryptoJS.pad.Pkcs7.unpad(wordArray); 6365 */ 6366 unpad: function (data) { 6367 // Get number of padding bytes from last byte 6368 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; 6369 6370 // Remove padding 6371 data.sigBytes -= nPaddingBytes; 6372 } 6373 }; 6374 6375 /** 6376 * Abstract base block cipher template. 6377 * 6378 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) 6379 */ 6380 var BlockCipher = C_lib.BlockCipher = Cipher.extend({ 6381 /** 6382 * Configuration options. 6383 * 6384 * @property {Mode} mode The block mode to use. Default: CBC 6385 * @property {Padding} padding The padding strategy to use. Default: Pkcs7 6386 */ 6387 cfg: Cipher.cfg.extend({ 6388 mode: CBC, 6389 padding: Pkcs7 6390 }), 6391 6392 reset: function () { 6393 var modeCreator; 6394 6395 // Reset cipher 6396 Cipher.reset.call(this); 6397 6398 // Shortcuts 6399 var cfg = this.cfg; 6400 var iv = cfg.iv; 6401 var mode = cfg.mode; 6402 6403 // Reset block mode 6404 if (this._xformMode == this._ENC_XFORM_MODE) { 6405 modeCreator = mode.createEncryptor; 6406 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { 6407 modeCreator = mode.createDecryptor; 6408 // Keep at least one block in the buffer for unpadding 6409 this._minBufferSize = 1; 6410 } 6411 6412 if (this._mode && this._mode.__creator == modeCreator) { 6413 this._mode.init(this, iv && iv.words); 6414 } else { 6415 this._mode = modeCreator.call(mode, this, iv && iv.words); 6416 this._mode.__creator = modeCreator; 6417 } 6418 }, 6419 6420 _doProcessBlock: function (words, offset) { 6421 this._mode.processBlock(words, offset); 6422 }, 6423 6424 _doFinalize: function () { 6425 var finalProcessedBlocks; 6426 6427 // Shortcut 6428 var padding = this.cfg.padding; 6429 6430 // Finalize 6431 if (this._xformMode == this._ENC_XFORM_MODE) { 6432 // Pad data 6433 padding.pad(this._data, this.blockSize); 6434 6435 // Process final blocks 6436 finalProcessedBlocks = this._process(!!'flush'); 6437 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { 6438 // Process final blocks 6439 finalProcessedBlocks = this._process(!!'flush'); 6440 6441 // Unpad data 6442 padding.unpad(finalProcessedBlocks); 6443 } 6444 6445 return finalProcessedBlocks; 6446 }, 6447 6448 blockSize: 128/32 6449 }); 6450 6451 /** 6452 * A collection of cipher parameters. 6453 * 6454 * @property {WordArray} ciphertext The raw ciphertext. 6455 * @property {WordArray} key The key to this ciphertext. 6456 * @property {WordArray} iv The IV used in the ciphering operation. 6457 * @property {WordArray} salt The salt used with a key derivation function. 6458 * @property {Cipher} algorithm The cipher algorithm. 6459 * @property {Mode} mode The block mode used in the ciphering operation. 6460 * @property {Padding} padding The padding scheme used in the ciphering operation. 6461 * @property {number} blockSize The block size of the cipher. 6462 * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. 6463 */ 6464 var CipherParams = C_lib.CipherParams = Base.extend({ 6465 /** 6466 * Initializes a newly created cipher params object. 6467 * 6468 * @param {Object} cipherParams An object with any of the possible cipher parameters. 6469 * 6470 * @example 6471 * 6472 * var cipherParams = CryptoJS.lib.CipherParams.create({ 6473 * ciphertext: ciphertextWordArray, 6474 * key: keyWordArray, 6475 * iv: ivWordArray, 6476 * salt: saltWordArray, 6477 * algorithm: CryptoJS.algo.AES, 6478 * mode: CryptoJS.mode.CBC, 6479 * padding: CryptoJS.pad.PKCS7, 6480 * blockSize: 4, 6481 * formatter: CryptoJS.format.OpenSSL 6482 * }); 6483 */ 6484 init: function (cipherParams) { 6485 this.mixIn(cipherParams); 6486 }, 6487 6488 /** 6489 * Converts this cipher params object to a string. 6490 * 6491 * @param {Format} formatter (Optional) The formatting strategy to use. 6492 * 6493 * @return {string} The stringified cipher params. 6494 * 6495 * @throws Error If neither the formatter nor the default formatter is set. 6496 * 6497 * @example 6498 * 6499 * var string = cipherParams + ''; 6500 * var string = cipherParams.toString(); 6501 * var string = cipherParams.toString(CryptoJS.format.OpenSSL); 6502 */ 6503 toString: function (formatter) { 6504 return (formatter || this.formatter).stringify(this); 6505 } 6506 }); 6507 6508 /** 6509 * Format namespace. 6510 */ 6511 var C_format = C.format = {}; 6512 6513 /** 6514 * OpenSSL formatting strategy. 6515 */
vendor: 11,645 bytes, lines 6516-6830
6516 var OpenSSLFormatter = C_format.OpenSSL = { 6517 /** 6518 * Converts a cipher params object to an OpenSSL-compatible string. 6519 * 6520 * @param {CipherParams} cipherParams The cipher params object. 6521 * 6522 * @return {string} The OpenSSL-compatible string. 6523 * 6524 * @static 6525 * 6526 * @example 6527 * 6528 * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); 6529 */ 6530 stringify: function (cipherParams) { 6531 var wordArray; 6532 6533 // Shortcuts 6534 var ciphertext = cipherParams.ciphertext; 6535 var salt = cipherParams.salt; 6536 6537 // Format 6538 if (salt) { 6539 wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); 6540 } else { 6541 wordArray = ciphertext; 6542 } 6543 6544 return wordArray.toString(Base64); 6545 }, 6546 6547 /** 6548 * Converts an OpenSSL-compatible string to a cipher params object. 6549 * 6550 * @param {string} openSSLStr The OpenSSL-compatible string. 6551 * 6552 * @return {CipherParams} The cipher params object. 6553 * 6554 * @static 6555 * 6556 * @example 6557 * 6558 * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); 6559 */ 6560 parse: function (openSSLStr) { 6561 var salt; 6562 6563 // Parse base64 6564 var ciphertext = Base64.parse(openSSLStr); 6565 6566 // Shortcut 6567 var ciphertextWords = ciphertext.words; 6568 6569 // Test for salt 6570 if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { 6571 // Extract salt 6572 salt = WordArray.create(ciphertextWords.slice(2, 4)); 6573 6574 // Remove salt from ciphertext 6575 ciphertextWords.splice(0, 4); 6576 ciphertext.sigBytes -= 16; 6577 } 6578 6579 return CipherParams.create({ ciphertext: ciphertext, salt: salt }); 6580 } 6581 }; 6582 6583 /** 6584 * A cipher wrapper that returns ciphertext as a serializable cipher params object. 6585 */ 6586 var SerializableCipher = C_lib.SerializableCipher = Base.extend({ 6587 /** 6588 * Configuration options. 6589 * 6590 * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL 6591 */ 6592 cfg: Base.extend({ 6593 format: OpenSSLFormatter 6594 }), 6595 6596 /** 6597 * Encrypts a message. 6598 * 6599 * @param {Cipher} cipher The cipher algorithm to use. 6600 * @param {WordArray|string} message The message to encrypt. 6601 * @param {WordArray} key The key. 6602 * @param {Object} cfg (Optional) The configuration options to use for this operation. 6603 * 6604 * @return {CipherParams} A cipher params object. 6605 * 6606 * @static 6607 * 6608 * @example 6609 * 6610 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); 6611 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); 6612 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); 6613 */ 6614 encrypt: function (cipher, message, key, cfg) { 6615 // Apply config defaults 6616 cfg = this.cfg.extend(cfg); 6617 6618 // Encrypt 6619 var encryptor = cipher.createEncryptor(key, cfg); 6620 var ciphertext = encryptor.finalize(message); 6621 6622 // Shortcut 6623 var cipherCfg = encryptor.cfg; 6624 6625 // Create and return serializable cipher params 6626 return CipherParams.create({ 6627 ciphertext: ciphertext, 6628 key: key, 6629 iv: cipherCfg.iv, 6630 algorithm: cipher, 6631 mode: cipherCfg.mode, 6632 padding: cipherCfg.padding, 6633 blockSize: cipher.blockSize, 6634 formatter: cfg.format 6635 }); 6636 }, 6637 6638 /** 6639 * Decrypts serialized ciphertext. 6640 * 6641 * @param {Cipher} cipher The cipher algorithm to use. 6642 * @param {CipherParams|string} ciphertext The ciphertext to decrypt. 6643 * @param {WordArray} key The key. 6644 * @param {Object} cfg (Optional) The configuration options to use for this operation. 6645 * 6646 * @return {WordArray} The plaintext. 6647 * 6648 * @static 6649 * 6650 * @example 6651 * 6652 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); 6653 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); 6654 */ 6655 decrypt: function (cipher, ciphertext, key, cfg) { 6656 // Apply config defaults 6657 cfg = this.cfg.extend(cfg); 6658 6659 // Convert string to CipherParams 6660 ciphertext = this._parse(ciphertext, cfg.format); 6661 6662 // Decrypt 6663 var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); 6664 6665 return plaintext; 6666 }, 6667 6668 /** 6669 * Converts serialized ciphertext to CipherParams, 6670 * else assumed CipherParams already and returns ciphertext unchanged. 6671 * 6672 * @param {CipherParams|string} ciphertext The ciphertext. 6673 * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. 6674 * 6675 * @return {CipherParams} The unserialized ciphertext. 6676 * 6677 * @static 6678 * 6679 * @example 6680 * 6681 * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); 6682 */ 6683 _parse: function (ciphertext, format) { 6684 if (typeof ciphertext == 'string') { 6685 return format.parse(ciphertext, this); 6686 } else { 6687 return ciphertext; 6688 } 6689 } 6690 }); 6691 6692 /** 6693 * Key derivation function namespace. 6694 */ 6695 var C_kdf = C.kdf = {}; 6696 6697 /** 6698 * OpenSSL key derivation function. 6699 */ 6700 var OpenSSLKdf = C_kdf.OpenSSL = { 6701 /** 6702 * Derives a key and IV from a password. 6703 * 6704 * @param {string} password The password to derive from. 6705 * @param {number} keySize The size in words of the key to generate. 6706 * @param {number} ivSize The size in words of the IV to generate. 6707 * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. 6708 * 6709 * @return {CipherParams} A cipher params object with the key, IV, and salt. 6710 * 6711 * @static 6712 * 6713 * @example 6714 * 6715 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); 6716 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); 6717 */ 6718 execute: function (password, keySize, ivSize, salt, hasher) { 6719 // Generate random salt 6720 if (!salt) { 6721 salt = WordArray.random(64/8); 6722 } 6723 6724 // Derive key and IV 6725 if (!hasher) { 6726 var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); 6727 } else { 6728 var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt); 6729 } 6730 6731 6732 // Separate key and IV 6733 var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); 6734 key.sigBytes = keySize * 4; 6735 6736 // Return params 6737 return CipherParams.create({ key: key, iv: iv, salt: salt }); 6738 } 6739 }; 6740 6741 /** 6742 * A serializable cipher wrapper that derives the key from a password, 6743 * and returns ciphertext as a serializable cipher params object. 6744 */ 6745 var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ 6746 /** 6747 * Configuration options. 6748 * 6749 * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL 6750 */ 6751 cfg: SerializableCipher.cfg.extend({ 6752 kdf: OpenSSLKdf 6753 }), 6754 6755 /** 6756 * Encrypts a message using a password. 6757 * 6758 * @param {Cipher} cipher The cipher algorithm to use. 6759 * @param {WordArray|string} message The message to encrypt. 6760 * @param {string} password The password. 6761 * @param {Object} cfg (Optional) The configuration options to use for this operation. 6762 * 6763 * @return {CipherParams} A cipher params object. 6764 * 6765 * @static 6766 * 6767 * @example 6768 * 6769 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); 6770 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); 6771 */ 6772 encrypt: function (cipher, message, password, cfg) { 6773 // Apply config defaults 6774 cfg = this.cfg.extend(cfg); 6775 6776 // Derive key and other params 6777 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher); 6778 6779 // Add IV to config 6780 cfg.iv = derivedParams.iv; 6781 6782 // Encrypt 6783 var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); 6784 6785 // Mix in derived params 6786 ciphertext.mixIn(derivedParams); 6787 6788 return ciphertext; 6789 }, 6790 6791 /** 6792 * Decrypts serialized ciphertext using a password. 6793 * 6794 * @param {Cipher} cipher The cipher algorithm to use. 6795 * @param {CipherParams|string} ciphertext The ciphertext to decrypt. 6796 * @param {string} password The password. 6797 * @param {Object} cfg (Optional) The configuration options to use for this operation. 6798 * 6799 * @return {WordArray} The plaintext. 6800 * 6801 * @static 6802 * 6803 * @example 6804 * 6805 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); 6806 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); 6807 */ 6808 decrypt: function (cipher, ciphertext, password, cfg) { 6809 // Apply config defaults 6810 cfg = this.cfg.extend(cfg); 6811 6812 // Convert string to CipherParams 6813 ciphertext = this._parse(ciphertext, cfg.format); 6814 6815 // Derive key and other params 6816 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher); 6817 6818 // Add IV to config 6819 cfg.iv = derivedParams.iv; 6820 6821 // Decrypt 6822 var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); 6823 6824 return plaintext; 6825 } 6826 }); 6827 }()); 6828 6829 6830}));
vendor: 1,080 bytes, lines 6831-6867
6831 6832/***/ }), 6833 6834/***/ 7176: 6835/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 6836 6837"use strict"; 6838 6839 6840var callBind = __webpack_require__(3126); 6841var gOPD = __webpack_require__(5795); 6842 6843var hasProtoAccessor; 6844try { 6845 // eslint-disable-next-line no-extra-parens, no-proto 6846 hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; 6847} catch (e) { 6848 if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { 6849 throw e; 6850 } 6851} 6852 6853// eslint-disable-next-line no-extra-parens 6854var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); 6855 6856var $Object = Object; 6857var $getPrototypeOf = $Object.getPrototypeOf; 6858 6859/** @type {import('./get')} */ 6860module.exports = desc && typeof desc.get === 'function' 6861 ? callBind([desc.get]) 6862 : typeof $getPrototypeOf === 'function' 6863 ? /** @type {import('./get')} */ function getDunder(value) { 6864 // eslint-disable-next-line eqeqeq 6865 return $getPrototypeOf(value == null ? value : $Object(value)); 6866 } 6867 : false;
vendor: 3,925 bytes, lines 6868-7026
6868 6869 6870/***/ }), 6871 6872/***/ 7193: 6873/***/ (function(module, exports, __webpack_require__) { 6874 6875;(function (root, factory, undef) { 6876 if (true) { 6877 // CommonJS 6878 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(754), __webpack_require__(4636), __webpack_require__(9506), __webpack_require__(7165)); 6879 } 6880 else // removed by dead control flow 6881{} 6882}(this, function (CryptoJS) { 6883 6884 (function () { 6885 // Shortcuts 6886 var C = CryptoJS; 6887 var C_lib = C.lib; 6888 var StreamCipher = C_lib.StreamCipher; 6889 var C_algo = C.algo; 6890 6891 /** 6892 * RC4 stream cipher algorithm. 6893 */ 6894 var RC4 = C_algo.RC4 = StreamCipher.extend({ 6895 _doReset: function () { 6896 // Shortcuts 6897 var key = this._key; 6898 var keyWords = key.words; 6899 var keySigBytes = key.sigBytes; 6900 6901 // Init sbox 6902 var S = this._S = []; 6903 for (var i = 0; i < 256; i++) { 6904 S[i] = i; 6905 } 6906 6907 // Key setup 6908 for (var i = 0, j = 0; i < 256; i++) { 6909 var keyByteIndex = i % keySigBytes; 6910 var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; 6911 6912 j = (j + S[i] + keyByte) % 256; 6913 6914 // Swap 6915 var t = S[i]; 6916 S[i] = S[j]; 6917 S[j] = t; 6918 } 6919 6920 // Counters 6921 this._i = this._j = 0; 6922 }, 6923 6924 _doProcessBlock: function (M, offset) { 6925 M[offset] ^= generateKeystreamWord.call(this); 6926 }, 6927 6928 keySize: 256/32, 6929 6930 ivSize: 0 6931 }); 6932 6933 function generateKeystreamWord() { 6934 // Shortcuts 6935 var S = this._S; 6936 var i = this._i; 6937 var j = this._j; 6938 6939 // Generate keystream word 6940 var keystreamWord = 0; 6941 for (var n = 0; n < 4; n++) { 6942 i = (i + 1) % 256; 6943 j = (j + S[i]) % 256; 6944 6945 // Swap 6946 var t = S[i]; 6947 S[i] = S[j]; 6948 S[j] = t; 6949 6950 keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); 6951 } 6952 6953 // Update counters 6954 this._i = i; 6955 this._j = j; 6956 6957 return keystreamWord; 6958 } 6959 6960 /** 6961 * Shortcut functions to the cipher's object interface. 6962 * 6963 * @example 6964 * 6965 * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); 6966 * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); 6967 */ 6968 C.RC4 = StreamCipher._createHelper(RC4); 6969 6970 /** 6971 * Modified RC4 stream cipher algorithm. 6972 */ 6973 var RC4Drop = C_algo.RC4Drop = RC4.extend({ 6974 /** 6975 * Configuration options. 6976 * 6977 * @property {number} drop The number of keystream words to drop. Default 192 6978 */ 6979 cfg: RC4.cfg.extend({ 6980 drop: 192 6981 }), 6982 6983 _doReset: function () { 6984 RC4._doReset.call(this); 6985 6986 // Drop 6987 for (var i = this.cfg.drop; i > 0; i--) { 6988 generateKeystreamWord.call(this); 6989 } 6990 } 6991 }); 6992 6993 /** 6994 * Shortcut functions to the cipher's object interface. 6995 * 6996 * @example 6997 * 6998 * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); 6999 * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); 7000 */ 7001 C.RC4Drop = StreamCipher._createHelper(RC4Drop); 7002 }()); 7003 7004 7005 return CryptoJS.RC4; 7006 7007})); 7008 7009/***/ }), 7010 7011/***/ 7435: 7012/***/ (function() { 7013 7014// extracted by mini-css-extract-plugin 7015 7016/***/ }), 7017 7018/***/ 7628: 7019/***/ (function(module, exports, __webpack_require__) { 7020 7021;(function (root, factory, undef) { 7022 if (true) { 7023 // CommonJS 7024 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(754), __webpack_require__(4636), __webpack_require__(9506), __webpack_require__(7165)); 7025 } 7026 else // removed by dead control flow
vendor: 12,352 bytes, lines 7027-7416
7027{} 7028}(this, function (CryptoJS) { 7029 7030 (function () { 7031 // Shortcuts 7032 var C = CryptoJS; 7033 var C_lib = C.lib; 7034 var WordArray = C_lib.WordArray; 7035 var BlockCipher = C_lib.BlockCipher; 7036 var C_algo = C.algo; 7037 7038 // Permuted Choice 1 constants 7039 var PC1 = [ 7040 57, 49, 41, 33, 25, 17, 9, 1, 7041 58, 50, 42, 34, 26, 18, 10, 2, 7042 59, 51, 43, 35, 27, 19, 11, 3, 7043 60, 52, 44, 36, 63, 55, 47, 39, 7044 31, 23, 15, 7, 62, 54, 46, 38, 7045 30, 22, 14, 6, 61, 53, 45, 37, 7046 29, 21, 13, 5, 28, 20, 12, 4 7047 ]; 7048 7049 // Permuted Choice 2 constants 7050 var PC2 = [ 7051 14, 17, 11, 24, 1, 5, 7052 3, 28, 15, 6, 21, 10, 7053 23, 19, 12, 4, 26, 8, 7054 16, 7, 27, 20, 13, 2, 7055 41, 52, 31, 37, 47, 55, 7056 30, 40, 51, 45, 33, 48, 7057 44, 49, 39, 56, 34, 53, 7058 46, 42, 50, 36, 29, 32 7059 ]; 7060 7061 // Cumulative bit shift constants 7062 var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; 7063 7064 // SBOXes and round permutation constants 7065 var SBOX_P = [ 7066 { 7067 0x0: 0x808200, 7068 0x10000000: 0x8000, 7069 0x20000000: 0x808002, 7070 0x30000000: 0x2, 7071 0x40000000: 0x200, 7072 0x50000000: 0x808202, 7073 0x60000000: 0x800202, 7074 0x70000000: 0x800000, 7075 0x80000000: 0x202, 7076 0x90000000: 0x800200, 7077 0xa0000000: 0x8200, 7078 0xb0000000: 0x808000, 7079 0xc0000000: 0x8002, 7080 0xd0000000: 0x800002, 7081 0xe0000000: 0x0, 7082 0xf0000000: 0x8202, 7083 0x8000000: 0x0, 7084 0x18000000: 0x808202, 7085 0x28000000: 0x8202, 7086 0x38000000: 0x8000, 7087 0x48000000: 0x808200, 7088 0x58000000: 0x200, 7089 0x68000000: 0x808002, 7090 0x78000000: 0x2, 7091 0x88000000: 0x800200, 7092 0x98000000: 0x8200, 7093 0xa8000000: 0x808000, 7094 0xb8000000: 0x800202, 7095 0xc8000000: 0x800002, 7096 0xd8000000: 0x8002, 7097 0xe8000000: 0x202, 7098 0xf8000000: 0x800000, 7099 0x1: 0x8000, 7100 0x10000001: 0x2, 7101 0x20000001: 0x808200, 7102 0x30000001: 0x800000, 7103 0x40000001: 0x808002, 7104 0x50000001: 0x8200, 7105 0x60000001: 0x200, 7106 0x70000001: 0x800202, 7107 0x80000001: 0x808202, 7108 0x90000001: 0x808000, 7109 0xa0000001: 0x800002, 7110 0xb0000001: 0x8202, 7111 0xc0000001: 0x202, 7112 0xd0000001: 0x800200, 7113 0xe0000001: 0x8002, 7114 0xf0000001: 0x0, 7115 0x8000001: 0x808202, 7116 0x18000001: 0x808000, 7117 0x28000001: 0x800000, 7118 0x38000001: 0x200, 7119 0x48000001: 0x8000, 7120 0x58000001: 0x800002, 7121 0x68000001: 0x2, 7122 0x78000001: 0x8202, 7123 0x88000001: 0x8002, 7124 0x98000001: 0x800202, 7125 0xa8000001: 0x202, 7126 0xb8000001: 0x808200, 7127 0xc8000001: 0x800200, 7128 0xd8000001: 0x0, 7129 0xe8000001: 0x8200, 7130 0xf8000001: 0x808002 7131 }, 7132 { 7133 0x0: 0x40084010, 7134 0x1000000: 0x4000, 7135 0x2000000: 0x80000, 7136 0x3000000: 0x40080010, 7137 0x4000000: 0x40000010, 7138 0x5000000: 0x40084000, 7139 0x6000000: 0x40004000, 7140 0x7000000: 0x10, 7141 0x8000000: 0x84000, 7142 0x9000000: 0x40004010, 7143 0xa000000: 0x40000000, 7144 0xb000000: 0x84010, 7145 0xc000000: 0x80010, 7146 0xd000000: 0x0, 7147 0xe000000: 0x4010, 7148 0xf000000: 0x40080000, 7149 0x800000: 0x40004000, 7150 0x1800000: 0x84010, 7151 0x2800000: 0x10, 7152 0x3800000: 0x40004010, 7153 0x4800000: 0x40084010, 7154 0x5800000: 0x40000000, 7155 0x6800000: 0x80000, 7156 0x7800000: 0x40080010, 7157 0x8800000: 0x80010, 7158 0x9800000: 0x0, 7159 0xa800000: 0x4000, 7160 0xb800000: 0x40080000, 7161 0xc800000: 0x40000010, 7162 0xd800000: 0x84000, 7163 0xe800000: 0x40084000, 7164 0xf800000: 0x4010, 7165 0x10000000: 0x0, 7166 0x11000000: 0x40080010, 7167 0x12000000: 0x40004010, 7168 0x13000000: 0x40084000, 7169 0x14000000: 0x40080000, 7170 0x15000000: 0x10, 7171 0x16000000: 0x84010, 7172 0x17000000: 0x4000, 7173 0x18000000: 0x4010, 7174 0x19000000: 0x80000, 7175 0x1a000000: 0x80010, 7176 0x1b000000: 0x40000010, 7177 0x1c000000: 0x84000, 7178 0x1d000000: 0x40004000, 7179 0x1e000000: 0x40000000, 7180 0x1f000000: 0x40084010, 7181 0x10800000: 0x84010, 7182 0x11800000: 0x80000, 7183 0x12800000: 0x40080000, 7184 0x13800000: 0x4000, 7185 0x14800000: 0x40004000, 7186 0x15800000: 0x40084010, 7187 0x16800000: 0x10, 7188 0x17800000: 0x40000000, 7189 0x18800000: 0x40084000, 7190 0x19800000: 0x40000010, 7191 0x1a800000: 0x40004010, 7192 0x1b800000: 0x80010, 7193 0x1c800000: 0x0, 7194 0x1d800000: 0x4010, 7195 0x1e800000: 0x40080010, 7196 0x1f800000: 0x84000 7197 }, 7198 { 7199 0x0: 0x104, 7200 0x100000: 0x0, 7201 0x200000: 0x4000100, 7202 0x300000: 0x10104, 7203 0x400000: 0x10004, 7204 0x500000: 0x4000004, 7205 0x600000: 0x4010104, 7206 0x700000: 0x4010000, 7207 0x800000: 0x4000000, 7208 0x900000: 0x4010100, 7209 0xa00000: 0x10100, 7210 0xb00000: 0x4010004, 7211 0xc00000: 0x4000104, 7212 0xd00000: 0x10000, 7213 0xe00000: 0x4, 7214 0xf00000: 0x100, 7215 0x80000: 0x4010100, 7216 0x180000: 0x4010004, 7217 0x280000: 0x0, 7218 0x380000: 0x4000100, 7219 0x480000: 0x4000004, 7220 0x580000: 0x10000, 7221 0x680000: 0x10004, 7222 0x780000: 0x104, 7223 0x880000: 0x4, 7224 0x980000: 0x100, 7225 0xa80000: 0x4010000, 7226 0xb80000: 0x10104, 7227 0xc80000: 0x10100, 7228 0xd80000: 0x4000104, 7229 0xe80000: 0x4010104, 7230 0xf80000: 0x4000000, 7231 0x1000000: 0x4010100, 7232 0x1100000: 0x10004, 7233 0x1200000: 0x10000, 7234 0x1300000: 0x4000100, 7235 0x1400000: 0x100, 7236 0x1500000: 0x4010104, 7237 0x1600000: 0x4000004, 7238 0x1700000: 0x0, 7239 0x1800000: 0x4000104, 7240 0x1900000: 0x4000000, 7241 0x1a00000: 0x4, 7242 0x1b00000: 0x10100, 7243 0x1c00000: 0x4010000, 7244 0x1d00000: 0x104, 7245 0x1e00000: 0x10104, 7246 0x1f00000: 0x4010004, 7247 0x1080000: 0x4000000, 7248 0x1180000: 0x104, 7249 0x1280000: 0x4010100, 7250 0x1380000: 0x0, 7251 0x1480000: 0x10004, 7252 0x1580000: 0x4000100, 7253 0x1680000: 0x100, 7254 0x1780000: 0x4010004, 7255 0x1880000: 0x10000, 7256 0x1980000: 0x4010104, 7257 0x1a80000: 0x10104, 7258 0x1b80000: 0x4000004, 7259 0x1c80000: 0x4000104, 7260 0x1d80000: 0x4010000, 7261 0x1e80000: 0x4, 7262 0x1f80000: 0x10100 7263 }, 7264 { 7265 0x0: 0x80401000, 7266 0x10000: 0x80001040, 7267 0x20000: 0x401040, 7268 0x30000: 0x80400000, 7269 0x40000: 0x0, 7270 0x50000: 0x401000, 7271 0x60000: 0x80000040, 7272 0x70000: 0x400040, 7273 0x80000: 0x80000000, 7274 0x90000: 0x400000, 7275 0xa0000: 0x40, 7276 0xb0000: 0x80001000, 7277 0xc0000: 0x80400040, 7278 0xd0000: 0x1040, 7279 0xe0000: 0x1000, 7280 0xf0000: 0x80401040, 7281 0x8000: 0x80001040, 7282 0x18000: 0x40, 7283 0x28000: 0x80400040, 7284 0x38000: 0x80001000, 7285 0x48000: 0x401000, 7286 0x58000: 0x80401040, 7287 0x68000: 0x0, 7288 0x78000: 0x80400000, 7289 0x88000: 0x1000, 7290 0x98000: 0x80401000, 7291 0xa8000: 0x400000, 7292 0xb8000: 0x1040, 7293 0xc8000: 0x80000000, 7294 0xd8000: 0x400040, 7295 0xe8000: 0x401040, 7296 0xf8000: 0x80000040, 7297 0x100000: 0x400040, 7298 0x110000: 0x401000, 7299 0x120000: 0x80000040, 7300 0x130000: 0x0, 7301 0x140000: 0x1040, 7302 0x150000: 0x80400040, 7303 0x160000: 0x80401000, 7304 0x170000: 0x80001040, 7305 0x180000: 0x80401040, 7306 0x190000: 0x80000000, 7307 0x1a0000: 0x80400000, 7308 0x1b0000: 0x401040, 7309 0x1c0000: 0x80001000, 7310 0x1d0000: 0x400000, 7311 0x1e0000: 0x40, 7312 0x1f0000: 0x1000, 7313 0x108000: 0x80400000, 7314 0x118000: 0x80401040, 7315 0x128000: 0x0, 7316 0x138000: 0x401000, 7317 0x148000: 0x400040, 7318 0x158000: 0x80000000, 7319 0x168000: 0x80001040, 7320 0x178000: 0x40, 7321 0x188000: 0x80000040, 7322 0x198000: 0x1000, 7323 0x1a8000: 0x80001000, 7324 0x1b8000: 0x80400040, 7325 0x1c8000: 0x1040, 7326 0x1d8000: 0x80401000, 7327 0x1e8000: 0x400000, 7328 0x1f8000: 0x401040 7329 }, 7330 { 7331 0x0: 0x80, 7332 0x1000: 0x1040000, 7333 0x2000: 0x40000, 7334 0x3000: 0x20000000, 7335 0x4000: 0x20040080, 7336 0x5000: 0x1000080, 7337 0x6000: 0x21000080, 7338 0x7000: 0x40080, 7339 0x8000: 0x1000000, 7340 0x9000: 0x20040000, 7341 0xa000: 0x20000080, 7342 0xb000: 0x21040080, 7343 0xc000: 0x21040000, 7344 0xd000: 0x0, 7345 0xe000: 0x1040080, 7346 0xf000: 0x21000000, 7347 0x800: 0x1040080, 7348 0x1800: 0x21000080, 7349 0x2800: 0x80, 7350 0x3800: 0x1040000, 7351 0x4800: 0x40000, 7352 0x5800: 0x20040080, 7353 0x6800: 0x21040000, 7354 0x7800: 0x20000000, 7355 0x8800: 0x20040000, 7356 0x9800: 0x0, 7357 0xa800: 0x21040080, 7358 0xb800: 0x1000080, 7359 0xc800: 0x20000080, 7360 0xd800: 0x21000000, 7361 0xe800: 0x1000000, 7362 0xf800: 0x40080, 7363 0x10000: 0x40000, 7364 0x11000: 0x80, 7365 0x12000: 0x20000000, 7366 0x13000: 0x21000080, 7367 0x14000: 0x1000080, 7368 0x15000: 0x21040000, 7369 0x16000: 0x20040080, 7370 0x17000: 0x1000000, 7371 0x18000: 0x21040080, 7372 0x19000: 0x21000000, 7373 0x1a000: 0x1040000, 7374 0x1b000: 0x20040000, 7375 0x1c000: 0x40080, 7376 0x1d000: 0x20000080, 7377 0x1e000: 0x0, 7378 0x1f000: 0x1040080, 7379 0x10800: 0x21000080, 7380 0x11800: 0x1000000, 7381 0x12800: 0x1040000, 7382 0x13800: 0x20040080, 7383 0x14800: 0x20000000, 7384 0x15800: 0x1040080, 7385 0x16800: 0x80, 7386 0x17800: 0x21040000, 7387 0x18800: 0x40080, 7388 0x19800: 0x21040080, 7389 0x1a800: 0x0, 7390 0x1b800: 0x21000000, 7391 0x1c800: 0x1000080, 7392 0x1d800: 0x40000, 7393 0x1e800: 0x20040000, 7394 0x1f800: 0x20000080 7395 }, 7396 { 7397 0x0: 0x10000008, 7398 0x100: 0x2000, 7399 0x200: 0x10200000, 7400 0x300: 0x10202008, 7401 0x400: 0x10002000, 7402 0x500: 0x200000, 7403 0x600: 0x200008, 7404 0x700: 0x10000000, 7405 0x800: 0x0, 7406 0x900: 0x10002008, 7407 0xa00: 0x202000, 7408 0xb00: 0x8, 7409 0xc00: 0x10200008, 7410 0xd00: 0x202008, 7411 0xe00: 0x2008, 7412 0xf00: 0x10202000, 7413 0x80: 0x10200000, 7414 0x180: 0x10202008, 7415 0x280: 0x8, 7416 0x380: 0x200000,
vendor: 12,082 bytes, lines 7417-7793
7417 0x480: 0x202008, 7418 0x580: 0x10000008, 7419 0x680: 0x10002000, 7420 0x780: 0x2008, 7421 0x880: 0x200008, 7422 0x980: 0x2000, 7423 0xa80: 0x10002008, 7424 0xb80: 0x10200008, 7425 0xc80: 0x0, 7426 0xd80: 0x10202000, 7427 0xe80: 0x202000, 7428 0xf80: 0x10000000, 7429 0x1000: 0x10002000, 7430 0x1100: 0x10200008, 7431 0x1200: 0x10202008, 7432 0x1300: 0x2008, 7433 0x1400: 0x200000, 7434 0x1500: 0x10000000, 7435 0x1600: 0x10000008, 7436 0x1700: 0x202000, 7437 0x1800: 0x202008, 7438 0x1900: 0x0, 7439 0x1a00: 0x8, 7440 0x1b00: 0x10200000, 7441 0x1c00: 0x2000, 7442 0x1d00: 0x10002008, 7443 0x1e00: 0x10202000, 7444 0x1f00: 0x200008, 7445 0x1080: 0x8, 7446 0x1180: 0x202000, 7447 0x1280: 0x200000, 7448 0x1380: 0x10000008, 7449 0x1480: 0x10002000, 7450 0x1580: 0x2008, 7451 0x1680: 0x10202008, 7452 0x1780: 0x10200000, 7453 0x1880: 0x10202000, 7454 0x1980: 0x10200008, 7455 0x1a80: 0x2000, 7456 0x1b80: 0x202008, 7457 0x1c80: 0x200008, 7458 0x1d80: 0x0, 7459 0x1e80: 0x10000000, 7460 0x1f80: 0x10002008 7461 }, 7462 { 7463 0x0: 0x100000, 7464 0x10: 0x2000401, 7465 0x20: 0x400, 7466 0x30: 0x100401, 7467 0x40: 0x2100401, 7468 0x50: 0x0, 7469 0x60: 0x1, 7470 0x70: 0x2100001, 7471 0x80: 0x2000400, 7472 0x90: 0x100001, 7473 0xa0: 0x2000001, 7474 0xb0: 0x2100400, 7475 0xc0: 0x2100000, 7476 0xd0: 0x401, 7477 0xe0: 0x100400, 7478 0xf0: 0x2000000, 7479 0x8: 0x2100001, 7480 0x18: 0x0, 7481 0x28: 0x2000401, 7482 0x38: 0x2100400, 7483 0x48: 0x100000, 7484 0x58: 0x2000001, 7485 0x68: 0x2000000, 7486 0x78: 0x401, 7487 0x88: 0x100401, 7488 0x98: 0x2000400, 7489 0xa8: 0x2100000, 7490 0xb8: 0x100001, 7491 0xc8: 0x400, 7492 0xd8: 0x2100401, 7493 0xe8: 0x1, 7494 0xf8: 0x100400, 7495 0x100: 0x2000000, 7496 0x110: 0x100000, 7497 0x120: 0x2000401, 7498 0x130: 0x2100001, 7499 0x140: 0x100001, 7500 0x150: 0x2000400, 7501 0x160: 0x2100400, 7502 0x170: 0x100401, 7503 0x180: 0x401, 7504 0x190: 0x2100401, 7505 0x1a0: 0x100400, 7506 0x1b0: 0x1, 7507 0x1c0: 0x0, 7508 0x1d0: 0x2100000, 7509 0x1e0: 0x2000001, 7510 0x1f0: 0x400, 7511 0x108: 0x100400, 7512 0x118: 0x2000401, 7513 0x128: 0x2100001, 7514 0x138: 0x1, 7515 0x148: 0x2000000, 7516 0x158: 0x100000, 7517 0x168: 0x401, 7518 0x178: 0x2100400, 7519 0x188: 0x2000001, 7520 0x198: 0x2100000, 7521 0x1a8: 0x0, 7522 0x1b8: 0x2100401, 7523 0x1c8: 0x100401, 7524 0x1d8: 0x400, 7525 0x1e8: 0x2000400, 7526 0x1f8: 0x100001 7527 }, 7528 { 7529 0x0: 0x8000820, 7530 0x1: 0x20000, 7531 0x2: 0x8000000, 7532 0x3: 0x20, 7533 0x4: 0x20020, 7534 0x5: 0x8020820, 7535 0x6: 0x8020800, 7536 0x7: 0x800, 7537 0x8: 0x8020000, 7538 0x9: 0x8000800, 7539 0xa: 0x20800, 7540 0xb: 0x8020020, 7541 0xc: 0x820, 7542 0xd: 0x0, 7543 0xe: 0x8000020, 7544 0xf: 0x20820, 7545 0x80000000: 0x800, 7546 0x80000001: 0x8020820, 7547 0x80000002: 0x8000820, 7548 0x80000003: 0x8000000, 7549 0x80000004: 0x8020000, 7550 0x80000005: 0x20800, 7551 0x80000006: 0x20820, 7552 0x80000007: 0x20, 7553 0x80000008: 0x8000020, 7554 0x80000009: 0x820, 7555 0x8000000a: 0x20020, 7556 0x8000000b: 0x8020800, 7557 0x8000000c: 0x0, 7558 0x8000000d: 0x8020020, 7559 0x8000000e: 0x8000800, 7560 0x8000000f: 0x20000, 7561 0x10: 0x20820, 7562 0x11: 0x8020800, 7563 0x12: 0x20, 7564 0x13: 0x800, 7565 0x14: 0x8000800, 7566 0x15: 0x8000020, 7567 0x16: 0x8020020, 7568 0x17: 0x20000, 7569 0x18: 0x0, 7570 0x19: 0x20020, 7571 0x1a: 0x8020000, 7572 0x1b: 0x8000820, 7573 0x1c: 0x8020820, 7574 0x1d: 0x20800, 7575 0x1e: 0x820, 7576 0x1f: 0x8000000, 7577 0x80000010: 0x20000, 7578 0x80000011: 0x800, 7579 0x80000012: 0x8020020, 7580 0x80000013: 0x20820, 7581 0x80000014: 0x20, 7582 0x80000015: 0x8020000, 7583 0x80000016: 0x8000000, 7584 0x80000017: 0x8000820, 7585 0x80000018: 0x8020820, 7586 0x80000019: 0x8000020, 7587 0x8000001a: 0x8000800, 7588 0x8000001b: 0x0, 7589 0x8000001c: 0x20800, 7590 0x8000001d: 0x820, 7591 0x8000001e: 0x20020, 7592 0x8000001f: 0x8020800 7593 } 7594 ]; 7595 7596 // Masks that select the SBOX input 7597 var SBOX_MASK = [ 7598 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 7599 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f 7600 ]; 7601 7602 /** 7603 * DES block cipher algorithm. 7604 */ 7605 var DES = C_algo.DES = BlockCipher.extend({ 7606 _doReset: function () { 7607 // Shortcuts 7608 var key = this._key; 7609 var keyWords = key.words; 7610 7611 // Select 56 bits according to PC1 7612 var keyBits = []; 7613 for (var i = 0; i < 56; i++) { 7614 var keyBitPos = PC1[i] - 1; 7615 keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; 7616 } 7617 7618 // Assemble 16 subkeys 7619 var subKeys = this._subKeys = []; 7620 for (var nSubKey = 0; nSubKey < 16; nSubKey++) { 7621 // Create subkey 7622 var subKey = subKeys[nSubKey] = []; 7623 7624 // Shortcut 7625 var bitShift = BIT_SHIFTS[nSubKey]; 7626 7627 // Select 48 bits according to PC2 7628 for (var i = 0; i < 24; i++) { 7629 // Select from the left 28 key bits 7630 subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); 7631 7632 // Select from the right 28 key bits 7633 subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); 7634 } 7635 7636 // Since each subkey is applied to an expanded 32-bit input, 7637 // the subkey can be broken into 8 values scaled to 32-bits, 7638 // which allows the key to be used without expansion 7639 subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); 7640 for (var i = 1; i < 7; i++) { 7641 subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); 7642 } 7643 subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); 7644 } 7645 7646 // Compute inverse subkeys 7647 var invSubKeys = this._invSubKeys = []; 7648 for (var i = 0; i < 16; i++) { 7649 invSubKeys[i] = subKeys[15 - i]; 7650 } 7651 }, 7652 7653 encryptBlock: function (M, offset) { 7654 this._doCryptBlock(M, offset, this._subKeys); 7655 }, 7656 7657 decryptBlock: function (M, offset) { 7658 this._doCryptBlock(M, offset, this._invSubKeys); 7659 }, 7660 7661 _doCryptBlock: function (M, offset, subKeys) { 7662 // Get input 7663 this._lBlock = M[offset]; 7664 this._rBlock = M[offset + 1]; 7665 7666 // Initial permutation 7667 exchangeLR.call(this, 4, 0x0f0f0f0f); 7668 exchangeLR.call(this, 16, 0x0000ffff); 7669 exchangeRL.call(this, 2, 0x33333333); 7670 exchangeRL.call(this, 8, 0x00ff00ff); 7671 exchangeLR.call(this, 1, 0x55555555); 7672 7673 // Rounds 7674 for (var round = 0; round < 16; round++) { 7675 // Shortcuts 7676 var subKey = subKeys[round]; 7677 var lBlock = this._lBlock; 7678 var rBlock = this._rBlock; 7679 7680 // Feistel function 7681 var f = 0; 7682 for (var i = 0; i < 8; i++) { 7683 f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; 7684 } 7685 this._lBlock = rBlock; 7686 this._rBlock = lBlock ^ f; 7687 } 7688 7689 // Undo swap from last round 7690 var t = this._lBlock; 7691 this._lBlock = this._rBlock; 7692 this._rBlock = t; 7693 7694 // Final permutation 7695 exchangeLR.call(this, 1, 0x55555555); 7696 exchangeRL.call(this, 8, 0x00ff00ff); 7697 exchangeRL.call(this, 2, 0x33333333); 7698 exchangeLR.call(this, 16, 0x0000ffff); 7699 exchangeLR.call(this, 4, 0x0f0f0f0f); 7700 7701 // Set output 7702 M[offset] = this._lBlock; 7703 M[offset + 1] = this._rBlock; 7704 }, 7705 7706 keySize: 64/32, 7707 7708 ivSize: 64/32, 7709 7710 blockSize: 64/32 7711 }); 7712 7713 // Swap bits across the left and right words 7714 function exchangeLR(offset, mask) { 7715 var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; 7716 this._rBlock ^= t; 7717 this._lBlock ^= t << offset; 7718 } 7719 7720 function exchangeRL(offset, mask) { 7721 var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; 7722 this._lBlock ^= t; 7723 this._rBlock ^= t << offset; 7724 } 7725 7726 /** 7727 * Shortcut functions to the cipher's object interface. 7728 * 7729 * @example 7730 * 7731 * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); 7732 * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); 7733 */ 7734 C.DES = BlockCipher._createHelper(DES); 7735 7736 /** 7737 * Triple-DES block cipher algorithm. 7738 */ 7739 var TripleDES = C_algo.TripleDES = BlockCipher.extend({ 7740 _doReset: function () { 7741 // Shortcuts 7742 var key = this._key; 7743 var keyWords = key.words; 7744 // Make sure the key length is valid (64, 128 or >= 192 bit) 7745 if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { 7746 throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); 7747 } 7748 7749 // Extend the key according to the keying options defined in 3DES standard 7750 var key1 = keyWords.slice(0, 2); 7751 var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); 7752 var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); 7753 7754 // Create DES instances 7755 this._des1 = DES.createEncryptor(WordArray.create(key1)); 7756 this._des2 = DES.createEncryptor(WordArray.create(key2)); 7757 this._des3 = DES.createEncryptor(WordArray.create(key3)); 7758 }, 7759 7760 encryptBlock: function (M, offset) { 7761 this._des1.encryptBlock(M, offset); 7762 this._des2.decryptBlock(M, offset); 7763 this._des3.encryptBlock(M, offset); 7764 }, 7765 7766 decryptBlock: function (M, offset) { 7767 this._des3.decryptBlock(M, offset); 7768 this._des2.encryptBlock(M, offset); 7769 this._des1.decryptBlock(M, offset); 7770 }, 7771 7772 keySize: 192/32, 7773 7774 ivSize: 64/32, 7775 7776 blockSize: 64/32 7777 }); 7778 7779 /** 7780 * Shortcut functions to the cipher's object interface. 7781 * 7782 * @example 7783 * 7784 * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); 7785 * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); 7786 */ 7787 C.TripleDES = BlockCipher._createHelper(TripleDES); 7788 }()); 7789 7790 7791 return CryptoJS.TripleDES; 7792 7793}));
vendor: 2,086 bytes, lines 7794-7879
7794 7795/***/ }), 7796 7797/***/ 7659: 7798/***/ (function(module) { 7799 7800"use strict"; 7801 7802 7803var memo = {}; 7804 7805/* istanbul ignore next */ 7806function getTarget(target) { 7807 if (typeof memo[target] === "undefined") { 7808 var styleTarget = document.querySelector(target); 7809 7810 // Special case to return head of iframe instead of iframe itself 7811 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { 7812 try { 7813 // This will throw an exception if access to iframe is blocked 7814 // due to cross-origin restrictions 7815 styleTarget = styleTarget.contentDocument.head; 7816 } catch (e) { 7817 // istanbul ignore next 7818 styleTarget = null; 7819 } 7820 } 7821 memo[target] = styleTarget; 7822 } 7823 return memo[target]; 7824} 7825 7826/* istanbul ignore next */ 7827function insertBySelector(insert, style) { 7828 var target = getTarget(insert); 7829 if (!target) { 7830 throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); 7831 } 7832 target.appendChild(style); 7833} 7834module.exports = insertBySelector; 7835 7836/***/ }), 7837 7838/***/ 7720: 7839/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 7840 7841"use strict"; 7842 7843 7844var formats = __webpack_require__(4765); 7845var getSideChannel = __webpack_require__(920); 7846 7847var has = Object.prototype.hasOwnProperty; 7848var isArray = Array.isArray; 7849 7850// Track objects created from arrayLimit overflow using side-channel 7851// Stores the current max numeric index for O(1) lookup 7852var overflowChannel = getSideChannel(); 7853 7854var markOverflow = function markOverflow(obj, maxIndex) { 7855 overflowChannel.set(obj, maxIndex); 7856 return obj; 7857}; 7858 7859var isOverflow = function isOverflow(obj) { 7860 return overflowChannel.has(obj); 7861}; 7862 7863var getMaxIndex = function getMaxIndex(obj) { 7864 return overflowChannel.get(obj); 7865}; 7866 7867var setMaxIndex = function setMaxIndex(obj, maxIndex) { 7868 overflowChannel.set(obj, maxIndex); 7869}; 7870 7871var hexTable = (function () { 7872 var array = []; 7873 for (var i = 0; i < 256; ++i) { 7874 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); 7875 } 7876 7877 return array; 7878}()); 7879
vendor: 4,308 bytes, lines 7880-8020
7880var compactQueue = function compactQueue(queue) { 7881 while (queue.length > 1) { 7882 var item = queue.pop(); 7883 var obj = item.obj[item.prop]; 7884 7885 if (isArray(obj)) { 7886 var compacted = []; 7887 7888 for (var j = 0; j < obj.length; ++j) { 7889 if (typeof obj[j] !== 'undefined') { 7890 compacted.push(obj[j]); 7891 } 7892 } 7893 7894 item.obj[item.prop] = compacted; 7895 } 7896 } 7897}; 7898 7899var arrayToObject = function arrayToObject(source, options) { 7900 var obj = options && options.plainObjects ? { __proto__: null } : {}; 7901 for (var i = 0; i < source.length; ++i) { 7902 if (typeof source[i] !== 'undefined') { 7903 obj[i] = source[i]; 7904 } 7905 } 7906 7907 return obj; 7908}; 7909 7910var merge = function merge(target, source, options) { 7911 /* eslint no-param-reassign: 0 */ 7912 if (!source) { 7913 return target; 7914 } 7915 7916 if (typeof source !== 'object' && typeof source !== 'function') { 7917 if (isArray(target)) { 7918 target.push(source); 7919 } else if (target && typeof target === 'object') { 7920 if (isOverflow(target)) { 7921 // Add at next numeric index for overflow objects 7922 var newIndex = getMaxIndex(target) + 1; 7923 target[newIndex] = source; 7924 setMaxIndex(target, newIndex); 7925 } else if ( 7926 (options && (options.plainObjects || options.allowPrototypes)) 7927 || !has.call(Object.prototype, source) 7928 ) { 7929 target[source] = true; 7930 } 7931 } else { 7932 return [target, source]; 7933 } 7934 7935 return target; 7936 } 7937 7938 if (!target || typeof target !== 'object') { 7939 if (isOverflow(source)) { 7940 // Create new object with target at 0, source values shifted by 1 7941 var sourceKeys = Object.keys(source); 7942 var result = options && options.plainObjects 7943 ? { __proto__: null, 0: target } 7944 : { 0: target }; 7945 for (var m = 0; m < sourceKeys.length; m++) { 7946 var oldKey = parseInt(sourceKeys[m], 10); 7947 result[oldKey + 1] = source[sourceKeys[m]]; 7948 } 7949 return markOverflow(result, getMaxIndex(source) + 1); 7950 } 7951 return [target].concat(source); 7952 } 7953 7954 var mergeTarget = target; 7955 if (isArray(target) && !isArray(source)) { 7956 mergeTarget = arrayToObject(target, options); 7957 } 7958 7959 if (isArray(target) && isArray(source)) { 7960 source.forEach(function (item, i) { 7961 if (has.call(target, i)) { 7962 var targetItem = target[i]; 7963 if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { 7964 target[i] = merge(targetItem, item, options); 7965 } else { 7966 target.push(item); 7967 } 7968 } else { 7969 target[i] = item; 7970 } 7971 }); 7972 return target; 7973 } 7974 7975 return Object.keys(source).reduce(function (acc, key) { 7976 var value = source[key]; 7977 7978 if (has.call(acc, key)) { 7979 acc[key] = merge(acc[key], value, options); 7980 } else { 7981 acc[key] = value; 7982 } 7983 return acc; 7984 }, mergeTarget); 7985}; 7986 7987var assign = function assignSingleSource(target, source) { 7988 return Object.keys(source).reduce(function (acc, key) { 7989 acc[key] = source[key]; 7990 return acc; 7991 }, target); 7992}; 7993 7994var decode = function (str, defaultDecoder, charset) { 7995 var strWithoutPlus = str.replace(/\+/g, ' '); 7996 if (charset === 'iso-8859-1') { 7997 // unescape never throws, no try...catch needed: 7998 return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); 7999 } 8000 // utf-8 8001 try { 8002 return decodeURIComponent(strWithoutPlus); 8003 } catch (e) { 8004 return strWithoutPlus; 8005 } 8006}; 8007 8008var limit = 1024; 8009 8010/* eslint operator-linebreak: [2, "before"] */ 8011 8012var encode = function encode(str, defaultEncoder, charset, kind, format) { 8013 // This code was originally written by Brian White (mscdex) for the io.js core querystring library. 8014 // It has been adapted here for stricter adherence to RFC 3986 8015 if (str.length === 0) { 8016 return str; 8017 } 8018 8019 var string = str; 8020 if (typeof str === 'symbol') {
vendor: 4,796 bytes, lines 8021-8197
8021 string = Symbol.prototype.toString.call(str); 8022 } else if (typeof str !== 'string') { 8023 string = String(str); 8024 } 8025 8026 if (charset === 'iso-8859-1') { 8027 return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { 8028 return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; 8029 }); 8030 } 8031 8032 var out = ''; 8033 for (var j = 0; j < string.length; j += limit) { 8034 var segment = string.length >= limit ? string.slice(j, j + limit) : string; 8035 var arr = []; 8036 8037 for (var i = 0; i < segment.length; ++i) { 8038 var c = segment.charCodeAt(i); 8039 if ( 8040 c === 0x2D // - 8041 || c === 0x2E // . 8042 || c === 0x5F // _ 8043 || c === 0x7E // ~ 8044 || (c >= 0x30 && c <= 0x39) // 0-9 8045 || (c >= 0x41 && c <= 0x5A) // a-z 8046 || (c >= 0x61 && c <= 0x7A) // A-Z 8047 || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) 8048 ) { 8049 arr[arr.length] = segment.charAt(i); 8050 continue; 8051 } 8052 8053 if (c < 0x80) { 8054 arr[arr.length] = hexTable[c]; 8055 continue; 8056 } 8057 8058 if (c < 0x800) { 8059 arr[arr.length] = hexTable[0xC0 | (c >> 6)] 8060 + hexTable[0x80 | (c & 0x3F)]; 8061 continue; 8062 } 8063 8064 if (c < 0xD800 || c >= 0xE000) { 8065 arr[arr.length] = hexTable[0xE0 | (c >> 12)] 8066 + hexTable[0x80 | ((c >> 6) & 0x3F)] 8067 + hexTable[0x80 | (c & 0x3F)]; 8068 continue; 8069 } 8070 8071 i += 1; 8072 c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); 8073 8074 arr[arr.length] = hexTable[0xF0 | (c >> 18)] 8075 + hexTable[0x80 | ((c >> 12) & 0x3F)] 8076 + hexTable[0x80 | ((c >> 6) & 0x3F)] 8077 + hexTable[0x80 | (c & 0x3F)]; 8078 } 8079 8080 out += arr.join(''); 8081 } 8082 8083 return out; 8084}; 8085 8086var compact = function compact(value) { 8087 var queue = [{ obj: { o: value }, prop: 'o' }]; 8088 var refs = []; 8089 8090 for (var i = 0; i < queue.length; ++i) { 8091 var item = queue[i]; 8092 var obj = item.obj[item.prop]; 8093 8094 var keys = Object.keys(obj); 8095 for (var j = 0; j < keys.length; ++j) { 8096 var key = keys[j]; 8097 var val = obj[key]; 8098 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { 8099 queue.push({ obj: obj, prop: key }); 8100 refs.push(val); 8101 } 8102 } 8103 } 8104 8105 compactQueue(queue); 8106 8107 return value; 8108}; 8109 8110var isRegExp = function isRegExp(obj) { 8111 return Object.prototype.toString.call(obj) === '[object RegExp]'; 8112}; 8113 8114var isBuffer = function isBuffer(obj) { 8115 if (!obj || typeof obj !== 'object') { 8116 return false; 8117 } 8118 8119 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 8120}; 8121 8122var combine = function combine(a, b, arrayLimit, plainObjects) { 8123 // If 'a' is already an overflow object, add to it 8124 if (isOverflow(a)) { 8125 var newIndex = getMaxIndex(a) + 1; 8126 a[newIndex] = b; 8127 setMaxIndex(a, newIndex); 8128 return a; 8129 } 8130 8131 var result = [].concat(a, b); 8132 if (result.length > arrayLimit) { 8133 return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1); 8134 } 8135 return result; 8136}; 8137 8138var maybeMap = function maybeMap(val, fn) { 8139 if (isArray(val)) { 8140 var mapped = []; 8141 for (var i = 0; i < val.length; i += 1) { 8142 mapped.push(fn(val[i])); 8143 } 8144 return mapped; 8145 } 8146 return fn(val); 8147}; 8148 8149module.exports = { 8150 arrayToObject: arrayToObject, 8151 assign: assign, 8152 combine: combine, 8153 compact: compact, 8154 decode: decode, 8155 encode: encode, 8156 isBuffer: isBuffer, 8157 isOverflow: isOverflow, 8158 isRegExp: isRegExp, 8159 maybeMap: maybeMap, 8160 merge: merge 8161}; 8162 8163 8164/***/ }), 8165 8166/***/ 7825: 8167/***/ (function(module) { 8168 8169"use strict"; 8170 8171 8172/* istanbul ignore next */ 8173function apply(styleElement, options, obj) { 8174 var css = ""; 8175 if (obj.supports) { 8176 css += "@supports (".concat(obj.supports, ") {"); 8177 } 8178 if (obj.media) { 8179 css += "@media ".concat(obj.media, " {"); 8180 } 8181 var needLayer = typeof obj.layer !== "undefined"; 8182 if (needLayer) { 8183 css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {"); 8184 } 8185 css += obj.css; 8186 if (needLayer) { 8187 css += "}"; 8188 } 8189 if (obj.media) { 8190 css += "}"; 8191 } 8192 if (obj.supports) { 8193 css += "}"; 8194 } 8195 var sourceMap = obj.sourceMap; 8196 if (sourceMap && typeof btoa !== "undefined") { 8197 css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)
vendor: 4,227 bytes, lines 8197-8366
8197))), " */"); 8198 } 8199 8200 // For old IE 8201 /* istanbul ignore if */ 8202 options.styleTagTransform(css, styleElement, options.options); 8203} 8204function removeStyleElement(styleElement) { 8205 // istanbul ignore if 8206 if (styleElement.parentNode === null) { 8207 return false; 8208 } 8209 styleElement.parentNode.removeChild(styleElement); 8210} 8211 8212/* istanbul ignore next */ 8213function domAPI(options) { 8214 if (typeof document === "undefined") { 8215 return { 8216 update: function update() {}, 8217 remove: function remove() {} 8218 }; 8219 } 8220 var styleElement = options.insertStyleElement(options); 8221 return { 8222 update: function update(obj) { 8223 apply(styleElement, options, obj); 8224 }, 8225 remove: function remove() { 8226 removeStyleElement(styleElement); 8227 } 8228 }; 8229} 8230module.exports = domAPI; 8231 8232/***/ }), 8233 8234/***/ 7943: 8235/***/ (function(module, exports, __webpack_require__) { 8236 8237var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 8238 * imagesLoaded v4.1.4 8239 * JavaScript is all like "You images are done yet or what?" 8240 * MIT License 8241 */ 8242 8243( function( window, factory ) { 'use strict'; 8244 // universal module definition 8245 8246 /*global define: false, module: false, require: false */ 8247 8248 if ( true ) { 8249 // AMD 8250 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 8251 __webpack_require__(2137) 8252 ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter ) { 8253 return factory( window, EvEmitter ); 8254 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 8255 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 8256 } else // removed by dead control flow 8257{} 8258 8259})( typeof window !== 'undefined' ? window : this, 8260 8261// -------------------------- factory -------------------------- // 8262 8263function factory( window, EvEmitter ) { 8264 8265'use strict'; 8266 8267var $ = window.jQuery; 8268var console = window.console; 8269 8270// -------------------------- helpers -------------------------- // 8271 8272// extend objects 8273function extend( a, b ) { 8274 for ( var prop in b ) { 8275 a[ prop ] = b[ prop ]; 8276 } 8277 return a; 8278} 8279 8280var arraySlice = Array.prototype.slice; 8281 8282// turn element or nodeList into an array 8283function makeArray( obj ) { 8284 if ( Array.isArray( obj ) ) { 8285 // use object if already an array 8286 return obj; 8287 } 8288 8289 var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; 8290 if ( isArrayLike ) { 8291 // convert nodeList to array 8292 return arraySlice.call( obj ); 8293 } 8294 8295 // array of single index 8296 return [ obj ]; 8297} 8298 8299// -------------------------- imagesLoaded -------------------------- // 8300 8301/** 8302 * @param {Array, Element, NodeList, String} elem 8303 * @param {Object or Function} options - if function, use as callback 8304 * @param {Function} onAlways - callback function 8305 */ 8306function ImagesLoaded( elem, options, onAlways ) { 8307 // coerce ImagesLoaded() without new, to be new ImagesLoaded() 8308 if ( !( this instanceof ImagesLoaded ) ) { 8309 return new ImagesLoaded( elem, options, onAlways ); 8310 } 8311 // use elem as selector string 8312 var queryElem = elem; 8313 if ( typeof elem == 'string' ) { 8314 queryElem = document.querySelectorAll( elem ); 8315 } 8316 // bail if bad element 8317 if ( !queryElem ) { 8318 console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) ); 8319 return; 8320 } 8321 8322 this.elements = makeArray( queryElem ); 8323 this.options = extend( {}, this.options ); 8324 // shift arguments if no options set 8325 if ( typeof options == 'function' ) { 8326 onAlways = options; 8327 } else { 8328 extend( this.options, options ); 8329 } 8330 8331 if ( onAlways ) { 8332 this.on( 'always', onAlways ); 8333 } 8334 8335 this.getImages(); 8336 8337 if ( $ ) { 8338 // add jQuery Deferred object 8339 this.jqDeferred = new $.Deferred(); 8340 } 8341 8342 // HACK check async to allow time to bind listeners 8343 setTimeout( this.check.bind( this ) ); 8344} 8345 8346ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); 8347 8348ImagesLoaded.prototype.options = {}; 8349 8350ImagesLoaded.prototype.getImages = function() { 8351 this.images = []; 8352 8353 // filter & find items if we have an item selector 8354 this.elements.forEach( this.addElementImages, this ); 8355}; 8356 8357/** 8358 * @param {Node} element 8359 */ 8360ImagesLoaded.prototype.addElementImages = function( elem ) { 8361 // filter siblings 8362 if ( elem.nodeName == 'IMG' ) { 8363 this.addImage( elem ); 8364 } 8365 // get background image on element 8366 if ( this.options.background === true ) {
vendor: 4,143 bytes, lines 8367-8512
8367 this.addElementBackgroundImages( elem ); 8368 } 8369 8370 // find children 8371 // no non-element nodes, #143 8372 var nodeType = elem.nodeType; 8373 if ( !nodeType || !elementNodeTypes[ nodeType ] ) { 8374 return; 8375 } 8376 var childImgs = elem.querySelectorAll('img'); 8377 // concat childElems to filterFound array 8378 for ( var i=0; i < childImgs.length; i++ ) { 8379 var img = childImgs[i]; 8380 this.addImage( img ); 8381 } 8382 8383 // get child background images 8384 if ( typeof this.options.background == 'string' ) { 8385 var children = elem.querySelectorAll( this.options.background ); 8386 for ( i=0; i < children.length; i++ ) { 8387 var child = children[i]; 8388 this.addElementBackgroundImages( child ); 8389 } 8390 } 8391}; 8392 8393var elementNodeTypes = { 8394 1: true, 8395 9: true, 8396 11: true 8397}; 8398 8399ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { 8400 var style = getComputedStyle( elem ); 8401 if ( !style ) { 8402 // Firefox returns null if in a hidden iframe https://bugzil.la/548397 8403 return; 8404 } 8405 // get url inside url("...") 8406 var reURL = /url\((['"])?(.*?)\1\)/gi; 8407 var matches = reURL.exec( style.backgroundImage ); 8408 while ( matches !== null ) { 8409 var url = matches && matches[2]; 8410 if ( url ) { 8411 this.addBackground( url, elem ); 8412 } 8413 matches = reURL.exec( style.backgroundImage ); 8414 } 8415}; 8416 8417/** 8418 * @param {Image} img 8419 */ 8420ImagesLoaded.prototype.addImage = function( img ) { 8421 var loadingImage = new LoadingImage( img ); 8422 this.images.push( loadingImage ); 8423}; 8424 8425ImagesLoaded.prototype.addBackground = function( url, elem ) { 8426 var background = new Background( url, elem ); 8427 this.images.push( background ); 8428}; 8429 8430ImagesLoaded.prototype.check = function() { 8431 var _this = this; 8432 this.progressedCount = 0; 8433 this.hasAnyBroken = false; 8434 // complete if no images 8435 if ( !this.images.length ) { 8436 this.complete(); 8437 return; 8438 } 8439 8440 function onProgress( image, elem, message ) { 8441 // HACK - Chrome triggers event before object properties have changed. #83 8442 setTimeout( function() { 8443 _this.progress( image, elem, message ); 8444 }); 8445 } 8446 8447 this.images.forEach( function( loadingImage ) { 8448 loadingImage.once( 'progress', onProgress ); 8449 loadingImage.check(); 8450 }); 8451}; 8452 8453ImagesLoaded.prototype.progress = function( image, elem, message ) { 8454 this.progressedCount++; 8455 this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 8456 // progress event 8457 this.emitEvent( 'progress', [ this, image, elem ] ); 8458 if ( this.jqDeferred && this.jqDeferred.notify ) { 8459 this.jqDeferred.notify( this, image ); 8460 } 8461 // check if completed 8462 if ( this.progressedCount == this.images.length ) { 8463 this.complete(); 8464 } 8465 8466 if ( this.options.debug && console ) { 8467 console.log( 'progress: ' + message, image, elem ); 8468 } 8469}; 8470 8471ImagesLoaded.prototype.complete = function() { 8472 var eventName = this.hasAnyBroken ? 'fail' : 'done'; 8473 this.isComplete = true; 8474 this.emitEvent( eventName, [ this ] ); 8475 this.emitEvent( 'always', [ this ] ); 8476 if ( this.jqDeferred ) { 8477 var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; 8478 this.jqDeferred[ jqMethod ]( this ); 8479 } 8480}; 8481 8482// -------------------------- -------------------------- // 8483 8484function LoadingImage( img ) { 8485 this.img = img; 8486} 8487 8488LoadingImage.prototype = Object.create( EvEmitter.prototype ); 8489 8490LoadingImage.prototype.check = function() { 8491 // If complete is true and browser supports natural sizes, 8492 // try to check for image status manually. 8493 var isComplete = this.getIsImageComplete(); 8494 if ( isComplete ) { 8495 // report based on naturalWidth 8496 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 8497 return; 8498 } 8499 8500 // If none of the checks above matched, simulate loading on detached element. 8501 this.proxyImage = new Image(); 8502 this.proxyImage.addEventListener( 'load', this ); 8503 this.proxyImage.addEventListener( 'error', this ); 8504 // bind to image as well for Firefox. #191 8505 this.img.addEventListener( 'load', this ); 8506 this.img.addEventListener( 'error', this ); 8507 this.proxyImage.src = this.img.src; 8508}; 8509 8510LoadingImage.prototype.getIsImageComplete = function() { 8511 // check for non-zero, non-undefined naturalWidth 8512 // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
8513 return this.img.complete && this.img.naturalWidth; 8514}; 8515 8516LoadingImage.prototype.confirm = function( isLoaded, message ) { 8517 this.isLoaded = isLoaded; 8518 this.emitEvent( 'progress', [ this, this.img, message ] ); 8519}; 8520 8521// ----- events ----- // 8522 8523// trigger specified handler for event type 8524LoadingImage.prototype.handleEvent = function( event ) { 8525 var method = 'on' + event.type; 8526 if ( this[ method ] ) { 8527 this[ method ]( event ); 8528 } 8529}; 8530 8531LoadingImage.prototype.onload = function() { 8532 this.confirm( true, 'onload' ); 8533 this.unbindEvents(); 8534}; 8535 8536LoadingImage.prototype.onerror = function() { 8537 this.confirm( false, 'onerror' ); 8538 this.unbindEvents(); 8539}; 8540 8541LoadingImage.prototype.unbindEvents = function() { 8542 this.proxyImage.removeEventListener( 'load', this ); 8543 this.proxyImage.removeEventListener( 'error', this ); 8544 this.img.removeEventListener( 'load', this ); 8545 this.img.removeEventListener( 'error', this ); 8546}; 8547 8548// -------------------------- Background -------------------------- // 8549 8550function Background( url, element ) { 8551 this.url = url; 8552 this.element = element; 8553 this.img = new Image(); 8554} 8555 8556// inherit LoadingImage prototype 8557Background.prototype = Object.create( LoadingImage.prototype ); 8558 8559Background.prototype.check = function() { 8560 this.img.addEventListener( 'load', this ); 8561 this.img.addEventListener( 'error', this ); 8562 this.img.src = this.url; 8563 // check if image is already complete 8564 var isComplete = this.getIsImageComplete(); 8565 if ( isComplete ) { 8566 this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 8567 this.unbindEvents(); 8568 } 8569}; 8570 8571Background.prototype.unbindEvents = function() { 8572 this.img.removeEventListener( 'load', this ); 8573 this.img.removeEventListener( 'error', this ); 8574}; 8575 8576Background.prototype.confirm = function( isLoaded, message ) { 8577 this.isLoaded = isLoaded; 8578 this.emitEvent( 'progress', [ this, this.element, message ] ); 8579}; 8580 8581// -------------------------- jQuery -------------------------- // 8582 8583ImagesLoaded.makeJQueryPlugin = function( jQuery ) { 8584 jQuery = jQuery || window.jQuery; 8585 if ( !jQuery ) { 8586 return; 8587 } 8588 // set local variable 8589 $ = jQuery; 8590 // $().imagesLoaded() 8591 $.fn.imagesLoaded = function( options, callback ) { 8592 var instance = new ImagesLoaded( this, options, callback ); 8593 return instance.jqDeferred.promise( $(this) ); 8594 }; 8595}; 8596// try making plugin 8597ImagesLoaded.makeJQueryPlugin(); 8598 8599// -------------------------- -------------------------- // 8600 8601return ImagesLoaded; 8602 8603}); 8604 8605 8606/***/ }), 8607 8608/***/ 8002: 8609/***/ (function(module) { 8610 8611"use strict"; 8612 8613 8614/** @type {import('./min')} */ 8615module.exports = Math.min; 8616 8617 8618/***/ }), 8619 8620/***/ 8056: 8621/***/ (function(module, exports, __webpack_require__) { 8622 8623;(function (root, factory) { 8624 if (true) { 8625 // CommonJS 8626 module.exports = exports = factory(__webpack_require__(9021)); 8627 } 8628 else // removed by dead control flow 8629{} 8630}(this, function (CryptoJS) { 8631 8632 /** @preserve 8633 (c) 2012 by Cédric Mesnil. All rights reserved. 8634 8635 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 8636 8637 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8638 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8639 8640 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8641 */ 8642 8643 (function (Math) { 8644 // Shortcuts 8645 var C = CryptoJS; 8646 var C_lib = C.lib; 8647 var WordArray = C_lib.WordArray; 8648 var Hasher = C_lib.Hasher; 8649 var C_algo = C.algo; 8650 8651 // Constants table 8652 var _zl = WordArray.create([ 8653 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8654 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 8655 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 8656 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 8657 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); 8658 var _zr = WordArray.create([ 8659 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 8660 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 8661 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8662 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 8663 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); 8664 var _sl = WordArray.create([ 8665 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 8666 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 8667 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 8668 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 8669 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); 8670 var _sr = WordArray.create([ 8671 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 8672 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 8673 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 8674 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8675 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); 8676 8677 var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); 8678 var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); 8679 8680 /** 8681 * RIPEMD160 hash algorithm. 8682 */ 8683 var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ 8684 _doReset: function () { 8685 this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); 8686 }, 8687 8688 _doProcessBlock: function (M, offset) { 8689 8690 // Swap endian 8691 for (var i = 0; i < 16; i++) { 8692 // Shortcuts 8693 var offset_i = offset + i; 8694 var M_offset_i = M[offset_i]; 8695 8696 // Swap 8697 M[offset_i] = ( 8698 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | 8699 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) 8700 ); 8701 } 8702 // Shortcut 8703 var H = this._hash.words; 8704 var hl = _hl.words; 8705 var hr = _hr.words; 8706 var zl = _zl.words; 8707 var zr = _zr.words;
vendor: 7,155 bytes, lines 8708-9004
8708 var sl = _sl.words; 8709 var sr = _sr.words; 8710 8711 // Working variables 8712 var al, bl, cl, dl, el; 8713 var ar, br, cr, dr, er; 8714 8715 ar = al = H[0]; 8716 br = bl = H[1]; 8717 cr = cl = H[2]; 8718 dr = dl = H[3]; 8719 er = el = H[4]; 8720 // Computation 8721 var t; 8722 for (var i = 0; i < 80; i += 1) { 8723 t = (al + M[offset+zl[i]])|0; 8724 if (i<16){ 8725 t += f1(bl,cl,dl) + hl[0]; 8726 } else if (i<32) { 8727 t += f2(bl,cl,dl) + hl[1]; 8728 } else if (i<48) { 8729 t += f3(bl,cl,dl) + hl[2]; 8730 } else if (i<64) { 8731 t += f4(bl,cl,dl) + hl[3]; 8732 } else {// if (i<80) { 8733 t += f5(bl,cl,dl) + hl[4]; 8734 } 8735 t = t|0; 8736 t = rotl(t,sl[i]); 8737 t = (t+el)|0; 8738 al = el; 8739 el = dl; 8740 dl = rotl(cl, 10); 8741 cl = bl; 8742 bl = t; 8743 8744 t = (ar + M[offset+zr[i]])|0; 8745 if (i<16){ 8746 t += f5(br,cr,dr) + hr[0]; 8747 } else if (i<32) { 8748 t += f4(br,cr,dr) + hr[1]; 8749 } else if (i<48) { 8750 t += f3(br,cr,dr) + hr[2]; 8751 } else if (i<64) { 8752 t += f2(br,cr,dr) + hr[3]; 8753 } else {// if (i<80) { 8754 t += f1(br,cr,dr) + hr[4]; 8755 } 8756 t = t|0; 8757 t = rotl(t,sr[i]) ; 8758 t = (t+er)|0; 8759 ar = er; 8760 er = dr; 8761 dr = rotl(cr, 10); 8762 cr = br; 8763 br = t; 8764 } 8765 // Intermediate hash value 8766 t = (H[1] + cl + dr)|0; 8767 H[1] = (H[2] + dl + er)|0; 8768 H[2] = (H[3] + el + ar)|0; 8769 H[3] = (H[4] + al + br)|0; 8770 H[4] = (H[0] + bl + cr)|0; 8771 H[0] = t; 8772 }, 8773 8774 _doFinalize: function () { 8775 // Shortcuts 8776 var data = this._data; 8777 var dataWords = data.words; 8778 8779 var nBitsTotal = this._nDataBytes * 8; 8780 var nBitsLeft = data.sigBytes * 8; 8781 8782 // Add padding 8783 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 8784 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( 8785 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | 8786 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) 8787 ); 8788 data.sigBytes = (dataWords.length + 1) * 4; 8789 8790 // Hash final blocks 8791 this._process(); 8792 8793 // Shortcuts 8794 var hash = this._hash; 8795 var H = hash.words; 8796 8797 // Swap endian 8798 for (var i = 0; i < 5; i++) { 8799 // Shortcut 8800 var H_i = H[i]; 8801 8802 // Swap 8803 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | 8804 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); 8805 } 8806 8807 // Return final computed hash 8808 return hash; 8809 }, 8810 8811 clone: function () { 8812 var clone = Hasher.clone.call(this); 8813 clone._hash = this._hash.clone(); 8814 8815 return clone; 8816 } 8817 }); 8818 8819 8820 function f1(x, y, z) { 8821 return ((x) ^ (y) ^ (z)); 8822 8823 } 8824 8825 function f2(x, y, z) { 8826 return (((x)&(y)) | ((~x)&(z))); 8827 } 8828 8829 function f3(x, y, z) { 8830 return (((x) | (~(y))) ^ (z)); 8831 } 8832 8833 function f4(x, y, z) { 8834 return (((x) & (z)) | ((y)&(~(z)))); 8835 } 8836 8837 function f5(x, y, z) { 8838 return ((x) ^ ((y) |(~(z)))); 8839 8840 } 8841 8842 function rotl(x,n) { 8843 return (x<<n) | (x>>>(32-n)); 8844 } 8845 8846 8847 /** 8848 * Shortcut function to the hasher's object interface. 8849 * 8850 * @param {WordArray|string} message The message to hash. 8851 * 8852 * @return {WordArray} The hash. 8853 * 8854 * @static 8855 * 8856 * @example 8857 * 8858 * var hash = CryptoJS.RIPEMD160('message'); 8859 * var hash = CryptoJS.RIPEMD160(wordArray); 8860 */ 8861 C.RIPEMD160 = Hasher._createHelper(RIPEMD160); 8862 8863 /** 8864 * Shortcut function to the HMAC's object interface. 8865 * 8866 * @param {WordArray|string} message The message to hash. 8867 * @param {WordArray|string} key The secret key. 8868 * 8869 * @return {WordArray} The HMAC. 8870 * 8871 * @static 8872 * 8873 * @example 8874 * 8875 * var hmac = CryptoJS.HmacRIPEMD160(message, key); 8876 */ 8877 C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); 8878 }(Math)); 8879 8880 8881 return CryptoJS.RIPEMD160; 8882 8883})); 8884 8885/***/ }), 8886 8887/***/ 8068: 8888/***/ (function(module) { 8889 8890"use strict"; 8891 8892 8893/** @type {import('./syntax')} */ 8894module.exports = SyntaxError; 8895 8896 8897/***/ }), 8898 8899/***/ 8124: 8900/***/ (function(module, exports, __webpack_require__) { 8901 8902;(function (root, factory, undef) { 8903 if (true) { 8904 // CommonJS 8905 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 8906 } 8907 else // removed by dead control flow 8908{} 8909}(this, function (CryptoJS) { 8910 8911 /** 8912 * A noop padding strategy. 8913 */ 8914 CryptoJS.pad.NoPadding = { 8915 pad: function () { 8916 }, 8917 8918 unpad: function () { 8919 } 8920 }; 8921 8922 8923 return CryptoJS.pad.NoPadding; 8924 8925})); 8926 8927/***/ }), 8928 8929/***/ 8454: 8930/***/ (function(module, exports, __webpack_require__) { 8931 8932;(function (root, factory, undef) { 8933 if (true) { 8934 // CommonJS 8935 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(7165)); 8936 } 8937 else // removed by dead control flow 8938{} 8939}(this, function (CryptoJS) { 8940 8941 /** 8942 * Electronic Codebook block mode. 8943 */ 8944 CryptoJS.mode.ECB = (function () { 8945 var ECB = CryptoJS.lib.BlockCipherMode.extend(); 8946 8947 ECB.Encryptor = ECB.extend({ 8948 processBlock: function (words, offset) { 8949 this._cipher.encryptBlock(words, offset); 8950 } 8951 }); 8952 8953 ECB.Decryptor = ECB.extend({ 8954 processBlock: function (words, offset) { 8955 this._cipher.decryptBlock(words, offset); 8956 } 8957 }); 8958 8959 return ECB; 8960 }()); 8961 8962 8963 return CryptoJS.mode.ECB; 8964 8965})); 8966 8967/***/ }), 8968 8969/***/ 8636: 8970/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 8971 8972"use strict"; 8973 8974 8975var getSideChannel = __webpack_require__(920); 8976var utils = __webpack_require__(7720); 8977var formats = __webpack_require__(4765); 8978var has = Object.prototype.hasOwnProperty; 8979 8980var arrayPrefixGenerators = { 8981 brackets: function brackets(prefix) { 8982 return prefix + '[]'; 8983 }, 8984 comma: 'comma', 8985 indices: function indices(prefix, key) { 8986 return prefix + '[' + key + ']'; 8987 }, 8988 repeat: function repeat(prefix) { 8989 return prefix; 8990 } 8991}; 8992 8993var isArray = Array.isArray; 8994var push = Array.prototype.push; 8995var pushToArray = function (arr, valueOrArray) { 8996 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); 8997}; 8998 8999var toISO = Date.prototype.toISOString; 9000 9001var defaultFormat = formats['default']; 9002var defaults = { 9003 addQueryPrefix: false, 9004 allowDots: false,
vendor: 10,641 bytes, lines 9005-9327
9005 allowEmptyArrays: false, 9006 arrayFormat: 'indices', 9007 charset: 'utf-8', 9008 charsetSentinel: false, 9009 commaRoundTrip: false, 9010 delimiter: '&', 9011 encode: true, 9012 encodeDotInKeys: false, 9013 encoder: utils.encode, 9014 encodeValuesOnly: false, 9015 filter: void undefined, 9016 format: defaultFormat, 9017 formatter: formats.formatters[defaultFormat], 9018 // deprecated 9019 indices: false, 9020 serializeDate: function serializeDate(date) { 9021 return toISO.call(date); 9022 }, 9023 skipNulls: false, 9024 strictNullHandling: false 9025}; 9026 9027var isNonNullishPrimitive = function isNonNullishPrimitive(v) { 9028 return typeof v === 'string' 9029 || typeof v === 'number' 9030 || typeof v === 'boolean' 9031 || typeof v === 'symbol' 9032 || typeof v === 'bigint'; 9033}; 9034 9035var sentinel = {}; 9036 9037var stringify = function stringify( 9038 object, 9039 prefix, 9040 generateArrayPrefix, 9041 commaRoundTrip, 9042 allowEmptyArrays, 9043 strictNullHandling, 9044 skipNulls, 9045 encodeDotInKeys, 9046 encoder, 9047 filter, 9048 sort, 9049 allowDots, 9050 serializeDate, 9051 format, 9052 formatter, 9053 encodeValuesOnly, 9054 charset, 9055 sideChannel 9056) { 9057 var obj = object; 9058 9059 var tmpSc = sideChannel; 9060 var step = 0; 9061 var findFlag = false; 9062 while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { 9063 // Where object last appeared in the ref tree 9064 var pos = tmpSc.get(object); 9065 step += 1; 9066 if (typeof pos !== 'undefined') { 9067 if (pos === step) { 9068 throw new RangeError('Cyclic object value'); 9069 } else { 9070 findFlag = true; // Break while 9071 } 9072 } 9073 if (typeof tmpSc.get(sentinel) === 'undefined') { 9074 step = 0; 9075 } 9076 } 9077 9078 if (typeof filter === 'function') { 9079 obj = filter(prefix, obj); 9080 } else if (obj instanceof Date) { 9081 obj = serializeDate(obj); 9082 } else if (generateArrayPrefix === 'comma' && isArray(obj)) { 9083 obj = utils.maybeMap(obj, function (value) { 9084 if (value instanceof Date) { 9085 return serializeDate(value); 9086 } 9087 return value; 9088 }); 9089 } 9090 9091 if (obj === null) { 9092 if (strictNullHandling) { 9093 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; 9094 } 9095 9096 obj = ''; 9097 } 9098 9099 if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { 9100 if (encoder) { 9101 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); 9102 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; 9103 } 9104 return [formatter(prefix) + '=' + formatter(String(obj))]; 9105 } 9106 9107 var values = []; 9108 9109 if (typeof obj === 'undefined') { 9110 return values; 9111 } 9112 9113 var objKeys; 9114 if (generateArrayPrefix === 'comma' && isArray(obj)) { 9115 // we need to join elements in 9116 if (encodeValuesOnly && encoder) { 9117 obj = utils.maybeMap(obj, encoder); 9118 } 9119 objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; 9120 } else if (isArray(filter)) { 9121 objKeys = filter; 9122 } else { 9123 var keys = Object.keys(obj); 9124 objKeys = sort ? keys.sort(sort) : keys; 9125 } 9126 9127 var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); 9128 9129 var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; 9130 9131 if (allowEmptyArrays && isArray(obj) && obj.length === 0) { 9132 return adjustedPrefix + '[]'; 9133 } 9134 9135 for (var j = 0; j < objKeys.length; ++j) { 9136 var key = objKeys[j]; 9137 var value = typeof key === 'object' && key && typeof key.value !== 'undefined' 9138 ? key.value 9139 : obj[key]; 9140 9141 if (skipNulls && value === null) { 9142 continue; 9143 } 9144 9145 var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); 9146 var keyPrefix = isArray(obj) 9147 ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix 9148 : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); 9149 9150 sideChannel.set(object, step); 9151 var valueSideChannel = getSideChannel(); 9152 valueSideChannel.set(sentinel, sideChannel); 9153 pushToArray(values, stringify( 9154 value, 9155 keyPrefix, 9156 generateArrayPrefix, 9157 commaRoundTrip, 9158 allowEmptyArrays, 9159 strictNullHandling, 9160 skipNulls, 9161 encodeDotInKeys, 9162 generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, 9163 filter, 9164 sort, 9165 allowDots, 9166 serializeDate, 9167 format, 9168 formatter, 9169 encodeValuesOnly, 9170 charset, 9171 valueSideChannel 9172 )); 9173 } 9174 9175 return values; 9176}; 9177 9178var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { 9179 if (!opts) { 9180 return defaults; 9181 } 9182 9183 if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { 9184 throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); 9185 } 9186 9187 if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { 9188 throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); 9189 } 9190 9191 if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { 9192 throw new TypeError('Encoder has to be a function.'); 9193 } 9194 9195 var charset = opts.charset || defaults.charset; 9196 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 9197 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 9198 } 9199 9200 var format = formats['default']; 9201 if (typeof opts.format !== 'undefined') { 9202 if (!has.call(formats.formatters, opts.format)) { 9203 throw new TypeError('Unknown format option provided.'); 9204 } 9205 format = opts.format; 9206 } 9207 var formatter = formats.formatters[format]; 9208 9209 var filter = defaults.filter; 9210 if (typeof opts.filter === 'function' || isArray(opts.filter)) { 9211 filter = opts.filter; 9212 } 9213 9214 var arrayFormat; 9215 if (opts.arrayFormat in arrayPrefixGenerators) { 9216 arrayFormat = opts.arrayFormat; 9217 } else if ('indices' in opts) { 9218 arrayFormat = opts.indices ? 'indices' : 'repeat'; 9219 } else { 9220 arrayFormat = defaults.arrayFormat; 9221 } 9222 9223 if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { 9224 throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); 9225 } 9226 9227 var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; 9228 9229 return { 9230 addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, 9231 allowDots: allowDots, 9232 allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 9233 arrayFormat: arrayFormat, 9234 charset: charset, 9235 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 9236 commaRoundTrip: !!opts.commaRoundTrip, 9237 delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, 9238 encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, 9239 encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, 9240 encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, 9241 encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, 9242 filter: filter, 9243 format: format, 9244 formatter: formatter, 9245 serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, 9246 skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, 9247 sort: typeof opts.sort === 'function' ? opts.sort : null, 9248 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling 9249 }; 9250}; 9251 9252module.exports = function (object, opts) { 9253 var obj = object; 9254 var options = normalizeStringifyOptions(opts); 9255 9256 var objKeys; 9257 var filter; 9258 9259 if (typeof options.filter === 'function') { 9260 filter = options.filter; 9261 obj = filter('', obj); 9262 } else if (isArray(options.filter)) { 9263 filter = options.filter; 9264 objKeys = filter; 9265 } 9266 9267 var keys = []; 9268 9269 if (typeof obj !== 'object' || obj === null) { 9270 return ''; 9271 } 9272 9273 var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; 9274 var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; 9275 9276 if (!objKeys) { 9277 objKeys = Object.keys(obj); 9278 } 9279 9280 if (options.sort) { 9281 objKeys.sort(options.sort); 9282 } 9283 9284 var sideChannel = getSideChannel(); 9285 for (var i = 0; i < objKeys.length; ++i) { 9286 var key = objKeys[i]; 9287 var value = obj[key]; 9288 9289 if (options.skipNulls && value === null) { 9290 continue; 9291 } 9292 pushToArray(keys, stringify( 9293 value, 9294 key, 9295 generateArrayPrefix, 9296 commaRoundTrip, 9297 options.allowEmptyArrays, 9298 options.strictNullHandling, 9299 options.skipNulls, 9300 options.encodeDotInKeys, 9301 options.encode ? options.encoder : null, 9302 options.filter, 9303 options.sort, 9304 options.allowDots, 9305 options.serializeDate, 9306 options.format, 9307 options.formatter, 9308 options.encodeValuesOnly, 9309 options.charset, 9310 sideChannel 9311 )); 9312 } 9313 9314 var joined = keys.join(options.delimiter); 9315 var prefix = options.addQueryPrefix === true ? '?' : ''; 9316 9317 if (options.charsetSentinel) { 9318 if (options.charset === 'iso-8859-1') { 9319 // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark 9320 prefix += 'utf8=%26%2310003%3B&'; 9321 } else { 9322 // encodeURIComponent('✓') 9323 prefix += 'utf8=%E2%9C%93&'; 9324 } 9325 } 9326 9327 return joined.length >
vendor: 3,632 bytes, lines 9327-9415
9327 0 ? prefix + joined : ''; 9328}; 9329 9330 9331/***/ }), 9332 9333/***/ 8648: 9334/***/ (function(module) { 9335 9336"use strict"; 9337 9338 9339/** @type {import('./Reflect.getPrototypeOf')} */ 9340module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; 9341 9342 9343/***/ }), 9344 9345/***/ 8859: 9346/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 9347 9348var hasMap = typeof Map === 'function' && Map.prototype; 9349var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; 9350var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; 9351var mapForEach = hasMap && Map.prototype.forEach; 9352var hasSet = typeof Set === 'function' && Set.prototype; 9353var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; 9354var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; 9355var setForEach = hasSet && Set.prototype.forEach; 9356var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; 9357var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; 9358var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; 9359var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; 9360var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; 9361var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; 9362var booleanValueOf = Boolean.prototype.valueOf; 9363var objectToString = Object.prototype.toString; 9364var functionToString = Function.prototype.toString; 9365var $match = String.prototype.match; 9366var $slice = String.prototype.slice; 9367var $replace = String.prototype.replace; 9368var $toUpperCase = String.prototype.toUpperCase; 9369var $toLowerCase = String.prototype.toLowerCase; 9370var $test = RegExp.prototype.test; 9371var $concat = Array.prototype.concat; 9372var $join = Array.prototype.join; 9373var $arrSlice = Array.prototype.slice; 9374var $floor = Math.floor; 9375var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; 9376var gOPS = Object.getOwnPropertySymbols; 9377var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; 9378var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; 9379// ie, `has-tostringtag/shams 9380var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') 9381 ? Symbol.toStringTag 9382 : null; 9383var isEnumerable = Object.prototype.propertyIsEnumerable; 9384 9385var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( 9386 [].__proto__ === Array.prototype // eslint-disable-line no-proto 9387 ? function (O) { 9388 return O.__proto__; // eslint-disable-line no-proto 9389 } 9390 : null 9391); 9392 9393function addNumericSeparator(num, str) { 9394 if ( 9395 num === Infinity 9396 || num === -Infinity 9397 || num !== num 9398 || (num && num > -1000 && num < 1000) 9399 || $test.call(/e/, str) 9400 ) { 9401 return str; 9402 } 9403 var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; 9404 if (typeof num === 'number') { 9405 var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) 9406 if (int !== num) { 9407 var intStr = String(int); 9408 var dec = $slice.call(str, intStr.length + 1); 9409 return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); 9410 } 9411 } 9412 return $replace.call(str, sepRegex, '$&_'); 9413} 9414 9415var utilInspect = __webpack_require__(2634
vendor: 9,045 bytes, lines 9415-9647
9415); 9416var inspectCustom = utilInspect.custom; 9417var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; 9418 9419var quotes = { 9420 __proto__: null, 9421 'double': '"', 9422 single: "'" 9423}; 9424var quoteREs = { 9425 __proto__: null, 9426 'double': /(["\\])/g, 9427 single: /(['\\])/g 9428}; 9429 9430module.exports = function inspect_(obj, options, depth, seen) { 9431 var opts = options || {}; 9432 9433 if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { 9434 throw new TypeError('option "quoteStyle" must be "single" or "double"'); 9435 } 9436 if ( 9437 has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' 9438 ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity 9439 : opts.maxStringLength !== null 9440 ) 9441 ) { 9442 throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); 9443 } 9444 var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; 9445 if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { 9446 throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); 9447 } 9448 9449 if ( 9450 has(opts, 'indent') 9451 && opts.indent !== null 9452 && opts.indent !== '\t' 9453 && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) 9454 ) { 9455 throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); 9456 } 9457 if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { 9458 throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); 9459 } 9460 var numericSeparator = opts.numericSeparator; 9461 9462 if (typeof obj === 'undefined') { 9463 return 'undefined'; 9464 } 9465 if (obj === null) { 9466 return 'null'; 9467 } 9468 if (typeof obj === 'boolean') { 9469 return obj ? 'true' : 'false'; 9470 } 9471 9472 if (typeof obj === 'string') { 9473 return inspectString(obj, opts); 9474 } 9475 if (typeof obj === 'number') { 9476 if (obj === 0) { 9477 return Infinity / obj > 0 ? '0' : '-0'; 9478 } 9479 var str = String(obj); 9480 return numericSeparator ? addNumericSeparator(obj, str) : str; 9481 } 9482 if (typeof obj === 'bigint') { 9483 var bigIntStr = String(obj) + 'n'; 9484 return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; 9485 } 9486 9487 var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; 9488 if (typeof depth === 'undefined') { depth = 0; } 9489 if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { 9490 return isArray(obj) ? '[Array]' : '[Object]'; 9491 } 9492 9493 var indent = getIndent(opts, depth); 9494 9495 if (typeof seen === 'undefined') { 9496 seen = []; 9497 } else if (indexOf(seen, obj) >= 0) { 9498 return '[Circular]'; 9499 } 9500 9501 function inspect(value, from, noIndent) { 9502 if (from) { 9503 seen = $arrSlice.call(seen); 9504 seen.push(from); 9505 } 9506 if (noIndent) { 9507 var newOpts = { 9508 depth: opts.depth 9509 }; 9510 if (has(opts, 'quoteStyle')) { 9511 newOpts.quoteStyle = opts.quoteStyle; 9512 } 9513 return inspect_(value, newOpts, depth + 1, seen); 9514 } 9515 return inspect_(value, opts, depth + 1, seen); 9516 } 9517 9518 if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable 9519 var name = nameOf(obj); 9520 var keys = arrObjKeys(obj, inspect); 9521 return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); 9522 } 9523 if (isSymbol(obj)) { 9524 var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); 9525 return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; 9526 } 9527 if (isElement(obj)) { 9528 var s = '<' + $toLowerCase.call(String(obj.nodeName)); 9529 var attrs = obj.attributes || []; 9530 for (var i = 0; i < attrs.length; i++) { 9531 s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); 9532 } 9533 s += '>'; 9534 if (obj.childNodes && obj.childNodes.length) { s += '...'; } 9535 s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>'; 9536 return s; 9537 } 9538 if (isArray(obj)) { 9539 if (obj.length === 0) { return '[]'; } 9540 var xs = arrObjKeys(obj, inspect); 9541 if (indent && !singleLineValues(xs)) { 9542 return '[' + indentedJoin(xs, indent) + ']'; 9543 } 9544 return '[ ' + $join.call(xs, ', ') + ' ]'; 9545 } 9546 if (isError(obj)) { 9547 var parts = arrObjKeys(obj, inspect); 9548 if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { 9549 return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; 9550 } 9551 if (parts.length === 0) { return '[' + String(obj) + ']'; } 9552 return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; 9553 } 9554 if (typeof obj === 'object' && customInspect) { 9555 if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { 9556 return utilInspect(obj, { depth: maxDepth - depth }); 9557 } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { 9558 return obj.inspect(); 9559 } 9560 } 9561 if (isMap(obj)) { 9562 var mapParts = []; 9563 if (mapForEach) { 9564 mapForEach.call(obj, function (value, key) { 9565 mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); 9566 }); 9567 } 9568 return collectionOf('Map', mapSize.call(obj), mapParts, indent); 9569 } 9570 if (isSet(obj)) { 9571 var setParts = []; 9572 if (setForEach) { 9573 setForEach.call(obj, function (value) { 9574 setParts.push(inspect(value, obj)); 9575 }); 9576 } 9577 return collectionOf('Set', setSize.call(obj), setParts, indent); 9578 } 9579 if (isWeakMap(obj)) { 9580 return weakCollectionOf('WeakMap'); 9581 } 9582 if (isWeakSet(obj)) { 9583 return weakCollectionOf('WeakSet'); 9584 } 9585 if (isWeakRef(obj)) { 9586 return weakCollectionOf('WeakRef'); 9587 } 9588 if (isNumber(obj)) { 9589 return markBoxed(inspect(Number(obj))); 9590 } 9591 if (isBigInt(obj)) { 9592 return markBoxed(inspect(bigIntValueOf.call(obj))); 9593 } 9594 if (isBoolean(obj)) { 9595 return markBoxed(booleanValueOf.call(obj)); 9596 } 9597 if (isString(obj)) { 9598 return markBoxed(inspect(String(obj))); 9599 } 9600 // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other 9601 /* eslint-env browser */ 9602 if (typeof window !== 'undefined' && obj === window) { 9603 return '{ [object Window] }'; 9604 } 9605 if ( 9606 (typeof globalThis !== 'undefined' && obj === globalThis) 9607 || (typeof __webpack_require__.g !== 'undefined' && obj === __webpack_require__.g) 9608 ) { 9609 return '{ [object globalThis] }'; 9610 } 9611 if (!isDate(obj) && !isRegExp(obj)) { 9612 var ys = arrObjKeys(obj, inspect); 9613 var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; 9614 var protoTag = obj instanceof Object ? '' : 'null prototype'; 9615 var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; 9616 var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; 9617 var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); 9618 if (ys.length === 0) { return tag + '{}'; } 9619 if (indent) { 9620 return tag + '{' + indentedJoin(ys, indent) + '}'; 9621 } 9622 return tag + '{ ' + $join.call(ys, ', ') + ' }'; 9623 } 9624 return String(obj); 9625}; 9626 9627function wrapQuotes(s, defaultStyle, opts) { 9628 var style = opts.quoteStyle || defaultStyle; 9629 var quoteChar = quotes[style]; 9630 return quoteChar + s + quoteChar; 9631} 9632 9633function quote(s) { 9634 return $replace.call(String(s), /"/g, '"'); 9635} 9636 9637function canTrustToString(obj) { 9638 return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); 9639} 9640function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } 9641function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } 9642function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } 9643function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } 9644function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } 9645function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } 9646function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } 9647
vendor: 6,763 bytes, lines 9648-9896
9648// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives 9649function isSymbol(obj) { 9650 if (hasShammedSymbols) { 9651 return obj && typeof obj === 'object' && obj instanceof Symbol; 9652 } 9653 if (typeof obj === 'symbol') { 9654 return true; 9655 } 9656 if (!obj || typeof obj !== 'object' || !symToString) { 9657 return false; 9658 } 9659 try { 9660 symToString.call(obj); 9661 return true; 9662 } catch (e) {} 9663 return false; 9664} 9665 9666function isBigInt(obj) { 9667 if (!obj || typeof obj !== 'object' || !bigIntValueOf) { 9668 return false; 9669 } 9670 try { 9671 bigIntValueOf.call(obj); 9672 return true; 9673 } catch (e) {} 9674 return false; 9675} 9676 9677var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; 9678function has(obj, key) { 9679 return hasOwn.call(obj, key); 9680} 9681 9682function toStr(obj) { 9683 return objectToString.call(obj); 9684} 9685 9686function nameOf(f) { 9687 if (f.name) { return f.name; } 9688 var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); 9689 if (m) { return m[1]; } 9690 return null; 9691} 9692 9693function indexOf(xs, x) { 9694 if (xs.indexOf) { return xs.indexOf(x); } 9695 for (var i = 0, l = xs.length; i < l; i++) { 9696 if (xs[i] === x) { return i; } 9697 } 9698 return -1; 9699} 9700 9701function isMap(x) { 9702 if (!mapSize || !x || typeof x !== 'object') { 9703 return false; 9704 } 9705 try { 9706 mapSize.call(x); 9707 try { 9708 setSize.call(x); 9709 } catch (s) { 9710 return true; 9711 } 9712 return x instanceof Map; // core-js workaround, pre-v2.5.0 9713 } catch (e) {} 9714 return false; 9715} 9716 9717function isWeakMap(x) { 9718 if (!weakMapHas || !x || typeof x !== 'object') { 9719 return false; 9720 } 9721 try { 9722 weakMapHas.call(x, weakMapHas); 9723 try { 9724 weakSetHas.call(x, weakSetHas); 9725 } catch (s) { 9726 return true; 9727 } 9728 return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 9729 } catch (e) {} 9730 return false; 9731} 9732 9733function isWeakRef(x) { 9734 if (!weakRefDeref || !x || typeof x !== 'object') { 9735 return false; 9736 } 9737 try { 9738 weakRefDeref.call(x); 9739 return true; 9740 } catch (e) {} 9741 return false; 9742} 9743 9744function isSet(x) { 9745 if (!setSize || !x || typeof x !== 'object') { 9746 return false; 9747 } 9748 try { 9749 setSize.call(x); 9750 try { 9751 mapSize.call(x); 9752 } catch (m) { 9753 return true; 9754 } 9755 return x instanceof Set; // core-js workaround, pre-v2.5.0 9756 } catch (e) {} 9757 return false; 9758} 9759 9760function isWeakSet(x) { 9761 if (!weakSetHas || !x || typeof x !== 'object') { 9762 return false; 9763 } 9764 try { 9765 weakSetHas.call(x, weakSetHas); 9766 try { 9767 weakMapHas.call(x, weakMapHas); 9768 } catch (s) { 9769 return true; 9770 } 9771 return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 9772 } catch (e) {} 9773 return false; 9774} 9775 9776function isElement(x) { 9777 if (!x || typeof x !== 'object') { return false; } 9778 if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { 9779 return true; 9780 } 9781 return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; 9782} 9783 9784function inspectString(str, opts) { 9785 if (str.length > opts.maxStringLength) { 9786 var remaining = str.length - opts.maxStringLength; 9787 var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); 9788 return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; 9789 } 9790 var quoteRE = quoteREs[opts.quoteStyle || 'single']; 9791 quoteRE.lastIndex = 0; 9792 // eslint-disable-next-line no-control-regex 9793 var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); 9794 return wrapQuotes(s, 'single', opts); 9795} 9796 9797function lowbyte(c) { 9798 var n = c.charCodeAt(0); 9799 var x = { 9800 8: 'b', 9801 9: 't', 9802 10: 'n', 9803 12: 'f', 9804 13: 'r' 9805 }[n]; 9806 if (x) { return '\\' + x; } 9807 return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); 9808} 9809 9810function markBoxed(str) { 9811 return 'Object(' + str + ')'; 9812} 9813 9814function weakCollectionOf(type) { 9815 return type + ' { ? }'; 9816} 9817 9818function collectionOf(type, size, entries, indent) { 9819 var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); 9820 return type + ' (' + size + ') {' + joinedEntries + '}'; 9821} 9822 9823function singleLineValues(xs) { 9824 for (var i = 0; i < xs.length; i++) { 9825 if (indexOf(xs[i], '\n') >= 0) { 9826 return false; 9827 } 9828 } 9829 return true; 9830} 9831 9832function getIndent(opts, depth) { 9833 var baseIndent; 9834 if (opts.indent === '\t') { 9835 baseIndent = '\t'; 9836 } else if (typeof opts.indent === 'number' && opts.indent > 0) { 9837 baseIndent = $join.call(Array(opts.indent + 1), ' '); 9838 } else { 9839 return null; 9840 } 9841 return { 9842 base: baseIndent, 9843 prev: $join.call(Array(depth + 1), baseIndent) 9844 }; 9845} 9846 9847function indentedJoin(xs, indent) { 9848 if (xs.length === 0) { return ''; } 9849 var lineJoiner = '\n' + indent.prev + indent.base; 9850 return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; 9851} 9852 9853function arrObjKeys(obj, inspect) { 9854 var isArr = isArray(obj); 9855 var xs = []; 9856 if (isArr) { 9857 xs.length = obj.length; 9858 for (var i = 0; i < obj.length; i++) { 9859 xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; 9860 } 9861 } 9862 var syms = typeof gOPS === 'function' ? gOPS(obj) : []; 9863 var symMap; 9864 if (hasShammedSymbols) { 9865 symMap = {}; 9866 for (var k = 0; k < syms.length; k++) { 9867 symMap['$' + syms[k]] = syms[k]; 9868 } 9869 } 9870 9871 for (var key in obj) { // eslint-disable-line no-restricted-syntax 9872 if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 9873 if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 9874 if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { 9875 // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section 9876 continue; // eslint-disable-line no-restricted-syntax, no-continue 9877 } else if ($test.call(/[^\w$]/, key)) { 9878 xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); 9879 } else { 9880 xs.push(key + ': ' + inspect(obj[key], obj)); 9881 } 9882 } 9883 if (typeof gOPS === 'function') { 9884 for (var j = 0; j < syms.length; j++) { 9885 if (isEnumerable.call(obj, syms[j])) { 9886 xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); 9887 } 9888 } 9889 } 9890 return xs; 9891} 9892 9893 9894/***/ }), 9895 9896/***/
vendor: 1,479 bytes, lines 9896-9957
98968968: 9897/***/ (function(module) { 9898 9899"use strict"; 9900 9901 9902/** @type {import('./floor')} */ 9903module.exports = Math.floor; 9904 9905 9906/***/ }), 9907 9908/***/ 9021: 9909/***/ (function(module, exports, __webpack_require__) { 9910 9911;(function (root, factory) { 9912 if (true) { 9913 // CommonJS 9914 module.exports = exports = factory(); 9915 } 9916 else // removed by dead control flow 9917{} 9918}(this, function () { 9919 9920 /*globals window, global, require*/ 9921 9922 /** 9923 * CryptoJS core components. 9924 */ 9925 var CryptoJS = CryptoJS || (function (Math, undefined) { 9926 9927 var crypto; 9928 9929 // Native crypto from window (Browser) 9930 if (typeof window !== 'undefined' && window.crypto) { 9931 crypto = window.crypto; 9932 } 9933 9934 // Native crypto in web worker (Browser) 9935 if (typeof self !== 'undefined' && self.crypto) { 9936 crypto = self.crypto; 9937 } 9938 9939 // Native crypto from worker 9940 if (typeof globalThis !== 'undefined' && globalThis.crypto) { 9941 crypto = globalThis.crypto; 9942 } 9943 9944 // Native (experimental IE 11) crypto from window (Browser) 9945 if (!crypto && typeof window !== 'undefined' && window.msCrypto) { 9946 crypto = window.msCrypto; 9947 } 9948 9949 // Native crypto from global (NodeJS) 9950 if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { 9951 crypto = __webpack_require__.g.crypto; 9952 } 9953 9954 // Native crypto import via require (NodeJS) 9955 if (!crypto && "function" === 'function') { 9956 try { 9957 crypto = __webpack_require__(477
vendor: 5,309 bytes, lines 9957-10143
9957); 9958 } catch (err) {} 9959 } 9960 9961 /* 9962 * Cryptographically secure pseudorandom number generator 9963 * 9964 * As Math.random() is cryptographically not safe to use 9965 */ 9966 var cryptoSecureRandomInt = function () { 9967 if (crypto) { 9968 // Use getRandomValues method (Browser) 9969 if (typeof crypto.getRandomValues === 'function') { 9970 try { 9971 return crypto.getRandomValues(new Uint32Array(1))[0]; 9972 } catch (err) {} 9973 } 9974 9975 // Use randomBytes method (NodeJS) 9976 if (typeof crypto.randomBytes === 'function') { 9977 try { 9978 return crypto.randomBytes(4).readInt32LE(); 9979 } catch (err) {} 9980 } 9981 } 9982 9983 throw new Error('Native crypto module could not be used to get secure random number.'); 9984 }; 9985 9986 /* 9987 * Local polyfill of Object.create 9988 9989 */ 9990 var create = Object.create || (function () { 9991 function F() {} 9992 9993 return function (obj) { 9994 var subtype; 9995 9996 F.prototype = obj; 9997 9998 subtype = new F(); 9999 10000 F.prototype = null; 10001 10002 return subtype; 10003 }; 10004 }()); 10005 10006 /** 10007 * CryptoJS namespace. 10008 */ 10009 var C = {}; 10010 10011 /** 10012 * Library namespace. 10013 */ 10014 var C_lib = C.lib = {}; 10015 10016 /** 10017 * Base object for prototypal inheritance. 10018 */ 10019 var Base = C_lib.Base = (function () { 10020 10021 10022 return { 10023 /** 10024 * Creates a new object that inherits from this object. 10025 * 10026 * @param {Object} overrides Properties to copy into the new object. 10027 * 10028 * @return {Object} The new object. 10029 * 10030 * @static 10031 * 10032 * @example 10033 * 10034 * var MyType = CryptoJS.lib.Base.extend({ 10035 * field: 'value', 10036 * 10037 * method: function () { 10038 * } 10039 * }); 10040 */ 10041 extend: function (overrides) { 10042 // Spawn 10043 var subtype = create(this); 10044 10045 // Augment 10046 if (overrides) { 10047 subtype.mixIn(overrides); 10048 } 10049 10050 // Create default initializer 10051 if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { 10052 subtype.init = function () { 10053 subtype.$super.init.apply(this, arguments); 10054 }; 10055 } 10056 10057 // Initializer's prototype is the subtype object 10058 subtype.init.prototype = subtype; 10059 10060 // Reference supertype 10061 subtype.$super = this; 10062 10063 return subtype; 10064 }, 10065 10066 /** 10067 * Extends this object and runs the init method. 10068 * Arguments to create() will be passed to init(). 10069 * 10070 * @return {Object} The new object. 10071 * 10072 * @static 10073 * 10074 * @example 10075 * 10076 * var instance = MyType.create(); 10077 */ 10078 create: function () { 10079 var instance = this.extend(); 10080 instance.init.apply(instance, arguments); 10081 10082 return instance; 10083 }, 10084 10085 /** 10086 * Initializes a newly created object. 10087 * Override this method to add some logic when your objects are created. 10088 * 10089 * @example 10090 * 10091 * var MyType = CryptoJS.lib.Base.extend({ 10092 * init: function () { 10093 * // ... 10094 * } 10095 * }); 10096 */ 10097 init: function () { 10098 }, 10099 10100 /** 10101 * Copies properties into this object. 10102 * 10103 * @param {Object} properties The properties to mix in. 10104 * 10105 * @example 10106 * 10107 * MyType.mixIn({ 10108 * field: 'value' 10109 * }); 10110 */ 10111 mixIn: function (properties) { 10112 for (var propertyName in properties) { 10113 if (properties.hasOwnProperty(propertyName)) { 10114 this[propertyName] = properties[propertyName]; 10115 } 10116 } 10117 10118 // IE won't copy toString using the loop above 10119 if (properties.hasOwnProperty('toString')) { 10120 this.toString = properties.toString; 10121 } 10122 }, 10123 10124 /** 10125 * Creates a copy of this object. 10126 * 10127 * @return {Object} The clone. 10128 * 10129 * @example 10130 * 10131 * var clone = instance.clone(); 10132 */ 10133 clone: function () { 10134 return this.init.prototype.extend(this); 10135 } 10136 }; 10137 }()); 10138 10139 /** 10140 * An array of 32-bit words. 10141 * 10142 * @property {Array} words The array of 32-bit words. 10143 * @property {number} sigBytes The number of significant bytes in this word array.
vendor: 4,591 bytes, lines 10144-10294
10144 */ 10145 var WordArray = C_lib.WordArray = Base.extend({ 10146 /** 10147 * Initializes a newly created word array. 10148 * 10149 * @param {Array} words (Optional) An array of 32-bit words. 10150 * @param {number} sigBytes (Optional) The number of significant bytes in the words. 10151 * 10152 * @example 10153 * 10154 * var wordArray = CryptoJS.lib.WordArray.create(); 10155 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); 10156 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); 10157 */ 10158 init: function (words, sigBytes) { 10159 words = this.words = words || []; 10160 10161 if (sigBytes != undefined) { 10162 this.sigBytes = sigBytes; 10163 } else { 10164 this.sigBytes = words.length * 4; 10165 } 10166 }, 10167 10168 /** 10169 * Converts this word array to a string. 10170 * 10171 * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex 10172 * 10173 * @return {string} The stringified word array. 10174 * 10175 * @example 10176 * 10177 * var string = wordArray + ''; 10178 * var string = wordArray.toString(); 10179 * var string = wordArray.toString(CryptoJS.enc.Utf8); 10180 */ 10181 toString: function (encoder) { 10182 return (encoder || Hex).stringify(this); 10183 }, 10184 10185 /** 10186 * Concatenates a word array to this word array. 10187 * 10188 * @param {WordArray} wordArray The word array to append. 10189 * 10190 * @return {WordArray} This word array. 10191 * 10192 * @example 10193 * 10194 * wordArray1.concat(wordArray2); 10195 */ 10196 concat: function (wordArray) { 10197 // Shortcuts 10198 var thisWords = this.words; 10199 var thatWords = wordArray.words; 10200 var thisSigBytes = this.sigBytes; 10201 var thatSigBytes = wordArray.sigBytes; 10202 10203 // Clamp excess bits 10204 this.clamp(); 10205 10206 // Concat 10207 if (thisSigBytes % 4) { 10208 // Copy one byte at a time 10209 for (var i = 0; i < thatSigBytes; i++) { 10210 var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 10211 thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); 10212 } 10213 } else { 10214 // Copy one word at a time 10215 for (var j = 0; j < thatSigBytes; j += 4) { 10216 thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; 10217 } 10218 } 10219 this.sigBytes += thatSigBytes; 10220 10221 // Chainable 10222 return this; 10223 }, 10224 10225 /** 10226 * Removes insignificant bits. 10227 * 10228 * @example 10229 * 10230 * wordArray.clamp(); 10231 */ 10232 clamp: function () { 10233 // Shortcuts 10234 var words = this.words; 10235 var sigBytes = this.sigBytes; 10236 10237 // Clamp 10238 words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); 10239 words.length = Math.ceil(sigBytes / 4); 10240 }, 10241 10242 /** 10243 * Creates a copy of this word array. 10244 * 10245 * @return {WordArray} The clone. 10246 * 10247 * @example 10248 * 10249 * var clone = wordArray.clone(); 10250 */ 10251 clone: function () { 10252 var clone = Base.clone.call(this); 10253 clone.words = this.words.slice(0); 10254 10255 return clone; 10256 }, 10257 10258 /** 10259 * Creates a word array filled with random bytes. 10260 * 10261 * @param {number} nBytes The number of random bytes to generate. 10262 * 10263 * @return {WordArray} The random word array. 10264 * 10265 * @static 10266 * 10267 * @example 10268 * 10269 * var wordArray = CryptoJS.lib.WordArray.random(16); 10270 */ 10271 random: function (nBytes) { 10272 var words = []; 10273 10274 for (var i = 0; i < nBytes; i += 4) { 10275 words.push(cryptoSecureRandomInt()); 10276 } 10277 10278 return new WordArray.init(words, nBytes); 10279 } 10280 }); 10281 10282 /** 10283 * Encoder namespace. 10284 */ 10285 var C_enc = C.enc = {}; 10286 10287 /** 10288 * Hex encoding strategy. 10289 */ 10290 var Hex = C_enc.Hex = { 10291 /** 10292 * Converts a word array to a hex string. 10293 * 10294 * @param {WordArray} wordArray The word array.
vendor: 8,564 bytes, lines 10295-10572
10295 * 10296 * @return {string} The hex string. 10297 * 10298 * @static 10299 * 10300 * @example 10301 * 10302 * var hexString = CryptoJS.enc.Hex.stringify(wordArray); 10303 */ 10304 stringify: function (wordArray) { 10305 // Shortcuts 10306 var words = wordArray.words; 10307 var sigBytes = wordArray.sigBytes; 10308 10309 // Convert 10310 var hexChars = []; 10311 for (var i = 0; i < sigBytes; i++) { 10312 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 10313 hexChars.push((bite >>> 4).toString(16)); 10314 hexChars.push((bite & 0x0f).toString(16)); 10315 } 10316 10317 return hexChars.join(''); 10318 }, 10319 10320 /** 10321 * Converts a hex string to a word array. 10322 * 10323 * @param {string} hexStr The hex string. 10324 * 10325 * @return {WordArray} The word array. 10326 * 10327 * @static 10328 * 10329 * @example 10330 * 10331 * var wordArray = CryptoJS.enc.Hex.parse(hexString); 10332 */ 10333 parse: function (hexStr) { 10334 // Shortcut 10335 var hexStrLength = hexStr.length; 10336 10337 // Convert 10338 var words = []; 10339 for (var i = 0; i < hexStrLength; i += 2) { 10340 words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); 10341 } 10342 10343 return new WordArray.init(words, hexStrLength / 2); 10344 } 10345 }; 10346 10347 /** 10348 * Latin1 encoding strategy. 10349 */ 10350 var Latin1 = C_enc.Latin1 = { 10351 /** 10352 * Converts a word array to a Latin1 string. 10353 * 10354 * @param {WordArray} wordArray The word array. 10355 * 10356 * @return {string} The Latin1 string. 10357 * 10358 * @static 10359 * 10360 * @example 10361 * 10362 * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); 10363 */ 10364 stringify: function (wordArray) { 10365 // Shortcuts 10366 var words = wordArray.words; 10367 var sigBytes = wordArray.sigBytes; 10368 10369 // Convert 10370 var latin1Chars = []; 10371 for (var i = 0; i < sigBytes; i++) { 10372 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 10373 latin1Chars.push(String.fromCharCode(bite)); 10374 } 10375 10376 return latin1Chars.join(''); 10377 }, 10378 10379 /** 10380 * Converts a Latin1 string to a word array. 10381 * 10382 * @param {string} latin1Str The Latin1 string. 10383 * 10384 * @return {WordArray} The word array. 10385 * 10386 * @static 10387 * 10388 * @example 10389 * 10390 * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); 10391 */ 10392 parse: function (latin1Str) { 10393 // Shortcut 10394 var latin1StrLength = latin1Str.length; 10395 10396 // Convert 10397 var words = []; 10398 for (var i = 0; i < latin1StrLength; i++) { 10399 words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); 10400 } 10401 10402 return new WordArray.init(words, latin1StrLength); 10403 } 10404 }; 10405 10406 /** 10407 * UTF-8 encoding strategy. 10408 */ 10409 var Utf8 = C_enc.Utf8 = { 10410 /** 10411 * Converts a word array to a UTF-8 string. 10412 * 10413 * @param {WordArray} wordArray The word array. 10414 * 10415 * @return {string} The UTF-8 string. 10416 * 10417 * @static 10418 * 10419 * @example 10420 * 10421 * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); 10422 */ 10423 stringify: function (wordArray) { 10424 try { 10425 return decodeURIComponent(escape(Latin1.stringify(wordArray))); 10426 } catch (e) { 10427 throw new Error('Malformed UTF-8 data'); 10428 } 10429 }, 10430 10431 /** 10432 * Converts a UTF-8 string to a word array. 10433 * 10434 * @param {string} utf8Str The UTF-8 string. 10435 * 10436 * @return {WordArray} The word array. 10437 * 10438 * @static 10439 * 10440 * @example 10441 * 10442 * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); 10443 */ 10444 parse: function (utf8Str) { 10445 return Latin1.parse(unescape(encodeURIComponent(utf8Str))); 10446 } 10447 }; 10448 10449 /** 10450 * Abstract buffered block algorithm template. 10451 * 10452 * The property blockSize must be implemented in a concrete subtype. 10453 * 10454 * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 10455 */ 10456 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ 10457 /** 10458 * Resets this block algorithm's data buffer to its initial state. 10459 * 10460 * @example 10461 * 10462 * bufferedBlockAlgorithm.reset(); 10463 */ 10464 reset: function () { 10465 // Initial values 10466 this._data = new WordArray.init(); 10467 this._nDataBytes = 0; 10468 }, 10469 10470 /** 10471 * Adds new data to this block algorithm's buffer. 10472 * 10473 * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. 10474 * 10475 * @example 10476 * 10477 * bufferedBlockAlgorithm._append('data'); 10478 * bufferedBlockAlgorithm._append(wordArray); 10479 */ 10480 _append: function (data) { 10481 // Convert string to WordArray, else assume WordArray already 10482 if (typeof data == 'string') { 10483 data = Utf8.parse(data); 10484 } 10485 10486 // Append 10487 this._data.concat(data); 10488 this._nDataBytes += data.sigBytes; 10489 }, 10490 10491 /** 10492 * Processes available data blocks. 10493 * 10494 * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. 10495 * 10496 * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. 10497 * 10498 * @return {WordArray} The processed data. 10499 * 10500 * @example 10501 * 10502 * var processedData = bufferedBlockAlgorithm._process(); 10503 * var processedData = bufferedBlockAlgorithm._process(!!'flush'); 10504 */ 10505 _process: function (doFlush) { 10506 var processedWords; 10507 10508 // Shortcuts 10509 var data = this._data; 10510 var dataWords = data.words; 10511 var dataSigBytes = data.sigBytes; 10512 var blockSize = this.blockSize; 10513 var blockSizeBytes = blockSize * 4; 10514 10515 // Count blocks ready 10516 var nBlocksReady = dataSigBytes / blockSizeBytes; 10517 if (doFlush) { 10518 // Round up to include partial blocks 10519 nBlocksReady = Math.ceil(nBlocksReady); 10520 } else { 10521 // Round down to include only full blocks, 10522 // less the number of blocks that must remain in the buffer 10523 nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); 10524 } 10525 10526 // Count words ready 10527 var nWordsReady = nBlocksReady * blockSize; 10528 10529 // Count bytes ready 10530 var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); 10531 10532 // Process blocks 10533 if (nWordsReady) { 10534 for (var offset = 0; offset < nWordsReady; offset += blockSize) { 10535 // Perform concrete-algorithm logic 10536 this._doProcessBlock(dataWords, offset); 10537 } 10538 10539 // Remove processed words 10540 processedWords = dataWords.splice(0, nWordsReady); 10541 data.sigBytes -= nBytesReady; 10542 } 10543 10544 // Return processed words 10545 return new WordArray.init(processedWords, nBytesReady); 10546 }, 10547 10548 /** 10549 * Creates a copy of this object. 10550 * 10551 * @return {Object} The clone. 10552 * 10553 * @example 10554 * 10555 * var clone = bufferedBlockAlgorithm.clone(); 10556 */ 10557 clone: function () { 10558 var clone = Base.clone.call(this); 10559 clone._data = this._data.clone(); 10560 10561 return clone; 10562 }, 10563 10564 _minBufferSize: 0 10565 }); 10566 10567 /** 10568 * Abstract hasher template. 10569 * 10570 * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) 10571 */ 10572
vendor: 11,993 bytes, lines 10572-11037
10572var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ 10573 /** 10574 * Configuration options. 10575 */ 10576 cfg: Base.extend(), 10577 10578 /** 10579 * Initializes a newly created hasher. 10580 * 10581 * @param {Object} cfg (Optional) The configuration options to use for this hash computation. 10582 * 10583 * @example 10584 * 10585 * var hasher = CryptoJS.algo.SHA256.create(); 10586 */ 10587 init: function (cfg) { 10588 // Apply config defaults 10589 this.cfg = this.cfg.extend(cfg); 10590 10591 // Set initial values 10592 this.reset(); 10593 }, 10594 10595 /** 10596 * Resets this hasher to its initial state. 10597 * 10598 * @example 10599 * 10600 * hasher.reset(); 10601 */ 10602 reset: function () { 10603 // Reset data buffer 10604 BufferedBlockAlgorithm.reset.call(this); 10605 10606 // Perform concrete-hasher logic 10607 this._doReset(); 10608 }, 10609 10610 /** 10611 * Updates this hasher with a message. 10612 * 10613 * @param {WordArray|string} messageUpdate The message to append. 10614 * 10615 * @return {Hasher} This hasher. 10616 * 10617 * @example 10618 * 10619 * hasher.update('message'); 10620 * hasher.update(wordArray); 10621 */ 10622 update: function (messageUpdate) { 10623 // Append 10624 this._append(messageUpdate); 10625 10626 // Update the hash 10627 this._process(); 10628 10629 // Chainable 10630 return this; 10631 }, 10632 10633 /** 10634 * Finalizes the hash computation. 10635 * Note that the finalize operation is effectively a destructive, read-once operation. 10636 * 10637 * @param {WordArray|string} messageUpdate (Optional) A final message update. 10638 * 10639 * @return {WordArray} The hash. 10640 * 10641 * @example 10642 * 10643 * var hash = hasher.finalize(); 10644 * var hash = hasher.finalize('message'); 10645 * var hash = hasher.finalize(wordArray); 10646 */ 10647 finalize: function (messageUpdate) { 10648 // Final message update 10649 if (messageUpdate) { 10650 this._append(messageUpdate); 10651 } 10652 10653 // Perform concrete-hasher logic 10654 var hash = this._doFinalize(); 10655 10656 return hash; 10657 }, 10658 10659 blockSize: 512/32, 10660 10661 /** 10662 * Creates a shortcut function to a hasher's object interface. 10663 * 10664 * @param {Hasher} hasher The hasher to create a helper for. 10665 * 10666 * @return {Function} The shortcut function. 10667 * 10668 * @static 10669 * 10670 * @example 10671 * 10672 * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); 10673 */ 10674 _createHelper: function (hasher) { 10675 return function (message, cfg) { 10676 return new hasher.init(cfg).finalize(message); 10677 }; 10678 }, 10679 10680 /** 10681 * Creates a shortcut function to the HMAC's object interface. 10682 * 10683 * @param {Hasher} hasher The hasher to use in this HMAC helper. 10684 * 10685 * @return {Function} The shortcut function. 10686 * 10687 * @static 10688 * 10689 * @example 10690 * 10691 * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); 10692 */ 10693 _createHmacHelper: function (hasher) { 10694 return function (message, key) { 10695 return new C_algo.HMAC.init(hasher, key).finalize(message); 10696 }; 10697 } 10698 }); 10699 10700 /** 10701 * Algorithm namespace. 10702 */ 10703 var C_algo = C.algo = {}; 10704 10705 return C; 10706 }(Math)); 10707 10708 10709 return CryptoJS; 10710 10711})); 10712 10713/***/ }), 10714 10715/***/ 9290: 10716/***/ (function(module) { 10717 10718"use strict"; 10719 10720 10721/** @type {import('./range')} */ 10722module.exports = RangeError; 10723 10724 10725/***/ }), 10726 10727/***/ 9353: 10728/***/ (function(module) { 10729 10730"use strict"; 10731 10732 10733/* eslint no-invalid-this: 1 */ 10734 10735var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; 10736var toStr = Object.prototype.toString; 10737var max = Math.max; 10738var funcType = '[object Function]'; 10739 10740var concatty = function concatty(a, b) { 10741 var arr = []; 10742 10743 for (var i = 0; i < a.length; i += 1) { 10744 arr[i] = a[i]; 10745 } 10746 for (var j = 0; j < b.length; j += 1) { 10747 arr[j + a.length] = b[j]; 10748 } 10749 10750 return arr; 10751}; 10752 10753var slicy = function slicy(arrLike, offset) { 10754 var arr = []; 10755 for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { 10756 arr[j] = arrLike[i]; 10757 } 10758 return arr; 10759}; 10760 10761var joiny = function (arr, joiner) { 10762 var str = ''; 10763 for (var i = 0; i < arr.length; i += 1) { 10764 str += arr[i]; 10765 if (i + 1 < arr.length) { 10766 str += joiner; 10767 } 10768 } 10769 return str; 10770}; 10771 10772module.exports = function bind(that) { 10773 var target = this; 10774 if (typeof target !== 'function' || toStr.apply(target) !== funcType) { 10775 throw new TypeError(ERROR_MESSAGE + target); 10776 } 10777 var args = slicy(arguments, 1); 10778 10779 var bound; 10780 var binder = function () { 10781 if (this instanceof bound) { 10782 var result = target.apply( 10783 this, 10784 concatty(args, arguments) 10785 ); 10786 if (Object(result) === result) { 10787 return result; 10788 } 10789 return this; 10790 } 10791 return target.apply( 10792 that, 10793 concatty(args, arguments) 10794 ); 10795 10796 }; 10797 10798 var boundLength = max(0, target.length - args.length); 10799 var boundArgs = []; 10800 for (var i = 0; i < boundLength; i++) { 10801 boundArgs[i] = '$' + i; 10802 } 10803 10804 bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); 10805 10806 if (target.prototype) { 10807 var Empty = function Empty() {}; 10808 Empty.prototype = target.prototype; 10809 bound.prototype = new Empty(); 10810 Empty.prototype = null; 10811 } 10812 10813 return bound; 10814}; 10815 10816 10817/***/ }), 10818 10819/***/ 9383: 10820/***/ (function(module) { 10821 10822"use strict"; 10823 10824 10825/** @type {import('.')} */ 10826module.exports = Error; 10827 10828 10829/***/ }), 10830 10831/***/ 9506: 10832/***/ (function(module, exports, __webpack_require__) { 10833 10834;(function (root, factory, undef) { 10835 if (true) { 10836 // CommonJS 10837 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(5471), __webpack_require__(1025)); 10838 } 10839 else // removed by dead control flow 10840{} 10841}(this, function (CryptoJS) { 10842 10843 (function () { 10844 // Shortcuts 10845 var C = CryptoJS; 10846 var C_lib = C.lib; 10847 var Base = C_lib.Base; 10848 var WordArray = C_lib.WordArray; 10849 var C_algo = C.algo; 10850 var MD5 = C_algo.MD5; 10851 10852 /** 10853 * This key derivation function is meant to conform with EVP_BytesToKey. 10854 * www.openssl.org/docs/crypto/EVP_BytesToKey.html 10855 */ 10856 var EvpKDF = C_algo.EvpKDF = Base.extend({ 10857 /** 10858 * Configuration options. 10859 * 10860 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) 10861 * @property {Hasher} hasher The hash algorithm to use. Default: MD5 10862 * @property {number} iterations The number of iterations to perform. Default: 1 10863 */ 10864 cfg: Base.extend({ 10865 keySize: 128/32, 10866 hasher: MD5, 10867 iterations: 1 10868 }), 10869 10870 /** 10871 * Initializes a newly created key derivation function. 10872 * 10873 * @param {Object} cfg (Optional) The configuration options to use for the derivation. 10874 * 10875 * @example 10876 * 10877 * var kdf = CryptoJS.algo.EvpKDF.create(); 10878 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); 10879 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); 10880 */ 10881 init: function (cfg) { 10882 this.cfg = this.cfg.extend(cfg); 10883 }, 10884 10885 /** 10886 * Derives a key from a password. 10887 * 10888 * @param {WordArray|string} password The password. 10889 * @param {WordArray|string} salt A salt. 10890 * 10891 * @return {WordArray} The derived key. 10892 * 10893 * @example 10894 * 10895 * var key = kdf.compute(password, salt); 10896 */ 10897 compute: function (password, salt) { 10898 var block; 10899 10900 // Shortcut 10901 var cfg = this.cfg; 10902 10903 // Init hasher 10904 var hasher = cfg.hasher.create(); 10905 10906 // Initial values 10907 var derivedKey = WordArray.create(); 10908 10909 // Shortcuts 10910 var derivedKeyWords = derivedKey.words; 10911 var keySize = cfg.keySize; 10912 var iterations = cfg.iterations; 10913 10914 // Generate key 10915 while (derivedKeyWords.length < keySize) { 10916 if (block) { 10917 hasher.update(block); 10918 } 10919 block = hasher.update(password).finalize(salt); 10920 hasher.reset(); 10921 10922 // Iterations 10923 for (var i = 1; i < iterations; i++) { 10924 block = hasher.finalize(block); 10925 hasher.reset(); 10926 } 10927 10928 derivedKey.concat(block); 10929 } 10930 derivedKey.sigBytes = keySize * 4; 10931 10932 return derivedKey; 10933 } 10934 }); 10935 10936 /** 10937 * Derives a key from a password. 10938 * 10939 * @param {WordArray|string} password The password. 10940 * @param {WordArray|string} salt A salt. 10941 * @param {Object} cfg (Optional) The configuration options to use for this computation. 10942 * 10943 * @return {WordArray} The derived key. 10944 * 10945 * @static 10946 * 10947 * @example 10948 * 10949 * var key = CryptoJS.EvpKDF(password, salt); 10950 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); 10951 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); 10952 */ 10953 C.EvpKDF = function (password, salt, cfg) { 10954 return EvpKDF.create(cfg).compute(password, salt); 10955 }; 10956 }()); 10957 10958 10959 return CryptoJS.EvpKDF; 10960 10961})); 10962 10963/***/ }), 10964 10965/***/ 9538: 10966/***/ (function(module) { 10967 10968"use strict"; 10969 10970 10971/** @type {import('./ref')} */ 10972module.exports = ReferenceError; 10973 10974 10975/***/ }), 10976 10977/***/ 9557: 10978/***/ (function(module, exports, __webpack_require__) { 10979 10980;(function (root, factory, undef) { 10981 if (true) { 10982 // CommonJS 10983 module.exports = exports = factory(__webpack_require__(9021), __webpack_require__(3240), __webpack_require__(1380)); 10984 } 10985 else // removed by dead control flow 10986{} 10987}(this, function (CryptoJS) { 10988 10989 (function () { 10990 // Shortcuts 10991 var C = CryptoJS; 10992 var C_x64 = C.x64; 10993 var X64Word = C_x64.Word; 10994 var X64WordArray = C_x64.WordArray; 10995 var C_algo = C.algo; 10996 var SHA512 = C_algo.SHA512; 10997 10998 /** 10999 * SHA-384 hash algorithm. 11000 */ 11001 var SHA384 = C_algo.SHA384 = SHA512.extend({ 11002 _doReset: function () { 11003 this._hash = new X64WordArray.init([ 11004 new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), 11005 new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), 11006 new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), 11007 new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) 11008 ]); 11009 }, 11010 11011 _doFinalize: function () { 11012 var hash = SHA512._doFinalize.call(this); 11013 11014 hash.sigBytes -= 16; 11015 11016 return hash; 11017 } 11018 }); 11019 11020 /** 11021 * Shortcut function to the hasher's object interface. 11022 * 11023 * @param {WordArray|string} message The message to hash. 11024 * 11025 * @return {WordArray} The hash. 11026 * 11027 * @static 11028 * 11029 * @example 11030 * 11031 * var hash = CryptoJS.SHA384('message'); 11032 * var hash = CryptoJS.SHA384(wordArray); 11033 */ 11034 C.SHA384 = SHA512._createHelper(SHA384); 11035 11036 /** 11037 * Shortcut function to the
11037HMAC's object interface. 11038 * 11039 * @param {WordArray|string} message The message to hash. 11040 * @param {WordArray|string} key The secret key. 11041 * 11042 * @return {WordArray} The HMAC. 11043 * 11044 * @static 11045 * 11046 * @example 11047 * 11048 * var hmac = CryptoJS.HmacSHA384(message, key); 11049 */ 11050 C.HmacSHA384 = SHA512._createHmacHelper(SHA384); 11051 }()); 11052 11053 11054 return CryptoJS.SHA384; 11055 11056})); 11057 11058/***/ }), 11059 11060/***/ 9612: 11061/***/ (function(module) { 11062 11063"use strict"; 11064 11065 11066/** @type {import('.')} */ 11067module.exports = Object; 11068 11069 11070/***/ }), 11071 11072/***/ 9675: 11073/***/ (function(module) { 11074 11075"use strict"; 11076 11077 11078/** @type {import('./type')} */ 11079module.exports = TypeError; 11080 11081 11082/***/ }), 11083 11084/***/ 9957: 11085/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 11086 11087"use strict"; 11088 11089 11090var call = Function.prototype.call; 11091var $hasOwn = Object.prototype.hasOwnProperty; 11092var bind = __webpack_require__(6743); 11093 11094/** @type {import('.')} */ 11095module.exports = bind.call(call, $hasOwn); 11096 11097 11098/***/ }) 11099 11100/******/ }); 11101/************************************************************************/ 11102/******/ // The module cache 11103/******/ var __webpack_module_cache__ = {}; 11104/******/ 11105/******/ // The require function 11106/******/ function __webpack_require__(moduleId) { 11107/******/ // Check if module is in cache 11108/******/ var cachedModule = __webpack_module_cache__[moduleId]; 11109/******/ if (cachedModule !== undefined) { 11110/******/ return cachedModule.exports; 11111/******/ } 11112/******/ // Create a new module (and put it into the cache) 11113/******/ var module = __webpack_module_cache__[moduleId] = { 11114/******/ // no module.id needed 11115/******/ // no module.loaded needed 11116/******/ exports: {} 11117/******/ }; 11118/******/ 11119/******/ // Execute the module function 11120/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 11121/******/ 11122/******/ // Return the exports of the module 11123/******/ return module.exports; 11124/******/ } 11125/******/ 11126/************************************************************************/ 11127/******/ /* webpack/runtime/compat get default export */ 11128/******/ !function() { 11129/******/ // getDefaultExport function for compatibility with non-harmony modules 11130/******/ __webpack_require__.n = function(module) { 11131/******/ var getter = module && module.__esModule ? 11132/******/ function() { return module['default']; } : 11133/******/ function() { return module; }; 11134/******/ __webpack_require__.d(getter, { a: getter }); 11135/******/ return getter; 11136/******/ }; 11137/******/ }(); 11138/******/ 11139/******/ /* webpack/runtime/define property getters */ 11140/******/ !function() { 11141/******/ // define getter functions for harmony exports 11142/******/ __webpack_require__.d = function(exports, definition) { 11143/******/ for(var key in definition) { 11144/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 11145/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 11146/******/ } 11147/******/ } 11148/******/ }; 11149/******/ }(); 11150/******/ 11151/******/ /* webpack/runtime/global */ 11152/******/ !function() { 11153/******/ __webpack_require__.g = (function() { 11154/******/ if (typeof globalThis === 'object') return globalThis; 11155/******/ try { 11156/******/ return this || new Function('return this')(); 11157/******/ } catch (e) { 11158/******/ if (typeof window === 'object') return window; 11159/******/ } 11160/******/ })(); 11161/******/ }(); 11162/******/ 11163/******/ /* webpack/runtime/hasOwnProperty shorthand */ 11164/******/ !function() { 11165/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 11166/******/ }(); 11167/******/ 11168/******/ /* webpack/runtime/make namespace object */ 11169/******/ !function() { 11170/******/ // define __esModule on exports 11171/******/ __webpack_require__.r = function(exports) { 11172/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 11173/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 11174/******/ } 11175/******/ Object.defineProperty(exports, '__esModule', { value: true }); 11176/******/ }; 11177/******/ }(); 11178/******/ 11179/******/ /* webpack/runtime/nonce */ 11180/******/ !function() { 11181/******/ __webpack_require__.nc = undefined; 11182/******/ }(); 11183/******/ 11184/************************************************************************/ 11185var __webpack_exports__ = {}; 11186// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 11187!function() { 11188"use strict";
vendor: 5,065 bytes, lines 11189-11366
11189// ESM COMPAT FLAG 11190__webpack_require__.r(__webpack_exports__); 11191 11192// EXPORTS 11193__webpack_require__.d(__webpack_exports__, { 11194 almScroll: function() { return /* binding */ almScroll; }, 11195 analytics: function() { return /* binding */ analytics; }, 11196 click: function() { return /* binding */ click; }, 11197 filter: function() { return /* binding */ filter; }, 11198 getOffset: function() { return /* binding */ getOffset; }, 11199 getPostCount: function() { return /* binding */ ajax_load_more_getPostCount; }, 11200 getTotalPosts: function() { return /* binding */ getTotalPosts; }, 11201 getTotalRemaining: function() { return /* binding */ getTotalRemaining; }, 11202 reset: function() { return /* binding */ ajax_load_more_reset; }, 11203 start: function() { return /* binding */ start; }, 11204 wpblock: function() { return /* binding */ wpblock; } 11205}); 11206 11207// NAMESPACE OBJECT: ./node_modules/axios/lib/platform/common/utils.js 11208var common_utils_namespaceObject = {}; 11209__webpack_require__.r(common_utils_namespaceObject); 11210__webpack_require__.d(common_utils_namespaceObject, { 11211 hasBrowserEnv: function() { return hasBrowserEnv; }, 11212 hasStandardBrowserEnv: function() { return hasStandardBrowserEnv; }, 11213 hasStandardBrowserWebWorkerEnv: function() { return hasStandardBrowserWebWorkerEnv; }, 11214 navigator: function() { return _navigator; }, 11215 origin: function() { return origin; } 11216}); 11217 11218;// ./node_modules/axios/lib/helpers/bind.js 11219 11220 11221/** 11222 * Create a bound version of a function with a specified `this` context 11223 * 11224 * @param {Function} fn - The function to bind 11225 * @param {*} thisArg - The value to be passed as the `this` parameter 11226 * @returns {Function} A new function that will call the original function with the specified `this` context 11227 */ 11228function bind(fn, thisArg) { 11229 return function wrap() { 11230 return fn.apply(thisArg, arguments); 11231 }; 11232} 11233 11234;// ./node_modules/axios/lib/utils.js 11235 11236 11237 11238 11239// utils is a library of generic helper functions non-specific to axios 11240 11241const {toString: utils_toString} = Object.prototype; 11242const {getPrototypeOf} = Object; 11243const {iterator, toStringTag} = Symbol; 11244 11245const kindOf = (cache => thing => { 11246 const str = utils_toString.call(thing); 11247 return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); 11248})(Object.create(null)); 11249 11250const kindOfTest = (type) => { 11251 type = type.toLowerCase(); 11252 return (thing) => kindOf(thing) === type 11253} 11254 11255const typeOfTest = type => thing => typeof thing === type; 11256 11257/** 11258 * Determine if a value is an Array 11259 * 11260 * @param {Object} val The value to test 11261 * 11262 * @returns {boolean} True if value is an Array, otherwise false 11263 */ 11264const {isArray} = Array; 11265 11266/** 11267 * Determine if a value is undefined 11268 * 11269 * @param {*} val The value to test 11270 * 11271 * @returns {boolean} True if the value is undefined, otherwise false 11272 */ 11273const isUndefined = typeOfTest('undefined'); 11274 11275/** 11276 * Determine if a value is a Buffer 11277 * 11278 * @param {*} val The value to test 11279 * 11280 * @returns {boolean} True if value is a Buffer, otherwise false 11281 */ 11282function isBuffer(val) { 11283 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) 11284 && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); 11285} 11286 11287/** 11288 * Determine if a value is an ArrayBuffer 11289 * 11290 * @param {*} val The value to test 11291 * 11292 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 11293 */ 11294const isArrayBuffer = kindOfTest('ArrayBuffer'); 11295 11296 11297/** 11298 * Determine if a value is a view on an ArrayBuffer 11299 * 11300 * @param {*} val The value to test 11301 * 11302 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 11303 */ 11304function isArrayBufferView(val) { 11305 let result; 11306 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 11307 result = ArrayBuffer.isView(val); 11308 } else { 11309 result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); 11310 } 11311 return result; 11312} 11313 11314/** 11315 * Determine if a value is a String 11316 * 11317 * @param {*} val The value to test 11318 * 11319 * @returns {boolean} True if value is a String, otherwise false 11320 */ 11321const isString = typeOfTest('string'); 11322 11323/** 11324 * Determine if a value is a Function 11325 * 11326 * @param {*} val The value to test 11327 * @returns {boolean} True if value is a Function, otherwise false 11328 */ 11329const isFunction = typeOfTest('function'); 11330 11331/** 11332 * Determine if a value is a Number 11333 * 11334 * @param {*} val The value to test 11335 * 11336 * @returns {boolean} True if value is a Number, otherwise false 11337 */ 11338const isNumber = typeOfTest('number'); 11339 11340/** 11341 * Determine if a value is an Object 11342 * 11343 * @param {*} thing The value to test 11344 * 11345 * @returns {boolean} True if value is an Object, otherwise false 11346 */ 11347const isObject = (thing) => thing !== null && typeof thing === 'object'; 11348 11349/** 11350 * Determine if a value is a Boolean 11351 * 11352 * @param {*} thing The value to test 11353 * @returns {boolean} True if value is a Boolean, otherwise false 11354 */ 11355const isBoolean = thing => thing === true || thing === false; 11356 11357/** 11358 * Determine if a value is a plain Object 11359 * 11360 * @param {*} val The value to test 11361 * 11362 * @returns {boolean} True if value is a plain Object, otherwise false 11363 */ 11364const isPlainObject = (val) => { 11365 if (kindOf(val) !== 'object') { 11366 return false;
vendor: 5,990 bytes, lines 11367-11593
11367 } 11368 11369 const prototype = getPrototypeOf(val); 11370 return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); 11371} 11372 11373/** 11374 * Determine if a value is an empty object (safely handles Buffers) 11375 * 11376 * @param {*} val The value to test 11377 * 11378 * @returns {boolean} True if value is an empty object, otherwise false 11379 */ 11380const isEmptyObject = (val) => { 11381 // Early return for non-objects or Buffers to prevent RangeError 11382 if (!isObject(val) || isBuffer(val)) { 11383 return false; 11384 } 11385 11386 try { 11387 return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; 11388 } catch (e) { 11389 // Fallback for any other objects that might cause RangeError with Object.keys() 11390 return false; 11391 } 11392} 11393 11394/** 11395 * Determine if a value is a Date 11396 * 11397 * @param {*} val The value to test 11398 * 11399 * @returns {boolean} True if value is a Date, otherwise false 11400 */ 11401const isDate = kindOfTest('Date'); 11402 11403/** 11404 * Determine if a value is a File 11405 * 11406 * @param {*} val The value to test 11407 * 11408 * @returns {boolean} True if value is a File, otherwise false 11409 */ 11410const isFile = kindOfTest('File'); 11411 11412/** 11413 * Determine if a value is a Blob 11414 * 11415 * @param {*} val The value to test 11416 * 11417 * @returns {boolean} True if value is a Blob, otherwise false 11418 */ 11419const isBlob = kindOfTest('Blob'); 11420 11421/** 11422 * Determine if a value is a FileList 11423 * 11424 * @param {*} val The value to test 11425 * 11426 * @returns {boolean} True if value is a File, otherwise false 11427 */ 11428const isFileList = kindOfTest('FileList'); 11429 11430/** 11431 * Determine if a value is a Stream 11432 * 11433 * @param {*} val The value to test 11434 * 11435 * @returns {boolean} True if value is a Stream, otherwise false 11436 */ 11437const isStream = (val) => isObject(val) && isFunction(val.pipe); 11438 11439/** 11440 * Determine if a value is a FormData 11441 * 11442 * @param {*} thing The value to test 11443 * 11444 * @returns {boolean} True if value is an FormData, otherwise false 11445 */ 11446const isFormData = (thing) => { 11447 let kind; 11448 return thing && ( 11449 (typeof FormData === 'function' && thing instanceof FormData) || ( 11450 isFunction(thing.append) && ( 11451 (kind = kindOf(thing)) === 'formdata' || 11452 // detect form-data instance 11453 (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') 11454 ) 11455 ) 11456 ) 11457} 11458 11459/** 11460 * Determine if a value is a URLSearchParams object 11461 * 11462 * @param {*} val The value to test 11463 * 11464 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 11465 */ 11466const isURLSearchParams = kindOfTest('URLSearchParams'); 11467 11468const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); 11469 11470/** 11471 * Trim excess whitespace off the beginning and end of a string 11472 * 11473 * @param {String} str The String to trim 11474 * 11475 * @returns {String} The String freed of excess whitespace 11476 */ 11477const trim = (str) => str.trim ? 11478 str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); 11479 11480/** 11481 * Iterate over an Array or an Object invoking a function for each item. 11482 * 11483 * If `obj` is an Array callback will be called passing 11484 * the value, index, and complete array for each item. 11485 * 11486 * If 'obj' is an Object callback will be called passing 11487 * the value, key, and complete object for each property. 11488 * 11489 * @param {Object|Array} obj The object to iterate 11490 * @param {Function} fn The callback to invoke for each item 11491 * 11492 * @param {Boolean} [allOwnKeys = false] 11493 * @returns {any} 11494 */ 11495function forEach(obj, fn, {allOwnKeys = false} = {}) { 11496 // Don't bother if no value provided 11497 if (obj === null || typeof obj === 'undefined') { 11498 return; 11499 } 11500 11501 let i; 11502 let l; 11503 11504 // Force an array if not already something iterable 11505 if (typeof obj !== 'object') { 11506 /*eslint no-param-reassign:0*/ 11507 obj = [obj]; 11508 } 11509 11510 if (isArray(obj)) { 11511 // Iterate over array values 11512 for (i = 0, l = obj.length; i < l; i++) { 11513 fn.call(null, obj[i], i, obj); 11514 } 11515 } else { 11516 // Buffer check 11517 if (isBuffer(obj)) { 11518 return; 11519 } 11520 11521 // Iterate over object keys 11522 const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); 11523 const len = keys.length; 11524 let key; 11525 11526 for (i = 0; i < len; i++) { 11527 key = keys[i]; 11528 fn.call(null, obj[key], key, obj); 11529 } 11530 } 11531} 11532 11533function findKey(obj, key) { 11534 if (isBuffer(obj)){ 11535 return null; 11536 } 11537 11538 key = key.toLowerCase(); 11539 const keys = Object.keys(obj); 11540 let i = keys.length; 11541 let _key; 11542 while (i-- > 0) { 11543 _key = keys[i]; 11544 if (key === _key.toLowerCase()) { 11545 return _key; 11546 } 11547 } 11548 return null; 11549} 11550 11551const _global = (() => { 11552 /*eslint no-undef:0*/ 11553 if (typeof globalThis !== "undefined") return globalThis; 11554 return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g) 11555})(); 11556 11557const isContextDefined = (context) => !isUndefined(context) && context !== _global; 11558 11559/** 11560 * Accepts varargs expecting each argument to be an object, then 11561 * immutably merges the properties of each object and returns result. 11562 * 11563 * When multiple objects contain the same key the later object in 11564 * the arguments list will take precedence. 11565 * 11566 * Example: 11567 * 11568 * ```js 11569 * var result = merge({foo: 123}, {foo: 456}); 11570 * console.log(result.foo); // outputs 456 11571 * ``` 11572 * 11573 * @param {Object} obj1 Object to merge 11574 * 11575 * @returns {Object} Result of all merge properties 11576 */ 11577function merge(/* obj1, obj2, obj3, ... */) { 11578 const {caseless, skipUndefined} = isContextDefined(this) && this || {}; 11579 const result = {}; 11580 const assignValue = (val, key) => { 11581 const targetKey = caseless && findKey(result, key) || key; 11582 if (isPlainObject(result[targetKey]) && isPlainObject(val)) { 11583 result[targetKey] = merge(result[targetKey], val); 11584 } else if (isPlainObject(val)) { 11585 result[targetKey] = merge({}, val); 11586 } else if (isArray(val)) { 11587 result[targetKey] = val.slice(); 11588 } else if (!skipUndefined || !isUndefined(val)) { 11589 result[targetKey] = val; 11590 } 11591 } 11592 11593 for (let i = 0, l = arguments.length; i < l; i++) {
vendor: 6,111 bytes, lines 11594-11828
11594 arguments[i] && forEach(arguments[i], assignValue); 11595 } 11596 return result; 11597} 11598 11599/** 11600 * Extends object a by mutably adding to it the properties of object b. 11601 * 11602 * @param {Object} a The object to be extended 11603 * @param {Object} b The object to copy properties from 11604 * @param {Object} thisArg The object to bind function to 11605 * 11606 * @param {Boolean} [allOwnKeys] 11607 * @returns {Object} The resulting value of object a 11608 */ 11609const extend = (a, b, thisArg, {allOwnKeys}= {}) => { 11610 forEach(b, (val, key) => { 11611 if (thisArg && isFunction(val)) { 11612 a[key] = bind(val, thisArg); 11613 } else { 11614 a[key] = val; 11615 } 11616 }, {allOwnKeys}); 11617 return a; 11618} 11619 11620/** 11621 * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 11622 * 11623 * @param {string} content with BOM 11624 * 11625 * @returns {string} content value without BOM 11626 */ 11627const stripBOM = (content) => { 11628 if (content.charCodeAt(0) === 0xFEFF) { 11629 content = content.slice(1); 11630 } 11631 return content; 11632} 11633 11634/** 11635 * Inherit the prototype methods from one constructor into another 11636 * @param {function} constructor 11637 * @param {function} superConstructor 11638 * @param {object} [props] 11639 * @param {object} [descriptors] 11640 * 11641 * @returns {void} 11642 */ 11643const inherits = (constructor, superConstructor, props, descriptors) => { 11644 constructor.prototype = Object.create(superConstructor.prototype, descriptors); 11645 constructor.prototype.constructor = constructor; 11646 Object.defineProperty(constructor, 'super', { 11647 value: superConstructor.prototype 11648 }); 11649 props && Object.assign(constructor.prototype, props); 11650} 11651 11652/** 11653 * Resolve object with deep prototype chain to a flat object 11654 * @param {Object} sourceObj source object 11655 * @param {Object} [destObj] 11656 * @param {Function|Boolean} [filter] 11657 * @param {Function} [propFilter] 11658 * 11659 * @returns {Object} 11660 */ 11661const toFlatObject = (sourceObj, destObj, filter, propFilter) => { 11662 let props; 11663 let i; 11664 let prop; 11665 const merged = {}; 11666 11667 destObj = destObj || {}; 11668 // eslint-disable-next-line no-eq-null,eqeqeq 11669 if (sourceObj == null) return destObj; 11670 11671 do { 11672 props = Object.getOwnPropertyNames(sourceObj); 11673 i = props.length; 11674 while (i-- > 0) { 11675 prop = props[i]; 11676 if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { 11677 destObj[prop] = sourceObj[prop]; 11678 merged[prop] = true; 11679 } 11680 } 11681 sourceObj = filter !== false && getPrototypeOf(sourceObj); 11682 } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); 11683 11684 return destObj; 11685} 11686 11687/** 11688 * Determines whether a string ends with the characters of a specified string 11689 * 11690 * @param {String} str 11691 * @param {String} searchString 11692 * @param {Number} [position= 0] 11693 * 11694 * @returns {boolean} 11695 */ 11696const endsWith = (str, searchString, position) => { 11697 str = String(str); 11698 if (position === undefined || position > str.length) { 11699 position = str.length; 11700 } 11701 position -= searchString.length; 11702 const lastIndex = str.indexOf(searchString, position); 11703 return lastIndex !== -1 && lastIndex === position; 11704} 11705 11706 11707/** 11708 * Returns new array from array like object or null if failed 11709 * 11710 * @param {*} [thing] 11711 * 11712 * @returns {?Array} 11713 */ 11714const toArray = (thing) => { 11715 if (!thing) return null; 11716 if (isArray(thing)) return thing; 11717 let i = thing.length; 11718 if (!isNumber(i)) return null; 11719 const arr = new Array(i); 11720 while (i-- > 0) { 11721 arr[i] = thing[i]; 11722 } 11723 return arr; 11724} 11725 11726/** 11727 * Checking if the Uint8Array exists and if it does, it returns a function that checks if the 11728 * thing passed in is an instance of Uint8Array 11729 * 11730 * @param {TypedArray} 11731 * 11732 * @returns {Array} 11733 */ 11734// eslint-disable-next-line func-names 11735const isTypedArray = (TypedArray => { 11736 // eslint-disable-next-line func-names 11737 return thing => { 11738 return TypedArray && thing instanceof TypedArray; 11739 }; 11740})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); 11741 11742/** 11743 * For each entry in the object, call the function with the key and value. 11744 * 11745 * @param {Object<any, any>} obj - The object to iterate over. 11746 * @param {Function} fn - The function to call for each entry. 11747 * 11748 * @returns {void} 11749 */ 11750const forEachEntry = (obj, fn) => { 11751 const generator = obj && obj[iterator]; 11752 11753 const _iterator = generator.call(obj); 11754 11755 let result; 11756 11757 while ((result = _iterator.next()) && !result.done) { 11758 const pair = result.value; 11759 fn.call(obj, pair[0], pair[1]); 11760 } 11761} 11762 11763/** 11764 * It takes a regular expression and a string, and returns an array of all the matches 11765 * 11766 * @param {string} regExp - The regular expression to match against. 11767 * @param {string} str - The string to search. 11768 * 11769 * @returns {Array<boolean>} 11770 */ 11771const matchAll = (regExp, str) => { 11772 let matches; 11773 const arr = []; 11774 11775 while ((matches = regExp.exec(str)) !== null) { 11776 arr.push(matches); 11777 } 11778 11779 return arr; 11780} 11781 11782/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ 11783const isHTMLForm = kindOfTest('HTMLFormElement'); 11784 11785const toCamelCase = str => { 11786 return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, 11787 function replacer(m, p1, p2) { 11788 return p1.toUpperCase() + p2; 11789 } 11790 ); 11791}; 11792 11793/* Creating a function that will check if an object has a property. */ 11794const utils_hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); 11795 11796/** 11797 * Determine if a value is a RegExp object 11798 * 11799 * @param {*} val The value to test 11800 * 11801 * @returns {boolean} True if value is a RegExp object, otherwise false 11802 */ 11803const isRegExp = kindOfTest('RegExp'); 11804 11805const reduceDescriptors = (obj, reducer) => { 11806 const descriptors = Object.getOwnPropertyDescriptors(obj); 11807 const reducedDescriptors = {}; 11808 11809 forEach(descriptors, (descriptor, name) => { 11810 let ret; 11811 if ((ret = reducer(descriptor, name, obj)) !== false) { 11812 reducedDescriptors[name] = ret || descriptor; 11813 } 11814 }); 11815 11816 Object.defineProperties(obj, reducedDescriptors); 11817} 11818 11819/** 11820 * Makes all methods read-only 11821 * @param {Object} obj 11822 */ 11823 11824const freezeMethods = (obj) => { 11825 reduceDescriptors(obj, (descriptor, name) => { 11826 // skip restricted props in strict mode 11827 if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { 11828 return false;
vendor: 81,420 bytes, lines 11829-14981
11829 } 11830 11831 const value = obj[name]; 11832 11833 if (!isFunction(value)) return; 11834 11835 descriptor.enumerable = false; 11836 11837 if ('writable' in descriptor) { 11838 descriptor.writable = false; 11839 return; 11840 } 11841 11842 if (!descriptor.set) { 11843 descriptor.set = () => { 11844 throw Error('Can not rewrite read-only method \'' + name + '\''); 11845 }; 11846 } 11847 }); 11848} 11849 11850const toObjectSet = (arrayOrString, delimiter) => { 11851 const obj = {}; 11852 11853 const define = (arr) => { 11854 arr.forEach(value => { 11855 obj[value] = true; 11856 }); 11857 } 11858 11859 isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); 11860 11861 return obj; 11862} 11863 11864const noop = () => {} 11865 11866const toFiniteNumber = (value, defaultValue) => { 11867 return value != null && Number.isFinite(value = +value) ? value : defaultValue; 11868} 11869 11870 11871 11872/** 11873 * If the thing is a FormData object, return true, otherwise return false. 11874 * 11875 * @param {unknown} thing - The thing to check. 11876 * 11877 * @returns {boolean} 11878 */ 11879function isSpecCompliantForm(thing) { 11880 return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); 11881} 11882 11883const toJSONObject = (obj) => { 11884 const stack = new Array(10); 11885 11886 const visit = (source, i) => { 11887 11888 if (isObject(source)) { 11889 if (stack.indexOf(source) >= 0) { 11890 return; 11891 } 11892 11893 //Buffer check 11894 if (isBuffer(source)) { 11895 return source; 11896 } 11897 11898 if(!('toJSON' in source)) { 11899 stack[i] = source; 11900 const target = isArray(source) ? [] : {}; 11901 11902 forEach(source, (value, key) => { 11903 const reducedValue = visit(value, i + 1); 11904 !isUndefined(reducedValue) && (target[key] = reducedValue); 11905 }); 11906 11907 stack[i] = undefined; 11908 11909 return target; 11910 } 11911 } 11912 11913 return source; 11914 } 11915 11916 return visit(obj, 0); 11917} 11918 11919const isAsyncFn = kindOfTest('AsyncFunction'); 11920 11921const isThenable = (thing) => 11922 thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); 11923 11924// original code 11925// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 11926 11927const _setImmediate = ((setImmediateSupported, postMessageSupported) => { 11928 if (setImmediateSupported) { 11929 return setImmediate; 11930 } 11931 11932 return postMessageSupported ? ((token, callbacks) => { 11933 _global.addEventListener("message", ({source, data}) => { 11934 if (source === _global && data === token) { 11935 callbacks.length && callbacks.shift()(); 11936 } 11937 }, false); 11938 11939 return (cb) => { 11940 callbacks.push(cb); 11941 _global.postMessage(token, "*"); 11942 } 11943 })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); 11944})( 11945 typeof setImmediate === 'function', 11946 isFunction(_global.postMessage) 11947); 11948 11949const asap = typeof queueMicrotask !== 'undefined' ? 11950 queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); 11951 11952// ********************* 11953 11954 11955const isIterable = (thing) => thing != null && isFunction(thing[iterator]); 11956 11957 11958/* harmony default export */ var utils = ({ 11959 isArray, 11960 isArrayBuffer, 11961 isBuffer, 11962 isFormData, 11963 isArrayBufferView, 11964 isString, 11965 isNumber, 11966 isBoolean, 11967 isObject, 11968 isPlainObject, 11969 isEmptyObject, 11970 isReadableStream, 11971 isRequest, 11972 isResponse, 11973 isHeaders, 11974 isUndefined, 11975 isDate, 11976 isFile, 11977 isBlob, 11978 isRegExp, 11979 isFunction, 11980 isStream, 11981 isURLSearchParams, 11982 isTypedArray, 11983 isFileList, 11984 forEach, 11985 merge, 11986 extend, 11987 trim, 11988 stripBOM, 11989 inherits, 11990 toFlatObject, 11991 kindOf, 11992 kindOfTest, 11993 endsWith, 11994 toArray, 11995 forEachEntry, 11996 matchAll, 11997 isHTMLForm, 11998 hasOwnProperty: utils_hasOwnProperty, 11999 hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection 12000 reduceDescriptors, 12001 freezeMethods, 12002 toObjectSet, 12003 toCamelCase, 12004 noop, 12005 toFiniteNumber, 12006 findKey, 12007 global: _global, 12008 isContextDefined, 12009 isSpecCompliantForm, 12010 toJSONObject, 12011 isAsyncFn, 12012 isThenable, 12013 setImmediate: _setImmediate, 12014 asap, 12015 isIterable 12016}); 12017 12018;// ./node_modules/axios/lib/core/AxiosError.js 12019 12020 12021 12022 12023/** 12024 * Create an Error with the specified message, config, error code, request and response. 12025 * 12026 * @param {string} message The error message. 12027 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 12028 * @param {Object} [config] The config. 12029 * @param {Object} [request] The request. 12030 * @param {Object} [response] The response. 12031 * 12032 * @returns {Error} The created error. 12033 */ 12034function AxiosError(message, code, config, request, response) { 12035 Error.call(this); 12036 12037 if (Error.captureStackTrace) { 12038 Error.captureStackTrace(this, this.constructor); 12039 } else { 12040 this.stack = (new Error()).stack; 12041 } 12042 12043 this.message = message; 12044 this.name = 'AxiosError'; 12045 code && (this.code = code); 12046 config && (this.config = config); 12047 request && (this.request = request); 12048 if (response) { 12049 this.response = response; 12050 this.status = response.status ? response.status : null; 12051 } 12052} 12053 12054utils.inherits(AxiosError, Error, { 12055 toJSON: function toJSON() { 12056 return { 12057 // Standard 12058 message: this.message, 12059 name: this.name, 12060 // Microsoft 12061 description: this.description, 12062 number: this.number, 12063 // Mozilla 12064 fileName: this.fileName, 12065 lineNumber: this.lineNumber, 12066 columnNumber: this.columnNumber, 12067 stack: this.stack, 12068 // Axios 12069 config: utils.toJSONObject(this.config), 12070 code: this.code, 12071 status: this.status 12072 }; 12073 } 12074}); 12075 12076const AxiosError_prototype = AxiosError.prototype; 12077const descriptors = {}; 12078 12079[ 12080 'ERR_BAD_OPTION_VALUE', 12081 'ERR_BAD_OPTION', 12082 'ECONNABORTED', 12083 'ETIMEDOUT', 12084 'ERR_NETWORK', 12085 'ERR_FR_TOO_MANY_REDIRECTS', 12086 'ERR_DEPRECATED', 12087 'ERR_BAD_RESPONSE', 12088 'ERR_BAD_REQUEST', 12089 'ERR_CANCELED', 12090 'ERR_NOT_SUPPORT', 12091 'ERR_INVALID_URL' 12092// eslint-disable-next-line func-names 12093].forEach(code => { 12094 descriptors[code] = {value: code}; 12095}); 12096 12097Object.defineProperties(AxiosError, descriptors); 12098Object.defineProperty(AxiosError_prototype, 'isAxiosError', {value: true}); 12099 12100// eslint-disable-next-line func-names 12101AxiosError.from = (error, code, config, request, response, customProps) => { 12102 const axiosError = Object.create(AxiosError_prototype); 12103 12104 utils.toFlatObject(error, axiosError, function filter(obj) { 12105 return obj !== Error.prototype; 12106 }, prop => { 12107 return prop !== 'isAxiosError'; 12108 }); 12109 12110 const msg = error && error.message ? error.message : 'Error'; 12111 12112 // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) 12113 const errCode = code == null && error ? error.code : code; 12114 AxiosError.call(axiosError, msg, errCode, config, request, response); 12115 12116 // Chain the original error on the standard field; non-enumerable to avoid JSON noise 12117 if (error && axiosError.cause == null) { 12118 Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); 12119 } 12120 12121 axiosError.name = (error && error.name) || 'Error'; 12122 12123 customProps && Object.assign(axiosError, customProps); 12124 12125 return axiosError; 12126}; 12127 12128/* harmony default export */ var core_AxiosError = (AxiosError); 12129 12130;// ./node_modules/axios/lib/helpers/null.js 12131// eslint-disable-next-line strict 12132/* harmony default export */ var helpers_null = (null); 12133 12134;// ./node_modules/axios/lib/helpers/toFormData.js 12135 12136 12137 12138 12139// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored 12140 12141 12142/** 12143 * Determines if the given thing is a array or js object. 12144 * 12145 * @param {string} thing - The object or array to be visited. 12146 * 12147 * @returns {boolean} 12148 */ 12149function isVisitable(thing) { 12150 return utils.isPlainObject(thing) || utils.isArray(thing); 12151} 12152 12153/** 12154 * It removes the brackets from the end of a string 12155 * 12156 * @param {string} key - The key of the parameter. 12157 * 12158 * @returns {string} the key without the brackets. 12159 */ 12160function removeBrackets(key) { 12161 return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; 12162} 12163 12164/** 12165 * It takes a path, a key, and a boolean, and returns a string 12166 * 12167 * @param {string} path - The path to the current key. 12168 * @param {string} key - The key of the current object being iterated over. 12169 * @param {string} dots - If true, the key will be rendered with dots instead of brackets. 12170 * 12171 * @returns {string} The path to the current key. 12172 */ 12173function renderKey(path, key, dots) { 12174 if (!path) return key; 12175 return path.concat(key).map(function each(token, i) { 12176 // eslint-disable-next-line no-param-reassign 12177 token = removeBrackets(token); 12178 return !dots && i ? '[' + token + ']' : token; 12179 }).join(dots ? '.' : ''); 12180} 12181 12182/** 12183 * If the array is an array and none of its elements are visitable, then it's a flat array. 12184 * 12185 * @param {Array<any>} arr - The array to check 12186 * 12187 * @returns {boolean} 12188 */ 12189function isFlatArray(arr) { 12190 return utils.isArray(arr) && !arr.some(isVisitable); 12191} 12192 12193const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { 12194 return /^is[A-Z]/.test(prop); 12195}); 12196 12197/** 12198 * Convert a data object to FormData 12199 * 12200 * @param {Object} obj 12201 * @param {?Object} [formData] 12202 * @param {?Object} [options] 12203 * @param {Function} [options.visitor] 12204 * @param {Boolean} [options.metaTokens = true] 12205 * @param {Boolean} [options.dots = false] 12206 * @param {?Boolean} [options.indexes = false] 12207 * 12208 * @returns {Object} 12209 **/ 12210 12211/** 12212 * It converts an object into a FormData object 12213 * 12214 * @param {Object<any, any>} obj - The object to convert to form data. 12215 * @param {string} formData - The FormData object to append to. 12216 * @param {Object<string, any>} options 12217 * 12218 * @returns 12219 */ 12220function toFormData(obj, formData, options) { 12221 if (!utils.isObject(obj)) { 12222 throw new TypeError('target must be an object'); 12223 } 12224 12225 // eslint-disable-next-line no-param-reassign 12226 formData = formData || new (helpers_null || FormData)(); 12227 12228 // eslint-disable-next-line no-param-reassign 12229 options = utils.toFlatObject(options, { 12230 metaTokens: true, 12231 dots: false, 12232 indexes: false 12233 }, false, function defined(option, source) { 12234 // eslint-disable-next-line no-eq-null,eqeqeq 12235 return !utils.isUndefined(source[option]); 12236 }); 12237 12238 const metaTokens = options.metaTokens; 12239 // eslint-disable-next-line no-use-before-define 12240 const visitor = options.visitor || defaultVisitor; 12241 const dots = options.dots; 12242 const indexes = options.indexes; 12243 const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; 12244 const useBlob = _Blob && utils.isSpecCompliantForm(formData); 12245 12246 if (!utils.isFunction(visitor)) { 12247 throw new TypeError('visitor must be a function'); 12248 } 12249 12250 function convertValue(value) { 12251 if (value === null) return ''; 12252 12253 if (utils.isDate(value)) { 12254 return value.toISOString(); 12255 } 12256 12257 if (utils.isBoolean(value)) { 12258 return value.toString(); 12259 } 12260 12261 if (!useBlob && utils.isBlob(value)) { 12262 throw new core_AxiosError('Blob is not supported. Use a Buffer instead.'); 12263 } 12264 12265 if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { 12266 return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); 12267 } 12268 12269 return value; 12270 } 12271 12272 /** 12273 * Default visitor. 12274 * 12275 * @param {*} value 12276 * @param {String|Number} key 12277 * @param {Array<String|Number>} path 12278 * @this {FormData} 12279 * 12280 * @returns {boolean} return true to visit the each prop of the value recursively 12281 */ 12282 function defaultVisitor(value, key, path) { 12283 let arr = value; 12284 12285 if (value && !path && typeof value === 'object') { 12286 if (utils.endsWith(key, '{}')) { 12287 // eslint-disable-next-line no-param-reassign 12288 key = metaTokens ? key : key.slice(0, -2); 12289 // eslint-disable-next-line no-param-reassign 12290 value = JSON.stringify(value); 12291 } else if ( 12292 (utils.isArray(value) && isFlatArray(value)) || 12293 ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) 12294 )) { 12295 // eslint-disable-next-line no-param-reassign 12296 key = removeBrackets(key); 12297 12298 arr.forEach(function each(el, index) { 12299 !(utils.isUndefined(el) || el === null) && formData.append( 12300 // eslint-disable-next-line no-nested-ternary 12301 indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), 12302 convertValue(el) 12303 ); 12304 }); 12305 return false; 12306 } 12307 } 12308 12309 if (isVisitable(value)) { 12310 return true; 12311 } 12312 12313 formData.append(renderKey(path, key, dots), convertValue(value)); 12314 12315 return false; 12316 } 12317 12318 const stack = []; 12319 12320 const exposedHelpers = Object.assign(predicates, { 12321 defaultVisitor, 12322 convertValue, 12323 isVisitable 12324 }); 12325 12326 function build(value, path) { 12327 if (utils.isUndefined(value)) return; 12328 12329 if (stack.indexOf(value) !== -1) { 12330 throw Error('Circular reference detected in ' + path.join('.')); 12331 } 12332 12333 stack.push(value); 12334 12335 utils.forEach(value, function each(el, key) { 12336 const result = !(utils.isUndefined(el) || el === null) && visitor.call( 12337 formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers 12338 ); 12339 12340 if (result === true) { 12341 build(el, path ? path.concat(key) : [key]); 12342 } 12343 }); 12344 12345 stack.pop(); 12346 } 12347 12348 if (!utils.isObject(obj)) { 12349 throw new TypeError('data must be an object'); 12350 } 12351 12352 build(obj); 12353 12354 return formData; 12355} 12356 12357/* harmony default export */ var helpers_toFormData = (toFormData); 12358 12359;// ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js 12360 12361 12362 12363 12364/** 12365 * It encodes a string by replacing all characters that are not in the unreserved set with 12366 * their percent-encoded equivalents 12367 * 12368 * @param {string} str - The string to encode. 12369 * 12370 * @returns {string} The encoded string. 12371 */ 12372function encode(str) { 12373 const charMap = { 12374 '!': '%21', 12375 "'": '%27', 12376 '(': '%28', 12377 ')': '%29', 12378 '~': '%7E', 12379 '%20': '+', 12380 '%00': '\x00' 12381 }; 12382 return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { 12383 return charMap[match]; 12384 }); 12385} 12386 12387/** 12388 * It takes a params object and converts it to a FormData object 12389 * 12390 * @param {Object<string, any>} params - The parameters to be converted to a FormData object. 12391 * @param {Object<string, any>} options - The options object passed to the Axios constructor. 12392 * 12393 * @returns {void} 12394 */ 12395function AxiosURLSearchParams(params, options) { 12396 this._pairs = []; 12397 12398 params && helpers_toFormData(params, this, options); 12399} 12400 12401const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype; 12402 12403AxiosURLSearchParams_prototype.append = function append(name, value) { 12404 this._pairs.push([name, value]); 12405}; 12406 12407AxiosURLSearchParams_prototype.toString = function toString(encoder) { 12408 const _encode = encoder ? function(value) { 12409 return encoder.call(this, value, encode); 12410 } : encode; 12411 12412 return this._pairs.map(function each(pair) { 12413 return _encode(pair[0]) + '=' + _encode(pair[1]); 12414 }, '').join('&'); 12415}; 12416 12417/* harmony default export */ var helpers_AxiosURLSearchParams = (AxiosURLSearchParams); 12418 12419;// ./node_modules/axios/lib/helpers/buildURL.js 12420 12421 12422 12423 12424 12425/** 12426 * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their 12427 * URI encoded counterparts 12428 * 12429 * @param {string} val The value to be encoded. 12430 * 12431 * @returns {string} The encoded value. 12432 */ 12433function buildURL_encode(val) { 12434 return encodeURIComponent(val). 12435 replace(/%3A/gi, ':'). 12436 replace(/%24/g, '$'). 12437 replace(/%2C/gi, ','). 12438 replace(/%20/g, '+'); 12439} 12440 12441/** 12442 * Build a URL by appending params to the end 12443 * 12444 * @param {string} url The base of the url (e.g., http://www.google.com) 12445 * @param {object} [params] The params to be appended 12446 * @param {?(object|Function)} options 12447 * 12448 * @returns {string} The formatted url 12449 */ 12450function buildURL(url, params, options) { 12451 /*eslint no-param-reassign:0*/ 12452 if (!params) { 12453 return url; 12454 } 12455 12456 const _encode = options && options.encode || buildURL_encode; 12457 12458 if (utils.isFunction(options)) { 12459 options = { 12460 serialize: options 12461 }; 12462 } 12463 12464 const serializeFn = options && options.serialize; 12465 12466 let serializedParams; 12467 12468 if (serializeFn) { 12469 serializedParams = serializeFn(params, options); 12470 } else { 12471 serializedParams = utils.isURLSearchParams(params) ? 12472 params.toString() : 12473 new helpers_AxiosURLSearchParams(params, options).toString(_encode); 12474 } 12475 12476 if (serializedParams) { 12477 const hashmarkIndex = url.indexOf("#"); 12478 12479 if (hashmarkIndex !== -1) { 12480 url = url.slice(0, hashmarkIndex); 12481 } 12482 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 12483 } 12484 12485 return url; 12486} 12487 12488;// ./node_modules/axios/lib/core/InterceptorManager.js 12489 12490 12491 12492 12493class InterceptorManager { 12494 constructor() { 12495 this.handlers = []; 12496 } 12497 12498 /** 12499 * Add a new interceptor to the stack 12500 * 12501 * @param {Function} fulfilled The function to handle `then` for a `Promise` 12502 * @param {Function} rejected The function to handle `reject` for a `Promise` 12503 * 12504 * @return {Number} An ID used to remove interceptor later 12505 */ 12506 use(fulfilled, rejected, options) { 12507 this.handlers.push({ 12508 fulfilled, 12509 rejected, 12510 synchronous: options ? options.synchronous : false, 12511 runWhen: options ? options.runWhen : null 12512 }); 12513 return this.handlers.length - 1; 12514 } 12515 12516 /** 12517 * Remove an interceptor from the stack 12518 * 12519 * @param {Number} id The ID that was returned by `use` 12520 * 12521 * @returns {void} 12522 */ 12523 eject(id) { 12524 if (this.handlers[id]) { 12525 this.handlers[id] = null; 12526 } 12527 } 12528 12529 /** 12530 * Clear all interceptors from the stack 12531 * 12532 * @returns {void} 12533 */ 12534 clear() { 12535 if (this.handlers) { 12536 this.handlers = []; 12537 } 12538 } 12539 12540 /** 12541 * Iterate over all the registered interceptors 12542 * 12543 * This method is particularly useful for skipping over any 12544 * interceptors that may have become `null` calling `eject`. 12545 * 12546 * @param {Function} fn The function to call for each interceptor 12547 * 12548 * @returns {void} 12549 */ 12550 forEach(fn) { 12551 utils.forEach(this.handlers, function forEachHandler(h) { 12552 if (h !== null) { 12553 fn(h); 12554 } 12555 }); 12556 } 12557} 12558 12559/* harmony default export */ var core_InterceptorManager = (InterceptorManager); 12560 12561;// ./node_modules/axios/lib/defaults/transitional.js 12562 12563 12564/* harmony default export */ var defaults_transitional = ({ 12565 silentJSONParsing: true, 12566 forcedJSONParsing: true, 12567 clarifyTimeoutError: false 12568}); 12569 12570;// ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js 12571 12572 12573 12574/* harmony default export */ var classes_URLSearchParams = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : helpers_AxiosURLSearchParams); 12575 12576;// ./node_modules/axios/lib/platform/browser/classes/FormData.js 12577 12578 12579/* harmony default export */ var classes_FormData = (typeof FormData !== 'undefined' ? FormData : null); 12580 12581;// ./node_modules/axios/lib/platform/browser/classes/Blob.js 12582 12583 12584/* harmony default export */ var classes_Blob = (typeof Blob !== 'undefined' ? Blob : null); 12585 12586;// ./node_modules/axios/lib/platform/browser/index.js 12587 12588 12589 12590 12591/* harmony default export */ var browser = ({ 12592 isBrowser: true, 12593 classes: { 12594 URLSearchParams: classes_URLSearchParams, 12595 FormData: classes_FormData, 12596 Blob: classes_Blob 12597 }, 12598 protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] 12599}); 12600 12601;// ./node_modules/axios/lib/platform/common/utils.js 12602const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; 12603 12604const _navigator = typeof navigator === 'object' && navigator || undefined; 12605 12606/** 12607 * Determine if we're running in a standard browser environment 12608 * 12609 * This allows axios to run in a web worker, and react-native. 12610 * Both environments support XMLHttpRequest, but not fully standard globals. 12611 * 12612 * web workers: 12613 * typeof window -> undefined 12614 * typeof document -> undefined 12615 * 12616 * react-native: 12617 * navigator.product -> 'ReactNative' 12618 * nativescript 12619 * navigator.product -> 'NativeScript' or 'NS' 12620 * 12621 * @returns {boolean} 12622 */ 12623const hasStandardBrowserEnv = hasBrowserEnv && 12624 (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); 12625 12626/** 12627 * Determine if we're running in a standard browser webWorker environment 12628 * 12629 * Although the `isStandardBrowserEnv` method indicates that 12630 * `allows axios to run in a web worker`, the WebWorker will still be 12631 * filtered out due to its judgment standard 12632 * `typeof window !== 'undefined' && typeof document !== 'undefined'`. 12633 * This leads to a problem when axios post `FormData` in webWorker 12634 */ 12635const hasStandardBrowserWebWorkerEnv = (() => { 12636 return ( 12637 typeof WorkerGlobalScope !== 'undefined' && 12638 // eslint-disable-next-line no-undef 12639 self instanceof WorkerGlobalScope && 12640 typeof self.importScripts === 'function' 12641 ); 12642})(); 12643 12644const origin = hasBrowserEnv && window.location.href || 'http://localhost'; 12645 12646 12647 12648;// ./node_modules/axios/lib/platform/index.js 12649 12650 12651 12652/* harmony default export */ var platform = ({ 12653 ...common_utils_namespaceObject, 12654 ...browser 12655}); 12656 12657;// ./node_modules/axios/lib/helpers/toURLEncodedForm.js 12658 12659 12660 12661 12662 12663 12664function toURLEncodedForm(data, options) { 12665 return helpers_toFormData(data, new platform.classes.URLSearchParams(), { 12666 visitor: function(value, key, path, helpers) { 12667 if (platform.isNode && utils.isBuffer(value)) { 12668 this.append(key, value.toString('base64')); 12669 return false; 12670 } 12671 12672 return helpers.defaultVisitor.apply(this, arguments); 12673 }, 12674 ...options 12675 }); 12676} 12677 12678;// ./node_modules/axios/lib/helpers/formDataToJSON.js 12679 12680 12681 12682 12683/** 12684 * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] 12685 * 12686 * @param {string} name - The name of the property to get. 12687 * 12688 * @returns An array of strings. 12689 */ 12690function parsePropPath(name) { 12691 // foo[x][y][z] 12692 // foo.x.y.z 12693 // foo-x-y-z 12694 // foo x y z 12695 return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { 12696 return match[0] === '[]' ? '' : match[1] || match[0]; 12697 }); 12698} 12699 12700/** 12701 * Convert an array to an object. 12702 * 12703 * @param {Array<any>} arr - The array to convert to an object. 12704 * 12705 * @returns An object with the same keys and values as the array. 12706 */ 12707function arrayToObject(arr) { 12708 const obj = {}; 12709 const keys = Object.keys(arr); 12710 let i; 12711 const len = keys.length; 12712 let key; 12713 for (i = 0; i < len; i++) { 12714 key = keys[i]; 12715 obj[key] = arr[key]; 12716 } 12717 return obj; 12718} 12719 12720/** 12721 * It takes a FormData object and returns a JavaScript object 12722 * 12723 * @param {string} formData The FormData object to convert to JSON. 12724 * 12725 * @returns {Object<string, any> | null} The converted object. 12726 */ 12727function formDataToJSON(formData) { 12728 function buildPath(path, value, target, index) { 12729 let name = path[index++]; 12730 12731 if (name === '__proto__') return true; 12732 12733 const isNumericKey = Number.isFinite(+name); 12734 const isLast = index >= path.length; 12735 name = !name && utils.isArray(target) ? target.length : name; 12736 12737 if (isLast) { 12738 if (utils.hasOwnProp(target, name)) { 12739 target[name] = [target[name], value]; 12740 } else { 12741 target[name] = value; 12742 } 12743 12744 return !isNumericKey; 12745 } 12746 12747 if (!target[name] || !utils.isObject(target[name])) { 12748 target[name] = []; 12749 } 12750 12751 const result = buildPath(path, value, target[name], index); 12752 12753 if (result && utils.isArray(target[name])) { 12754 target[name] = arrayToObject(target[name]); 12755 } 12756 12757 return !isNumericKey; 12758 } 12759 12760 if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { 12761 const obj = {}; 12762 12763 utils.forEachEntry(formData, (name, value) => { 12764 buildPath(parsePropPath(name), value, obj, 0); 12765 }); 12766 12767 return obj; 12768 } 12769 12770 return null; 12771} 12772 12773/* harmony default export */ var helpers_formDataToJSON = (formDataToJSON); 12774 12775;// ./node_modules/axios/lib/defaults/index.js 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786/** 12787 * It takes a string, tries to parse it, and if it fails, it returns the stringified version 12788 * of the input 12789 * 12790 * @param {any} rawValue - The value to be stringified. 12791 * @param {Function} parser - A function that parses a string into a JavaScript object. 12792 * @param {Function} encoder - A function that takes a value and returns a string. 12793 * 12794 * @returns {string} A stringified version of the rawValue. 12795 */ 12796function stringifySafely(rawValue, parser, encoder) { 12797 if (utils.isString(rawValue)) { 12798 try { 12799 (parser || JSON.parse)(rawValue); 12800 return utils.trim(rawValue); 12801 } catch (e) { 12802 if (e.name !== 'SyntaxError') { 12803 throw e; 12804 } 12805 } 12806 } 12807 12808 return (encoder || JSON.stringify)(rawValue); 12809} 12810 12811const defaults = { 12812 12813 transitional: defaults_transitional, 12814 12815 adapter: ['xhr', 'http', 'fetch'], 12816 12817 transformRequest: [function transformRequest(data, headers) { 12818 const contentType = headers.getContentType() || ''; 12819 const hasJSONContentType = contentType.indexOf('application/json') > -1; 12820 const isObjectPayload = utils.isObject(data); 12821 12822 if (isObjectPayload && utils.isHTMLForm(data)) { 12823 data = new FormData(data); 12824 } 12825 12826 const isFormData = utils.isFormData(data); 12827 12828 if (isFormData) { 12829 return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data; 12830 } 12831 12832 if (utils.isArrayBuffer(data) || 12833 utils.isBuffer(data) || 12834 utils.isStream(data) || 12835 utils.isFile(data) || 12836 utils.isBlob(data) || 12837 utils.isReadableStream(data) 12838 ) { 12839 return data; 12840 } 12841 if (utils.isArrayBufferView(data)) { 12842 return data.buffer; 12843 } 12844 if (utils.isURLSearchParams(data)) { 12845 headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); 12846 return data.toString(); 12847 } 12848 12849 let isFileList; 12850 12851 if (isObjectPayload) { 12852 if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { 12853 return toURLEncodedForm(data, this.formSerializer).toString(); 12854 } 12855 12856 if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { 12857 const _FormData = this.env && this.env.FormData; 12858 12859 return helpers_toFormData( 12860 isFileList ? {'files[]': data} : data, 12861 _FormData && new _FormData(), 12862 this.formSerializer 12863 ); 12864 } 12865 } 12866 12867 if (isObjectPayload || hasJSONContentType ) { 12868 headers.setContentType('application/json', false); 12869 return stringifySafely(data); 12870 } 12871 12872 return data; 12873 }], 12874 12875 transformResponse: [function transformResponse(data) { 12876 const transitional = this.transitional || defaults.transitional; 12877 const forcedJSONParsing = transitional && transitional.forcedJSONParsing; 12878 const JSONRequested = this.responseType === 'json'; 12879 12880 if (utils.isResponse(data) || utils.isReadableStream(data)) { 12881 return data; 12882 } 12883 12884 if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { 12885 const silentJSONParsing = transitional && transitional.silentJSONParsing; 12886 const strictJSONParsing = !silentJSONParsing && JSONRequested; 12887 12888 try { 12889 return JSON.parse(data, this.parseReviver); 12890 } catch (e) { 12891 if (strictJSONParsing) { 12892 if (e.name === 'SyntaxError') { 12893 throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response); 12894 } 12895 throw e; 12896 } 12897 } 12898 } 12899 12900 return data; 12901 }], 12902 12903 /** 12904 * A timeout in milliseconds to abort a request. If set to 0 (default) a 12905 * timeout is not created. 12906 */ 12907 timeout: 0, 12908 12909 xsrfCookieName: 'XSRF-TOKEN', 12910 xsrfHeaderName: 'X-XSRF-TOKEN', 12911 12912 maxContentLength: -1, 12913 maxBodyLength: -1, 12914 12915 env: { 12916 FormData: platform.classes.FormData, 12917 Blob: platform.classes.Blob 12918 }, 12919 12920 validateStatus: function validateStatus(status) { 12921 return status >= 200 && status < 300; 12922 }, 12923 12924 headers: { 12925 common: { 12926 'Accept': 'application/json, text/plain, */*', 12927 'Content-Type': undefined 12928 } 12929 } 12930}; 12931 12932utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { 12933 defaults.headers[method] = {}; 12934}); 12935 12936/* harmony default export */ var lib_defaults = (defaults); 12937 12938;// ./node_modules/axios/lib/helpers/parseHeaders.js 12939 12940 12941 12942 12943// RawAxiosHeaders whose duplicates are ignored by node 12944// c.f. https://nodejs.org/api/http.html#http_message_headers 12945const ignoreDuplicateOf = utils.toObjectSet([ 12946 'age', 'authorization', 'content-length', 'content-type', 'etag', 12947 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 12948 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 12949 'referer', 'retry-after', 'user-agent' 12950]); 12951 12952/** 12953 * Parse headers into an object 12954 * 12955 * ``` 12956 * Date: Wed, 27 Aug 2014 08:58:49 GMT 12957 * Content-Type: application/json 12958 * Connection: keep-alive 12959 * Transfer-Encoding: chunked 12960 * ``` 12961 * 12962 * @param {String} rawHeaders Headers needing to be parsed 12963 * 12964 * @returns {Object} Headers parsed into an object 12965 */ 12966/* harmony default export */ var parseHeaders = (rawHeaders => { 12967 const parsed = {}; 12968 let key; 12969 let val; 12970 let i; 12971 12972 rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { 12973 i = line.indexOf(':'); 12974 key = line.substring(0, i).trim().toLowerCase(); 12975 val = line.substring(i + 1).trim(); 12976 12977 if (!key || (parsed[key] && ignoreDuplicateOf[key])) { 12978 return; 12979 } 12980 12981 if (key === 'set-cookie') { 12982 if (parsed[key]) { 12983 parsed[key].push(val); 12984 } else { 12985 parsed[key] = [val]; 12986 } 12987 } else { 12988 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 12989 } 12990 }); 12991 12992 return parsed; 12993}); 12994 12995;// ./node_modules/axios/lib/core/AxiosHeaders.js 12996 12997 12998 12999 13000 13001const $internals = Symbol('internals'); 13002 13003function normalizeHeader(header) { 13004 return header && String(header).trim().toLowerCase(); 13005} 13006 13007function normalizeValue(value) { 13008 if (value === false || value == null) { 13009 return value; 13010 } 13011 13012 return utils.isArray(value) ? value.map(normalizeValue) : String(value); 13013} 13014 13015function parseTokens(str) { 13016 const tokens = Object.create(null); 13017 const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; 13018 let match; 13019 13020 while ((match = tokensRE.exec(str))) { 13021 tokens[match[1]] = match[2]; 13022 } 13023 13024 return tokens; 13025} 13026 13027const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); 13028 13029function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { 13030 if (utils.isFunction(filter)) { 13031 return filter.call(this, value, header); 13032 } 13033 13034 if (isHeaderNameFilter) { 13035 value = header; 13036 } 13037 13038 if (!utils.isString(value)) return; 13039 13040 if (utils.isString(filter)) { 13041 return value.indexOf(filter) !== -1; 13042 } 13043 13044 if (utils.isRegExp(filter)) { 13045 return filter.test(value); 13046 } 13047} 13048 13049function formatHeader(header) { 13050 return header.trim() 13051 .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { 13052 return char.toUpperCase() + str; 13053 }); 13054} 13055 13056function buildAccessors(obj, header) { 13057 const accessorName = utils.toCamelCase(' ' + header); 13058 13059 ['get', 'set', 'has'].forEach(methodName => { 13060 Object.defineProperty(obj, methodName + accessorName, { 13061 value: function(arg1, arg2, arg3) { 13062 return this[methodName].call(this, header, arg1, arg2, arg3); 13063 }, 13064 configurable: true 13065 }); 13066 }); 13067} 13068 13069class AxiosHeaders { 13070 constructor(headers) { 13071 headers && this.set(headers); 13072 } 13073 13074 set(header, valueOrRewrite, rewrite) { 13075 const self = this; 13076 13077 function setHeader(_value, _header, _rewrite) { 13078 const lHeader = normalizeHeader(_header); 13079 13080 if (!lHeader) { 13081 throw new Error('header name must be a non-empty string'); 13082 } 13083 13084 const key = utils.findKey(self, lHeader); 13085 13086 if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { 13087 self[key || _header] = normalizeValue(_value); 13088 } 13089 } 13090 13091 const setHeaders = (headers, _rewrite) => 13092 utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); 13093 13094 if (utils.isPlainObject(header) || header instanceof this.constructor) { 13095 setHeaders(header, valueOrRewrite) 13096 } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { 13097 setHeaders(parseHeaders(header), valueOrRewrite); 13098 } else if (utils.isObject(header) && utils.isIterable(header)) { 13099 let obj = {}, dest, key; 13100 for (const entry of header) { 13101 if (!utils.isArray(entry)) { 13102 throw TypeError('Object iterator must return a key-value pair'); 13103 } 13104 13105 obj[key = entry[0]] = (dest = obj[key]) ? 13106 (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; 13107 } 13108 13109 setHeaders(obj, valueOrRewrite) 13110 } else { 13111 header != null && setHeader(valueOrRewrite, header, rewrite); 13112 } 13113 13114 return this; 13115 } 13116 13117 get(header, parser) { 13118 header = normalizeHeader(header); 13119 13120 if (header) { 13121 const key = utils.findKey(this, header); 13122 13123 if (key) { 13124 const value = this[key]; 13125 13126 if (!parser) { 13127 return value; 13128 } 13129 13130 if (parser === true) { 13131 return parseTokens(value); 13132 } 13133 13134 if (utils.isFunction(parser)) { 13135 return parser.call(this, value, key); 13136 } 13137 13138 if (utils.isRegExp(parser)) { 13139 return parser.exec(value); 13140 } 13141 13142 throw new TypeError('parser must be boolean|regexp|function'); 13143 } 13144 } 13145 } 13146 13147 has(header, matcher) { 13148 header = normalizeHeader(header); 13149 13150 if (header) { 13151 const key = utils.findKey(this, header); 13152 13153 return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); 13154 } 13155 13156 return false; 13157 } 13158 13159 delete(header, matcher) { 13160 const self = this; 13161 let deleted = false; 13162 13163 function deleteHeader(_header) { 13164 _header = normalizeHeader(_header); 13165 13166 if (_header) { 13167 const key = utils.findKey(self, _header); 13168 13169 if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { 13170 delete self[key]; 13171 13172 deleted = true; 13173 } 13174 } 13175 } 13176 13177 if (utils.isArray(header)) { 13178 header.forEach(deleteHeader); 13179 } else { 13180 deleteHeader(header); 13181 } 13182 13183 return deleted; 13184 } 13185 13186 clear(matcher) { 13187 const keys = Object.keys(this); 13188 let i = keys.length; 13189 let deleted = false; 13190 13191 while (i--) { 13192 const key = keys[i]; 13193 if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { 13194 delete this[key]; 13195 deleted = true; 13196 } 13197 } 13198 13199 return deleted; 13200 } 13201 13202 normalize(format) { 13203 const self = this; 13204 const headers = {}; 13205 13206 utils.forEach(this, (value, header) => { 13207 const key = utils.findKey(headers, header); 13208 13209 if (key) { 13210 self[key] = normalizeValue(value); 13211 delete self[header]; 13212 return; 13213 } 13214 13215 const normalized = format ? formatHeader(header) : String(header).trim(); 13216 13217 if (normalized !== header) { 13218 delete self[header]; 13219 } 13220 13221 self[normalized] = normalizeValue(value); 13222 13223 headers[normalized] = true; 13224 }); 13225 13226 return this; 13227 } 13228 13229 concat(...targets) { 13230 return this.constructor.concat(this, ...targets); 13231 } 13232 13233 toJSON(asStrings) { 13234 const obj = Object.create(null); 13235 13236 utils.forEach(this, (value, header) => { 13237 value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); 13238 }); 13239 13240 return obj; 13241 } 13242 13243 [Symbol.iterator]() { 13244 return Object.entries(this.toJSON())[Symbol.iterator](); 13245 } 13246 13247 toString() { 13248 return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); 13249 } 13250 13251 getSetCookie() { 13252 return this.get("set-cookie") || []; 13253 } 13254 13255 get [Symbol.toStringTag]() { 13256 return 'AxiosHeaders'; 13257 } 13258 13259 static from(thing) { 13260 return thing instanceof this ? thing : new this(thing); 13261 } 13262 13263 static concat(first, ...targets) { 13264 const computed = new this(first); 13265 13266 targets.forEach((target) => computed.set(target)); 13267 13268 return computed; 13269 } 13270 13271 static accessor(header) { 13272 const internals = this[$internals] = (this[$internals] = { 13273 accessors: {} 13274 }); 13275 13276 const accessors = internals.accessors; 13277 const prototype = this.prototype; 13278 13279 function defineAccessor(_header) { 13280 const lHeader = normalizeHeader(_header); 13281 13282 if (!accessors[lHeader]) { 13283 buildAccessors(prototype, _header); 13284 accessors[lHeader] = true; 13285 } 13286 } 13287 13288 utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); 13289 13290 return this; 13291 } 13292} 13293 13294AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); 13295 13296// reserved names hotfix 13297utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { 13298 let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` 13299 return { 13300 get: () => value, 13301 set(headerValue) { 13302 this[mapped] = headerValue; 13303 } 13304 } 13305}); 13306 13307utils.freezeMethods(AxiosHeaders); 13308 13309/* harmony default export */ var core_AxiosHeaders = (AxiosHeaders); 13310 13311;// ./node_modules/axios/lib/core/transformData.js 13312 13313 13314 13315 13316 13317 13318/** 13319 * Transform the data for a request or a response 13320 * 13321 * @param {Array|Function} fns A single function or Array of functions 13322 * @param {?Object} response The response object 13323 * 13324 * @returns {*} The resulting transformed data 13325 */ 13326function transformData(fns, response) { 13327 const config = this || lib_defaults; 13328 const context = response || config; 13329 const headers = core_AxiosHeaders.from(context.headers); 13330 let data = context.data; 13331 13332 utils.forEach(fns, function transform(fn) { 13333 data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); 13334 }); 13335 13336 headers.normalize(); 13337 13338 return data; 13339} 13340 13341;// ./node_modules/axios/lib/cancel/isCancel.js 13342 13343 13344function isCancel(value) { 13345 return !!(value && value.__CANCEL__); 13346} 13347 13348;// ./node_modules/axios/lib/cancel/CanceledError.js 13349 13350 13351 13352 13353 13354/** 13355 * A `CanceledError` is an object that is thrown when an operation is canceled. 13356 * 13357 * @param {string=} message The message. 13358 * @param {Object=} config The config. 13359 * @param {Object=} request The request. 13360 * 13361 * @returns {CanceledError} The created error. 13362 */ 13363function CanceledError(message, config, request) { 13364 // eslint-disable-next-line no-eq-null,eqeqeq 13365 core_AxiosError.call(this, message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request); 13366 this.name = 'CanceledError'; 13367} 13368 13369utils.inherits(CanceledError, core_AxiosError, { 13370 __CANCEL__: true 13371}); 13372 13373/* harmony default export */ var cancel_CanceledError = (CanceledError); 13374 13375;// ./node_modules/axios/lib/core/settle.js 13376 13377 13378 13379 13380/** 13381 * Resolve or reject a Promise based on response status. 13382 * 13383 * @param {Function} resolve A function that resolves the promise. 13384 * @param {Function} reject A function that rejects the promise. 13385 * @param {object} response The response. 13386 * 13387 * @returns {object} The response. 13388 */ 13389function settle(resolve, reject, response) { 13390 const validateStatus = response.config.validateStatus; 13391 if (!response.status || !validateStatus || validateStatus(response.status)) { 13392 resolve(response); 13393 } else { 13394 reject(new core_AxiosError( 13395 'Request failed with status code ' + response.status, 13396 [core_AxiosError.ERR_BAD_REQUEST, core_AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], 13397 response.config, 13398 response.request, 13399 response 13400 )); 13401 } 13402} 13403 13404;// ./node_modules/axios/lib/helpers/parseProtocol.js 13405 13406 13407function parseProtocol(url) { 13408 const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); 13409 return match && match[1] || ''; 13410} 13411 13412;// ./node_modules/axios/lib/helpers/speedometer.js 13413 13414 13415/** 13416 * Calculate data maxRate 13417 * @param {Number} [samplesCount= 10] 13418 * @param {Number} [min= 1000] 13419 * @returns {Function} 13420 */ 13421function speedometer(samplesCount, min) { 13422 samplesCount = samplesCount || 10; 13423 const bytes = new Array(samplesCount); 13424 const timestamps = new Array(samplesCount); 13425 let head = 0; 13426 let tail = 0; 13427 let firstSampleTS; 13428 13429 min = min !== undefined ? min : 1000; 13430 13431 return function push(chunkLength) { 13432 const now = Date.now(); 13433 13434 const startedAt = timestamps[tail]; 13435 13436 if (!firstSampleTS) { 13437 firstSampleTS = now; 13438 } 13439 13440 bytes[head] = chunkLength; 13441 timestamps[head] = now; 13442 13443 let i = tail; 13444 let bytesCount = 0; 13445 13446 while (i !== head) { 13447 bytesCount += bytes[i++]; 13448 i = i % samplesCount; 13449 } 13450 13451 head = (head + 1) % samplesCount; 13452 13453 if (head === tail) { 13454 tail = (tail + 1) % samplesCount; 13455 } 13456 13457 if (now - firstSampleTS < min) { 13458 return; 13459 } 13460 13461 const passed = startedAt && now - startedAt; 13462 13463 return passed ? Math.round(bytesCount * 1000 / passed) : undefined; 13464 }; 13465} 13466 13467/* harmony default export */ var helpers_speedometer = (speedometer); 13468 13469;// ./node_modules/axios/lib/helpers/throttle.js 13470/** 13471 * Throttle decorator 13472 * @param {Function} fn 13473 * @param {Number} freq 13474 * @return {Function} 13475 */ 13476function throttle(fn, freq) { 13477 let timestamp = 0; 13478 let threshold = 1000 / freq; 13479 let lastArgs; 13480 let timer; 13481 13482 const invoke = (args, now = Date.now()) => { 13483 timestamp = now; 13484 lastArgs = null; 13485 if (timer) { 13486 clearTimeout(timer); 13487 timer = null; 13488 } 13489 fn(...args); 13490 } 13491 13492 const throttled = (...args) => { 13493 const now = Date.now(); 13494 const passed = now - timestamp; 13495 if ( passed >= threshold) { 13496 invoke(args, now); 13497 } else { 13498 lastArgs = args; 13499 if (!timer) { 13500 timer = setTimeout(() => { 13501 timer = null; 13502 invoke(lastArgs) 13503 }, threshold - passed); 13504 } 13505 } 13506 } 13507 13508 const flush = () => lastArgs && invoke(lastArgs); 13509 13510 return [throttled, flush]; 13511} 13512 13513/* harmony default export */ var helpers_throttle = (throttle); 13514 13515;// ./node_modules/axios/lib/helpers/progressEventReducer.js 13516 13517 13518 13519 13520const progressEventReducer = (listener, isDownloadStream, freq = 3) => { 13521 let bytesNotified = 0; 13522 const _speedometer = helpers_speedometer(50, 250); 13523 13524 return helpers_throttle(e => { 13525 const loaded = e.loaded; 13526 const total = e.lengthComputable ? e.total : undefined; 13527 const progressBytes = loaded - bytesNotified; 13528 const rate = _speedometer(progressBytes); 13529 const inRange = loaded <= total; 13530 13531 bytesNotified = loaded; 13532 13533 const data = { 13534 loaded, 13535 total, 13536 progress: total ? (loaded / total) : undefined, 13537 bytes: progressBytes, 13538 rate: rate ? rate : undefined, 13539 estimated: rate && total && inRange ? (total - loaded) / rate : undefined, 13540 event: e, 13541 lengthComputable: total != null, 13542 [isDownloadStream ? 'download' : 'upload']: true 13543 }; 13544 13545 listener(data); 13546 }, freq); 13547} 13548 13549const progressEventDecorator = (total, throttled) => { 13550 const lengthComputable = total != null; 13551 13552 return [(loaded) => throttled[0]({ 13553 lengthComputable, 13554 total, 13555 loaded 13556 }), throttled[1]]; 13557} 13558 13559const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args)); 13560 13561;// ./node_modules/axios/lib/helpers/isURLSameOrigin.js 13562 13563 13564/* harmony default export */ var isURLSameOrigin = (platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { 13565 url = new URL(url, platform.origin); 13566 13567 return ( 13568 origin.protocol === url.protocol && 13569 origin.host === url.host && 13570 (isMSIE || origin.port === url.port) 13571 ); 13572})( 13573 new URL(platform.origin), 13574 platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) 13575) : () => true); 13576 13577;// ./node_modules/axios/lib/helpers/cookies.js 13578 13579 13580 13581/* harmony default export */ var cookies = (platform.hasStandardBrowserEnv ? 13582 13583 // Standard browser envs support document.cookie 13584 { 13585 write(name, value, expires, path, domain, secure, sameSite) { 13586 if (typeof document === 'undefined') return; 13587 13588 const cookie = [`${name}=${encodeURIComponent(value)}`]; 13589 13590 if (utils.isNumber(expires)) { 13591 cookie.push(`expires=${new Date(expires).toUTCString()}`); 13592 } 13593 if (utils.isString(path)) { 13594 cookie.push(`path=${path}`); 13595 } 13596 if (utils.isString(domain)) { 13597 cookie.push(`domain=${domain}`); 13598 } 13599 if (secure === true) { 13600 cookie.push('secure'); 13601 } 13602 if (utils.isString(sameSite)) { 13603 cookie.push(`SameSite=${sameSite}`); 13604 } 13605 13606 document.cookie = cookie.join('; '); 13607 }, 13608 13609 read(name) { 13610 if (typeof document === 'undefined') return null; 13611 const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); 13612 return match ? decodeURIComponent(match[1]) : null; 13613 }, 13614 13615 remove(name) { 13616 this.write(name, '', Date.now() - 86400000, '/'); 13617 } 13618 } 13619 13620 : 13621 13622 // Non-standard browser env (web workers, react-native) lack needed support. 13623 { 13624 write() {}, 13625 read() { 13626 return null; 13627 }, 13628 remove() {} 13629 }); 13630 13631 13632;// ./node_modules/axios/lib/helpers/isAbsoluteURL.js 13633 13634 13635/** 13636 * Determines whether the specified URL is absolute 13637 * 13638 * @param {string} url The URL to test 13639 * 13640 * @returns {boolean} True if the specified URL is absolute, otherwise false 13641 */ 13642function isAbsoluteURL(url) { 13643 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 13644 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 13645 // by any combination of letters, digits, plus, period, or hyphen. 13646 return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); 13647} 13648 13649;// ./node_modules/axios/lib/helpers/combineURLs.js 13650 13651 13652/** 13653 * Creates a new URL by combining the specified URLs 13654 * 13655 * @param {string} baseURL The base URL 13656 * @param {string} relativeURL The relative URL 13657 * 13658 * @returns {string} The combined URL 13659 */ 13660function combineURLs(baseURL, relativeURL) { 13661 return relativeURL 13662 ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') 13663 : baseURL; 13664} 13665 13666;// ./node_modules/axios/lib/core/buildFullPath.js 13667 13668 13669 13670 13671 13672/** 13673 * Creates a new URL by combining the baseURL with the requestedURL, 13674 * only when the requestedURL is not already an absolute URL. 13675 * If the requestURL is absolute, this function returns the requestedURL untouched. 13676 * 13677 * @param {string} baseURL The base URL 13678 * @param {string} requestedURL Absolute or relative URL to combine 13679 * 13680 * @returns {string} The combined full path 13681 */ 13682function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { 13683 let isRelativeUrl = !isAbsoluteURL(requestedURL); 13684 if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { 13685 return combineURLs(baseURL, requestedURL); 13686 } 13687 return requestedURL; 13688} 13689 13690;// ./node_modules/axios/lib/core/mergeConfig.js 13691 13692 13693 13694 13695 13696const headersToObject = (thing) => thing instanceof core_AxiosHeaders ? { ...thing } : thing; 13697 13698/** 13699 * Config-specific merge-function which creates a new config-object 13700 * by merging two configuration objects together. 13701 * 13702 * @param {Object} config1 13703 * @param {Object} config2 13704 * 13705 * @returns {Object} New object resulting from merging config2 to config1 13706 */ 13707function mergeConfig(config1, config2) { 13708 // eslint-disable-next-line no-param-reassign 13709 config2 = config2 || {}; 13710 const config = {}; 13711 13712 function getMergedValue(target, source, prop, caseless) { 13713 if (utils.isPlainObject(target) && utils.isPlainObject(source)) { 13714 return utils.merge.call({caseless}, target, source); 13715 } else if (utils.isPlainObject(source)) { 13716 return utils.merge({}, source); 13717 } else if (utils.isArray(source)) { 13718 return source.slice(); 13719 } 13720 return source; 13721 } 13722 13723 // eslint-disable-next-line consistent-return 13724 function mergeDeepProperties(a, b, prop, caseless) { 13725 if (!utils.isUndefined(b)) { 13726 return getMergedValue(a, b, prop, caseless); 13727 } else if (!utils.isUndefined(a)) { 13728 return getMergedValue(undefined, a, prop, caseless); 13729 } 13730 } 13731 13732 // eslint-disable-next-line consistent-return 13733 function valueFromConfig2(a, b) { 13734 if (!utils.isUndefined(b)) { 13735 return getMergedValue(undefined, b); 13736 } 13737 } 13738 13739 // eslint-disable-next-line consistent-return 13740 function defaultToConfig2(a, b) { 13741 if (!utils.isUndefined(b)) { 13742 return getMergedValue(undefined, b); 13743 } else if (!utils.isUndefined(a)) { 13744 return getMergedValue(undefined, a); 13745 } 13746 } 13747 13748 // eslint-disable-next-line consistent-return 13749 function mergeDirectKeys(a, b, prop) { 13750 if (prop in config2) { 13751 return getMergedValue(a, b); 13752 } else if (prop in config1) { 13753 return getMergedValue(undefined, a); 13754 } 13755 } 13756 13757 const mergeMap = { 13758 url: valueFromConfig2, 13759 method: valueFromConfig2, 13760 data: valueFromConfig2, 13761 baseURL: defaultToConfig2, 13762 transformRequest: defaultToConfig2, 13763 transformResponse: defaultToConfig2, 13764 paramsSerializer: defaultToConfig2, 13765 timeout: defaultToConfig2, 13766 timeoutMessage: defaultToConfig2, 13767 withCredentials: defaultToConfig2, 13768 withXSRFToken: defaultToConfig2, 13769 adapter: defaultToConfig2, 13770 responseType: defaultToConfig2, 13771 xsrfCookieName: defaultToConfig2, 13772 xsrfHeaderName: defaultToConfig2, 13773 onUploadProgress: defaultToConfig2, 13774 onDownloadProgress: defaultToConfig2, 13775 decompress: defaultToConfig2, 13776 maxContentLength: defaultToConfig2, 13777 maxBodyLength: defaultToConfig2, 13778 beforeRedirect: defaultToConfig2, 13779 transport: defaultToConfig2, 13780 httpAgent: defaultToConfig2, 13781 httpsAgent: defaultToConfig2, 13782 cancelToken: defaultToConfig2, 13783 socketPath: defaultToConfig2, 13784 responseEncoding: defaultToConfig2, 13785 validateStatus: mergeDirectKeys, 13786 headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) 13787 }; 13788 13789 utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { 13790 const merge = mergeMap[prop] || mergeDeepProperties; 13791 const configValue = merge(config1[prop], config2[prop], prop); 13792 (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); 13793 }); 13794 13795 return config; 13796} 13797 13798;// ./node_modules/axios/lib/helpers/resolveConfig.js 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808/* harmony default export */ var resolveConfig = ((config) => { 13809 const newConfig = mergeConfig({}, config); 13810 13811 let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; 13812 13813 newConfig.headers = headers = core_AxiosHeaders.from(headers); 13814 13815 newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); 13816 13817 // HTTP basic authentication 13818 if (auth) { 13819 headers.set('Authorization', 'Basic ' + 13820 btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) 13821 ); 13822 } 13823 13824 if (utils.isFormData(data)) { 13825 if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { 13826 headers.setContentType(undefined); // browser handles it 13827 } else if (utils.isFunction(data.getHeaders)) { 13828 // Node.js FormData (like form-data package) 13829 const formHeaders = data.getHeaders(); 13830 // Only set safe headers to avoid overwriting security headers 13831 const allowedHeaders = ['content-type', 'content-length']; 13832 Object.entries(formHeaders).forEach(([key, val]) => { 13833 if (allowedHeaders.includes(key.toLowerCase())) { 13834 headers.set(key, val); 13835 } 13836 }); 13837 } 13838 } 13839 13840 // Add xsrf header 13841 // This is only done if running in a standard browser environment. 13842 // Specifically not if we're in a web worker, or react-native. 13843 13844 if (platform.hasStandardBrowserEnv) { 13845 withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); 13846 13847 if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { 13848 // Add xsrf header 13849 const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); 13850 13851 if (xsrfValue) { 13852 headers.set(xsrfHeaderName, xsrfValue); 13853 } 13854 } 13855 } 13856 13857 return newConfig; 13858}); 13859 13860 13861;// ./node_modules/axios/lib/adapters/xhr.js 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; 13874 13875/* harmony default export */ var xhr = (isXHRAdapterSupported && function (config) { 13876 return new Promise(function dispatchXhrRequest(resolve, reject) { 13877 const _config = resolveConfig(config); 13878 let requestData = _config.data; 13879 const requestHeaders = core_AxiosHeaders.from(_config.headers).normalize(); 13880 let {responseType, onUploadProgress, onDownloadProgress} = _config; 13881 let onCanceled; 13882 let uploadThrottled, downloadThrottled; 13883 let flushUpload, flushDownload; 13884 13885 function done() { 13886 flushUpload && flushUpload(); // flush events 13887 flushDownload && flushDownload(); // flush events 13888 13889 _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); 13890 13891 _config.signal && _config.signal.removeEventListener('abort', onCanceled); 13892 } 13893 13894 let request = new XMLHttpRequest(); 13895 13896 request.open(_config.method.toUpperCase(), _config.url, true); 13897 13898 // Set the request timeout in MS 13899 request.timeout = _config.timeout; 13900 13901 function onloadend() { 13902 if (!request) { 13903 return; 13904 } 13905 // Prepare the response 13906 const responseHeaders = core_AxiosHeaders.from( 13907 'getAllResponseHeaders' in request && request.getAllResponseHeaders() 13908 ); 13909 const responseData = !responseType || responseType === 'text' || responseType === 'json' ? 13910 request.responseText : request.response; 13911 const response = { 13912 data: responseData, 13913 status: request.status, 13914 statusText: request.statusText, 13915 headers: responseHeaders, 13916 config, 13917 request 13918 }; 13919 13920 settle(function _resolve(value) { 13921 resolve(value); 13922 done(); 13923 }, function _reject(err) { 13924 reject(err); 13925 done(); 13926 }, response); 13927 13928 // Clean up request 13929 request = null; 13930 } 13931 13932 if ('onloadend' in request) { 13933 // Use onloadend if available 13934 request.onloadend = onloadend; 13935 } else { 13936 // Listen for ready state to emulate onloadend 13937 request.onreadystatechange = function handleLoad() { 13938 if (!request || request.readyState !== 4) { 13939 return; 13940 } 13941 13942 // The request errored out and we didn't get a response, this will be 13943 // handled by onerror instead 13944 // With one exception: request that using file: protocol, most browsers 13945 // will return status as 0 even though it's a successful request 13946 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 13947 return; 13948 } 13949 // readystate handler is calling before onerror or ontimeout handlers, 13950 // so we should call onloadend on the next 'tick' 13951 setTimeout(onloadend); 13952 }; 13953 } 13954 13955 // Handle browser request cancellation (as opposed to a manual cancellation) 13956 request.onabort = function handleAbort() { 13957 if (!request) { 13958 return; 13959 } 13960 13961 reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request)); 13962 13963 // Clean up request 13964 request = null; 13965 }; 13966 13967 // Handle low level network errors 13968 request.onerror = function handleError(event) { 13969 // Browsers deliver a ProgressEvent in XHR onerror 13970 // (message may be empty; when present, surface it) 13971 // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event 13972 const msg = event && event.message ? event.message : 'Network Error'; 13973 const err = new core_AxiosError(msg, core_AxiosError.ERR_NETWORK, config, request); 13974 // attach the underlying event for consumers who want details 13975 err.event = event || null; 13976 reject(err); 13977 request = null; 13978 }; 13979 13980 // Handle timeout 13981 request.ontimeout = function handleTimeout() { 13982 let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; 13983 const transitional = _config.transitional || defaults_transitional; 13984 if (_config.timeoutErrorMessage) { 13985 timeoutErrorMessage = _config.timeoutErrorMessage; 13986 } 13987 reject(new core_AxiosError( 13988 timeoutErrorMessage, 13989 transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, 13990 config, 13991 request)); 13992 13993 // Clean up request 13994 request = null; 13995 }; 13996 13997 // Remove Content-Type if data is undefined 13998 requestData === undefined && requestHeaders.setContentType(null); 13999 14000 // Add headers to the request 14001 if ('setRequestHeader' in request) { 14002 utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { 14003 request.setRequestHeader(key, val); 14004 }); 14005 } 14006 14007 // Add withCredentials to request if needed 14008 if (!utils.isUndefined(_config.withCredentials)) { 14009 request.withCredentials = !!_config.withCredentials; 14010 } 14011 14012 // Add responseType to request if needed 14013 if (responseType && responseType !== 'json') { 14014 request.responseType = _config.responseType; 14015 } 14016 14017 // Handle progress if needed 14018 if (onDownloadProgress) { 14019 ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); 14020 request.addEventListener('progress', downloadThrottled); 14021 } 14022 14023 // Not all browsers support upload events 14024 if (onUploadProgress && request.upload) { 14025 ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); 14026 14027 request.upload.addEventListener('progress', uploadThrottled); 14028 14029 request.upload.addEventListener('loadend', flushUpload); 14030 } 14031 14032 if (_config.cancelToken || _config.signal) { 14033 // Handle cancellation 14034 // eslint-disable-next-line func-names 14035 onCanceled = cancel => { 14036 if (!request) { 14037 return; 14038 } 14039 reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel); 14040 request.abort(); 14041 request = null; 14042 }; 14043 14044 _config.cancelToken && _config.cancelToken.subscribe(onCanceled); 14045 if (_config.signal) { 14046 _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); 14047 } 14048 } 14049 14050 const protocol = parseProtocol(_config.url); 14051 14052 if (protocol && platform.protocols.indexOf(protocol) === -1) { 14053 reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config)); 14054 return; 14055 } 14056 14057 14058 // Send the request 14059 request.send(requestData || null); 14060 }); 14061}); 14062 14063;// ./node_modules/axios/lib/helpers/composeSignals.js 14064 14065 14066 14067 14068const composeSignals = (signals, timeout) => { 14069 const {length} = (signals = signals ? signals.filter(Boolean) : []); 14070 14071 if (timeout || length) { 14072 let controller = new AbortController(); 14073 14074 let aborted; 14075 14076 const onabort = function (reason) { 14077 if (!aborted) { 14078 aborted = true; 14079 unsubscribe(); 14080 const err = reason instanceof Error ? reason : this.reason; 14081 controller.abort(err instanceof core_AxiosError ? err : new cancel_CanceledError(err instanceof Error ? err.message : err)); 14082 } 14083 } 14084 14085 let timer = timeout && setTimeout(() => { 14086 timer = null; 14087 onabort(new core_AxiosError(`timeout ${timeout} of ms exceeded`, core_AxiosError.ETIMEDOUT)) 14088 }, timeout) 14089 14090 const unsubscribe = () => { 14091 if (signals) { 14092 timer && clearTimeout(timer); 14093 timer = null; 14094 signals.forEach(signal => { 14095 signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); 14096 }); 14097 signals = null; 14098 } 14099 } 14100 14101 signals.forEach((signal) => signal.addEventListener('abort', onabort)); 14102 14103 const {signal} = controller; 14104 14105 signal.unsubscribe = () => utils.asap(unsubscribe); 14106 14107 return signal; 14108 } 14109} 14110 14111/* harmony default export */ var helpers_composeSignals = (composeSignals); 14112 14113;// ./node_modules/axios/lib/helpers/trackStream.js 14114 14115const streamChunk = function* (chunk, chunkSize) { 14116 let len = chunk.byteLength; 14117 14118 if (!chunkSize || len < chunkSize) { 14119 yield chunk; 14120 return; 14121 } 14122 14123 let pos = 0; 14124 let end; 14125 14126 while (pos < len) { 14127 end = pos + chunkSize; 14128 yield chunk.slice(pos, end); 14129 pos = end; 14130 } 14131} 14132 14133const readBytes = async function* (iterable, chunkSize) { 14134 for await (const chunk of readStream(iterable)) { 14135 yield* streamChunk(chunk, chunkSize); 14136 } 14137} 14138 14139const readStream = async function* (stream) { 14140 if (stream[Symbol.asyncIterator]) { 14141 yield* stream; 14142 return; 14143 } 14144 14145 const reader = stream.getReader(); 14146 try { 14147 for (;;) { 14148 const {done, value} = await reader.read(); 14149 if (done) { 14150 break; 14151 } 14152 yield value; 14153 } 14154 } finally { 14155 await reader.cancel(); 14156 } 14157} 14158 14159const trackStream = (stream, chunkSize, onProgress, onFinish) => { 14160 const iterator = readBytes(stream, chunkSize); 14161 14162 let bytes = 0; 14163 let done; 14164 let _onFinish = (e) => { 14165 if (!done) { 14166 done = true; 14167 onFinish && onFinish(e); 14168 } 14169 } 14170 14171 return new ReadableStream({ 14172 async pull(controller) { 14173 try { 14174 const {done, value} = await iterator.next(); 14175 14176 if (done) { 14177 _onFinish(); 14178 controller.close(); 14179 return; 14180 } 14181 14182 let len = value.byteLength; 14183 if (onProgress) { 14184 let loadedBytes = bytes += len; 14185 onProgress(loadedBytes); 14186 } 14187 controller.enqueue(new Uint8Array(value)); 14188 } catch (err) { 14189 _onFinish(err); 14190 throw err; 14191 } 14192 }, 14193 cancel(reason) { 14194 _onFinish(reason); 14195 return iterator.return(); 14196 } 14197 }, { 14198 highWaterMark: 2 14199 }) 14200} 14201 14202;// ./node_modules/axios/lib/adapters/fetch.js 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213const DEFAULT_CHUNK_SIZE = 64 * 1024; 14214 14215const {isFunction: fetch_isFunction} = utils; 14216 14217const globalFetchAPI = (({Request, Response}) => ({ 14218 Request, Response 14219}))(utils.global); 14220 14221const { 14222 ReadableStream: fetch_ReadableStream, TextEncoder 14223} = utils.global; 14224 14225 14226const test = (fn, ...args) => { 14227 try { 14228 return !!fn(...args); 14229 } catch (e) { 14230 return false 14231 } 14232} 14233 14234const factory = (env) => { 14235 env = utils.merge.call({ 14236 skipUndefined: true 14237 }, globalFetchAPI, env); 14238 14239 const {fetch: envFetch, Request, Response} = env; 14240 const isFetchSupported = envFetch ? fetch_isFunction(envFetch) : typeof fetch === 'function'; 14241 const isRequestSupported = fetch_isFunction(Request); 14242 const isResponseSupported = fetch_isFunction(Response); 14243 14244 if (!isFetchSupported) { 14245 return false; 14246 } 14247 14248 const isReadableStreamSupported = isFetchSupported && fetch_isFunction(fetch_ReadableStream); 14249 14250 const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? 14251 ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : 14252 async (str) => new Uint8Array(await new Request(str).arrayBuffer()) 14253 ); 14254 14255 const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { 14256 let duplexAccessed = false; 14257 14258 const hasContentType = new Request(platform.origin, { 14259 body: new fetch_ReadableStream(), 14260 method: 'POST', 14261 get duplex() { 14262 duplexAccessed = true; 14263 return 'half'; 14264 }, 14265 }).headers.has('Content-Type'); 14266 14267 return duplexAccessed && !hasContentType; 14268 }); 14269 14270 const supportsResponseStream = isResponseSupported && isReadableStreamSupported && 14271 test(() => utils.isReadableStream(new Response('').body)); 14272 14273 const resolvers = { 14274 stream: supportsResponseStream && ((res) => res.body) 14275 }; 14276 14277 isFetchSupported && ((() => { 14278 ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { 14279 !resolvers[type] && (resolvers[type] = (res, config) => { 14280 let method = res && res[type]; 14281 14282 if (method) { 14283 return method.call(res); 14284 } 14285 14286 throw new core_AxiosError(`Response type '${type}' is not supported`, core_AxiosError.ERR_NOT_SUPPORT, config); 14287 }) 14288 }); 14289 })()); 14290 14291 const getBodyLength = async (body) => { 14292 if (body == null) { 14293 return 0; 14294 } 14295 14296 if (utils.isBlob(body)) { 14297 return body.size; 14298 } 14299 14300 if (utils.isSpecCompliantForm(body)) { 14301 const _request = new Request(platform.origin, { 14302 method: 'POST', 14303 body, 14304 }); 14305 return (await _request.arrayBuffer()).byteLength; 14306 } 14307 14308 if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) { 14309 return body.byteLength; 14310 } 14311 14312 if (utils.isURLSearchParams(body)) { 14313 body = body + ''; 14314 } 14315 14316 if (utils.isString(body)) { 14317 return (await encodeText(body)).byteLength; 14318 } 14319 } 14320 14321 const resolveBodyLength = async (headers, body) => { 14322 const length = utils.toFiniteNumber(headers.getContentLength()); 14323 14324 return length == null ? getBodyLength(body) : length; 14325 } 14326 14327 return async (config) => { 14328 let { 14329 url, 14330 method, 14331 data, 14332 signal, 14333 cancelToken, 14334 timeout, 14335 onDownloadProgress, 14336 onUploadProgress, 14337 responseType, 14338 headers, 14339 withCredentials = 'same-origin', 14340 fetchOptions 14341 } = resolveConfig(config); 14342 14343 let _fetch = envFetch || fetch; 14344 14345 responseType = responseType ? (responseType + '').toLowerCase() : 'text'; 14346 14347 let composedSignal = helpers_composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); 14348 14349 let request = null; 14350 14351 const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { 14352 composedSignal.unsubscribe(); 14353 }); 14354 14355 let requestContentLength; 14356 14357 try { 14358 if ( 14359 onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && 14360 (requestContentLength = await resolveBodyLength(headers, data)) !== 0 14361 ) { 14362 let _request = new Request(url, { 14363 method: 'POST', 14364 body: data, 14365 duplex: "half" 14366 }); 14367 14368 let contentTypeHeader; 14369 14370 if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { 14371 headers.setContentType(contentTypeHeader) 14372 } 14373 14374 if (_request.body) { 14375 const [onProgress, flush] = progressEventDecorator( 14376 requestContentLength, 14377 progressEventReducer(asyncDecorator(onUploadProgress)) 14378 ); 14379 14380 data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); 14381 } 14382 } 14383 14384 if (!utils.isString(withCredentials)) { 14385 withCredentials = withCredentials ? 'include' : 'omit'; 14386 } 14387 14388 // Cloudflare Workers throws when credentials are defined 14389 // see https://github.com/cloudflare/workerd/issues/902 14390 const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; 14391 14392 const resolvedOptions = { 14393 ...fetchOptions, 14394 signal: composedSignal, 14395 method: method.toUpperCase(), 14396 headers: headers.normalize().toJSON(), 14397 body: data, 14398 duplex: "half", 14399 credentials: isCredentialsSupported ? withCredentials : undefined 14400 }; 14401 14402 request = isRequestSupported && new Request(url, resolvedOptions); 14403 14404 let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); 14405 14406 const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); 14407 14408 if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { 14409 const options = {}; 14410 14411 ['status', 'statusText', 'headers'].forEach(prop => { 14412 options[prop] = response[prop]; 14413 }); 14414 14415 const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length')); 14416 14417 const [onProgress, flush] = onDownloadProgress && progressEventDecorator( 14418 responseContentLength, 14419 progressEventReducer(asyncDecorator(onDownloadProgress), true) 14420 ) || []; 14421 14422 response = new Response( 14423 trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { 14424 flush && flush(); 14425 unsubscribe && unsubscribe(); 14426 }), 14427 options 14428 ); 14429 } 14430 14431 responseType = responseType || 'text'; 14432 14433 let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config); 14434 14435 !isStreamResponse && unsubscribe && unsubscribe(); 14436 14437 return await new Promise((resolve, reject) => { 14438 settle(resolve, reject, { 14439 data: responseData, 14440 headers: core_AxiosHeaders.from(response.headers), 14441 status: response.status, 14442 statusText: response.statusText, 14443 config, 14444 request 14445 }) 14446 }) 14447 } catch (err) { 14448 unsubscribe && unsubscribe(); 14449 14450 if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { 14451 throw Object.assign( 14452 new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request), 14453 { 14454 cause: err.cause || err 14455 } 14456 ) 14457 } 14458 14459 throw core_AxiosError.from(err, err && err.code, config, request); 14460 } 14461 } 14462} 14463 14464const seedCache = new Map(); 14465 14466const getFetch = (config) => { 14467 let env = (config && config.env) || {}; 14468 const {fetch, Request, Response} = env; 14469 const seeds = [ 14470 Request, Response, fetch 14471 ]; 14472 14473 let len = seeds.length, i = len, 14474 seed, target, map = seedCache; 14475 14476 while (i--) { 14477 seed = seeds[i]; 14478 target = map.get(seed); 14479 14480 target === undefined && map.set(seed, target = (i ? new Map() : factory(env))) 14481 14482 map = target; 14483 } 14484 14485 return target; 14486}; 14487 14488const adapter = getFetch(); 14489 14490/* harmony default export */ var adapters_fetch = ((/* unused pure expression or super */ null && (adapter))); 14491 14492;// ./node_modules/axios/lib/adapters/adapters.js 14493 14494 14495 14496 14497 14498 14499/** 14500 * Known adapters mapping. 14501 * Provides environment-specific adapters for Axios: 14502 * - `http` for Node.js 14503 * - `xhr` for browsers 14504 * - `fetch` for fetch API-based requests 14505 * 14506 * @type {Object<string, Function|Object>} 14507 */ 14508const knownAdapters = { 14509 http: helpers_null, 14510 xhr: xhr, 14511 fetch: { 14512 get: getFetch, 14513 } 14514}; 14515 14516// Assign adapter names for easier debugging and identification 14517utils.forEach(knownAdapters, (fn, value) => { 14518 if (fn) { 14519 try { 14520 Object.defineProperty(fn, 'name', { value }); 14521 } catch (e) { 14522 // eslint-disable-next-line no-empty 14523 } 14524 Object.defineProperty(fn, 'adapterName', { value }); 14525 } 14526}); 14527 14528/** 14529 * Render a rejection reason string for unknown or unsupported adapters 14530 * 14531 * @param {string} reason 14532 * @returns {string} 14533 */ 14534const renderReason = (reason) => `- ${reason}`; 14535 14536/** 14537 * Check if the adapter is resolved (function, null, or false) 14538 * 14539 * @param {Function|null|false} adapter 14540 * @returns {boolean} 14541 */ 14542const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; 14543 14544/** 14545 * Get the first suitable adapter from the provided list. 14546 * Tries each adapter in order until a supported one is found. 14547 * Throws an AxiosError if no adapter is suitable. 14548 * 14549 * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function. 14550 * @param {Object} config - Axios request configuration 14551 * @throws {AxiosError} If no suitable adapter is available 14552 * @returns {Function} The resolved adapter function 14553 */ 14554function getAdapter(adapters, config) { 14555 adapters = utils.isArray(adapters) ? adapters : [adapters]; 14556 14557 const { length } = adapters; 14558 let nameOrAdapter; 14559 let adapter; 14560 14561 const rejectedReasons = {}; 14562 14563 for (let i = 0; i < length; i++) { 14564 nameOrAdapter = adapters[i]; 14565 let id; 14566 14567 adapter = nameOrAdapter; 14568 14569 if (!isResolvedHandle(nameOrAdapter)) { 14570 adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; 14571 14572 if (adapter === undefined) { 14573 throw new core_AxiosError(`Unknown adapter '${id}'`); 14574 } 14575 } 14576 14577 if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) { 14578 break; 14579 } 14580 14581 rejectedReasons[id || '#' + i] = adapter; 14582 } 14583 14584 if (!adapter) { 14585 const reasons = Object.entries(rejectedReasons) 14586 .map(([id, state]) => `adapter ${id} ` + 14587 (state === false ? 'is not supported by the environment' : 'is not available in the build') 14588 ); 14589 14590 let s = length ? 14591 (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : 14592 'as no adapter specified'; 14593 14594 throw new core_AxiosError( 14595 `There is no suitable adapter to dispatch the request ` + s, 14596 'ERR_NOT_SUPPORT' 14597 ); 14598 } 14599 14600 return adapter; 14601} 14602 14603/** 14604 * Exports Axios adapters and utility to resolve an adapter 14605 */ 14606/* harmony default export */ var adapters = ({ 14607 /** 14608 * Resolve an adapter from a list of adapter names or functions. 14609 * @type {Function} 14610 */ 14611 getAdapter, 14612 14613 /** 14614 * Exposes all known adapters 14615 * @type {Object<string, Function|Object>} 14616 */ 14617 adapters: knownAdapters 14618}); 14619 14620;// ./node_modules/axios/lib/core/dispatchRequest.js 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630/** 14631 * Throws a `CanceledError` if cancellation has been requested. 14632 * 14633 * @param {Object} config The config that is to be used for the request 14634 * 14635 * @returns {void} 14636 */ 14637function throwIfCancellationRequested(config) { 14638 if (config.cancelToken) { 14639 config.cancelToken.throwIfRequested(); 14640 } 14641 14642 if (config.signal && config.signal.aborted) { 14643 throw new cancel_CanceledError(null, config); 14644 } 14645} 14646 14647/** 14648 * Dispatch a request to the server using the configured adapter. 14649 * 14650 * @param {object} config The config that is to be used for the request 14651 * 14652 * @returns {Promise} The Promise to be fulfilled 14653 */ 14654function dispatchRequest(config) { 14655 throwIfCancellationRequested(config); 14656 14657 config.headers = core_AxiosHeaders.from(config.headers); 14658 14659 // Transform request data 14660 config.data = transformData.call( 14661 config, 14662 config.transformRequest 14663 ); 14664 14665 if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { 14666 config.headers.setContentType('application/x-www-form-urlencoded', false); 14667 } 14668 14669 const adapter = adapters.getAdapter(config.adapter || lib_defaults.adapter, config); 14670 14671 return adapter(config).then(function onAdapterResolution(response) { 14672 throwIfCancellationRequested(config); 14673 14674 // Transform response data 14675 response.data = transformData.call( 14676 config, 14677 config.transformResponse, 14678 response 14679 ); 14680 14681 response.headers = core_AxiosHeaders.from(response.headers); 14682 14683 return response; 14684 }, function onAdapterRejection(reason) { 14685 if (!isCancel(reason)) { 14686 throwIfCancellationRequested(config); 14687 14688 // Transform response data 14689 if (reason && reason.response) { 14690 reason.response.data = transformData.call( 14691 config, 14692 config.transformResponse, 14693 reason.response 14694 ); 14695 reason.response.headers = core_AxiosHeaders.from(reason.response.headers); 14696 } 14697 } 14698 14699 return Promise.reject(reason); 14700 }); 14701} 14702 14703;// ./node_modules/axios/lib/env/data.js 14704const VERSION = "1.13.2"; 14705;// ./node_modules/axios/lib/helpers/validator.js 14706 14707 14708 14709 14710 14711const validators = {}; 14712 14713// eslint-disable-next-line func-names 14714['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { 14715 validators[type] = function validator(thing) { 14716 return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; 14717 }; 14718}); 14719 14720const deprecatedWarnings = {}; 14721 14722/** 14723 * Transitional option validator 14724 * 14725 * @param {function|boolean?} validator - set to false if the transitional option has been removed 14726 * @param {string?} version - deprecated version / removed since version 14727 * @param {string?} message - some message with additional info 14728 * 14729 * @returns {function} 14730 */ 14731validators.transitional = function transitional(validator, version, message) { 14732 function formatMessage(opt, desc) { 14733 return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); 14734 } 14735 14736 // eslint-disable-next-line func-names 14737 return (value, opt, opts) => { 14738 if (validator === false) { 14739 throw new core_AxiosError( 14740 formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), 14741 core_AxiosError.ERR_DEPRECATED 14742 ); 14743 } 14744 14745 if (version && !deprecatedWarnings[opt]) { 14746 deprecatedWarnings[opt] = true; 14747 // eslint-disable-next-line no-console 14748 console.warn( 14749 formatMessage( 14750 opt, 14751 ' has been deprecated since v' + version + ' and will be removed in the near future' 14752 ) 14753 ); 14754 } 14755 14756 return validator ? validator(value, opt, opts) : true; 14757 }; 14758}; 14759 14760validators.spelling = function spelling(correctSpelling) { 14761 return (value, opt) => { 14762 // eslint-disable-next-line no-console 14763 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 14764 return true; 14765 } 14766}; 14767 14768/** 14769 * Assert object's properties type 14770 * 14771 * @param {object} options 14772 * @param {object} schema 14773 * @param {boolean?} allowUnknown 14774 * 14775 * @returns {object} 14776 */ 14777 14778function assertOptions(options, schema, allowUnknown) { 14779 if (typeof options !== 'object') { 14780 throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE); 14781 } 14782 const keys = Object.keys(options); 14783 let i = keys.length; 14784 while (i-- > 0) { 14785 const opt = keys[i]; 14786 const validator = schema[opt]; 14787 if (validator) { 14788 const value = options[opt]; 14789 const result = value === undefined || validator(value, opt, options); 14790 if (result !== true) { 14791 throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE); 14792 } 14793 continue; 14794 } 14795 if (allowUnknown !== true) { 14796 throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION); 14797 } 14798 } 14799} 14800 14801/* harmony default export */ var validator = ({ 14802 assertOptions, 14803 validators 14804}); 14805 14806;// ./node_modules/axios/lib/core/Axios.js 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818const Axios_validators = validator.validators; 14819 14820/** 14821 * Create a new instance of Axios 14822 * 14823 * @param {Object} instanceConfig The default config for the instance 14824 * 14825 * @return {Axios} A new instance of Axios 14826 */ 14827class Axios { 14828 constructor(instanceConfig) { 14829 this.defaults = instanceConfig || {}; 14830 this.interceptors = { 14831 request: new core_InterceptorManager(), 14832 response: new core_InterceptorManager() 14833 }; 14834 } 14835 14836 /** 14837 * Dispatch a request 14838 * 14839 * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) 14840 * @param {?Object} config 14841 * 14842 * @returns {Promise} The Promise to be fulfilled 14843 */ 14844 async request(configOrUrl, config) { 14845 try { 14846 return await this._request(configOrUrl, config); 14847 } catch (err) { 14848 if (err instanceof Error) { 14849 let dummy = {}; 14850 14851 Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); 14852 14853 // slice off the Error: ... line 14854 const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; 14855 try { 14856 if (!err.stack) { 14857 err.stack = stack; 14858 // match without the 2 top stack lines 14859 } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { 14860 err.stack += '\n' + stack 14861 } 14862 } catch (e) { 14863 // ignore the case where "stack" is an un-writable property 14864 } 14865 } 14866 14867 throw err; 14868 } 14869 } 14870 14871 _request(configOrUrl, config) { 14872 /*eslint no-param-reassign:0*/ 14873 // Allow for axios('example/url'[, config]) a la fetch API 14874 if (typeof configOrUrl === 'string') { 14875 config = config || {}; 14876 config.url = configOrUrl; 14877 } else { 14878 config = configOrUrl || {}; 14879 } 14880 14881 config = mergeConfig(this.defaults, config); 14882 14883 const {transitional, paramsSerializer, headers} = config; 14884 14885 if (transitional !== undefined) { 14886 validator.assertOptions(transitional, { 14887 silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean), 14888 forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean), 14889 clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean) 14890 }, false); 14891 } 14892 14893 if (paramsSerializer != null) { 14894 if (utils.isFunction(paramsSerializer)) { 14895 config.paramsSerializer = { 14896 serialize: paramsSerializer 14897 } 14898 } else { 14899 validator.assertOptions(paramsSerializer, { 14900 encode: Axios_validators.function, 14901 serialize: Axios_validators.function 14902 }, true); 14903 } 14904 } 14905 14906 // Set config.allowAbsoluteUrls 14907 if (config.allowAbsoluteUrls !== undefined) { 14908 // do nothing 14909 } else if (this.defaults.allowAbsoluteUrls !== undefined) { 14910 config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; 14911 } else { 14912 config.allowAbsoluteUrls = true; 14913 } 14914 14915 validator.assertOptions(config, { 14916 baseUrl: Axios_validators.spelling('baseURL'), 14917 withXsrfToken: Axios_validators.spelling('withXSRFToken') 14918 }, true); 14919 14920 // Set config.method 14921 config.method = (config.method || this.defaults.method || 'get').toLowerCase(); 14922 14923 // Flatten headers 14924 let contextHeaders = headers && utils.merge( 14925 headers.common, 14926 headers[config.method] 14927 ); 14928 14929 headers && utils.forEach( 14930 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 14931 (method) => { 14932 delete headers[method]; 14933 } 14934 ); 14935 14936 config.headers = core_AxiosHeaders.concat(contextHeaders, headers); 14937 14938 // filter out skipped interceptors 14939 const requestInterceptorChain = []; 14940 let synchronousRequestInterceptors = true; 14941 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 14942 if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { 14943 return; 14944 } 14945 14946 synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; 14947 14948 requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); 14949 }); 14950 14951 const responseInterceptorChain = []; 14952 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 14953 responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); 14954 }); 14955 14956 let promise; 14957 let i = 0; 14958 let len; 14959 14960 if (!synchronousRequestInterceptors) { 14961 const chain = [dispatchRequest.bind(this), undefined]; 14962 chain.unshift(...requestInterceptorChain); 14963 chain.push(...responseInterceptorChain); 14964 len = chain.length; 14965 14966 promise = Promise.resolve(config); 14967 14968 while (i < len) { 14969 promise = promise.then(chain[i++], chain[i++]); 14970 } 14971 14972 return promise; 14973 } 14974 14975 len = requestInterceptorChain.length; 14976 14977 let newConfig = config; 14978 14979 while (i < len) { 14980 const onFulfilled = requestInterceptorChain[i++]; 14981 const onRejected = requestInterceptorChain[i++];
vendor: 4,254 bytes, lines 14982-15171
14982 try { 14983 newConfig = onFulfilled(newConfig); 14984 } catch (error) { 14985 onRejected.call(this, error); 14986 break; 14987 } 14988 } 14989 14990 try { 14991 promise = dispatchRequest.call(this, newConfig); 14992 } catch (error) { 14993 return Promise.reject(error); 14994 } 14995 14996 i = 0; 14997 len = responseInterceptorChain.length; 14998 14999 while (i < len) { 15000 promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); 15001 } 15002 15003 return promise; 15004 } 15005 15006 getUri(config) { 15007 config = mergeConfig(this.defaults, config); 15008 const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); 15009 return buildURL(fullPath, config.params, config.paramsSerializer); 15010 } 15011} 15012 15013// Provide aliases for supported request methods 15014utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 15015 /*eslint func-names:0*/ 15016 Axios.prototype[method] = function(url, config) { 15017 return this.request(mergeConfig(config || {}, { 15018 method, 15019 url, 15020 data: (config || {}).data 15021 })); 15022 }; 15023}); 15024 15025utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 15026 /*eslint func-names:0*/ 15027 15028 function generateHTTPMethod(isForm) { 15029 return function httpMethod(url, data, config) { 15030 return this.request(mergeConfig(config || {}, { 15031 method, 15032 headers: isForm ? { 15033 'Content-Type': 'multipart/form-data' 15034 } : {}, 15035 url, 15036 data 15037 })); 15038 }; 15039 } 15040 15041 Axios.prototype[method] = generateHTTPMethod(); 15042 15043 Axios.prototype[method + 'Form'] = generateHTTPMethod(true); 15044}); 15045 15046/* harmony default export */ var core_Axios = (Axios); 15047 15048;// ./node_modules/axios/lib/cancel/CancelToken.js 15049 15050 15051 15052 15053/** 15054 * A `CancelToken` is an object that can be used to request cancellation of an operation. 15055 * 15056 * @param {Function} executor The executor function. 15057 * 15058 * @returns {CancelToken} 15059 */ 15060class CancelToken { 15061 constructor(executor) { 15062 if (typeof executor !== 'function') { 15063 throw new TypeError('executor must be a function.'); 15064 } 15065 15066 let resolvePromise; 15067 15068 this.promise = new Promise(function promiseExecutor(resolve) { 15069 resolvePromise = resolve; 15070 }); 15071 15072 const token = this; 15073 15074 // eslint-disable-next-line func-names 15075 this.promise.then(cancel => { 15076 if (!token._listeners) return; 15077 15078 let i = token._listeners.length; 15079 15080 while (i-- > 0) { 15081 token._listeners[i](cancel); 15082 } 15083 token._listeners = null; 15084 }); 15085 15086 // eslint-disable-next-line func-names 15087 this.promise.then = onfulfilled => { 15088 let _resolve; 15089 // eslint-disable-next-line func-names 15090 const promise = new Promise(resolve => { 15091 token.subscribe(resolve); 15092 _resolve = resolve; 15093 }).then(onfulfilled); 15094 15095 promise.cancel = function reject() { 15096 token.unsubscribe(_resolve); 15097 }; 15098 15099 return promise; 15100 }; 15101 15102 executor(function cancel(message, config, request) { 15103 if (token.reason) { 15104 // Cancellation has already been requested 15105 return; 15106 } 15107 15108 token.reason = new cancel_CanceledError(message, config, request); 15109 resolvePromise(token.reason); 15110 }); 15111 } 15112 15113 /** 15114 * Throws a `CanceledError` if cancellation has been requested. 15115 */ 15116 throwIfRequested() { 15117 if (this.reason) { 15118 throw this.reason; 15119 } 15120 } 15121 15122 /** 15123 * Subscribe to the cancel signal 15124 */ 15125 15126 subscribe(listener) { 15127 if (this.reason) { 15128 listener(this.reason); 15129 return; 15130 } 15131 15132 if (this._listeners) { 15133 this._listeners.push(listener); 15134 } else { 15135 this._listeners = [listener]; 15136 } 15137 } 15138 15139 /** 15140 * Unsubscribe from the cancel signal 15141 */ 15142 15143 unsubscribe(listener) { 15144 if (!this._listeners) { 15145 return; 15146 } 15147 const index = this._listeners.indexOf(listener); 15148 if (index !== -1) { 15149 this._listeners.splice(index, 1); 15150 } 15151 } 15152 15153 toAbortSignal() { 15154 const controller = new AbortController(); 15155 15156 const abort = (err) => { 15157 controller.abort(err); 15158 }; 15159 15160 this.subscribe(abort); 15161 15162 controller.signal.unsubscribe = () => this.unsubscribe(abort); 15163 15164 return controller.signal; 15165 } 15166 15167 /** 15168 * Returns an object that contains a new `CancelToken` and a function that, when called, 15169 * cancels the `CancelToken`. 15170 */ 15171 static source() {
15172 let cancel; 15173 const token = new CancelToken(function executor(c) { 15174 cancel = c; 15175 }); 15176 return { 15177 token, 15178 cancel 15179 }; 15180 } 15181} 15182 15183/* harmony default export */ var cancel_CancelToken = (CancelToken); 15184 15185;// ./node_modules/axios/lib/helpers/spread.js 15186 15187 15188/** 15189 * Syntactic sugar for invoking a function and expanding an array for arguments. 15190 * 15191 * Common use case would be to use `Function.prototype.apply`. 15192 * 15193 * ```js 15194 * function f(x, y, z) {} 15195 * var args = [1, 2, 3]; 15196 * f.apply(null, args); 15197 * ``` 15198 * 15199 * With `spread` this example can be re-written. 15200 * 15201 * ```js 15202 * spread(function(x, y, z) {})([1, 2, 3]); 15203 * ``` 15204 * 15205 * @param {Function} callback 15206 * 15207 * @returns {Function} 15208 */ 15209function spread(callback) { 15210 return function wrap(arr) { 15211 return callback.apply(null, arr); 15212 }; 15213} 15214 15215;// ./node_modules/axios/lib/helpers/isAxiosError.js 15216 15217 15218 15219 15220/** 15221 * Determines whether the payload is an error thrown by Axios 15222 * 15223 * @param {*} payload The value to test 15224 * 15225 * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false 15226 */ 15227function isAxiosError(payload) { 15228 return utils.isObject(payload) && (payload.isAxiosError === true); 15229} 15230 15231;// ./node_modules/axios/lib/helpers/HttpStatusCode.js 15232const HttpStatusCode = { 15233 Continue: 100, 15234 SwitchingProtocols: 101, 15235 Processing: 102, 15236 EarlyHints: 103, 15237 Ok: 200, 15238 Created: 201, 15239 Accepted: 202, 15240 NonAuthoritativeInformation: 203, 15241 NoContent: 204, 15242 ResetContent: 205, 15243 PartialContent: 206, 15244 MultiStatus: 207, 15245 AlreadyReported: 208, 15246 ImUsed: 226, 15247 MultipleChoices: 300, 15248 MovedPermanently: 301, 15249 Found: 302, 15250 SeeOther: 303, 15251 NotModified: 304, 15252 UseProxy: 305, 15253 Unused: 306, 15254 TemporaryRedirect: 307, 15255 PermanentRedirect: 308, 15256 BadRequest: 400, 15257 Unauthorized: 401, 15258 PaymentRequired: 402, 15259 Forbidden: 403, 15260 NotFound: 404, 15261 MethodNotAllowed: 405, 15262 NotAcceptable: 406, 15263 ProxyAuthenticationRequired: 407, 15264 RequestTimeout: 408, 15265 Conflict: 409, 15266 Gone: 410, 15267 LengthRequired: 411, 15268 PreconditionFailed: 412, 15269 PayloadTooLarge: 413, 15270 UriTooLong: 414, 15271 UnsupportedMediaType: 415, 15272 RangeNotSatisfiable: 416, 15273 ExpectationFailed: 417, 15274 ImATeapot: 418, 15275 MisdirectedRequest: 421, 15276 UnprocessableEntity: 422, 15277 Locked: 423, 15278 FailedDependency: 424, 15279 TooEarly: 425, 15280 UpgradeRequired: 426, 15281 PreconditionRequired: 428, 15282 TooManyRequests: 429, 15283 RequestHeaderFieldsTooLarge: 431, 15284 UnavailableForLegalReasons: 451, 15285 InternalServerError: 500, 15286 NotImplemented: 501, 15287 BadGateway: 502, 15288 ServiceUnavailable: 503, 15289 GatewayTimeout: 504, 15290 HttpVersionNotSupported: 505, 15291 VariantAlsoNegotiates: 506, 15292 InsufficientStorage: 507, 15293 LoopDetected: 508, 15294 NotExtended: 510, 15295 NetworkAuthenticationRequired: 511, 15296 WebServerIsDown: 521, 15297 ConnectionTimedOut: 522, 15298 OriginIsUnreachable: 523, 15299 TimeoutOccurred: 524, 15300 SslHandshakeFailed: 525, 15301 InvalidSslCertificate: 526, 15302}; 15303 15304Object.entries(HttpStatusCode).forEach(([key, value]) => { 15305 HttpStatusCode[value] = key; 15306}); 15307 15308/* harmony default export */ var helpers_HttpStatusCode = (HttpStatusCode); 15309 15310;// ./node_modules/axios/lib/axios.js 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331/** 15332 * Create an instance of Axios 15333 * 15334 * @param {Object} defaultConfig The default config for the instance 15335 * 15336 * @returns {Axios} A new instance of Axios 15337 */ 15338function createInstance(defaultConfig) { 15339 const context = new core_Axios(defaultConfig); 15340 const instance = bind(core_Axios.prototype.request, context); 15341 15342 // Copy axios.prototype to instance 15343 utils.extend(instance, core_Axios.prototype, context, {allOwnKeys: true}); 15344 15345 // Copy context to instance 15346 utils.extend(instance, context, null, {allOwnKeys: true}); 15347 15348 // Factory for creating new instances 15349 instance.create = function create(instanceConfig) { 15350 return createInstance(mergeConfig(defaultConfig, instanceConfig)); 15351 }; 15352 15353 return instance; 15354} 15355 15356// Create the default instance to be exported 15357const axios = createInstance(lib_defaults); 15358 15359// Expose Axios class to allow class inheritance 15360axios.Axios = core_Axios; 15361 15362// Expose Cancel & CancelToken 15363axios.CanceledError = cancel_CanceledError; 15364axios.CancelToken = cancel_CancelToken; 15365axios.isCancel = isCancel; 15366axios.VERSION = VERSION; 15367axios.toFormData = helpers_toFormData; 15368 15369// Expose AxiosError class 15370axios.AxiosError = core_AxiosError; 15371 15372// alias for CanceledError for backward compatibility 15373axios.Cancel = axios.CanceledError; 15374 15375// Expose all/spread 15376axios.all = function all(promises) { 15377 return Promise.all(promises); 15378}; 15379 15380axios.spread = spread; 15381 15382// Expose isAxiosError 15383axios.isAxiosError = isAxiosError; 15384 15385// Expose mergeConfig 15386axios.mergeConfig = mergeConfig; 15387 15388axios.AxiosHeaders = core_AxiosHeaders; 15389 15390axios.formToJSON = thing => helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); 15391 15392axios.getAdapter = adapters.getAdapter; 15393 15394axios.HttpStatusCode = helpers_HttpStatusCode; 15395 15396axios.default = axios; 15397 15398// this module should only have a default export 15399/* harmony default export */ var lib_axios = (axios); 15400 15401;// ./node_modules/dompurify/dist/purify.es.mjs 15402/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */ 15403 15404const { 15405 entries, 15406 setPrototypeOf, 15407 isFrozen, 15408 getPrototypeOf: purify_es_getPrototypeOf, 15409 getOwnPropertyDescriptor 15410} = Object; 15411let { 15412 freeze, 15413 seal, 15414 create 15415} = Object; // eslint-disable-line import/no-mutable-exports 15416let { 15417 apply, 15418 construct 15419} = typeof Reflect !== 'undefined' && Reflect; 15420if (!freeze) { 15421 freeze = function freeze(x) { 15422 return x; 15423 }; 15424} 15425if (!seal) { 15426 seal = function seal(x) { 15427 return x; 15428 }; 15429} 15430if (!apply) { 15431 apply = function apply(func, thisArg) { 15432 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 15433 args[_key - 2] = arguments[_key]; 15434 } 15435 return func.apply(thisArg, args); 15436 }; 15437} 15438if (!construct) { 15439 construct = function construct(Func) { 15440 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 15441 args[_key2 - 1] = arguments[_key2]; 15442 } 15443 return new Func(...args); 15444 }; 15445} 15446const arrayForEach = unapply(Array.prototype.forEach); 15447const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); 15448const arrayPop = unapply(Array.prototype.pop); 15449const arrayPush = unapply(Array.prototype.push); 15450const arraySplice = unapply(Array.prototype.splice); 15451const stringToLowerCase = unapply(String.prototype.toLowerCase); 15452const stringToString = unapply(String.prototype.toString); 15453const stringMatch = unapply(String.prototype.match); 15454const stringReplace = unapply(String.prototype.replace); 15455const stringIndexOf = unapply(String.prototype.indexOf); 15456const stringTrim = unapply(String.prototype.trim); 15457const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); 15458const regExpTest = unapply(RegExp.prototype.test); 15459const typeErrorCreate = unconstruct(TypeError); 15460/** 15461 * Creates a new function that calls the given function with a specified thisArg and arguments. 15462 * 15463 * @param func - The function to be wrapped and called. 15464 * @returns A new function that calls the given function with a specified thisArg and arguments. 15465 */ 15466function unapply(func) { 15467 return function (thisArg) { 15468 if (thisArg instanceof RegExp) { 15469 thisArg.lastIndex = 0; 15470 } 15471 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 15472 args[_key3 - 1] = arguments[_key3]; 15473 } 15474 return apply(func, thisArg, args); 15475 }; 15476} 15477/** 15478 * Creates a new function that constructs an instance of the given constructor function with the provided arguments. 15479 * 15480 * @param func - The constructor function to be wrapped and called. 15481 * @returns A new function that constructs an instance of the given constructor function with the provided arguments. 15482 */ 15483function unconstruct(Func) { 15484 return function () { 15485 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
vendor: 6,147 bytes, lines 15486-15598
15486 args[_key4] = arguments[_key4]; 15487 } 15488 return construct(Func, args); 15489 }; 15490} 15491/** 15492 * Add properties to a lookup table 15493 * 15494 * @param set - The set to which elements will be added. 15495 * @param array - The array containing elements to be added to the set. 15496 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set. 15497 * @returns The modified set with added elements. 15498 */ 15499function addToSet(set, array) { 15500 let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase; 15501 if (setPrototypeOf) { 15502 // Make 'in' and truthy checks like Boolean(set.constructor) 15503 // independent of any properties defined on Object.prototype. 15504 // Prevent prototype setters from intercepting set as a this value. 15505 setPrototypeOf(set, null); 15506 } 15507 let l = array.length; 15508 while (l--) { 15509 let element = array[l]; 15510 if (typeof element === 'string') { 15511 const lcElement = transformCaseFunc(element); 15512 if (lcElement !== element) { 15513 // Config presets (e.g. tags.js, attrs.js) are immutable. 15514 if (!isFrozen(array)) { 15515 array[l] = lcElement; 15516 } 15517 element = lcElement; 15518 } 15519 } 15520 set[element] = true; 15521 } 15522 return set; 15523} 15524/** 15525 * Clean up an array to harden against CSPP 15526 * 15527 * @param array - The array to be cleaned. 15528 * @returns The cleaned version of the array 15529 */ 15530function cleanArray(array) { 15531 for (let index = 0; index < array.length; index++) { 15532 const isPropertyExist = objectHasOwnProperty(array, index); 15533 if (!isPropertyExist) { 15534 array[index] = null; 15535 } 15536 } 15537 return array; 15538} 15539/** 15540 * Shallow clone an object 15541 * 15542 * @param object - The object to be cloned. 15543 * @returns A new object that copies the original. 15544 */ 15545function clone(object) { 15546 const newObject = create(null); 15547 for (const [property, value] of entries(object)) { 15548 const isPropertyExist = objectHasOwnProperty(object, property); 15549 if (isPropertyExist) { 15550 if (Array.isArray(value)) { 15551 newObject[property] = cleanArray(value); 15552 } else if (value && typeof value === 'object' && value.constructor === Object) { 15553 newObject[property] = clone(value); 15554 } else { 15555 newObject[property] = value; 15556 } 15557 } 15558 } 15559 return newObject; 15560} 15561/** 15562 * This method automatically checks if the prop is function or getter and behaves accordingly. 15563 * 15564 * @param object - The object to look up the getter function in its prototype chain. 15565 * @param prop - The property name for which to find the getter function. 15566 * @returns The getter function found in the prototype chain or a fallback function. 15567 */ 15568function lookupGetter(object, prop) { 15569 while (object !== null) { 15570 const desc = getOwnPropertyDescriptor(object, prop); 15571 if (desc) { 15572 if (desc.get) { 15573 return unapply(desc.get); 15574 } 15575 if (typeof desc.value === 'function') { 15576 return unapply(desc.value); 15577 } 15578 } 15579 object = purify_es_getPrototypeOf(object); 15580 } 15581 function fallbackValue() { 15582 return null; 15583 } 15584 return fallbackValue; 15585} 15586 15587const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); 15588const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); 15589const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); 15590// List of SVG elements that are disallowed by default. 15591// We still need to know them so that we can do namespace 15592// checks properly in case one wants to add them to 15593// allow-list. 15594const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']); 15595const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); 15596// Similarly to SVG, we want to know all MathML elements, 15597// even those that we disallow by default. 15598const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'n
15598one']); 15599const purify_es_
vendor: 11,108 bytes, lines 15599-15786
15599text = freeze(['#text']); 15600 15601const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']); 15602const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); 15603const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); 15604const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); 15605 15606// eslint-disable-next-line unicorn/better-regex 15607const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode 15608const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); 15609const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex 15610const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape 15611const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape 15612const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape 15613); 15614const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); 15615const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex 15616); 15617const DOCTYPE_NAME = seal(/^html$/i); 15618const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); 15619 15620var EXPRESSIONS = /*#__PURE__*/Object.freeze({ 15621 __proto__: null, 15622 ARIA_ATTR: ARIA_ATTR, 15623 ATTR_WHITESPACE: ATTR_WHITESPACE, 15624 CUSTOM_ELEMENT: CUSTOM_ELEMENT, 15625 DATA_ATTR: DATA_ATTR, 15626 DOCTYPE_NAME: DOCTYPE_NAME, 15627 ERB_EXPR: ERB_EXPR, 15628 IS_ALLOWED_URI: IS_ALLOWED_URI, 15629 IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA, 15630 MUSTACHE_EXPR: MUSTACHE_EXPR, 15631 TMPLIT_EXPR: TMPLIT_EXPR 15632}); 15633 15634/* eslint-disable @typescript-eslint/indent */ 15635// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType 15636const NODE_TYPE = { 15637 element: 1, 15638 attribute: 2, 15639 text: 3, 15640 cdataSection: 4, 15641 entityReference: 5, 15642 // Deprecated 15643 entityNode: 6, 15644 // Deprecated 15645 progressingInstruction: 7, 15646 comment: 8, 15647 document: 9, 15648 documentType: 10, 15649 documentFragment: 11, 15650 notation: 12 // Deprecated 15651}; 15652const getGlobal = function getGlobal() { 15653 return typeof window === 'undefined' ? null : window; 15654}; 15655/** 15656 * Creates a no-op policy for internal use only. 15657 * Don't export this function outside this module! 15658 * @param trustedTypes The policy factory. 15659 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). 15660 * @return The policy created (or null, if Trusted Types 15661 * are not supported or creating the policy failed). 15662 */ 15663const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) { 15664 if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') { 15665 return null; 15666 } 15667 // Allow the callers to control the unique policy name 15668 // by adding a data-tt-policy-suffix to the script element with the DOMPurify. 15669 // Policy creation with duplicate names throws in Trusted Types. 15670 let suffix = null; 15671 const ATTR_NAME = 'data-tt-policy-suffix'; 15672 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { 15673 suffix = purifyHostElement.getAttribute(ATTR_NAME); 15674 } 15675 const policyName = 'dompurify' + (suffix ? '#' + suffix : ''); 15676 try { 15677 return trustedTypes.createPolicy(policyName, { 15678 createHTML(html) { 15679 return html; 15680 }, 15681 createScriptURL(scriptUrl) { 15682 return scriptUrl; 15683 } 15684 }); 15685 } catch (_) { 15686 // Policy creation failed (most likely another DOMPurify script has 15687 // already run). Skip creating the policy, as this will only cause errors 15688 // if TT are enforced. 15689 console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); 15690 return null; 15691 } 15692}; 15693const _createHooksMap = function _createHooksMap() { 15694 return { 15695 afterSanitizeAttributes: [], 15696 afterSanitizeElements: [], 15697 afterSanitizeShadowDOM: [], 15698 beforeSanitizeAttributes: [], 15699 beforeSanitizeElements: [], 15700 beforeSanitizeShadowDOM: [], 15701 uponSanitizeAttribute: [], 15702 uponSanitizeElement: [], 15703 uponSanitizeShadowNode: [] 15704 }; 15705}; 15706function createDOMPurify() { 15707 let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); 15708 const DOMPurify = root => createDOMPurify(root); 15709 DOMPurify.version = '3.3.1'; 15710 DOMPurify.removed = []; 15711 if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) { 15712 // Not running in a browser, provide a factory function 15713 // so that you can pass your own Window 15714 DOMPurify.isSupported = false; 15715 return DOMPurify; 15716 } 15717 let { 15718 document 15719 } = window; 15720 const originalDocument = document; 15721 const currentScript = originalDocument.currentScript; 15722 const { 15723 DocumentFragment, 15724 HTMLTemplateElement, 15725 Node, 15726 Element, 15727 NodeFilter, 15728 NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, 15729 HTMLFormElement, 15730 DOMParser, 15731 trustedTypes 15732 } = window; 15733 const ElementPrototype = Element.prototype; 15734 const cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); 15735 const remove = lookupGetter(ElementPrototype, 'remove'); 15736 const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); 15737 const getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); 15738 const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); 15739 // As per issue #47, the web-components registry is inherited by a 15740 // new document created via createHTMLDocument. As per the spec 15741 // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) 15742 // a new empty registry is used when creating a template contents owner 15743 // document, so we use that as our parent document to ensure nothing 15744 // is inherited. 15745 if (typeof HTMLTemplateElement === 'function') { 15746 const template = document.createElement('template'); 15747 if (template.content && template.content.ownerDocument) { 15748 document = template.content.ownerDocument; 15749 } 15750 } 15751 let trustedTypesPolicy; 15752 let emptyHTML = ''; 15753 const { 15754 implementation, 15755 createNodeIterator, 15756 createDocumentFragment, 15757 getElementsByTagName 15758 } = document; 15759 const { 15760 importNode 15761 } = originalDocument; 15762 let hooks = _createHooksMap(); 15763 /** 15764 * Expose whether this browser supports running the full DOMPurify. 15765 */ 15766 DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined; 15767 const { 15768 MUSTACHE_EXPR, 15769 ERB_EXPR, 15770 TMPLIT_EXPR, 15771 DATA_ATTR, 15772 ARIA_ATTR, 15773 IS_SCRIPT_OR_DATA, 15774 ATTR_WHITESPACE, 15775 CUSTOM_ELEMENT 15776 } = EXPRESSIONS; 15777 let { 15778 IS_ALLOWED_URI: IS_ALLOWED_URI$1 15779 } = EXPRESSIONS; 15780 /** 15781 * We consider the elements and attributes below to be safe. Ideally 15782 * don't add any new ones but feel free to remove unwanted ones. 15783 */ 15784 /* allowed element names */ 15785 let ALLOWED_TAGS = null; 15786 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...
15786purify_es_
vendor: 11,553 bytes, lines 15786-16003
15786text]); 15787 /* Allowed attribute names */ 15788 let ALLOWED_ATTR = null; 15789 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); 15790 /* 15791 * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements. 15792 * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements) 15793 * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list) 15794 * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`. 15795 */ 15796 let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { 15797 tagNameCheck: { 15798 writable: true, 15799 configurable: false, 15800 enumerable: true, 15801 value: null 15802 }, 15803 attributeNameCheck: { 15804 writable: true, 15805 configurable: false, 15806 enumerable: true, 15807 value: null 15808 }, 15809 allowCustomizedBuiltInElements: { 15810 writable: true, 15811 configurable: false, 15812 enumerable: true, 15813 value: false 15814 } 15815 })); 15816 /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ 15817 let FORBID_TAGS = null; 15818 /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ 15819 let FORBID_ATTR = null; 15820 /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */ 15821 const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, { 15822 tagCheck: { 15823 writable: true, 15824 configurable: false, 15825 enumerable: true, 15826 value: null 15827 }, 15828 attributeCheck: { 15829 writable: true, 15830 configurable: false, 15831 enumerable: true, 15832 value: null 15833 } 15834 })); 15835 /* Decide if ARIA attributes are okay */ 15836 let ALLOW_ARIA_ATTR = true; 15837 /* Decide if custom data attributes are okay */ 15838 let ALLOW_DATA_ATTR = true; 15839 /* Decide if unknown protocols are okay */ 15840 let ALLOW_UNKNOWN_PROTOCOLS = false; 15841 /* Decide if self-closing tags in attributes are allowed. 15842 * Usually removed due to a mXSS issue in jQuery 3.0 */ 15843 let ALLOW_SELF_CLOSE_IN_ATTR = true; 15844 /* Output should be safe for common template engines. 15845 * This means, DOMPurify removes data attributes, mustaches and ERB 15846 */ 15847 let SAFE_FOR_TEMPLATES = false; 15848 /* Output should be safe even for XML used within HTML and alike. 15849 * This means, DOMPurify removes comments when containing risky content. 15850 */ 15851 let SAFE_FOR_XML = true; 15852 /* Decide if document with <html>... should be returned */ 15853 let WHOLE_DOCUMENT = false; 15854 /* Track whether config is already set on this instance of DOMPurify. */ 15855 let SET_CONFIG = false; 15856 /* Decide if all elements (e.g. style, script) must be children of 15857 * document.body. By default, browsers might move them to document.head */ 15858 let FORCE_BODY = false; 15859 /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html 15860 * string (or a TrustedHTML object if Trusted Types are supported). 15861 * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead 15862 */ 15863 let RETURN_DOM = false; 15864 /* Decide if a DOM `DocumentFragment` should be returned, instead of a html 15865 * string (or a TrustedHTML object if Trusted Types are supported) */ 15866 let RETURN_DOM_FRAGMENT = false; 15867 /* Try to return a Trusted Type object instead of a string, return a string in 15868 * case Trusted Types are not supported */ 15869 let RETURN_TRUSTED_TYPE = false; 15870 /* Output should be free from DOM clobbering attacks? 15871 * This sanitizes markups named with colliding, clobberable built-in DOM APIs. 15872 */ 15873 let SANITIZE_DOM = true; 15874 /* Achieve full DOM Clobbering protection by isolating the namespace of named 15875 * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules. 15876 * 15877 * HTML/DOM spec rules that enable DOM Clobbering: 15878 * - Named Access on Window (§7.3.3) 15879 * - DOM Tree Accessors (§3.1.5) 15880 * - Form Element Parent-Child Relations (§4.10.3) 15881 * - Iframe srcdoc / Nested WindowProxies (§4.8.5) 15882 * - HTMLCollection (§4.2.10.2) 15883 * 15884 * Namespace isolation is implemented by prefixing `id` and `name` attributes 15885 * with a constant string, i.e., `user-content-` 15886 */ 15887 let SANITIZE_NAMED_PROPS = false; 15888 const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-'; 15889 /* Keep element content when removing element? */ 15890 let KEEP_CONTENT = true; 15891 /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead 15892 * of importing it into a new Document and returning a sanitized copy */ 15893 let IN_PLACE = false; 15894 /* Allow usage of profiles like html, svg and mathMl */ 15895 let USE_PROFILES = {}; 15896 /* Tags to ignore content of when KEEP_CONTENT is true */ 15897 let FORBID_CONTENTS = null; 15898 const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); 15899 /* Tags that are safe for data: URIs */ 15900 let DATA_URI_TAGS = null; 15901 const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); 15902 /* Attributes safe for values like "javascript:" */ 15903 let URI_SAFE_ATTRIBUTES = null; 15904 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); 15905 const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; 15906 const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; 15907 const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; 15908 /* Document namespace */ 15909 let NAMESPACE = HTML_NAMESPACE; 15910 let IS_EMPTY_INPUT = false; 15911 /* Allowed XHTML+XML namespaces */ 15912 let ALLOWED_NAMESPACES = null; 15913 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); 15914 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); 15915 let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']); 15916 // Certain elements are allowed in both SVG and HTML 15917 // namespace. We need to specify them explicitly 15918 // so that they don't get erroneously deleted from 15919 // HTML namespace. 15920 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']); 15921 /* Parsing of strict XHTML documents */ 15922 let PARSER_MEDIA_TYPE = null; 15923 const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html']; 15924 const DEFAULT_PARSER_MEDIA_TYPE = 'text/html'; 15925 let transformCaseFunc = null; 15926 /* Keep a reference to config to pass to hooks */ 15927 let CONFIG = null; 15928 /* Ideally, do not touch anything below this line */ 15929 /* ______________________________________________ */ 15930 const formElement = document.createElement('form'); 15931 const isRegexOrFunction = function isRegexOrFunction(testValue) { 15932 return testValue instanceof RegExp || testValue instanceof Function; 15933 }; 15934 /** 15935 * _parseConfig 15936 * 15937 * @param cfg optional config literal 15938 */ 15939 // eslint-disable-next-line complexity 15940 const _parseConfig = function _parseConfig() { 15941 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 15942 if (CONFIG && CONFIG === cfg) { 15943 return; 15944 } 15945 /* Shield configuration object from tampering */ 15946 if (!cfg || typeof cfg !== 'object') { 15947 cfg = {}; 15948 } 15949 /* Shield configuration object from prototype pollution */ 15950 cfg = clone(cfg); 15951 PARSER_MEDIA_TYPE = 15952 // eslint-disable-next-line unicorn/prefer-includes 15953 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; 15954 // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is. 15955 transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase; 15956 /* Set configuration parameters */ 15957 ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; 15958 ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; 15959 ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; 15960 URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES; 15961 DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS; 15962 FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; 15963 FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({}); 15964 FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({}); 15965 USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false; 15966 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true 15967 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true 15968 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false 15969 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true 15970 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false 15971 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true 15972 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false 15973 RETURN_DOM = cfg.RETURN_DOM || false; // Default false 15974 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false 15975 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false 15976 FORCE_BODY = cfg.FORCE_BODY || false; // Default false 15977 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true 15978 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false 15979 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true 15980 IN_PLACE = cfg.IN_PLACE || false; // Default false 15981 IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; 15982 NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; 15983 MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS; 15984 HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS; 15985 CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; 15986 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { 15987 CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; 15988 } 15989 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { 15990 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; 15991 } 15992 if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') { 15993 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; 15994 } 15995 if (SAFE_FOR_TEMPLATES) { 15996 ALLOW_DATA_ATTR = false; 15997 } 15998 if (RETURN_DOM_FRAGMENT) { 15999 RETURN_DOM = true; 16000 } 16001 /* Parse profile info */ 16002 if (USE_PROFILES) { 16003 ALLOWED_TAGS = addToSet({},
vendor: 1,917 bytes, lines 16003-16059
16003purify_es_text); 16004 ALLOWED_ATTR = []; 16005 if (USE_PROFILES.html === true) { 16006 addToSet(ALLOWED_TAGS, html$1); 16007 addToSet(ALLOWED_ATTR, html); 16008 } 16009 if (USE_PROFILES.svg === true) { 16010 addToSet(ALLOWED_TAGS, svg$1); 16011 addToSet(ALLOWED_ATTR, svg); 16012 addToSet(ALLOWED_ATTR, xml); 16013 } 16014 if (USE_PROFILES.svgFilters === true) { 16015 addToSet(ALLOWED_TAGS, svgFilters); 16016 addToSet(ALLOWED_ATTR, svg); 16017 addToSet(ALLOWED_ATTR, xml); 16018 } 16019 if (USE_PROFILES.mathMl === true) { 16020 addToSet(ALLOWED_TAGS, mathMl$1); 16021 addToSet(ALLOWED_ATTR, mathMl); 16022 addToSet(ALLOWED_ATTR, xml); 16023 } 16024 } 16025 /* Merge configuration parameters */ 16026 if (cfg.ADD_TAGS) { 16027 if (typeof cfg.ADD_TAGS === 'function') { 16028 EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; 16029 } else { 16030 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { 16031 ALLOWED_TAGS = clone(ALLOWED_TAGS); 16032 } 16033 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); 16034 } 16035 } 16036 if (cfg.ADD_ATTR) { 16037 if (typeof cfg.ADD_ATTR === 'function') { 16038 EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; 16039 } else { 16040 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { 16041 ALLOWED_ATTR = clone(ALLOWED_ATTR); 16042 } 16043 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); 16044 } 16045 } 16046 if (cfg.ADD_URI_SAFE_ATTR) { 16047 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); 16048 } 16049 if (cfg.FORBID_CONTENTS) { 16050 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 16051 FORBID_CONTENTS = clone(FORBID_CONTENTS); 16052 } 16053 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); 16054 } 16055 if (cfg.ADD_FORBID_CONTENTS) { 16056 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 16057 FORBID_CONTENTS = clone(FORBID_CONTENTS); 16058 } 16059 addToSet(FORBID_CONTENTS, cfg.ADD_
vendor: 8,044 bytes, lines 16059-16266
16059FORBID_CONTENTS, transformCaseFunc); 16060 } 16061 /* Add #text in case KEEP_CONTENT is set to true */ 16062 if (KEEP_CONTENT) { 16063 ALLOWED_TAGS['#text'] = true; 16064 } 16065 /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ 16066 if (WHOLE_DOCUMENT) { 16067 addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); 16068 } 16069 /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ 16070 if (ALLOWED_TAGS.table) { 16071 addToSet(ALLOWED_TAGS, ['tbody']); 16072 delete FORBID_TAGS.tbody; 16073 } 16074 if (cfg.TRUSTED_TYPES_POLICY) { 16075 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') { 16076 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); 16077 } 16078 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') { 16079 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); 16080 } 16081 // Overwrite existing TrustedTypes policy. 16082 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; 16083 // Sign local variables required by `sanitize`. 16084 emptyHTML = trustedTypesPolicy.createHTML(''); 16085 } else { 16086 // Uninitialized policy, attempt to initialize the internal dompurify policy. 16087 if (trustedTypesPolicy === undefined) { 16088 trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); 16089 } 16090 // If creating the internal policy succeeded sign internal variables. 16091 if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') { 16092 emptyHTML = trustedTypesPolicy.createHTML(''); 16093 } 16094 } 16095 // Prevent further manipulation of configuration. 16096 // Not available in IE8, Safari 5, etc. 16097 if (freeze) { 16098 freeze(cfg); 16099 } 16100 CONFIG = cfg; 16101 }; 16102 /* Keep track of all possible SVG and MathML tags 16103 * so that we can perform the namespace checks 16104 * correctly. */ 16105 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); 16106 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); 16107 /** 16108 * @param element a DOM element whose namespace is being checked 16109 * @returns Return false if the element has a 16110 * namespace that a spec-compliant parser would never 16111 * return. Return true otherwise. 16112 */ 16113 const _checkValidNamespace = function _checkValidNamespace(element) { 16114 let parent = getParentNode(element); 16115 // In JSDOM, if we're inside shadow DOM, then parentNode 16116 // can be null. We just simulate parent in this case. 16117 if (!parent || !parent.tagName) { 16118 parent = { 16119 namespaceURI: NAMESPACE, 16120 tagName: 'template' 16121 }; 16122 } 16123 const tagName = stringToLowerCase(element.tagName); 16124 const parentTagName = stringToLowerCase(parent.tagName); 16125 if (!ALLOWED_NAMESPACES[element.namespaceURI]) { 16126 return false; 16127 } 16128 if (element.namespaceURI === SVG_NAMESPACE) { 16129 // The only way to switch from HTML namespace to SVG 16130 // is via <svg>. If it happens via any other tag, then 16131 // it should be killed. 16132 if (parent.namespaceURI === HTML_NAMESPACE) { 16133 return tagName === 'svg'; 16134 } 16135 // The only way to switch from MathML to SVG is via` 16136 // svg if parent is either <annotation-xml> or MathML 16137 // text integration points. 16138 if (parent.namespaceURI === MATHML_NAMESPACE) { 16139 return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); 16140 } 16141 // We only allow elements that are defined in SVG 16142 // spec. All others are disallowed in SVG namespace. 16143 return Boolean(ALL_SVG_TAGS[tagName]); 16144 } 16145 if (element.namespaceURI === MATHML_NAMESPACE) { 16146 // The only way to switch from HTML namespace to MathML 16147 // is via <math>. If it happens via any other tag, then 16148 // it should be killed. 16149 if (parent.namespaceURI === HTML_NAMESPACE) { 16150 return tagName === 'math'; 16151 } 16152 // The only way to switch from SVG to MathML is via 16153 // <math> and HTML integration points 16154 if (parent.namespaceURI === SVG_NAMESPACE) { 16155 return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; 16156 } 16157 // We only allow elements that are defined in MathML 16158 // spec. All others are disallowed in MathML namespace. 16159 return Boolean(ALL_MATHML_TAGS[tagName]); 16160 } 16161 if (element.namespaceURI === HTML_NAMESPACE) { 16162 // The only way to switch from SVG to HTML is via 16163 // HTML integration points, and from MathML to HTML 16164 // is via MathML text integration points 16165 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { 16166 return false; 16167 } 16168 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { 16169 return false; 16170 } 16171 // We disallow tags that are specific for MathML 16172 // or SVG and should never appear in HTML namespace 16173 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); 16174 } 16175 // For XHTML and XML documents that support custom namespaces 16176 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) { 16177 return true; 16178 } 16179 // The code should never reach this place (this means 16180 // that the element somehow got namespace that is not 16181 // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES). 16182 // Return false just in case. 16183 return false; 16184 }; 16185 /** 16186 * _forceRemove 16187 * 16188 * @param node a DOM node 16189 */ 16190 const _forceRemove = function _forceRemove(node) { 16191 arrayPush(DOMPurify.removed, { 16192 element: node 16193 }); 16194 try { 16195 // eslint-disable-next-line unicorn/prefer-dom-node-remove 16196 getParentNode(node).removeChild(node); 16197 } catch (_) { 16198 remove(node); 16199 } 16200 }; 16201 /** 16202 * _removeAttribute 16203 * 16204 * @param name an Attribute name 16205 * @param element a DOM node 16206 */ 16207 const _removeAttribute = function _removeAttribute(name, element) { 16208 try { 16209 arrayPush(DOMPurify.removed, { 16210 attribute: element.getAttributeNode(name), 16211 from: element 16212 }); 16213 } catch (_) { 16214 arrayPush(DOMPurify.removed, { 16215 attribute: null, 16216 from: element 16217 }); 16218 } 16219 element.removeAttribute(name); 16220 // We void attribute values for unremovable "is" attributes 16221 if (name === 'is') { 16222 if (RETURN_DOM || RETURN_DOM_FRAGMENT) { 16223 try { 16224 _forceRemove(element); 16225 } catch (_) {} 16226 } else { 16227 try { 16228 element.setAttribute(name, ''); 16229 } catch (_) {} 16230 } 16231 } 16232 }; 16233 /** 16234 * _initDocument 16235 * 16236 * @param dirty - a string of dirty markup 16237 * @return a DOM, filled with the dirty markup 16238 */ 16239 const _initDocument = function _initDocument(dirty) { 16240 /* Create a HTML document */ 16241 let doc = null; 16242 let leadingWhitespace = null; 16243 if (FORCE_BODY) { 16244 dirty = '<remove></remove>' + dirty; 16245 } else { 16246 /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ 16247 const matches = stringMatch(dirty, /^[\r\n\t ]+/); 16248 leadingWhitespace = matches && matches[0]; 16249 } 16250 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) { 16251 // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict) 16252 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>'; 16253 } 16254 const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; 16255 /* 16256 * Use the DOMParser API by default, fallback later if needs be 16257 * DOMParser not work for svg when has multiple root element. 16258 */ 16259 if (NAMESPACE === HTML_NAMESPACE) { 16260 try { 16261 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); 16262 } catch (_) {} 16263 } 16264 /* Use createHTMLDocument in case DOMParser is not available */ 16265 if (!doc || !doc.documentElement) { 16266 doc = implementation.createDocument(NAMESPACE, 'template', null);
vendor: 4,359 bytes, lines 16267-16362
16267 try { 16268 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; 16269 } catch (_) { 16270 // Syntax error if dirtyPayload is invalid xml 16271 } 16272 } 16273 const body = doc.body || doc.documentElement; 16274 if (dirty && leadingWhitespace) { 16275 body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); 16276 } 16277 /* Work on whole document or just its body */ 16278 if (NAMESPACE === HTML_NAMESPACE) { 16279 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; 16280 } 16281 return WHOLE_DOCUMENT ? doc.documentElement : body; 16282 }; 16283 /** 16284 * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. 16285 * 16286 * @param root The root element or node to start traversing on. 16287 * @return The created NodeIterator 16288 */ 16289 const _createNodeIterator = function _createNodeIterator(root) { 16290 return createNodeIterator.call(root.ownerDocument || root, root, 16291 // eslint-disable-next-line no-bitwise 16292 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null); 16293 }; 16294 /** 16295 * _isClobbered 16296 * 16297 * @param element element to check for clobbering attacks 16298 * @return true if clobbered, false if safe 16299 */ 16300 const _isClobbered = function _isClobbered(element) { 16301 return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function'); 16302 }; 16303 /** 16304 * Checks whether the given object is a DOM node. 16305 * 16306 * @param value object to check whether it's a DOM node 16307 * @return true is object is a DOM node 16308 */ 16309 const _isNode = function _isNode(value) { 16310 return typeof Node === 'function' && value instanceof Node; 16311 }; 16312 function _executeHooks(hooks, currentNode, data) { 16313 arrayForEach(hooks, hook => { 16314 hook.call(DOMPurify, currentNode, data, CONFIG); 16315 }); 16316 } 16317 /** 16318 * _sanitizeElements 16319 * 16320 * @protect nodeName 16321 * @protect textContent 16322 * @protect removeChild 16323 * @param currentNode to check for permission to exist 16324 * @return true if node was killed, false if left alive 16325 */ 16326 const _sanitizeElements = function _sanitizeElements(currentNode) { 16327 let content = null; 16328 /* Execute a hook if present */ 16329 _executeHooks(hooks.beforeSanitizeElements, currentNode, null); 16330 /* Check if element is clobbered or can clobber */ 16331 if (_isClobbered(currentNode)) { 16332 _forceRemove(currentNode); 16333 return true; 16334 } 16335 /* Now let's check the element's type and name */ 16336 const tagName = transformCaseFunc(currentNode.nodeName); 16337 /* Execute a hook if present */ 16338 _executeHooks(hooks.uponSanitizeElement, currentNode, { 16339 tagName, 16340 allowedTags: ALLOWED_TAGS 16341 }); 16342 /* Detect mXSS attempts abusing namespace confusion */ 16343 if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) { 16344 _forceRemove(currentNode); 16345 return true; 16346 } 16347 /* Remove any occurrence of processing instructions */ 16348 if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { 16349 _forceRemove(currentNode); 16350 return true; 16351 } 16352 /* Remove any kind of possibly harmful comments */ 16353 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { 16354 _forceRemove(currentNode); 16355 return true; 16356 } 16357 /* Remove element if anything forbids its presence */ 16358 if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) { 16359 /* Check if we have a custom element to handle */ 16360 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { 16361 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { 16362 return false;
vendor: 9,812 bytes, lines 16363-16566
16363 } 16364 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { 16365 return false; 16366 } 16367 } 16368 /* Keep content except for bad-listed elements */ 16369 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { 16370 const parentNode = getParentNode(currentNode) || currentNode.parentNode; 16371 const childNodes = getChildNodes(currentNode) || currentNode.childNodes; 16372 if (childNodes && parentNode) { 16373 const childCount = childNodes.length; 16374 for (let i = childCount - 1; i >= 0; --i) { 16375 const childClone = cloneNode(childNodes[i], true); 16376 childClone.__removalCount = (currentNode.__removalCount || 0) + 1; 16377 parentNode.insertBefore(childClone, getNextSibling(currentNode)); 16378 } 16379 } 16380 } 16381 _forceRemove(currentNode); 16382 return true; 16383 } 16384 /* Check whether element has a valid namespace */ 16385 if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { 16386 _forceRemove(currentNode); 16387 return true; 16388 } 16389 /* Make sure that older browsers don't get fallback-tag mXSS */ 16390 if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { 16391 _forceRemove(currentNode); 16392 return true; 16393 } 16394 /* Sanitize element content to be template-safe */ 16395 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { 16396 /* Get the element's text content */ 16397 content = currentNode.textContent; 16398 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 16399 content = stringReplace(content, expr, ' '); 16400 }); 16401 if (currentNode.textContent !== content) { 16402 arrayPush(DOMPurify.removed, { 16403 element: currentNode.cloneNode() 16404 }); 16405 currentNode.textContent = content; 16406 } 16407 } 16408 /* Execute a hook if present */ 16409 _executeHooks(hooks.afterSanitizeElements, currentNode, null); 16410 return false; 16411 }; 16412 /** 16413 * _isValidAttribute 16414 * 16415 * @param lcTag Lowercase tag name of containing element. 16416 * @param lcName Lowercase attribute name. 16417 * @param value Attribute value. 16418 * @return Returns true if `value` is valid, otherwise false. 16419 */ 16420 // eslint-disable-next-line complexity 16421 const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { 16422 /* Make sure attribute cannot clobber */ 16423 if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) { 16424 return false; 16425 } 16426 /* Allow valid data-* attributes: At least one character after "-" 16427 (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) 16428 XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) 16429 We don't need to check the value; it's always URI safe. */ 16430 if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { 16431 if ( 16432 // First condition does a very basic check if a) it's basically a valid custom element tagname AND 16433 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 16434 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck 16435 _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || 16436 // Alternative, second condition checks if it's an `is`-attribute, AND 16437 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 16438 lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else { 16439 return false; 16440 } 16441 /* Check value is safe. First, is attr inert? If so, is safe */ 16442 } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) { 16443 return false; 16444 } else ; 16445 return true; 16446 }; 16447 /** 16448 * _isBasicCustomElement 16449 * checks if at least one dash is included in tagName, and it's not the first char 16450 * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name 16451 * 16452 * @param tagName name of the tag of the node to sanitize 16453 * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false. 16454 */ 16455 const _isBasicCustomElement = function _isBasicCustomElement(tagName) { 16456 return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT); 16457 }; 16458 /** 16459 * _sanitizeAttributes 16460 * 16461 * @protect attributes 16462 * @protect nodeName 16463 * @protect removeAttribute 16464 * @protect setAttribute 16465 * 16466 * @param currentNode to sanitize 16467 */ 16468 const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { 16469 /* Execute a hook if present */ 16470 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); 16471 const { 16472 attributes 16473 } = currentNode; 16474 /* Check if we have attributes; if not we might have a text node */ 16475 if (!attributes || _isClobbered(currentNode)) { 16476 return; 16477 } 16478 const hookEvent = { 16479 attrName: '', 16480 attrValue: '', 16481 keepAttr: true, 16482 allowedAttributes: ALLOWED_ATTR, 16483 forceKeepAttr: undefined 16484 }; 16485 let l = attributes.length; 16486 /* Go backwards over all attributes; safely remove bad ones */ 16487 while (l--) { 16488 const attr = attributes[l]; 16489 const { 16490 name, 16491 namespaceURI, 16492 value: attrValue 16493 } = attr; 16494 const lcName = transformCaseFunc(name); 16495 const initValue = attrValue; 16496 let value = name === 'value' ? initValue : stringTrim(initValue); 16497 /* Execute a hook if present */ 16498 hookEvent.attrName = lcName; 16499 hookEvent.attrValue = value; 16500 hookEvent.keepAttr = true; 16501 hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set 16502 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); 16503 value = hookEvent.attrValue; 16504 /* Full DOM Clobbering protection via namespace isolation, 16505 * Prefix id and name attributes with `user-content-` 16506 */ 16507 if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) { 16508 // Remove the attribute with this value 16509 _removeAttribute(name, currentNode); 16510 // Prefix the value and later re-create the attribute with the sanitized value 16511 value = SANITIZE_NAMED_PROPS_PREFIX + value; 16512 } 16513 /* Work around a security issue with comments inside attributes */ 16514 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) { 16515 _removeAttribute(name, currentNode); 16516 continue; 16517 } 16518 /* Make sure we cannot easily use animated hrefs, even if animations are allowed */ 16519 if (lcName === 'attributename' && stringMatch(value, 'href')) { 16520 _removeAttribute(name, currentNode); 16521 continue; 16522 } 16523 /* Did the hooks approve of the attribute? */ 16524 if (hookEvent.forceKeepAttr) { 16525 continue; 16526 } 16527 /* Did the hooks approve of the attribute? */ 16528 if (!hookEvent.keepAttr) { 16529 _removeAttribute(name, currentNode); 16530 continue; 16531 } 16532 /* Work around a security issue in jQuery 3.0 */ 16533 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { 16534 _removeAttribute(name, currentNode); 16535 continue; 16536 } 16537 /* Sanitize attribute content to be template-safe */ 16538 if (SAFE_FOR_TEMPLATES) { 16539 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 16540 value = stringReplace(value, expr, ' '); 16541 }); 16542 } 16543 /* Is `value` valid for this attribute? */ 16544 const lcTag = transformCaseFunc(currentNode.nodeName); 16545 if (!_isValidAttribute(lcTag, lcName, value)) { 16546 _removeAttribute(name, currentNode); 16547 continue; 16548 } 16549 /* Handle attributes that require Trusted Types */ 16550 if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') { 16551 if (namespaceURI) ; else { 16552 switch (trustedTypes.getAttributeType(lcTag, lcName)) { 16553 case 'TrustedHTML': 16554 { 16555 value = trustedTypesPolicy.createHTML(value); 16556 break; 16557 } 16558 case 'TrustedScriptURL': 16559 { 16560 value = trustedTypesPolicy.createScriptURL(value); 16561 break; 16562 } 16563 } 16564 } 16565 } 16566 /* Handle invalid data-* attribute set by try-catching it */
vendor: 8,193 bytes, lines 16567-16785
16567 if (value !== initValue) { 16568 try { 16569 if (namespaceURI) { 16570 currentNode.setAttributeNS(namespaceURI, name, value); 16571 } else { 16572 /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */ 16573 currentNode.setAttribute(name, value); 16574 } 16575 if (_isClobbered(currentNode)) { 16576 _forceRemove(currentNode); 16577 } else { 16578 arrayPop(DOMPurify.removed); 16579 } 16580 } catch (_) { 16581 _removeAttribute(name, currentNode); 16582 } 16583 } 16584 } 16585 /* Execute a hook if present */ 16586 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); 16587 }; 16588 /** 16589 * _sanitizeShadowDOM 16590 * 16591 * @param fragment to iterate over recursively 16592 */ 16593 const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { 16594 let shadowNode = null; 16595 const shadowIterator = _createNodeIterator(fragment); 16596 /* Execute a hook if present */ 16597 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); 16598 while (shadowNode = shadowIterator.nextNode()) { 16599 /* Execute a hook if present */ 16600 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); 16601 /* Sanitize tags and elements */ 16602 _sanitizeElements(shadowNode); 16603 /* Check attributes next */ 16604 _sanitizeAttributes(shadowNode); 16605 /* Deep shadow DOM detected */ 16606 if (shadowNode.content instanceof DocumentFragment) { 16607 _sanitizeShadowDOM(shadowNode.content); 16608 } 16609 } 16610 /* Execute a hook if present */ 16611 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); 16612 }; 16613 // eslint-disable-next-line complexity 16614 DOMPurify.sanitize = function (dirty) { 16615 let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 16616 let body = null; 16617 let importedNode = null; 16618 let currentNode = null; 16619 let returnNode = null; 16620 /* Make sure we have a string to sanitize. 16621 DO NOT return early, as this will return the wrong type if 16622 the user has requested a DOM object rather than a string */ 16623 IS_EMPTY_INPUT = !dirty; 16624 if (IS_EMPTY_INPUT) { 16625 dirty = '<!-->'; 16626 } 16627 /* Stringify, in case dirty is an object */ 16628 if (typeof dirty !== 'string' && !_isNode(dirty)) { 16629 if (typeof dirty.toString === 'function') { 16630 dirty = dirty.toString(); 16631 if (typeof dirty !== 'string') { 16632 throw typeErrorCreate('dirty is not a string, aborting'); 16633 } 16634 } else { 16635 throw typeErrorCreate('toString is not a function'); 16636 } 16637 } 16638 /* Return dirty HTML if DOMPurify cannot run */ 16639 if (!DOMPurify.isSupported) { 16640 return dirty; 16641 } 16642 /* Assign config vars */ 16643 if (!SET_CONFIG) { 16644 _parseConfig(cfg); 16645 } 16646 /* Clean up removed elements */ 16647 DOMPurify.removed = []; 16648 /* Check if dirty is correctly typed for IN_PLACE */ 16649 if (typeof dirty === 'string') { 16650 IN_PLACE = false; 16651 } 16652 if (IN_PLACE) { 16653 /* Do some early pre-sanitization to avoid unsafe root nodes */ 16654 if (dirty.nodeName) { 16655 const tagName = transformCaseFunc(dirty.nodeName); 16656 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { 16657 throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place'); 16658 } 16659 } 16660 } else if (dirty instanceof Node) { 16661 /* If dirty is a DOM element, append to an empty document to avoid 16662 elements being stripped by the parser */ 16663 body = _initDocument('<!---->'); 16664 importedNode = body.ownerDocument.importNode(dirty, true); 16665 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') { 16666 /* Node is already a body, use as is */ 16667 body = importedNode; 16668 } else if (importedNode.nodeName === 'HTML') { 16669 body = importedNode; 16670 } else { 16671 // eslint-disable-next-line unicorn/prefer-dom-node-append 16672 body.appendChild(importedNode); 16673 } 16674 } else { 16675 /* Exit directly if we have nothing to do */ 16676 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && 16677 // eslint-disable-next-line unicorn/prefer-includes 16678 dirty.indexOf('<') === -1) { 16679 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; 16680 } 16681 /* Initialize the document to work on */ 16682 body = _initDocument(dirty); 16683 /* Check we have a DOM node from the data */ 16684 if (!body) { 16685 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ''; 16686 } 16687 } 16688 /* Remove first element node (ours) if FORCE_BODY is set */ 16689 if (body && FORCE_BODY) { 16690 _forceRemove(body.firstChild); 16691 } 16692 /* Get node iterator */ 16693 const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); 16694 /* Now start iterating over the created document */ 16695 while (currentNode = nodeIterator.nextNode()) { 16696 /* Sanitize tags and elements */ 16697 _sanitizeElements(currentNode); 16698 /* Check attributes next */ 16699 _sanitizeAttributes(currentNode); 16700 /* Shadow DOM detected, sanitize it */ 16701 if (currentNode.content instanceof DocumentFragment) { 16702 _sanitizeShadowDOM(currentNode.content); 16703 } 16704 } 16705 /* If we sanitized `dirty` in-place, return it. */ 16706 if (IN_PLACE) { 16707 return dirty; 16708 } 16709 /* Return sanitized string or DOM */ 16710 if (RETURN_DOM) { 16711 if (RETURN_DOM_FRAGMENT) { 16712 returnNode = createDocumentFragment.call(body.ownerDocument); 16713 while (body.firstChild) { 16714 // eslint-disable-next-line unicorn/prefer-dom-node-append 16715 returnNode.appendChild(body.firstChild); 16716 } 16717 } else { 16718 returnNode = body; 16719 } 16720 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { 16721 /* 16722 AdoptNode() is not used because internal state is not reset 16723 (e.g. the past names map of a HTMLFormElement), this is safe 16724 in theory but we would rather not risk another attack vector. 16725 The state that is cloned by importNode() is explicitly defined 16726 by the specs. 16727 */ 16728 returnNode = importNode.call(originalDocument, returnNode, true); 16729 } 16730 return returnNode; 16731 } 16732 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; 16733 /* Serialize doctype if allowed */ 16734 if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { 16735 serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML; 16736 } 16737 /* Sanitize final string template-safe */ 16738 if (SAFE_FOR_TEMPLATES) { 16739 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 16740 serializedHTML = stringReplace(serializedHTML, expr, ' '); 16741 }); 16742 } 16743 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; 16744 }; 16745 DOMPurify.setConfig = function () { 16746 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 16747 _parseConfig(cfg); 16748 SET_CONFIG = true; 16749 }; 16750 DOMPurify.clearConfig = function () { 16751 CONFIG = null; 16752 SET_CONFIG = false; 16753 }; 16754 DOMPurify.isValidAttribute = function (tag, attr, value) { 16755 /* Initialize shared config vars if necessary. */ 16756 if (!CONFIG) { 16757 _parseConfig({}); 16758 } 16759 const lcTag = transformCaseFunc(tag); 16760 const lcName = transformCaseFunc(attr); 16761 return _isValidAttribute(lcTag, lcName, value); 16762 }; 16763 DOMPurify.addHook = function (entryPoint, hookFunction) { 16764 if (typeof hookFunction !== 'function') { 16765 return; 16766 } 16767 arrayPush(hooks[entryPoint], hookFunction); 16768 }; 16769 DOMPurify.removeHook = function (entryPoint, hookFunction) { 16770 if (hookFunction !== undefined) { 16771 const index = arrayLastIndexOf(hooks[entryPoint], hookFunction); 16772 return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0]; 16773 } 16774 return arrayPop(hooks[entryPoint]); 16775 }; 16776 DOMPurify.removeHooks = function (entryPoint) { 16777 hooks[entryPoint] = []; 16778 }; 16779 DOMPurify.removeAllHooks = function () { 16780 hooks = _createHooksMap(); 16781 }; 16782 return DOMPurify; 16783} 16784var purify = createDOMPurify(); 16785
16786 16787//# sourceMappingURL=purify.es.mjs.map 16788 16789// EXTERNAL MODULE: ./node_modules/crypto-js/index.js 16790var crypto_js = __webpack_require__(1396); 16791;// ./src/frontend/js/functions/api.js 16792 16793var _alm_localize = alm_localize, 16794 rest_api = _alm_localize.rest_api, 16795 rest_nonce = _alm_localize.rest_nonce; 16796 16797/* 16798 * Create a Api object with Axios and configure it for the WordPress Rest API. 16799 * 16800 * @see https://axios-http.com/docs/instance 16801 */ 16802var api = lib_axios.create({ 16803 baseURL: rest_api, 16804 headers: { 16805 'content-type': 'application/json', 16806 'X-WP-Nonce': rest_nonce 16807 } 16808}); 16809;// ./src/frontend/js/functions/getButtonURL.js 16810/** 16811 * Get the URL for Load More button. 16812 * 16813 * @param {Object} alm The Ajax Load More object. 16814 * @param {string} rel The type of load more, `next` or `previous`. 16815 * @since 5.4.0 16816 */ 16817function getButtonURL(alm) { 16818 var _button; 16819 var rel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'next'; 16820 if (!alm || !alm.trigger) { 16821 return false; 16822 } 16823 var button = alm.trigger.querySelector('.alm-load-more-btn'); 16824 if (rel === 'prev') { 16825 button = document.querySelector('.alm-load-more-btn--prev'); 16826 } 16827 return ((_button = button) === null || _button === void 0 || (_button = _button.dataset) === null || _button === void 0 ? void 0 : _button.url) || ''; 16828} 16829 16830/** 16831 * Set button dataset attributes. 16832 * 16833 * @param {Element} button The HTML element. 16834 * @param {number} page The current page number. 16835 * @param {string} url The URL for updating. 16836 */ 16837function setButtonAtts(button, page, url) { 16838 if (!button || page === 0) { 16839 return; 16840 } 16841 if ((button === null || button === void 0 ? void 0 : button.rel) === 'prev') { 16842 button.href = url; 16843 } 16844 16845 // Set page & URL attributes. 16846 button.dataset.page = page; 16847 button.dataset.url = url ? url : ''; 16848} 16849;// ./src/frontend/js/functions/timeout.js 16850/** 16851 * Wait for a specified amount of time. 16852 * 16853 * @param {number} ms The number of milliseconds to wait. 16854 * @return {Promise} A promise that resolves after the specified time. 16855 */ 16856function timeout(ms) { 16857 return new Promise(function (resolve) { 16858 return setTimeout(resolve, ms); 16859 }); 16860} 16861;// ./src/frontend/js/addons/cache.js 16862function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
vendor: 4,252 bytes, lines 16862-16889
16862 var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 16863function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); } 16864function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 16865function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 16866function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 16867function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 16868function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 16869function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } 16870function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 16871function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 16872 16873 16874 16875 16876 16877/** 16878 * Create add-on params for ALM. 16879 * 16880 * @param {Object} alm The alm object. 16881 * @return {Object} The modified object. 16882 */ 16883function cacheCreateParams(alm) { 16884 var _listing$dataset; 16885 var listing = alm.listing; 16886 alm.addons.cache = (listing === null || listing === void 0 || (_listing$dataset = listing.dataset) === null || _listing$dataset === void 0 ? void 0 : _listing$dataset.cache) === 'true'; 16887 if (alm.addons.cache) { 16888 // Will be true if the "Known Users: Disable Cache for Logged In Users" setting is checked. 16889 alm.addons.cache_logged_in = listing.dataset.cacheLoggedIn && listing.dataset.cacheLoggedIn === 'true' ? true : false;
16890 } 16891 return alm; 16892} 16893 16894/** 16895 * Get the cache ID for the given ALM instance and data. 16896 * 16897 * @param {Object} alm The ALM object. 16898 * @param {Object} data The data to cache. 16899 * @return {string} The cache ID. 16900 */ 16901function getCacheId(alm, data) { 16902 var addons = alm.addons, 16903 _alm$id = alm.id, 16904 id = _alm$id === void 0 ? '' : _alm$id; 16905 16906 // Generate a cache ID for specific addons that perform full page fetches (Woo, Elementor, Query Loop). 16907 if (addons.woocommerce || addons.elementor || addons.queryloop) { 16908 var url = getButtonURL(alm, alm.rel); // Get the target URL. 16909 var settings = getAddOnSettings(alm); // Get addon settings. 16910 return createMD5Hash("".concat(url, "-").concat(id, "-").concat(settings)); // Combine params to generate cache ID. 16911 } 16912 16913 // Create a shallow copy of the data object so we don't modify the main data object. 16914 var copy = _objectSpread({}, data); 16915 16916 // Remove the following params to prevent unnecessary cache misses on paged results. 16917 delete copy.page; 16918 delete copy.seo_start_page; 16919 delete copy.filters_startpage; 16920 delete copy.paging; 16921 delete copy.preloaded; 16922 delete copy.preloaded_amount; 16923 delete copy.cache; 16924 delete copy.cache_logged_in; 16925 delete copy.cache_id; 16926 return createMD5Hash(copy); 16927} 16928 16929/** 16930 * Return MD5 hash of data. 16931 * 16932 * @param {Object} data The data to hash. 16933 * @return {string} The MD5 hash. 16934 */ 16935function createMD5Hash(data) { 16936 return (0,crypto_js.MD5)(JSON.stringify(data)).toString(); 16937} 16938 16939/** 16940 * Create a cache file. 16941 * 16942 * @param {Object} alm The ALM object. 16943 * @param {Object} data The data to cache. 16944 * @param {string} cache_id The cache ID. 16945 * @param {boolean} paging Whether the query request is for paging add-on, which returns different data shape. 16946 * @since 5.3.1 16947 */ 16948function createCache(_x, _x2, _x3) { 16949 return _createCache.apply(this, arguments); 16950} 16951 16952/** 16953 * Get cache data file. 16954 * 16955 * Note: This function is used for various addons that perform full page fetches: 16956 * WooCommerce, Elementor, Single Post, Query Loop, etc. 16957 * 16958 * @param {Object} alm The ALM object. 16959 * @param {Object} params Query params. 16960 * @return {Promise} Cache data or false. 16961 */ 16962function _createCache() { 16963 _createCache = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(alm, data, cache_id) { 16964 var paging, 16965 _res, 16966 _data$html, 16967 html, 16968 _data$meta, 16969 meta, 16970 _data$facets, 16971 facets, 16972 params, 16973 res, 16974 _args = arguments; 16975 return _regenerator().w(function (_context) { 16976 while (1) switch (_context.n) { 16977 case 0: 16978 paging = _args.length > 3 && _args[3] !== undefined ? _args[3] : false; 16979 if (!(!alm.addons.cache || alm.addons.cache && alm.addons.cache_logged_in)) { 16980 _context.n = 1; 16981 break; 16982 } 16983 return _context.a(2); 16984 case 1: 16985 _context.n = 2; 16986 return timeout(500); 16987 case 2: 16988 if (!paging) { 16989 _context.n = 4; 16990 break; 16991 } 16992 _context.n = 3; 16993 return api.post('ajax-load-more/cache/create', { 16994 cache_id: cache_id, 16995 paging: data 16996 }); 16997 case 3: 16998 _res = _context.v; 16999 if (_res.status === 200 && _res.data && _res.data.success) { 17000 console.log(_res.data.msg); // eslint-disable-line no-console 17001 } 17002 return _context.a(2); 17003 case 4: 17004 // Standard ALM cache. 17005 _data$html = data.html, html = _data$html === void 0 ? '' : _data$html, _data$meta = data.meta, meta = _data$meta === void 0 ? {} : _data$meta, _data$facets = data.facets, facets = _data$facets === void 0 ? {} : _data$facets; 17006 if (!(!html || !alm.addons.cache || alm.addons.cache && alm.addons.cache_logged_in)) { 17007 _context.n = 5; 17008 break; 17009 } 17010 return _context.a(2, false); 17011 case 5: 17012 params = { 17013 cache_id: cache_id, 17014 html: html.trim(), 17015 postcount: meta.postcount, 17016 totalposts: meta.totalposts 17017 }; // Include facets if present. 17018 if (facets) { 17019 params.facets = facets; 17020 } 17021 17022 // Create the cache file via REST API. 17023 _context.n = 6; 17024 return api.post('ajax-load-more/cache/create', params); 17025 case 6: 17026 res = _context.v; 17027 if (res.status === 200 && res.data && res.data.success) { 17028 console.log(res.data.msg); // eslint-disable-line no-console 17029 } 17030 case 7: 17031 return _context.a(2); 17032 } 17033 }, _callee); 17034 })); 17035 return _createCache.apply(this, arguments); 17036} 17037function getCache(_x4, _x5) { 17038 return _getCache.apply(this, arguments); 17039} 17040 17041/** 17042 * Get addon settings for cache ID generation. 17043 * 17044 * @param {Object} alm The ALM object. 17045 * @return {string} The addon settings as a JSON string. 17046 */ 17047function _getCache() { 17048 _getCache = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(alm, params) { 17049 var res; 17050 return _regenerator().w(function (_context2) { 17051 while (1) switch (_context2.n) { 17052 case 0: 17053 if (!(!alm.addons.cache || !params.cache_id || alm.addons.cache && alm.addons.cache_logged_in)) { 17054 _context2.n = 1; 17055 break; 17056 } 17057 return _context2.a(2, false); 17058 case 1: 17059 _context2.n = 2; 17060 return api.get('ajax-load-more/cache/get', { 17061 params: { 17062 id: params.cache_id 17063 } 17064 }); 17065 case 2: 17066 res = _context2.v; 17067 if (!(res.status === 200 && res.data)) { 17068 _context2.n = 3; 17069 break; 17070 } 17071 return _context2.a(2, res.data); 17072 case 3: 17073 return _context2.a(2, false); 17074 } 17075 }, _callee2); 17076 })); 17077 return _getCache.apply(this, arguments); 17078} 17079function getAddOnSettings(alm) { 17080 var addons = alm.addons; 17081 var settings = {}; 17082 if (addons.elementor) { 17083 var _addons$elementor_set; 17084 settings = (addons === null || addons === void 0 || (_addons$elementor_set = add
17084ons.elementor_settings) === null || _addons$elementor_set === void 0 ? void 0 : _addons$elementor_set.target) || {}; // Pluck unique target settings. 17085 } 17086 if (addons.woocommerce) { 17087 var _addons$woocommerce_s; 17088 settings = (addons === null || addons === void 0 || (_addons$woocommerce_s = addons.woocommerce_settings) === null || _addons$woocommerce_s === void 0 ? void 0 : _addons$woocommerce_s.container) || {}; // Pluck unique container settings. 17089 } 17090 if (addons.queryloop) { 17091 var _addons$queryloop_set; 17092 settings = (addons === null || addons === void 0 ? void 0 : addons.queryloopId) || (addons === null || addons === void 0 || (_addons$queryloop_set = addons.queryloop_settings) === null || _addons$queryloop_set === void 0 || (_addons$queryloop_set = _addons$queryloop_set.classes) === null || _addons$queryloop_set === void 0 ? void 0 : _addons$queryloop_set.container) || {}; // Pluck unique query loop ID 17093 } 17094 return JSON.stringify(settings); 17095} 17096;// ./src/frontend/js/addons/call-to-actions.js 17097/** 17098 * Create add-on params for ALM. 17099 * 17100 * @param {Object} alm The alm object. 17101 * @return {Object} The modified object. 17102 */ 17103function ctaCreateParams(alm) { 17104 var _listing$dataset; 17105 var listing = alm.listing; 17106 alm.addons.cta = (listing === null || listing === void 0 || (_listing$dataset = listing.dataset) === null || _listing$dataset === void 0 ? void 0 : _listing$dataset.cta) === 'true'; 17107 if (alm.addons.cta) { 17108 alm.addons.cta_position = listing.dataset.ctaPosition; 17109 if (listing.dataset.ctaTemplate) { 17110 alm.addons.cta_template = listing.dataset.ctaTemplate; 17111 } 17112 alm.addons.cta_repeater = listing.dataset.ctaRepeater; 17113 alm.addons.cta_theme_repeater = listing.dataset.ctaThemeRepeater; 17114 } 17115 return alm; 17116} 17117;// ./src/frontend/js/addons/comments.js 17118/** 17119 * Create add-on params for ALM. 17120 * 17121 * @param {Object} alm The alm object. 17122 * @return {Object} The modified object. 17123 */ 17124function commentsCreateParams(alm) { 17125 var _listing$dataset; 17126 var listing = alm.listing; 17127 alm.addons.comments = (listing === null || listing === void 0 || (_listing$dataset = listing.dataset) === null || _listing$dataset === void 0 ? void 0 : _listing$dataset.comments) === 'true'; 17128 if (alm.addons.comments) { 17129 alm.addons.comments_post_id = listing.dataset.comments_post_id; 17130 alm.addons.comments_per_page = listing.dataset.comments_per_page; 17131 alm.addons.comments_per_page = alm.addons.comments_per_page === undefined ? '5' : alm.addons.comments_per_page; 17132 alm.addons.comments_type = listing.dataset.comments_type; 17133 alm.addons.comments_style = listing.dataset.comments_style; 17134 alm.addons.comments_template = listing.dataset.comments_template; 17135 alm.addons.comments_callback = listing.dataset.comments_callback; 17136 } 17137 return alm; 17138} 17139;// ./src/frontend/js/functions/constants.js 17140var EXCLUDED_NODES = ['#text', '#comment']; 17141 17142// The default data shape returned by the API. 17143var API_DEFAULT_DATA_SHAPE = { 17144 html: '', 17145 meta: { 17146 postcount: 0, 17147 totalposts: 0 17148 } 17149}; 17150;// ./src/frontend/js/functions/dispatchScrollEvent.js 17151/** 17152 * Dispatch a window scroll event. 17153 * 17154 * @param {boolean} delay Should this be delayed. 17155 * @since 5.5 17156 */ 17157function dispatchScrollEvent() { 17158 var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 17159 if (typeof Event === 'function') { 17160 setTimeout(function () { 17161 window.dispatchEvent(new CustomEvent('scroll')); 17162 }, delay ? 150 : 1); 17163 } 17164} 17165;// ./src/frontend/js/functions/setContentParams.js 17166/** 17167 * Set accessibility attributes on the containers. 17168 * 17169 * @param {Element} container The container element. 17170 * @param {Element} almListing The Ajax Load More container. 17171 */ 17172function setContentContainersParams(container, almListing) { 17173 container.setAttribute('aria-live', 'polite'); 17174 container.setAttribute('aria-atomic', 'true'); 17175 almListing.removeAttribute('aria-live'); 17176 almListing.removeAttribute('aria-atomic'); 17177} 17178;// ./src/frontend/js/modules/lazyImages.js 17179function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } 17180function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 17181function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } 17182function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } 17183function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } 17184function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 17185/** 17186 * Lazy load images helper. 17187 * When a plugin or 3rd party script has hooked into WP Post Thumbnails to provide a lazy load solution, images will not load via Ajax. 17188 * This helper provides a fix by grabbing the dataset value and making it the src. 17189 * 17190 * @param {Object} alm The Ajax Load More object. 17191 */ 17192function lazyImages(alm) { 17193 var lazy_images = alm.lazy_images, 17194 last_loaded = alm.last_loaded; 17195 if (lazy_images && last_loaded !== null && last_loaded !== void 0 && last_loaded.length) { 17196 last_loaded.forEach(function (item) { 17197 lazyImagesReplace(item); 17198 }); 17199 } 17200} 17201 17202/** 17203 * Loop all images in container and replace the src. 17204 * 17205 * @param {HTMLElement} container The element HTML. 17206 */ 17207function lazyImagesReplace(container) { 17208 var images = container.querySelectorAll('img'); 17209 if (images) { 17210 // Loop all images.
17211 _toConsumableArray(images).forEach(function (image) { 17212 if (image) { 17213 replaceSrc(image); 17214 } 17215 }); 17216 } 17217} 17218 17219/** 17220 * Replace the image src with the value from data-src attributes. 17221 * 17222 * @param {HTMLElement} img The HTML image element. 17223 */ 17224function replaceSrc(img) { 17225 var _img$dataset, _img$dataset2, _img$dataset3, _img$dataset4; 17226 if (!img) { 17227 return; 17228 } 17229 if (img !== null && img !== void 0 && (_img$dataset = img.dataset) !== null && _img$dataset !== void 0 && _img$dataset.src) { 17230 img.src = img.dataset.src; 17231 } 17232 if (img !== null && img !== void 0 && (_img$dataset2 = img.dataset) !== null && _img$dataset2 !== void 0 && _img$dataset2.srcset) { 17233 img.srcset = img.dataset.srcset; 17234 } 17235 // Blocksy Pro. 17236 // @see https://creativethemes.com/blocksy 17237 if (img !== null && img !== void 0 && (_img$dataset3 = img.dataset) !== null && _img$dataset3 !== void 0 && _img$dataset3.ctLazy) { 17238 img.src = img.dataset.ctLazy; 17239 } 17240 if (img !== null && img !== void 0 && (_img$dataset4 = img.dataset) !== null && _img$dataset4 !== void 0 && _img$dataset4.ctLazySet) { 17241 img.srcset = img.dataset.ctLazySet; 17242 } 17243} 17244;// ./src/frontend/js/functions/srcsetPolyfill.js 17245/** 17246 * A srcset polyfill to get Masonry and ImagesLoaded working with Safari and Firefox. 17247 * 17248 * @param {HTMLElement} container Container HTML element. 17249 * @param {string} ua The user-agent string. 17250 * @since 5.0.2 17251 */ 17252function srcsetPolyfill() { 17253 var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 17254 var ua = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 17255 if (!container) { 17256 return false; // Exit if no container. 17257 } 17258 17259 // Exit if useragent is Chrome, Safari or Windows. 17260 if (ua.indexOf('Safari') > -1 && ua.indexOf('Chrome') !== -1 || ua.indexOf('Firefox') > -1 || ua.indexOf('Windows') > -1) { 17261 return false; 17262 } 17263 17264 // Get all images. 17265 var imgs = container.querySelectorAll('img[srcset]:not(.alm-loaded)'); 17266 17267 // Loop images. 17268 for (var i = 0; i < imgs.length; i++) { 17269 var img = imgs[i]; 17270 img.classList.add('alm-loaded'); 17271 img.outerHTML = img.outerHTML; 17272 } 17273} 17274;// ./src/frontend/js/modules/loadImage.js 17275 17276 17277var imagesLoaded = __webpack_require__(7943); 17278 17279/** 17280 * Load the image with imagesLoaded 17281 * 17282 * @param {Element} container The HTML container. 17283 * @param {Element} item The element to load. 17284 * @param {string} ua Browser user-agent. 17285 * @param {string} rel The loading direction, next or prev. 17286 * @param {boolean} waitForImages Wait for images to load before loading next item. 17287 */ 17288function loadImage(container, item, ua) { 17289 var rel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'next'; 17290 var waitForImages = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; 17291 /** 17292 * Append item to container. 17293 */ 17294 function appendImage() { 17295 if (rel === 'prev') { 17296 container.insertBefore(item, container.childNodes[0]); 17297 } else { 17298 container.appendChild(item); 17299 } 17300 lazyImagesReplace(item); // Lazy load image fix. 17301 srcsetPolyfill(item, ua); // Safari/Firefox polyfills. 17302 } 17303 return new Promise(function (resolve) { 17304 item.style.transition = 'all 0.25s ease'; // Add CSS transition to each item. 17305 17306 if (waitForImages) { 17307 imagesLoaded(item, function () { 17308 appendImage(); 17309 resolve(true); // Send Promise callback 17310 }); 17311 } else { 17312 appendImage(); 17313 resolve(true); // Send Promise callback 17314 } 17315 }); 17316} 17317;// ./src/frontend/js/functions/setFocus.js 17318/** 17319 * Set user focus to improve accessibility after load events. 17320 * 17321 * @param {Object} alm ALM object. 17322 * @param {Element} element The element to focus on. 17323 * @param {number} total The total number of posts returned. 17324 * @param {boolean} is_filtering Is this a filtering event. 17325 * @since 5.1 17326 */ 17327function setFocus(alm) { 17328 var _alm_localize, _alm$addons, _alm$addons2; 17329 var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; 17330 var total = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; 17331 var is_filtering = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
17332 if (!((_alm_localize = alm_localize) !== null && _alm_localize !== void 0 && _alm_localize.a11y_focus) || !element) { 17333 return; 17334 } 17335 17336 // WooCommerce||Elementor Add-ons. 17337 if (alm !== null && alm !== void 0 && (_alm$addons = alm.addons) !== null && _alm$addons !== void 0 && _alm$addons.woocommerce || alm !== null && alm !== void 0 && (_alm$addons2 = alm.addons) !== null && _alm$addons2 !== void 0 && _alm$addons2.elementor) { 17338 moveFocus(false, false, element, false); 17339 return; 17340 } 17341 if (total < 1) { 17342 return; // Exit if no posts returned. 17343 } 17344 if (alm.addons.paging) { 17345 // Paging. 17346 moveFocus(alm.init, alm.addons.preloaded, alm.listing, is_filtering); 17347 } else if (alm.addons.single_post || alm.addons.nextpage) { 17348 // Single Posts || Next Page - Set `init` to false to trigger focus. 17349 moveFocus(false, alm.addons.preloaded, element, is_filtering); 17350 } else { 17351 // Standard. 17352 moveFocus(alm.init, alm.addons.preloaded, element, is_filtering); 17353 } 17354} 17355 17356/** 17357 * Move user focus to latest elements that have been loaded. 17358 * 17359 * @param {boolean} init Initial run true or false. 17360 * @param {string} preloaded Preloaded true or false. 17361 * @param {Element} element The container HTML element. 17362 * @param {boolean} is_filtering Filtering true or false. 17363 * @since 5.1 17364 */ 17365 17366function moveFocus() { 17367 var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 17368 var preloaded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'false'; 17369 var element = arguments.length > 2 ? arguments[2] : undefined; 17370 var is_filtering = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 17371 if (!element) { 17372 return; // Exit if no element. 17373 } 17374 if (!is_filtering && init && !preloaded) { 17375 return; // Exit if first run and not preloaded. 17376 } 17377 element.setAttribute('tabIndex', '-1'); // Set tabIndex. 17378 element.style.outline = 'none'; // Set element outline. 17379 17380 // Add slight delay for elements to settle into DOM. 17381 setTimeout(function () { 17382 element.focus({ 17383 preventScroll: true 17384 }); 17385 }, 50); 17386} 17387;// ./src/frontend/js/modules/loadItems.js 17388function loadItems_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return loadItems_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
17388 var c = [][n] ? t(t([][n]())) : (loadItems_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, loadItems_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, loadItems_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), loadItems_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", loadItems_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), loadItems_regeneratorDefine2(u), loadItems_regeneratorDefine2(u, o, "Generator"), loadItems_regeneratorDefine2(u, n, function () { return this; }), loadItems_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (loadItems_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 17389function loadItems_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } loadItems_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { loadItems_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, loadItems_regeneratorDefine2(e, r, n, t); } 17390function loadItems_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 17391function loadItems_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { loadItems_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { loadItems_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 17392 17393 17394 17395/** 17396 * Load all items after Ajax request. 17397 * 17398 * Note: The function is used with WooCommerce and Elementor add-ons. 17399 * 17400 * @param {HTMLElement} container The HTML container. 17401 * @param {Array} items Array of items. 17402 * @param {Object} alm The ALM object. 17403 * @param {boolean} waitForImages Wait for images to load before loading next item. 17404 */ 17405function loadItems(container, items, alm) { 17406 var waitForImages = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; 17407 return new Promise(function (resolve) { 17408 var _alm$rel = alm.rel, 17409 rel = _alm$rel === void 0 ? 'next' : _alm$rel; 17410 var total = items.length; 17411 var index = 0; 17412 var count = 1; 17413 17414 // Reverse items array if rel is 'prev'. 17415 items = rel === 'prev' ? items.reverse() : items; 17416 function loadItem() { 17417 if (count <= total) { 17418 loadItems_asyncToGenerator(/*#__PURE__*/loadItems_regenerator().m(function _callee() { 17419 return loadItems_regenerator().w(function (_context) { 17420 while (1) switch (_context.n) { 17421 case 0: 17422 items[index].style.opacity = 0; 17423 _context.n = 1; 17424 return loadImage(container, items[index], alm.ua, rel, waitForImages); 17425 case 1: 17426 count++; 17427 index++; 17428 loadItem(); 17429 case 2: 17430 return _context.a(2); 17431 } 17432 }, _callee); 17433 }))()["catch"](function () { 17434 console.warn('There was an error loading the items.'); 17435 }); 17436 } else { 17437 // Delay for effect only 17438 setTimeout(function () { 17439 items.map(function (item) { 17440 item.style.opacity = 1; 17441 return item; 17442 }); 17443 if (items[0]) { 17444 var focusItem = rel === 'prev' ? items[items.length - 1] : items[0]; // Get the item to focus. 17445 setFocus(alm, focusItem, null, false); // Set the focus. 17446 } 17447 }, 25); 17448 resolve(true); 17449 } 17450 } 17451 loadItem(); 17452 }); 17453} 17454;// ./src/frontend/js/modules/loadPrevious.js 17455/** 17456 * Create a Load Previous button. 17457 * 17458 * @param {Object} alm The Ajax Load More object. 17459 * @param {Object} container The container element. 17460 * @param {number} page The previous page number. 17461 * @param {string} url The previous page url. 17462 * @param {string} label The label for the button. 17463 * @since 5.5.0 17464 */ 17465function createLoadPreviousButton(alm, container) { 17466 var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; 17467 var url = arguments.length > 3 ? arguments[3] : undefined; 17468 var label = arguments.length > 4 ? arguments[4] : undefined; 17469 if (!label) { 17470 return; 17471 } 17472 17473 // Create wrapper. 17474 var btnWrap = document.createElement('div'); 17475 btnWrap.classList.add('alm-btn-wrap--prev'); 17476 17477 // Create button. 17478 var button = document.createElement('a'); 17479 button.href = url; 17480 button.innerHTML = label; 17481 button.setAttribute('rel', 'prev'); 17482 button.dataset.page = page; 17483 button.dataset.url = url; 17484 button.setAttribute('class', "alm-load-more-btn alm-load-more-btn--prev ".concat(alm.loading_style)); 17485 17486 // Click event. 17487 button.addEventListener('click', function (e) { 17488 alm.AjaxLoadMore.prevClick(e); 17489 }); 17490 17491 // Set alm previous button to this button. 17492 alm.AjaxLoadMore.setPreviousButton(button); 17493 17494 // Append button to wrap. 17495 btnWrap.appendChild(button); 17496 17497 // Get parent element. 17498 var parent = container.parentNode; 17499 17500 // Append button before container. 17501 parent.insertBefore(btnWrap, container); 17502} 17503;// ./src/frontend/js/addons/elementor.js 17504function elementor_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return elementor_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
17504 var c = [][n] ? t(t([][n]())) : (elementor_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, elementor_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, elementor_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), elementor_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", elementor_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), elementor_regeneratorDefine2(u), elementor_regeneratorDefine2(u, o, "Generator"), elementor_regeneratorDefine2(u, n, function () { return this; }), elementor_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (elementor_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 17505function elementor_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } elementor_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { elementor_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, elementor_regeneratorDefine2(e, r, n, t); } 17506function elementor_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 17507function elementor_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { elementor_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { elementor_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 17508 17509 17510 17511 17512 17513 17514 17515 17516/** 17517 * Create add-on params for ALM. 17518 * 17519 * @param {Object} alm The alm object. 17520 * @return {Object} The modified object. 17521 */ 17522function elementorCreateParams(alm) { 17523 var _alm = alm, 17524 listing = _alm.listing; 17525 alm.addons.elementor = listing.dataset.elementor === 'posts' && listing.dataset.elementorSettings; 17526 if (alm.addons.elementor) { 17527 alm.addons.elementor_type = 'posts'; 17528 alm.addons.elementor_settings = JSON.parse(alm.listing.dataset.elementorSettings); 17529 17530 // Parse Container Settings 17531 alm.addons.elementor_target = alm.addons.elementor_settings.target; 17532 alm.addons.elementor_element = alm.addons.elementor_settings.target ? document.querySelector(".elementor-element ".concat(alm.addons.elementor_settings.target)) : ''; 17533 alm.addons.elementor_widget = elementorGetWidgetType(alm.addons.elementor_element); 17534 17535 // Masonry 17536 alm = setClasses(alm, alm.addons.elementor_widget); 17537 17538 // Pagination Element 17539 alm.addons.elementor_controls = alm.addons.elementor_settings.controls; 17540 alm.addons.elementor_controls = alm.addons.elementor_controls === 'true' ? true : false; 17541 alm.addons.elementor_scrolltop = parseInt(alm.addons.elementor_settings.scrolltop); 17542 alm.addons.elementor_prev_label = alm.addons.elementor_settings.prev_label || ''; 17543 17544 // Get next page URL.
17545 alm.addons.elementor_next_page = getURL(alm, alm.addons.elementor_element); 17546 alm.addons.elementor_prev_page = getURL(alm, alm.addons.elementor_element, 'prev'); 17547 17548 // Get the max pages. 17549 alm.addons.elementor_max_pages = alm.addons.elementor_element.querySelector('.e-load-more-anchor'); 17550 alm.addons.elementor_max_pages = alm.addons.elementor_max_pages ? parseInt(alm.addons.elementor_max_pages.dataset.maxPage) : 999; 17551 alm.addons.elementor_paged = alm.addons.elementor_settings.paged ? parseInt(alm.addons.elementor_settings.paged) : 1; 17552 alm.page = parseInt(alm.page) + alm.addons.elementor_paged; 17553 17554 // Masonry 17555 alm = parseMasonryConfig(alm); 17556 if (!alm.addons.elementor_element) { 17557 console.warn("Ajax Load More: Unable to locate Elementor Widget. Are you sure you've set up your target parameter correctly?"); 17558 } 17559 if (!alm.addons.elementor_next_page) { 17560 console.warn('Ajax Load More: Unable to locate Elementor pagination. There are either no results or Ajax Load More is unable to locate the pagination widget?'); 17561 } 17562 } 17563 return alm; 17564} 17565 17566/** 17567 * Set up the instance on Elementor 17568 * 17569 * @param {Object} alm 17570 */ 17571function elementorInit(alm) { 17572 var addons = alm.addons; 17573 if (!addons.elementor || !addons.elementor_type || !addons.elementor_type === 'posts') { 17574 return false; 17575 } 17576 var container = addons.elementor_element; 17577 if (!container) { 17578 return false; 17579 } 17580 alm.button.dataset.page = addons.elementor_paged; // Set button data attributes 17581 17582 // Set button URL 17583 var nextPage = addons.elementor_next_page; 17584 alm.button.dataset.url = nextPage ? nextPage : ''; 17585 17586 // Set attributes on containers. 17587 setContentContainersParams(container, alm.listing); 17588 17589 // Set data attributes on first item. 17590 var item = container.querySelector(".".concat(addons.elementor_item_class)); // Get first item 17591 if (item) { 17592 item.classList.add('alm-elementor'); 17593 item.dataset.url = window.location; 17594 item.dataset.page = addons.elementor_paged; 17595 item.dataset.pageTitle = document.title; 17596 } 17597 17598 // Paged URL: Create previous button. 17599 if (addons.elementor_paged > 1 && addons.elementor_prev_page && addons.elementor_prev_label) { 17600 createLoadPreviousButton(alm, container, addons.elementor_paged, addons.elementor_prev_page, addons.elementor_prev_label); 17601 } 17602 17603 // Masonry Window Resize. Delay for masonry to be added via Elementor. 17604 if (addons.elementor_masonry) { 17605 var resizeTimeout; 17606 setTimeout(function () { 17607 window.addEventListener('resize', function () { 17608 clearTimeout(resizeTimeout); 17609 resizeTimeout = setTimeout(function () { 17610 positionMasonryItems(alm, ".".concat(addons.elementor_container_
17610class), ".".concat(addons.elementor_item_class)); 17611 }, 100); 17612 }); 17613 }, 250); 17614 } 17615} 17616 17617/** 17618 * Get the content, title and results text from the Ajax response. 17619 * 17620 * @param {Object} alm The alm object. 17621 * @param {string} url The request URL. 17622 * @param {string} html The HTML data as a string. 17623 * @return {Object} Results data. 17624 */ 17625function elementorGetContent(alm, url) { 17626 var html = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; 17627 if (!html) { 17628 return API_DEFAULT_DATA_SHAPE; // Bail early if missing html content. 17629 } 17630 var addons = alm.addons, 17631 page = alm.page, 17632 rel = alm.rel; 17633 var elementor_target = addons.elementor_target, 17634 elementor_container_class = addons.elementor_container_class, 17635 elementor_item_class = addons.elementor_item_class; 17636 17637 // Create temp div to hold html data. 17638 var tempDiv = document.createElement('div'); 17639 tempDiv.innerHTML = html; 17640 var target = tempDiv.querySelector(elementor_target); 17641 if (!target) { 17642 console.warn("Ajax Load More Elementor: Unable to find Elementor target element."); 17643 return API_DEFAULT_DATA_SHAPE; 17644 } 17645 17646 // Get Elementor container. 17647 var container = target.querySelector(".".concat(elementor_container_
17647class)); 17648 if (!container) { 17649 console.warn("Ajax Load More Elementor: Unable to find Elementor container element."); 17650 return API_DEFAULT_DATA_SHAPE; 17651 } 17652 17653 // Get the returned items. 17654 var items = container.querySelectorAll(".".concat(elementor_item_class)); 17655 if (items) { 17656 // Set first item data attributes. 17657 items[0].classList.add('alm-elementor'); 17658 items[0].dataset.url = url; 17659 items[0].dataset.page = rel === 'next' ? page + 1 : page - 1; 17660 items[0].dataset.pageTitle = tempDiv.querySelector('title').innerHTML; 17661 17662 // Return data object. 17663 return { 17664 html: target ? target.innerHTML : '', 17665 meta: { 17666 postcount: items.length, 17667 totalposts: items.length 17668 } 17669 }; 17670 } 17671 return API_DEFAULT_DATA_SHAPE; // Return default data shape if no items found. 17672} 17673 17674/** 17675 * Core ALM Elementor loader. 17676 * 17677 * @param {HTMLElement} content The HTML data. 17678 * @param {Object} alm The alm object. 17679 */ 17680function elementor(content, alm) { 17681 if (!content || !alm) { 17682 alm.AjaxLoadMore.triggerDone(); 17683 return false; 17684 } 17685 setButtonURLs(alm, content); // Set button state & URL. 17686 17687 return new Promise(function (resolve) { 17688 var addons = alm.addons; 17689 var container = alm.addons.elementor_element.querySelector(".".concat(addons.elementor_container_
17689class)); // Get post container 17690 var items = content.querySelectorAll(".".concat(addons.elementor_item_class)); // Get all items in container 17691 17692 if (container && items) { 17693 var ElementorItems = Array.prototype.slice.call(items); // Convert NodeList to Array 17694 17695 if (typeof almElementorLoaded === 'function') { 17696 window.almElementorLoaded(ElementorItems); // Trigger almElementorLoaded callback. 17697 } 17698 17699 // Load the items. 17700 elementor_asyncToGenerator(/*#__PURE__*/elementor_regenerator().m(function _callee() { 17701 return elementor_regenerator().w(function (_context) { 17702 while (1) switch (_context.n) { 17703 case 0: 17704 _context.n = 1; 17705 return loadItems(container, ElementorItems, alm); 17706 case 1: 17707 if (addons.elementor_masonry) { 17708 setTimeout(function () { 17709 positionMasonryItems(alm, ".".concat(addons.elementor_container_class), ".".concat(addons.elementor_item_class)); 17710 }, 125); 17711 } 17712 resolve(true); 17713 case 2: 17714 return _context.a(2); 17715 } 17716 }, _callee); 17717 }))()["catch"](function (e) { 17718 console.warn(e, 'There was an error with Elementor'); // eslint-disable-line no-console 17719 }); 17720 } else { 17721 resolve(false); 17722 } 17723 }); 17724} 17725 17726/** 17727 * Elementor loaded and dispatch actions. 17728 * 17729 * @param {Object} alm The alm object. 17730 * @return {Promise} Resolves when done. 17731 */ 17732function elementorLoaded(_x) { 17733 return _elementorLoaded.apply(this, arguments); 17734} 17735 17736/** 17737 * Set the required classnames for parsing data and injecting content into the Elementor listing 17738 * 17739 * @param {Object} alm The alm object. 17740 * @param {string} type The Elementor type. 17741 * @return {Object} The modified object. 17742 */ 17743function _elementorLoaded() { 17744 _elementorLoaded = elementor_asyncToGenerator(/*#__PURE__*/elementor_regenerator().m(function _callee2(alm) { 17745 var page, AjaxLoadMore, addons, _alm$rel, rel, nextPage, elementor_max_pages; 17746 return elementor_regenerator().w(function (_context2) { 17747 while (1) switch (_context2.n) { 17748 case 0: 17749 page = alm.page, AjaxLoadMore = alm.AjaxLoadMore, addons = alm.addons, _alm$rel = alm.rel, rel = _alm$rel === void 0 ? 'next' : _alm$rel; 17750 nextPage = page + 1; 17751 elementor_max_pages = addons.elementor_max_pages; 17752 lazyImages(alm); // Lazy load images if necessary. 17753 17754 if (typeof almComplete === 'function' && alm.transition !== 'masonry') { 17755 window.almComplete(alm); // Trigger almComplete. 17756 } 17757 if (rel === 'next' && nextPage >= elementor_max_pages) { 17758 AjaxLoadMore.triggerDone(); // Reached max pages. 17759 } 17760 AjaxLoadMore.transitionEnd(); 17761 dispatchScrollEvent(); 17762 return _context2.a(2, new Promise(function (resolve) { 17763 resolve(true); 17764 })); 17765 } 17766 }, _callee2); 17767 })); 17768 return _elementorLoaded.apply(this, arguments); 17769} 17770function setClasses(alm) { 17771 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'posts'; 17772 // Get the items based on the Elementor type.
17773 alm.addons.elementor_container_class = alm.addons.elementor_settings.container_class; // Container class 17774 17775 switch (type) { 17776 case 'woocommerce': 17777 alm.addons.elementor_item_class = alm.addons.elementor_settings.woo_item_class; // item class. 17778 alm.addons.elementor_pagination_class = ".".concat(alm.addons.elementor_settings.woo_pagination_class); // Pagination class. 17779 break; 17780 case 'loop-grid': 17781 alm.addons.elementor_item_class = alm.addons.elementor_settings.loop_grid_item_class; // item class. 17782 alm.addons.elementor_pagination_class = ".".concat(alm.addons.elementor_settings.loop_grid_pagination_class); // Pagination class. 17783 break; 17784 default: 17785 alm.addons.elementor_item_class = alm.addons.elementor_settings.posts_item_class; // item class. 17786 alm.addons.elementor_pagination_class = ".".concat(alm.addons.elementor_settings.posts_pagination_class); // Pagination class. 17787 break; 17788 } 17789 return alm; 17790} 17791 17792/** 17793 * Parse Masonry Settings from Elementor Data atts 17794 * 17795 * @param {Object} alm The alm object. 17796 * @return {Object} The modified object. 17797 */ 17798function parseMasonryConfig(alm) { 17799 var _target$dataset; 17800 var addons = alm.addons; 17801 if (!addons.elementor_element) { 17802 return alm; // Exit if not found. 17803 } 17804 var target = addons.elementor_element; 17805 var settings = target !== null && target !== void 0 && (_target$dataset = target.dataset) !== null && _target$dataset !== void 0 && _target$dataset.settings ? JSON.parse(target.dataset.settings) : ''; 17806 if (!settings) { 17807 return alm; // Exit if not found. 17808 } 17809 addons.elementor_masonry = settings.hasOwnProperty('cards_masonry') || settings.hasOwnProperty('classic_masonry') || settings.hasOwnProperty('masonry'); 17810 if (addons.elementor_masonry) { 17811 var _settings$cards_row_g, _settings$row_gap; 17812 addons.elementor_masonry_columns = parseInt(settings === null || settings === void 0 ? void 0 : settings.cards_columns) || parseInt(settings === null || settings === void 0 ? void 0 : settings.classic_columns) || parseInt(settings === null || settings === void 0 ? void 0 : settings.columns); 17813 addons.elementor_masonry_columns_mobile = parseInt(settings === null || settings === void 0 ? void 0 : settings.cards_columns_mobile) || parseInt(settings === null || settings === void 0 ? void 0 : settings.classic_columns_mobile) || parseInt(settings === null || settings === void 0 ? void 0 : settings.columns_mobile); 17814 addons.elementor_masonry_columns_tablet = parseInt(settings === null || settings === void 0 ? void 0 : settings.cards_columns_tablet) || parseInt(settings === null || settings === void 0 ? void 0 : settings.classic_columns_tablet) || parseInt(settings === null || settings === void 0 ? void 0 : settings.columns_tablet); 17815 addons.elementor_masonry_gap = parseInt(settings === null || settings === void 0 || (_settings$cards_row_g = settings.cards_row_gap) === null || _settings$cards_row_g === void 0 ? void 0 : _settings$cards_row_g.size) || parseInt(settings === null || settings === void 0 || (_settings$row_gap = settings.row_gap) === null || _settings$row_gap === void 0 ? void 0 : _settings$row_gap.size); 17816 } 17817 return alm; 17818} 17819 17820/** 17821 * Position Elementor Masonry Items 17822 * 17823 * @param {Object} alm The alm object. 17824 * @param {string} container_class The container classname. 17825 * @param {string} item_class The item classname. 17826 */ 17827function positionMasonryItems(alm, container_class, item_class) { 17828 var heights = []; 17829 17830 // Get Elementor Settings 17831 var columnsCount = alm.addons.elementor_masonry_columns; 17832 var columnsCountTablet = alm.addons.elementor_masonry_columns_tablet; 17833 var columnsCountMobile = alm.addons.elementor_masonry_columns_mobile; 17834 var verticalSpaceBetween = alm.addons.elementor_masonry_gap; 17835 var columns = columnsCount; 17836 17837 // Get Elementor Breakpoints 17838 var breakpoints = window.elementorFrontendConfig && window.elementorFrontendConfig.breakpoints ? window.elementorFrontendConfig.breakpoints : 0; 17839 var windowW = window.innerWidth; 17840 17841 // Set Columns 17842 if (windowW > breakpoints.lg) { 17843 columns = columnsCount; 17844 } else if (windowW > breakpoints.md) { 17845 columns = columnsCountTablet; 17846 } else { 17847 columns = columnsCountMobile; 17848 } 17849 17850 // Get Containers
17851 var container = document.querySelector(container_class); 17852 if (!container) { 17853 return false; 17854 } 17855 var items = container.querySelectorAll(item_class); 17856 if (!items) { 17857 return false; 17858 } 17859 17860 // Loop items 17861 items.forEach(function (item, index) { 17862 var row = Math.floor(index / columns); 17863 var itemHeight = item.getBoundingClientRect().height + verticalSpaceBetween; 17864 if (row) { 17865 var itemPosition = jQuery(item).position(); 17866 var indexAtRow = index % columns; 17867 var pullHeight = Math.round(itemPosition.top) - heights[indexAtRow]; 17868 pullHeight *= -1; 17869 item.style.marginTop = "".concat(Math.round(pullHeight), "px"); 17870 heights[indexAtRow] += itemHeight; 17871 } else { 17872 heights.push(itemHeight); 17873 } 17874 }); 17875} 17876 17877/** 17878 * Determine the type of elementor widget (woocommerce || posts) 17879 * 17880 * @param {HTMLElement} target The target element. 17881 * @return {string} The Elementor type. 17882 */ 17883function elementorGetWidgetType(target) { 17884 if (!target) { 17885 return false; 17886 } 17887 17888 // Get Elementor type based on container class. 17889 if (target.classList.contains('elementor-wc-products')) { 17890 return 'woocommerce'; 17891 } else if (target.classList.contains('elementor-widget-loop-grid')) { 17892 return 'loop-grid'; 17893 } 17894 return 'posts'; 17895} 17896 17897/** 17898 * Set the Elementor paging URL on the ALM buttons. 17899 * 17900 * @param {Object} alm The alm object. 17901 * @param {HTMLElement} content The HTML content to search. 17902 */ 17903function setButtonURLs(alm, content) { 17904 if (!content) { 17905 return; 17906 } 17907 var page = alm.page, 17908 button = alm.button, 17909 buttonPrev = alm.buttonPrev, 17910 rel = alm.rel; 17911 17912 // Set button state & URL. 17913 if (rel === 'prev' && buttonPrev) { 17914 var prevURL = getURL(alm, content, 'prev'); 17915 if (prevURL) { 17916 setButtonAtts(buttonPrev, page - 1, prevURL); 17917 } else { 17918 alm.AjaxLoadMore.triggerDonePrev(); 17919 } 17920 } else { 17921 var nextURL = getURL(alm, content); 17922 if (nextURL) { 17923 setButtonAtts(button, page + 1, nextURL); 17924 } else { 17925 alm.AjaxLoadMore.triggerDone(); 17926 } 17927 } 17928} 17929 17930/** 17931 * Get the paged URL from Elementor pagination element. 17932 * 17933 * @param {Object} alm The alm object. 17934 * @param {Element} content The HTML content to search. 17935 * @param {string} direction The direction, next of prev. 17936 * @return {HTMLElement} The pagination element. 17937 */ 17938function getURL(alm, content) { 17939 var _addons$elementor_set, _element$querySelecto; 17940 var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'next'; 17941 var _alm$addons = alm.addons, 17942 addons = _alm$addons === void 0 ? {} : _alm$addons; 17943 var element = (content === null || content === void 0 ? void 0 : content.querySelector(addons === null || addons === void 0 ? void 0 : addons.elementor_pagination_class)) || (content === null || content === void 0 ? void 0 : content.querySelector(".".concat(addons === null || addons === void 0 || (_addons$elementor_set = addons.elementor_settings) === null || _addons$elementor_set === void 0 ? void 0 : _addons$elementor_set.pagination_class))); // Locate the pagination container. 17944 var page = element === null || element === void 0 || (_element$querySelecto = element.querySelector("a.".concat(direction))) === null || _element$querySelecto === void 0 ? void 0 : _element$querySelecto.href; // Get URL from the pagination element. 17945 return page ? page : false; // Return the paged URL element. 17946} 17947;// ./src/frontend/js/functions/getParameterByName.js 17948/** 17949 * Return a query param by name. 17950 * 17951 * @param {string} name The query param name. 17952 * @param {string} url The URL. 17953 * @return {string} The query param value. 17954 */ 17955function getParameterByName(name, url) { 17956 if (!url) { 17957 url = window.location.href; 17958 } 17959 name = name.replace(/[\[\]]/g, '\\$&'); 17960 var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); 17961 var results = regex.exec(url); 17962 if (!results) { 17963 return null; 17964 } 17965 if (!results[2]) { 17966 return ''; 17967 } 17968 return decodeURIComponent(results[2].replace(/\+/g, ' ')); 17969} 17970;// ./src/frontend/js/functions/getQueryVariable.js 17971/** 17972 * Get a query variable from location querystring 17973 * 17974 * @param {string} variable
17975 * @since 5.3.4 17976 */ 17977function getQueryVariable(variable) { 17978 var query = window.location.search.substring(1); 17979 var vars = query.split('&'); 17980 for (var i = 0; i < vars.length; i++) { 17981 var pair = vars[i].split('='); 17982 if (decodeURIComponent(pair[0]) === variable) { 17983 return decodeURIComponent(pair[1]); 17984 } 17985 } 17986 return false; 17987} 17988;// ./src/frontend/js/addons/filters.js 17989 17990 17991 17992/** 17993 * Create add-on params for ALM. 17994 * 17995 * @param {Object} alm The alm object. 17996 * @return {Object} The modified object. 17997 */ 17998function filtersCreateParams(alm) { 17999 var _alm$listing; 18000 var listing = alm.listing; 18001 alm.addons.filters = (alm === null || alm === void 0 || (_alm$listing = alm.listing) === null || _alm$listing === void 0 || (_alm$listing = _alm$listing.dataset) === null || _alm$listing === void 0 ? void 0 : _alm$listing.filters) === 'true'; 18002 if (alm.addons.filters) { 18003 alm.addons.filters_url = listing.dataset.filtersUrl === 'true'; 18004 alm.addons.filters_target = listing.dataset.filtersTarget ? listing.dataset.filtersTarget : false;
18005 alm.addons.filters_paging = listing.dataset.filtersPaging === 'true'; 18006 alm.addons.filters_scroll = listing.dataset.filtersScroll === 'true'; 18007 alm.addons.filters_scrolltop = listing.dataset.filtersScrolltop ? listing.dataset.filtersScrolltop : '30'; 18008 alm.addons.filters_debug = listing.dataset.filtersDebug; 18009 alm.facets = listing.dataset.facets === 'true'; 18010 18011 // Display warning when `filters_target` parameter is missing. 18012 if (!alm.addons.filters_target) { 18013 console.warn('Ajax Load More: Unable to locate a target for Filters. Make sure you set a target parameter in the core Ajax Load More shortcode - e.g. [ajax_load_more filters="true" target="filters"]'); 18014 } 18015 18016 // Parse querystring value for pg. 18017 var page = getParameterByName('pg'); 18018 alm.addons.filters_startpage = page !== null ? parseInt(page) : 0; 18019 18020 // Handle a paged URL with filters. 18021 if (alm.addons.filters_startpage > 0) { 18022 if (alm.addons.paging) { 18023 // Paging add-on: Set current page value. 18024 alm.page = alm.addons.filters_startpage - 1; 18025 } else { 18026 // Set posts_per_page value to load all required posts. 18027 alm.posts_per_page = alm.posts_per_page * alm.addons.filters_startpage; 18028 alm.paged = true; 18029 } 18030 } 18031 } 18032 return alm; 18033} 18034 18035/** 18036 * Create data attributes for a Filters item. 18037 * 18038 * @param {Object} alm The ALM object. 18039 * @param {HTMLElement} element The element HTML node. 18040 * @param {number} pagenum The current page number. 18041 * @return {HTMLElement} Modified HTML element. 18042 */ 18043function addFiltersAttributes(alm, element, pagenum) { 18044 var canonical_url = alm.canonical_url; 18045 var querystring = window.location.search; 18046 element.classList.add('alm-filters'); 18047 element.dataset.page = pagenum; 18048 if (pagenum > 1) { 18049 element.dataset.url = canonical_url + buildFilterURL(alm, querystring, pagenum); 18050 } else { 18051 element.dataset.url = canonical_url + buildFilterURL(alm, querystring, 0); 18052 } 18053 return element; 18054} 18055 18056/** 18057 * Parse a filter querystring for returning caches directories. 18058 * 18059 * @param {string} path The URL path. 18060 * @since 5.3.1 18061 */ 18062function parseQuerystring(path) { 18063 // Get querystring 18064 var query = window.location.search.substring(1); 18065 var obj = ''; 18066 var cache_dir = ''; 18067 18068 // Parse querystring into object 18069 if (query) { 18070 obj = JSON.parse('{"' + query.replace(/&/g, '","').replace(/=/g, '":"') + '"}', function (key, value) { 18071 // Replace + with - in URL 18072 return key === '' ? value : decodeURIComponent(value.replace(/\+/g, '-')); 18073 }); 18074 18075 // Remove the following properties from the object as they should not be included in the cache ID 18076 18077 if (obj.pg) { 18078 // `pg` object prop 18079 delete obj.pg; 18080 } 18081 if (obj.auto) { 18082 // `auto` object prop 18083 delete obj.auto; 18084 } 18085 } 18086 if (obj) { 18087 cache_dir += '/'; 18088 Object.keys(obj).forEach(function (key, index) { 18089 cache_dir += index > 0 ? '--' : ''; 18090 cache_dir += "".concat(key, "--").concat(obj[key]); 18091 }); 18092 } 18093 return path + cache_dir; 18094} 18095 18096/** 18097 * Build new paging URL for filters. 18098 * 18099 * @param {Object} alm The ALM object. 18100 * @param {string} querystring The current querystring. 18101 * @param {number} page The page number. 18102 * @return {string} The querystring. 18103 * @since 5.3.5 18104 */ 18105function buildFilterURL(alm) { 18106 var querystring = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 18107 var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; 18108 var qs = querystring; 18109 if (alm.addons.filters_paging) { 18110 if (page > 1) { 18111 // Paged 18112 if (qs) { 18113 // If already has `pg` in querystring 18114 if (getQueryVariable('pg')) { 18115 qs = querystring.replace(/(pg=)[^\&]+/, '$1' + page); 18116 } else { 18117 qs = querystring + '&pg=' + page; 18118 } 18119 } else { 18120 qs = '?pg=' + page; 18121 } 18122 } else { 18123 // Not Paged 18124 qs = querystring.replace(/(pg=)[^\&]+/, ''); 18125 qs = qs === '?' ? '' : qs; // Remove `?` if only symbol in querystring 18126 qs = qs[qs.length - 1] === '&' ? qs.slice(0, -1) : qs; // Remove trailing `&` symbols 18127 } 18128 } 18129 return qs; 18130} 18131;// ./src/frontend/js/addons/next-page.js 18132/** 18133 * Create add-on params for ALM. 18134 * 18135 * @param {Object} alm The alm object. 18136 * @return {Object} The modified object. 18137 */ 18138function nextpageCreateParams(alm) { 18139 var _listing$dataset; 18140 var listing = alm.listing; 18141 alm.addons.nextpage = (listing === null || listing === void 0 || (_listing$dataset = listing.dataset) === null || _listing$dataset === void 0 ? void 0 : _listing$dataset.nextpage) === 'true'; 18142 if (alm.addons.nextpage) { 18143 alm.addons.nextpage_urls = listing.dataset.nextpageUrls === undefined ? 'true' : listing.dataset.nextpageUrls; 18144 alm.addons.nextpage_scroll = listing.dataset.nextpageScroll === undefined ? 'false:30' : listing.dataset.nextpageScroll; 18145 alm.addons.nextpage_post_id = listing.dataset.nextpagePostId ? listing.dataset.nextpagePostId : false;
18146 alm.addons.nextpage_startpage = listing.dataset.nextpageStartpage ? parseInt(listing.dataset.nextpageStartpage) : 1; 18147 alm.addons.nextpage_title_template = listing.dataset.nextpageTitleTemplate; 18148 alm.addons.nextpage_postTitle = alm.listing.dataset.nextpagePostTitle; 18149 18150 // Set default fallbacks. 18151 alm.posts_per_page = 1; 18152 alm.orginal_posts_per_page = 1; 18153 if (!alm.addons.nextpage_post_id) { 18154 alm.addons.nextpage = false; 18155 } 18156 if (alm.addons.nextpage_startpage > 1) { 18157 alm.paged = true; 18158 } 18159 } 18160 return alm; 18161} 18162;// ./src/frontend/js/modules/insertScript.js 18163/** 18164 * Search nodes for <script/> tags and run scripts. 18165 * Scripts cannot run with appendChild or innerHTML so this is necessary to function. 18166 * 18167 * @since 5.0 18168 */ 18169var insertScript = { 18170 /** 18171 * Initiate the script insertion. 18172 * 18173 * @param {Array} nodes The HTML nodes. 18174 */ 18175 init: function init(nodes) { 18176 var _this = this; 18177 if (!(nodes !== null && nodes !== void 0 && nodes.length)) { 18178 return false; 18179 } 18180 nodes.forEach(function (node) { 18181 _this.check(node); 18182 }); 18183 }, 18184 /** 18185 * Parse HTML node from script. 18186 * 18187 * @param {HTMLElement} node The HTML node/element. 18188 * @return {HTMLElement} The modified HTML node. 18189 */ 18190 check: function check(node) { 18191 if (this.isScript(node) === true) { 18192 node.parentNode.replaceChild(this.clone(node), node); 18193 } else { 18194 var i = 0; 18195 var children = node.childNodes; 18196 if (children === undefined) { 18197 var parser = new DOMParser(); 18198 var data = parser.parseFromString(node, 'text/html'); 18199 if (data) { 18200 children = data.body.childNodes; 18201 } 18202 } 18203 while (i < children.length) { 18204 this.replace(children[i++]); 18205 } 18206 } 18207 return node; 18208 }, 18209 /** 18210 * Replace the script tag with a clone. 18211 * 18212 * @param {HTMLElement} node The HTML node/element. 18213 * @return {HTMLElement} The modified node. 18214 */ 18215 replace: function replace(node) { 18216 if (this.isScript(node) === true) { 18217 node.parentNode.replaceChild(this.clone(node), node); 18218 } else { 18219 var i = 0; 18220 var children = node.childNodes; 18221 while (i < children.length) { 18222 this.replace(children[i++]); 18223 } 18224 } 18225 return node; 18226 }, 18227 /** 18228 * Clone the tag. 18229 * 18230 * @param {HTMLElement} node The HTML node/element. 18231 * @return {HTMLElement} The cloned node. 18232 */ 18233 clone: function clone(node) { 18234 var script = document.createElement('script'); 18235 script.text = node.innerHTML; 18236 for (var i = node.attributes.length - 1; i >= 0; i--) { 18237 script.setAttribute(node.attributes[i].name, node.attributes[i].value); 18238 } 18239 return script; 18240 }, 18241 /** 18242 * Is the node a script tag. 18243 * 18244 * @param {HTMLElement} node The html node. 18245 */ 18246 isScript: function isScript(node) { 18247 return node.tagName === 'SCRIPT'; 18248 } 18249}; 18250/* harmony default export */ var modules_insertScript = (insertScript); 18251;// ./src/frontend/js/addons/paging.js 18252 18253 18254/** 18255 * Create add-on params for ALM. 18256 * 18257 * @param {Object} alm The alm object. 18258 * @return {Object} The modified object. 18259 */ 18260function pagingCreateParams(alm) { 18261 var listing = alm.listing, 18262 container_type = alm.container_type; 18263 alm.addons.paging = listing.dataset.paging === 'true'; 18264 if (alm.addons.paging) { 18265 alm.addons.paging_init = true; 18266 alm.addons.paging_controls = listing.dataset.pagingControls === 'true'; 18267 alm.addons.paging_show_at_most = listing.dataset.pagingShowAtMost ? parseInt(listing.dataset.pagingShowAtMost) : 6; 18268 alm.addons.paging_classes = listing.dataset.pagingClasses; 18269 alm.addons.paging_first_label = listing.dataset.pagingFirstLabel; 18270 alm.addons.paging_previous_label = listing.dataset.pagingPreviousLabel; 18271 alm.addons.paging_next_label = listing.dataset.pagingNextLabel; 18272 alm.addons.paging_last_label = listing.dataset.pagingLastLabel; 18273 alm.addons.paging_scroll = listing.dataset.pagingScroll ? listing.dataset.pagingScroll : false; 18274 alm.addons.paging_scrolltop = listing.dataset.pagingScrolltop ? parseInt(listing.dataset.pagingScrolltop) : 100; 18275 alm.addons.paging_container = container_type === 'table' ? listing : listing.querySelector('.alm-paging-content'); 18276 alm.pause = alm.addons.preloaded ? true : alm.pause; // If preloaded, pause ALM. 18277 } 18278 return alm; 18279} 18280
18281/** 18282 * Function dispatched after paging content has been loaded. 18283 * 18284 * @param {Object} alm The alm object. 18285 * @param {boolean} alm_is_filtering Is ALM filtering. 18286 * @param {boolean} init Is first run. 18287 */ 18288function pagingComplete(alm) { 18289 var alm_is_filtering = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 18290 var init = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 18291 var main = alm.main, 18292 AjaxLoadMore = alm.AjaxLoadMore, 18293 last_loaded = alm.last_loaded; 18294 main.classList.remove('alm-loading'); 18295 AjaxLoadMore.triggerAddons(alm); 18296 if (init) { 18297 if (typeof almPagingComplete === 'function') { 18298 window.almPagingComplete(); 18299 } 18300 } else { 18301 // Dispatch almOnPagingComplete callback when not alm.init. 18302 if (typeof almOnPagingComplete === 'function') { 18303 window.almOnPagingComplete(alm); // Callback: Paging Add-on Complete. 18304 } 18305 } 18306 if (alm_is_filtering && alm.addons.filters && typeof almFiltersAddonComplete === 'function') { 18307 window.almFiltersAddonComplete(main); // Callback: Filters Add-on Complete 18308 } 18309 if (typeof almComplete === 'function') { 18310 window.almComplete(alm); // Callback: ALM Complete 18311 } 18312 18313 // Trigger <script /> tags in templates. 18314 modules_insertScript.init(last_loaded); 18315} 18316;// ./src/frontend/js/functions/stripEmptyNodes.js 18317 18318 18319/** 18320 * Remove empty HTML nodes from array of nodes. 18321 * Filter out nodes by nodeName. 18322 * 18323 * @param {Array} nodes Array of HTML nodes 18324 * @return {Array} The filtered array of HTML nodes 18325 * @since 5.1.3 18326 */ 18327var stripEmptyNodes = function stripEmptyNodes() { 18328 var nodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 18329 return (nodes === null || nodes === void 0 ? void 0 : nodes.length) && nodes.filter(function (node) { 18330 return EXCLUDED_NODES.indexOf(node.nodeName.toLowerCase()) === -1; 18331 }); 18332}; 18333/* harmony default export */ var functions_stripEmptyNodes = (stripEmptyNodes); 18334;// ./src/frontend/js/addons/seo.js 18335/** 18336 * Create add-on params for ALM. 18337 * 18338 * @param {Object} alm The alm object. 18339 * @return {Object} The modified object. 18340 */ 18341function seoCreateParams(alm) { 18342 var _alm$listing; 18343 var listing = alm.listing; 18344 alm.addons.seo = listing.dataset.seo === 'true'; 18345 if (alm.addons.seo) { 18346 alm.addons.seo_offset = listing.dataset.seoOffset || false; 18347 alm.addons.seo_permalink = listing.dataset.seoPermalink; 18348 alm.addons.seo_trailing_slash = listing.dataset.seoTrailingSlash === 'false' ? '' : '/'; 18349 alm.addons.seo_leading_slash = listing.dataset.seoLeadingSlash === 'true' ? '/' : ''; 18350 if (alm.addons.seo_offset === 'true') { 18351 alm.offset = alm.posts_per_page; 18352 } 18353 } 18354 alm.start_page = (alm === null || alm === void 0 || (_alm$listing = alm.listing) === null || _alm$listing === void 0 || (_alm$listing = _alm$listing.dataset) === null || _alm$listing === void 0 ? void 0 : _alm$listing.seoStartPage) || 0; 18355 if (alm.start_page) { 18356 alm.start_page = parseInt(alm.start_page); 18357 alm.addons.seo_scroll = listing.dataset.seoScroll; 18358 alm.addons.seo_scrolltop = listing.dataset.seoScrolltop; 18359 alm.addons.seo_controls = listing.dataset.seoControls; 18360 alm.paged = false; 18361 if (alm.start_page > 1) { 18362 alm.paged = true; 18363 if (alm.addons.paging) { 18364 // Paging add-on: Set current page value. 18365 alm.page = alm.start_page - 1; 18366 } else { 18367 // Set posts_per_page value to load all required posts. 18368 alm.posts_per_page = alm.start_page * alm.posts_per_page; 18369 } 18370 } 18371 } else { 18372 alm.start_page = 1; 18373 } 18374 return alm; 18375} 18376 18377/** 18378 * Create data attributes for an SEO item. 18379 * 18380 * @param {Object} alm The ALM object. 18381 * @param {HTMLElement} element The element HTML node. 18382 * @param {number} pagenum The current page number. 18383 * @param {boolean} skipOffset Skip the SEO offset check. 18384 * @return {HTMLElement} Modified HTML element. 18385 */ 18386function addSEOAttributes(alm, element, pagenum) { 18387 var skipOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 18388 var addons = alm.addons, 18389 canonical_url = alm.canonical_url; 18390 var _alm_localize = alm_localize, 18391 _alm_localize$retain_ = _alm_localize.retain_querystring, 18392 retain_querystring = _alm_localize$retain_ === void 0 ? true : _alm_localize$retain_; 18393 var querystring = retain_querystring || alm.init ? window.location.search : '';
18394 pagenum = !skipOffset ? getSEOPageNum(addons === null || addons === void 0 ? void 0 : addons.seo_offset, pagenum) : pagenum; 18395 element.classList.add('alm-seo'); 18396 element.dataset.page = pagenum; 18397 if (addons.seo_permalink === 'default') { 18398 // Default Permalinks 18399 if (pagenum > 1) { 18400 element.dataset.url = "".concat(canonical_url).concat(querystring, "&paged=").concat(pagenum); 18401 } else { 18402 element.dataset.url = "".concat(canonical_url).concat(querystring); 18403 } 18404 } else { 18405 // Pretty Permalinks 18406 if (pagenum > 1) { 18407 element.dataset.url = "".concat(canonical_url).concat(addons.seo_leading_slash, "page/").concat(pagenum).concat(addons.seo_trailing_slash).concat(querystring); 18408 } else { 18409 element.dataset.url = "".concat(canonical_url).concat(querystring); 18410 } 18411 } 18412 return element; 18413} 18414 18415/** 18416 * Get the current page number. 18417 * 18418 * @param {string} seo_offset Is this an SEO offset. 18419 * @param {number} page The page number, 18420 * @return {number} The page number. 18421 */ 18422function getSEOPageNum(seo_offset, page) { 18423 return seo_offset === 'true' ? parseInt(page) + 1 : parseInt(page); 18424} 18425 18426/** 18427 * Create div to hold offset values for SEO. 18428 * 18429 * @param {Object} alm The ALM object. 18430 */ 18431function createSEOOffset(alm) { 18432 var offsetDiv = document.createElement('div'); 18433 // Add data attributes. 18434 offsetDiv = addSEOAttributes(alm, offsetDiv, 1, true); 18435 18436 // Insert into ALM container. 18437 alm.main.insertBefore(offsetDiv, alm.listing); 18438} 18439;// ./src/frontend/js/addons/preloaded.js 18440function preloaded_toConsumableArray(r) { return preloaded_arrayWithoutHoles(r) || preloaded_iterableToArray(r) || preloaded_unsupportedIterableToArray(r) || preloaded_nonIterableSpread(); } 18441function preloaded_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 18442function preloaded_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return preloaded_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? preloaded_arrayLikeToArray(r, a) : void 0; } } 18443function preloaded_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } 18444function preloaded_arrayWithoutHoles(r) { if (Array.isArray(r)) return preloaded_arrayLikeToArray(r); } 18445function preloaded_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 18446 18447 18448 18449 18450/** 18451 * Create add-on params for ALM. 18452 * 18453 * @param {Object} alm The alm object. 18454 * @return {Object} The modified object. 18455 */ 18456function preloadedCreateParams(alm) { 18457 var _listing$dataset; 18458 var listing = alm.listing, 18459 addons = alm.addons; 18460 alm.addons.preloaded = listing.dataset.preloaded === 'true'; 18461 alm.addons.preloaded_amount = listing !== null && listing !== void 0 && (_listing$dataset = listing.dataset) !== null && _listing$dataset !== void 0 && _listing$dataset.preloadedAmount ? parseInt(listing.dataset.preloadedAmount) : alm.posts_per_page; 18462 if (!alm.addons.preloaded) { 18463 alm.addons.preloaded_amount = 0; 18464 } 18465 if (addons.preloaded) { 18466 if (alm !== null && alm !== void 0 && alm.localize) { 18467 // Disable ALM if total_posts is equal to or less than preloaded_amount. 18468 var _alm$localize$total_p = alm.localize.total_posts, 18469 total_posts = _alm$localize$total_p === void 0 ? 0 : _alm$localize$total_p; 18470 if (parseInt(total_posts) <= addons.preloaded_amount) { 18471 alm.addons.preloaded_total_posts = parseInt(total_posts); 18472 alm.disable_ajax = true; 18473 } 18474 } 18475 } 18476 return alm; 18477} 18478 18479/** 18480 * Set parameters on HTML elements for preloaded results. 18481 * 18482 * @param {Object} alm The ALM object. 18483 * @since 7.0.0 18484 */ 18485function setPreloadedParams(alm) { 18486 var addons = alm.addons, 18487 listing = alm.listing; 18488 if (addons.paging) { 18489 return; // Exit if paging. 18490 } 18491 18492 // Parse preloaded data into array of HTML elements. 18493 var data = functions_stripEmptyNodes(preloaded_toConsumableArray(listing === null || listing === void 0 ? void 0 : listing.childNodes)); 18494 18495 // Get first element in the data array.
18496 var firstElement = data !== null && data !== void 0 && data.length && data[0] ? data[0] : false; 18497 if (firstElement) { 18498 if (addons !== null && addons !== void 0 && addons.seo) { 18499 addSEOAttributes(alm, firstElement, 1); 18500 } 18501 if (addons !== null && addons !== void 0 && addons.filters) { 18502 addFiltersAttributes(alm, firstElement, 1); 18503 } 18504 } 18505} 18506;// ./src/frontend/js/addons/query-loop.js 18507function query_loop_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return query_loop_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (query_loop_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, query_loop_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, query_loop_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), query_loop_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", query_loop_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), query_loop_regeneratorDefine2(u), query_loop_regeneratorDefine2(u, o, "Generator"), query_loop_regeneratorDefine2(u, n, function () { return this; }), query_loop_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (query_loop_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 18508function query_loop_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } query_loop_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { query_loop_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, query_loop_regeneratorDefine2(e, r, n, t); } 18509function query_loop_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 18510function query_loop_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { query_loop_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { query_loop_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 18511 18512 18513 18514 18515 18516 18517 18518/** 18519 * Create add-on params for ALM. 18520 * 18521 * @param {Object} alm The alm object. 18522 * @return {Object|null} The modified object. 18523 */ 18524function queryLoopCreateParams(alm) { 18525 var main = alm.main; 18526 var blockClassname = 'wp-block-query'; 18527 18528 // Get the parent container. 18529 var container = main.closest(".".concat(blockClassname)); 18530 18531 // If parent is not a .wp-block-query, return alm. 18532 if (!container) { 18533 return alm; 18534 } 18535 18536 // Pluck the queryId from the config. 18537 var _getQueryLoopConfig = getQueryLoopConfig(container), 18538 _getQueryLoopConfig$q = _getQueryLoopConfig.queryId, 18539 queryId = _getQueryLoopConfig$q === void 0 ? false : _getQueryLoopConfig$q, 18540 _getQueryLoopConfig$p = _getQueryLoopConfig.paged, 18541 paged = _getQueryLoopConfig$p === void 0 ? 1 : _getQueryLoopConfig$p; 18542 if (!queryId) { 18543 console.warn('Ajax Load More: Unable to locate Query Loop ID.'); 18544 return alm; 18545 } 18546 alm.addons.queryloop = true; 18547 alm.addons.queryloopId = queryId; 18548 alm.addons.queryloop_settings = { 18549 container: container, 18550 firstEl: container.querySelector('.wp-block-post'), 18551 classes: { 18552 container: ".".concat(container.className.replace(/ /g, '.')), 18553 listing: '.wp-block-post-template', 18554 element: '.wp-block-post' 18555 } 18556 }; 18557 alm.page = parseInt(paged); 18558 alm.pause = 'true'; // Pause ALM by default. 18559 return alm; 18560} 18561
18562/** 18563 * Init the Query Loop functionality. 18564 * @param {Object} alm The alm object. 18565 */ 18566function queryLoopInit(alm) { 18567 var _alm$addons$queryloop = alm.addons.queryloop_settings, 18568 queryloop_settings = _alm$addons$queryloop === void 0 ? {} : _alm$addons$queryloop; 18569 var _queryloop_settings$c = queryloop_settings.container, 18570 container = _queryloop_settings$c === void 0 ? '' : _queryloop_settings$c, 18571 first = queryloop_settings.firstEl; 18572 var _getQueryLoopConfig2 = getQueryLoopConfig(container), 18573 _getQueryLoopConfig2$ = _getQueryLoopConfig2.paged, 18574 paged = _getQueryLoopConfig2$ === void 0 ? 1 : _getQueryLoopConfig2$, 18575 prev = _getQueryLoopConfig2.prev; 18576 18577 // Create Load Previous button. 18578 if (container && paged > 1 && prev) { 18579 var _alm$prev_button_labe; 18580 createLoadPreviousButton(alm, container, paged - 1, prev, alm === null || alm === void 0 || (_alm$prev_button_labe = alm.prev_button_labels) === null || _alm$prev_button_labe === void 0 ? void 0 : _alm$prev_button_labe["default"]); 18581 } 18582 18583 // Config first element in list. 18584 if (first) { 18585 first.classList.add('alm-query-loop'); 18586 first.dataset.url = window.location.href; 18587 first.dataset.page = alm.page; 18588 first.dataset.title = document.querySelector('title').innerHTML; 18589 } 18590 18591 // Set button URLs. 18592 query_loop_setButtonURLs(alm); 18593 18594 // Attach scroll events. 18595 if (alm.urls) { 18596 window.addEventListener('touchstart', onScroll); 18597 window.addEventListener('scroll', onScroll); 18598 } 18599} 18600 18601/** 18602 * Get the content, title and results text from the Ajax response. 18603 * 18604 * @param {Object} alm The alm object. 18605 * @param {string} url The request URL. 18606 * @param {string} html The HTML data as a string. 18607 * @return {Object} Results data. 18608 */ 18609function queryLoopGetContent(alm, url) { 18610 var _queryloop_settings$c2, _queryloop_settings$c3, _queryloop_settings$c4; 18611 var html = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; 18612 if (!html) { 18613 return API_DEFAULT_DATA_SHAPE; // Bail early if missing html content. 18614 } 18615 var addons = alm.addons, 18616 canonical_url = alm.canonical_url; 18617 var _addons$queryloop_set = addons.queryloop_settings, 18618 queryloop_settings = _addons$queryloop_set === void 0 ? {} : _addons$queryloop_set; 18619 18620 // Create temp div to hold html data. 18621 var tempDiv = document.createElement('div'); 18622 tempDiv.innerHTML = html; 18623 18624 // Get container. 18625 var container = tempDiv.querySelector("".concat(queryloop_settings === null || queryloop_settings === void 0 || (_queryloop_settings$c2 = queryloop_settings.classes) === null || _queryloop_settings$c2 === void 0 ? void 0 : _queryloop_settings$c2.container)); 18626 if (!container) { 18627 console.warn('Ajax Load More: Unable to locate Query Loop container.'); 18628 return data; 18629 } 18630 var listing = container === null || container === void 0 ? void 0 : container.querySelector("".concat(queryloop_settings === null || queryloop_settings === void 0 || (_queryloop_settings$c3 = queryloop_settings.classes) === null || _queryloop_settings$c3 === void 0 ? void 0 : _queryloop_settings$c3.listing)); 18631 var raw = container === null || container === void 0 ? void 0 : container.querySelector('pre[data-rel="ajax-load-more"]'); 18632 18633 // Create a new content container that holds both listing and raw query loop config. 18634 var content = document.createElement('div'); 18635 content.className = container.classList.toString(); 18636 content.appendChild(listing); 18637 content.appendChild(raw); 18638 18639 // Get the returned items. 18640 var items = content.querySelectorAll(queryloop_settings === null || queryloop_settings === void 0 || (_queryloop_settings$c4 = queryloop_settings.classes) === null || _queryloop_settings$c4 === void 0 ? void 0 : _queryloop_settings$c4.element); 18641 if (items) { 18642 // Set first item data attributes. 18643 var _getQueryLoopConfig3 = getQueryLoopConfig(content), 18644 _getQueryLoopConfig3$ = _getQueryLoopConfig3.paged, 18645 paged = _getQueryLoopConfig3$ === void 0 ? 1 : _getQueryLoopConfig3$; // Get current page from config settings. 18646 items[0].classList.add('alm-query-loop'); 18647 items[0].dataset.url = paged > 1 ? url : canonical_url; 18648 items[0].dataset.page = paged; 18649 items[0].dataset.title = tempDiv.querySelector('title').innerHTML; 18650 18651 // Return data object. 18652 return { 18653 html: content.innerHTML, 18654 meta: { 18655 postcount: items.length, 18656 totalposts: items.length 18657 } 18658 }; 18659 } 18660 return data; 18661} 18662 18663/**
18664 * Core ALM Query Loop loader. 18665 * 18666 * @param {HTMLElement} content The HTML data. 18667 * @param {Object} alm The alm object. 18668 */ 18669function queryLoop(content, alm) { 18670 if (!content || !alm) { 18671 alm.AjaxLoadMore.triggerDone(); 18672 return false; 18673 } 18674 query_loop_setButtonURLs(alm, content); // Set button state & URL. 18675 18676 return new Promise(function (resolve) { 18677 var _queryloop_settings$c5, _queryloop_settings$c6; 18678 var addons = alm.addons; 18679 var _addons$queryloop_set2 = addons.queryloop_settings, 18680 queryloop_settings = _addons$queryloop_set2 === void 0 ? {} : _addons$queryloop_set2; 18681 18682 // Get post listing container. 18683 var container = queryloop_settings === null || queryloop_settings === void 0 || (_queryloop_settings$c5 = queryloop_settings.container) === null || _queryloop_settings$c5 === void 0 ? void 0 : _queryloop_settings$c5.querySelector("".concat(queryloop_settings.classes.listing)); 18684 18685 // Get all individual items in Ajax response. 18686 var items = content.querySelectorAll("".concat(queryloop_settings === null || queryloop_settings === void 0 || (_queryloop_settings$c6 = queryloop_settings.classes) === null || _queryloop_settings$c6 === void 0 ? void 0 : _queryloop_settings$c6.element)); 18687 if (container && items) { 18688 var queryloopItems = Array.prototype.slice.call(items); // Convert NodeList to Array 18689 18690 // Trigger almqueryLoopLoaded callback. 18691 if (typeof almqueryLoopLoaded === 'function') { 18692 window.almqueryLoopLoaded(queryloopItems); 18693 } 18694 18695 // Load the items. 18696 query_loop_asyncToGenerator(/*#__PURE__*/query_loop_regenerator().m(function _callee() { 18697 return query_loop_regenerator().w(function (_context) { 18698 while (1) switch (_context.n) { 18699 case 0: 18700 _context.n = 1; 18701 return loadItems(container, queryloopItems, alm); 18702 case 1: 18703 resolve(true); 18704 case 2: 18705 return _context.a(2); 18706 } 18707 }, _callee); 18708 }))()["catch"](function (e) { 18709 console.warn(e, 'There was an error with Query Loop'); // eslint-disable-line no-console 18710 }); 18711 } else { 18712 resolve(false); 18713 } 18714 }); 18715} 18716 18717/** 18718 * Query Loop loaded and dispatch actions. 18719 * 18720 * @param {Object} alm The alm object. 18721 * @return {Promise} Resolves when done. 18722 */ 18723function queryLoopLoaded(_x) { 18724 return _queryLoopLoaded.apply(this, arguments); 18725} 18726 18727/** 18728 * Get the `<pre/>` config element. 18729 * 18730 * @param {HTMLElement} element The element to search. 18731 * @return {Object|void} The config object. 18732 */ 18733function _queryLoopLoaded() { 18734 _queryLoopLoaded = query_loop_asyncToGenerator(/*#__PURE__*/query_loop_regenerator().m(function _callee2(alm) { 18735 var AjaxLoadMore; 18736 return query_loop_regenerator().w(function (_context2) { 18737 while (1) switch (_context2.n) { 18738 case 0: 18739 AjaxLoadMore = alm.AjaxLoadMore; 18740 lazyImages(alm); // Lazy load images if necessary. 18741 18742 if (typeof almComplete === 'function' && alm.transition !== 'masonry') { 18743 window.almComplete(alm); // Trigger almComplete. 18744 } 18745 AjaxLoadMore.transitionEnd(); // End transitions. 18746 dispatchScrollEvent(); 18747 return _context2.a(2, new Promise(function (resolve) { 18748 resolve(true); 18749 })); 18750 } 18751 }, _callee2); 18752 })); 18753 return _queryLoopLoaded.apply(this, arguments); 18754} 18755function getQueryLoopConfig(element) { 18756 var raw = element === null || element === void 0 ? void 0 : element.querySelector('pre[data-rel="ajax-load-more"]'); 18757 if (!raw) { 18758 return {}; 18759 } 18760 return JSON.parse(raw === null || raw === void 0 ? void 0 : raw.innerHTML); 18761} 18762 18763/** 18764 * Set the button URLs. 18765 * 18766 * @param {Object} alm The alm object. 18767 * @param {HTMLElement} element The element to search. 18768 */ 18769function query_loop_setButtonURLs(alm) { 18770 var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; 18771 var rel = alm.rel, 18772 button = alm.button, 18773 buttonPrev = alm.buttonPrev, 18774 page = alm.page, 18775 _alm$pagePrev = alm.pagePrev, 18776 pagePrev = _alm$pagePrev === void 0 ? 1 : _alm$pagePrev; 18777 var _getQueryLoopConfig4 = getQueryLoopConfig(element), 18778 _getQueryLoopConfig4$ = _getQueryLoopConfig4.next, 18779 next = _getQueryLoopConfig4$ === void 0 ? '' : _getQueryLoopConfig4$, 18780 _getQueryLoopConfig4$2 = _getQueryLoopConfig4.prev, 18781 prev = _getQueryLoopConfig4$2 === void 0 ? '' : _getQueryLoopConfig4$2; 18782 18783 // Set button state & URL. 18784 if (rel === 'prev' && buttonPrev) { 18785 if (prev) { 18786 setButtonAtts(buttonPrev, pagePrev - 1, prev); 18787 } else { 18788 alm.AjaxLoadMore.triggerDonePrev(); 18789 } 18790 } else { 18791 if (next) { 18792 setButtonAtts(button, page + 1, next); 18793 } else { 18794 alm.AjaxLoadMore.triggerDone(); 18795 } 18796 } 18797} 18798 18799/** 18800 * Scroll and touchstart events. 18801 * 18802 * @since 2.0 18803 */ 18804function onScroll() { 18805 var scrollTop = window.scrollY; 18806 var disabled = false;
18807 if (!disabled) { 18808 var _posts$; 18809 // Get all elements. 18810 var posts = document.querySelectorAll('.alm-query-loop'); 18811 if (!posts) { 18812 return; 18813 } 18814 var first = (_posts$ = posts[0]) === null || _posts$ === void 0 || (_posts$ = _posts$.dataset) === null || _posts$ === void 0 ? void 0 : _posts$.url; 18815 18816 // Get container scroll position 18817 var fromTop = scrollTop; 18818 18819 // Loop all posts 18820 var current = Array.prototype.filter.call(posts, function (n) { 18821 var divOffset = ajaxloadmore.getOffset(n); 18822 if (divOffset.top < fromTop) { 18823 return n; 18824 } 18825 }); 18826 18827 // Get the data attributes of the current element. 18828 var currentPost = current[current.length - 1]; 18829 var title = currentPost ? currentPost.dataset.title : ''; 18830 var permalink = currentPost ? currentPost.dataset.url : ''; 18831 var url = permalink || first; 18832 if (window.location.href !== url) { 18833 // Set URL if current post doesn't match the browser URL. 18834 setURL(title, url); 18835 } 18836 } 18837} 18838 18839/** 18840 * Set the URL in the browser. 18841 * 18842 * @param {string} title Page title. 18843 * @param {string} permalink The permalink. 18844 */ 18845function setURL(title, permalink) { 18846 var state = { 18847 permalink: permalink, 18848 title: title 18849 }; 18850 history.replaceState(state, title, permalink); 18851} 18852;// ./src/frontend/js/addons/singleposts.js 18853 18854 18855/** 18856 * Create add-on params for ALM. 18857 * 18858 * @param {Object} alm The alm object. 18859 * @return {Object} The modified object. 18860 */ 18861function singlepostsCreateParams(alm) { 18862 var _listing$dataset; 18863 var listing = alm.listing; 18864 alm.addons.single_post = (listing === null || listing === void 0 || (_listing$dataset = listing.dataset) === null || _listing$dataset === void 0 ? void 0 : _listing$dataset.singlePost) === 'true'; 18865 if (alm.addons.single_post) { 18866 alm.addons.single_post_id = listing.dataset.singlePostId; 18867 alm.addons.single_post_query = listing.dataset.singlePostQuery; 18868 alm.addons.single_post_order = listing.dataset.singlePostOrder === undefined ? 'previous' : listing.dataset.singlePostOrder; 18869 alm.addons.single_post_init_id = listing.dataset.singlePostId; 18870 alm.addons.single_post_taxonomy = listing.dataset.singlePostTaxonomy === undefined ? '' : listing.dataset.singlePostTaxonomy; 18871 alm.addons.single_post_excluded_terms = listing.dataset.singlePostExcludedTerms === undefined ? '' : listing.dataset.singlePostExcludedTerms; 18872 alm.addons.single_post_progress_bar = listing.dataset.singlePostProgressBar === undefined ? '' : listing.dataset.singlePostProgressBar; 18873 alm.addons.single_post_target = listing.dataset.singlePostTarget === undefined ? '' : listing.dataset.singlePostTarget; 18874 alm.addons.single_post_preview = listing.dataset.singlePostPreview === undefined ? false : true; 18875 18876 // Post Preview. Does this even work? 18877 if (alm.addons.single_post_preview) { 18878 var singlePostPreviewData = listing.dataset.singlePostPreview.split(':'); 18879 alm.addons.single_post_preview_data = { 18880 button_label: singlePostPreviewData[0] ? singlePostPreviewData[0] : 'Continue Reading', 18881 height: singlePostPreviewData[1] ? singlePostPreviewData[1] : 500, 18882 element: singlePostPreviewData[2] ? singlePostPreviewData[2] : 'default', 18883 className: 'alm-single-post--preview' 18884 }; 18885 } 18886 if (alm.addons.single_post_id === undefined) { 18887 alm.addons.single_post_id = ''; 18888 alm.addons.single_post_init_id = ''; 18889 } 18890 18891 // Set default fallbacks. 18892 alm.addons.single_post_permalink = ''; 18893 alm.addons.single_post_title = ''; 18894 alm.addons.single_post_slug = ''; 18895 alm.addons.single_post_title_template = listing.dataset.singlePostTitleTemplate; 18896 alm.addons.single_post_siteTitle = listing.dataset.singlePostSiteTitle; 18897 alm.addons.single_post_siteTagline = listing.dataset.singlePostSiteTagline; 18898 alm.addons.single_post_scroll = listing.dataset.singlePostScroll; 18899 alm.addons.single_post_scroll_speed = listing.dataset.singlePostScrollSpeed; 18900 alm.addons.single_post_scroll_top = listing.dataset.singlePostScrolltop; 18901 alm.addons.single_post_controls = listing.dataset.singlePostControls; 18902 } 18903 return alm; 18904} 18905
18906/** 18907 * Build the data object to send with the Ajax request. 18908 * 18909 * @param {Object} alm The ALM object. 18910 * @return {Object} The data object. 18911 */ 18912function singlepostsQueryParams(alm) { 18913 var addons = alm.addons; 18914 return { 18915 id: parseInt(addons.single_post_id), 18916 order: addons.single_post_order, 18917 post_type: alm.post_type, 18918 taxonomy: addons.single_post_taxonomy, 18919 excluded_terms: addons.single_post_excluded_terms, 18920 initial_id: parseInt(addons.single_post_init_id), 18921 init: addons.single_post_init, 18922 target: addons.single_post_target, 18923 action: 'alm_get_single' 18924 }; 18925} 18926 18927/** 18928 * Create the HTML for loading Single Posts. 18929 * 18930 * @param {Object} alm The alm object. 18931 * @param {string} html The HTML data as a string. 18932 * @return {Object} Results data. 18933 * @since 5.1.8.1 18934 */ 18935function singlepostsHTML(alm) { 18936 var _window; 18937 var html = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 18938 var _alm$addons = alm.addons, 18939 single_post_target = _alm$addons.single_post_target, 18940 single_post_id = _alm$addons.single_post_id; // Get target elements. 18941 18942 if (!html || !single_post_target) { 18943 return API_DEFAULT_DATA_SHAPE; // Bail early if missing requirements. 18944 } 18945 18946 // Create temp div to hold html data. 18947 var tempDiv = document.createElement('div'); 18948 tempDiv.innerHTML = html; 18949 18950 // Get target ref element. 18951 var ref = tempDiv.querySelector(single_post_target); 18952 if (!ref) { 18953 console.warn("Ajax Load More: Unable to find ".concat(single_post_target, " element.")); 18954 return API_DEFAULT_DATA_SHAPE; 18955 } 18956 18957 // Get any custom target elements. 18958 if ((_window = window) !== null && _window !== void 0 && _window.almSinglePostsCustomElements) { 18959 var _window2; 18960 var customElements = singlepostsGetCustomElements(tempDiv, (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.almSinglePostsCustomElements, single_post_id); 18961 if (customElements) { 18962 // Get first element in HTML. 18963 var target = ref.querySelector('article, section, div'); 18964 if (target) { 18965 target.appendChild(customElements); 18966 } 18967 } 18968 } 18969 18970 // Build return data. 18971 return { 18972 html: ref.innerHTML, 18973 meta: { 18974 postcount: 1, 18975 totalposts: 1 18976 } 18977 }; 18978} 18979 18980/** 18981 * Find nested Next Page instance and prepend first element to the returned HTML. 18982 * 18983 * @param {Element} html The wrapper element. 18984 * @return {Element} The modified element. 18985 */ 18986function getNestedNextPageElement(html) { 18987 var nextpageElement = html.querySelector('.ajax-load-more-wrap .alm-nextpage'); 18988 if (!nextpageElement) { 18989 return html; 18990 } 18991 18992 // Clone the nextpage element and clear the contents. 18993 var clone = nextpageElement.cloneNode(true); 18994 clone.innerHTML = ''; 18995 18996 // Insert the clone before the first child. 18997 html.insertBefore(clone, html.querySelector(':first-child')); 18998 return html; 18999} 19000 19001/** 19002 * Collect custom target elements and append them to the returned HTML. 19003 * This function is useful to get elements from outside the ALM target and bring them into the returned HTML. 19004 * Useful for when CSS or JS may be loaded in the <head/> and we need it brought into the HTML for Single Posts. 19005 * 19006 * e.g. window.almSinglePostsCustomElements = ['#woocommerce-inline-inline-css', '#wc-block-style-css']; 19007 * 19008 * @param {HTMLElement} content The HTML element. 19009 * @param {Array} customElements The elements to search for in content. 19010 * @param {string|number} id The Post ID. 19011 * @return {HTMLElement} The HTML elements. 19012 */ 19013function singlepostsGetCustomElements() { 19014 var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 19015 var customElements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 19016 var id = arguments.length > 2 ? arguments[2] : undefined; 19017 if (!content || !customElements) { 19018 return container; // Exit if empty. 19019 } 19020 19021 // Create container element if if doesn't exist. 19022 var container = document.createElement('div'); 19023 container.classList.add('alm-custom-elements'); 19024 container.dataset.id = id; 19025 19026 // Convert customElements to an Array. 19027 customElements = !Array.isArray(customElements) ? [customElements] : customElements; 19028 19029 // Loop Array to extract elements and append to container. 19030 for (var i = 0; i < customElements.length; i++) { 19031 var element = content.querySelector(customElements[i]); 19032 if (element) { 19033 element.classList.add('alm-custom-element'); 19034 container.appendChild(element); 19035 } 19036 } 19037 return container; 19038} 19039 19040/** 19041 * Create data attributes for a Single Post item. 19042 * 19043 * @param {Object} alm The ALM object. 19044 * @param {Element} element The elements HTML element to add data params. 19045 * @return {Array} Modified HTML element. 19046 */ 19047function addSinglePostsAttributes(alm, element) { 19048 if (!element) { 19049 return []; 19050 } 19051 var page = alm.page, 19052 addons = alm.addons; 19053 var _alm_localize = alm_localize, 19054 _alm_localize$retain_ = _alm_localize.retain_querystring, 19055 retain_querystring = _alm_localize$retain_ === void 0 ? true : _alm_localize$retain_; 19056 var querystring = retain_querystring ? window.location.search : ''; 19057 element.setAttribute('class', "alm-single-post post-".concat(addons.single_post_id)); 19058 element.dataset.id = addons.single_post_id; 19059 element.dataset.url = "".concat(addons.single_post_permalink).concat(querystring); 19060 element.dataset.page = addons.single_post_target ? parseInt(page) + 1 : page; 19061 element.dataset.title = addons.single_post_title; 19062 return element; 19063} 19064;// ./src/frontend/js/addons/woocommerce.js 19065function woocommerce_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return woocommerce_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
19065 var c = [][n] ? t(t([][n]())) : (woocommerce_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, woocommerce_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, woocommerce_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), woocommerce_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", woocommerce_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), woocommerce_regeneratorDefine2(u), woocommerce_regeneratorDefine2(u, o, "Generator"), woocommerce_regeneratorDefine2(u, n, function () { return this; }), woocommerce_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (woocommerce_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 19066function woocommerce_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } woocommerce_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { woocommerce_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, woocommerce_regeneratorDefine2(e, r, n, t); } 19067function woocommerce_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 19068function woocommerce_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { woocommerce_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { woocommerce_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078/** 19079 * Create add-on params for ALM. 19080 * 19081 * @param {Object} alm The alm object. 19082 * @return {Object} The modified object. 19083 */ 19084function wooCreateParams(alm) { 19085 var _listing$dataset; 19086 var listing = alm.listing, 19087 addons = alm.addons; 19088 alm.addons.woocommerce = (listing === null || listing === void 0 || (_listing$dataset = listing.dataset) === null || _listing$dataset === void 0 ? void 0 : _listing$dataset.woo) === 'true'; 19089 if (alm.addons.woocommerce && listing.dataset.wooSettings) { 19090 var _addons$woocommerce_s; 19091 alm.addons.woocommerce_settings = JSON.parse(listing.dataset.wooSettings); 19092 alm.addons.woocommerce_settings.results_text = document.querySelectorAll(addons === null || addons === void 0 || (_addons$woocommerce_s = addons.woocommerce_settings) === null || _addons$woocommerce_s === void 0 ? void 0 : _addons$woocommerce_s.results); // Add Results Text 19093 alm.page = parseInt(alm.page) + parseInt(addons.woocommerce_settings.paged); 19094 } 19095 return alm; 19096} 19097 19098/** 19099 * Set up instance of ALM WooCommerce 19100 * 19101 * @param {Object} alm ALM object. 19102 * @since 5.3.0 19103 */ 19104function wooInit(alm) { 19105 if (!alm || !alm.addons.woocommerce) { 19106 return false; 19107 } 19108 var container = document.querySelector(alm.addons.woocommerce_settings.container); // Get `ul.products` 19109 if (!container) { 19110 console.warn('ALM WooCommerce: Unable to locate container element. Get more information -> https://ajaxloadmore.com/docs/add-ons/woocommerce/#alm_woocommerce_container'); 19111 return; 19112 } 19113 alm.button.dataset.page = alm.addons.woocommerce_settings.paged + 1; // Page 19114 19115 // Get upcoming URL. 19116 var nextPage = alm.addons.woocommerce_settings.paged_urls[alm.addons.woocommerce_settings.paged]; 19117 if (nextPage) { 19118 alm.button.dataset.url = nextPage; 19119 } else { 19120 alm.button.dataset.url = ''; 19121 } 19122 var count = countContainers(alm.addons.woocommerce_settings.container); 19123 var page = alm.addons.woocommerce_settings.paged; 19124 if (count > 1) { 19125 // Display warning if multiple containers were found. 19126 console.warn('ALM WooCommerce: Multiple containers with the same classname or ID found. The WooCommerce add-on requires a single container to be defined. Get more information -> https://ajaxloadmore.com/docs/add-ons/woocommerce/'); 19127 } 19128 19129 // Set attributes on containers. 19130 setContentContainersParams(container, alm.listing); 19131 19132 // Set data attributes on first item. 19133 var item = container.querySelector(alm.addons.woocommerce_settings.products); // Get first `.product` item 19134 if (item) { 19135 item.classList.add('alm-woocommerce'); 19136 item.dataset.url = alm.addons.woocommerce_settings.paged_urls[alm.addons.woocommerce_settings.paged - 1]; 19137 item.dataset.page = alm.page; 19138 item.dataset.pageTitle = document.title; 19139 } else { 19140 console.warn('ALM WooCommerce: Unable to locate products. Get more information -> https://ajaxloadmore.com/docs/add-ons/woocommerce/#alm_woocommerce_products'); 19141 } 19142 19143 // Paged URL: Create previous button. 19144 if (page > 1 && alm.addons.woocommerce_settings.settings.previous_products) { 19145 var prevURL = alm.addons.woocommerce_settings.paged_urls[page - 2]; 19146 var label = alm.addons.woocommerce_settings.settings.previous_products; 19147 createLoadPreviousButton(alm, container, page - 1, prevURL, label); 19148 } 19149} 19150 19151/**
19152 * Core ALM WooCommerce product loader 19153 * 19154 * @param {Element} content WooCommerce content container. 19155 * @param {Object} alm ALM object. 19156 * @since 5.3.0 19157 */ 19158function woocommerce(content, alm) { 19159 if (!content || !alm) { 19160 return false; 19161 } 19162 return new Promise(function (resolve) { 19163 var _alm$addons$woocommer = alm.addons.woocommerce_settings, 19164 woocommerce_settings = _alm$addons$woocommer === void 0 ? {} : _alm$addons$woocommer; 19165 var _woocommerce_settings = woocommerce_settings.settings, 19166 settings = _woocommerce_settings === void 0 ? {} : _woocommerce_settings; 19167 var container = document.querySelector(woocommerce_settings.container); // Get `ul.products` 19168 var products = content.querySelectorAll(woocommerce_settings.products); // Get all `.products` 19169 var waitForImages = settings && settings.images_loaded === 'true' ? true : false; 19170 if (container && products) { 19171 var wooProducts = Array.prototype.slice.call(products); // Convert NodeList to Array. 19172 19173 // Load the items. 19174 woocommerce_asyncToGenerator(/*#__PURE__*/woocommerce_regenerator().m(function _callee() { 19175 return woocommerce_regenerator().w(function (_context) { 19176 while (1) switch (_context.n) { 19177 case 0: 19178 _context.n = 1; 19179 return loadItems(container, wooProducts, alm, waitForImages); 19180 case 1: 19181 resolve(true); 19182 case 2: 19183 return _context.a(2); 19184 } 19185 }, _callee); 19186 }))()["catch"](function (e) { 19187 console.warn(e, 'There was an error with WooCommerce'); // eslint-disable-line no-console 19188 }); 19189 19190 // Trigger almWooCommerceLoaded callback. 19191 if (typeof almWooCommerceLoaded === 'function') { 19192 window.almWooCommerceLoaded(products); 19193 } 19194 } 19195 }); 19196} 19197 19198/** 19199 * Get the content, title and results from the Ajax request. 19200 * 19201 * @param {Object} alm The alm object. 19202 * @param {string} url The request URL. 19203 * @param {string} html The HTML data as a string. 19204 * @return {Object} Results data. 19205 * @since 5.3.0 19206 */ 19207function wooGetContent(alm, url) { 19208 var html = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; 19209 if (!html) { 19210 return API_DEFAULT_DATA_SHAPE; // Bail early if missing html content. 19211 } 19212 var addons = alm.addons, 19213 pagePrev = alm.pagePrev, 19214 _alm$rel = alm.rel, 19215 rel = _alm$rel === void 0 ? 'next' : _alm$rel, 19216 page = alm.page, 19217 localize = alm.localize; 19218 var total_posts = localize.total_posts; 19219 var _addons$woocommerce_s2 = addons.woocommerce_settings, 19220 woocommerce_settings = _addons$woocommerce_s2 === void 0 ? {} : _addons$woocommerce_s2; 19221 19222 // Get the page number. 19223 var currentPage = rel === 'prev' ? pagePrev : page + 1; 19224 19225 // Create temp div to hold html data. 19226 var tempDiv = document.createElement('div'); 19227 tempDiv.innerHTML = html; 19228 19229 // Get WooCommerce products container. 19230 var container = tempDiv.querySelector(woocommerce_settings.container); 19231 if (!container) { 19232 console.warn("Ajax Load More WooCommerce: Unable to find WooCommerce ".concat(woocommerce_settings.container, " element.")); 19233 return API_DEFAULT_DATA_SHAPE; 19234 } 19235 19236 // Get the returned items. 19237 var items = container.querySelectorAll(woocommerce_settings.products); 19238 if (items) { 19239 // Set first item data attributes. 19240 items[0].classList.add('alm-woocommerce'); 19241 items[0].dataset.url = url; 19242 items[0].dataset.page = currentPage; 19243 items[0].dataset.pageTitle = tempDiv.querySelector('title').innerHTML; 19244 19245 // Update the results Text. 19246 almWooCommerceResultsText(tempDiv, alm); 19247 19248 // Return data object. 19249 return { 19250 html: container.innerHTML, 19251 meta: { 19252 postcount: items.length, 19253 totalposts: total_posts 19254 } 19255 }; 19256 } 19257 return API_DEFAULT_DATA_SHAPE; // Return default data shape if no items found. 19258} 19259 19260/** 19261 * Handle WooCommerce loaded functionality and dispatch actions. 19262 * 19263 * @param {Object} alm ALM object. 19264 * @return {Promise} Resolves when done. 19265 */ 19266function woocommerceLoaded(_x) { 19267 return _woocommerceLoaded.apply(this, arguments); 19268} 19269 19270/** 19271 * Reset a WooCommerce Instance by hitting the updated site URL. 19272 * 19273 * @since 5.3.8 19274 */ 19275function _woocommerceLoaded() { 19276 _woocommerceLoaded = woocommerce_asyncToGenerator(/*#__PURE__*/woocommerce_regenerator().m(function _callee2(alm) { 19277 var addons, nextPageNum, nextPage, prevPage; 19278 return woocommerce_regenerator().w(function (_context2) { 19279 while (1) switch (_context2.n) { 19280 case 0: 19281 addons = alm.addons; 19282 nextPageNum = alm.page + 2; 19283 nextPage = addons.woocommerce_settings.paged_urls[nextPageNum - 1]; // Get URL. 19284 // Set button state & URL. 19285 if (alm.rel === 'prev' && alm.buttonPrev) { 19286 prevPage = addons.woocommerce_settings.paged_urls[alm.pagePrev - 2]; 19287 setButtonAtts(alm.buttonPrev, parseInt(alm.pagePrev) - 1, prevPage); 19288 } else { 19289 setButtonAtts(alm.button, nextPageNum, nextPage); 19290 } 19291 19292 // Lazy load images if necessary. 19293 lazyImages(alm); 19294 19295 // Trigger almComplete. 19296 if (typeof almComplete === 'function' && alm.transition !== 'masonry') { 19297 window.almComplete(alm); 19298 } 19299 19300 // End transitions. 19301 alm.AjaxLoadMore.transitionEnd(); 19302 19303 // ALM Done. 19304 if (alm.rel === 'prev' && alm.pagePrev <= 1) { 19305 alm.AjaxLoadMore.triggerDonePrev(); 19306 } 19307 if (alm.rel === 'next' && nextPageNum > parseInt(alm.addons.woocommerce_settings.pages)) { 19308 alm.AjaxLoadMore.triggerDone(); 19309 } 19310 dispatchScrollEvent(); 19311 return _context2.a(2, new Promise(function (resolve) { 19312 resolve(true); 19313 })); 19314 } 19315 }, _callee2); 19316 })); 19317 return _woocommerceLoaded.apply(this, arguments); 19318} 19319function wooReset() { 19320 return new Promise(function (resolve) { 19321 var url = window.location; 19322 lib_axios.get(url).then(function (response) { 19323 if (response.status === 200 && response.data) { 19324 var div = document.createElement('div'); 19325 div.innerHTML = response.data; // Add data to div 19326 19327 var alm = div.querySelector('.ajax-load-more-wrap .alm-listing[data-woo="true"]'); // Get ALM instance 19328 var settings = alm ? alm.dataset.wooSettings : ''; // Get settings data 19329 resolve(settings); 19330 } else { 19331 resolve(false); 19332 } 19333 })["catch"](function () { 19334 resolve(false); 19335 }); 19336 }); 19337} 19338 19339/** 19340 * Set results text for WooCommerce Add-on. 19341 * 19342 * @param {Element} target The target HTML element. 19343 * @param {Object} alm ALM object. 19344 * @since 5.3 19345 */ 19346function almWooCommerceResultsText() { 19347 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 19348 var alm = arguments.length > 1 ? arguments[1] : undefined; 19349 if (target && alm && alm.addons.woocommerce_settings.results_text) { 19350 var currentResults = target.querySelector(alm.addons.woocommerce_settings.results); 19351 if (alm.addons.woocommerce_settings.results_text) { 19352 //let link = alm.addons.woocommerce_settings.settings.previous_page_link; 19353 //let label = alm.addons.woocommerce_settings.settings.previous_page_label; 19354 //let sep = alm.addons.woocommerce_settings.settings.previous_page_sep; 19355 alm.addons.woocommerce_settings.results_text.forEach(function (element) { 19356 element.innerHTML = currentResults.innerHTML; 19357 // if (link && label) { 19358 // element.innerHTML = returnButton(currentResults, link, label, sep); 19359 // } else { 19360 // element.innerHTML = currentResults.innerHTML; 19361 // } 19362 }); 19363 } 19364 } 19365} 19366 19367/** 19368 * Initiate Results text. 19369 * 19370 * @param {Object} alm ALM object. 19371 * @since 5.3 19372 * @deprecated 5.5 19373 */ 19374function almWooCommerceResultsTextInit(alm) { 19375 if (alm && alm.addons.woocommerce_settings.results_text) { 19376 var results = document.querySelectorAll(alm.addons.woocommerce_settings.results); 19377 if (results.length < 1) { 19378 return false;
19379 } 19380 var link = alm.addons.woocommerce_settings.settings.previous_page_link; 19381 var label = alm.addons.woocommerce_settings.settings.previous_page_label; 19382 var sep = alm.addons.woocommerce_settings.settings.previous_page_sep; 19383 // Loop all result text elements 19384 results.forEach(function (element) { 19385 if (link && label) { 19386 element.innerHTML = returnButton(element, link, label, sep); 19387 } 19388 }); 19389 } 19390} 19391 19392/** 19393 * Create button text for returning to the first page 19394 * 19395 * @param {Element} text The button text. 19396 * @param {string} link Link URL. 19397 * @param {string} label Button label. 19398 * @param {string} seperator HTML separator. 19399 */ 19400function returnButton(text, link, label, seperator) { 19401 var button = " ".concat(seperator, " <a href=\"").concat(link, "\">").concat(label, "</a>"); 19402 return text.innerHTML + button; 19403} 19404 19405/** 19406 * Get total count of WooCommerce containers. 19407 * 19408 * @param {string} container The container class. 19409 * @return {number} The total number of containers. 19410 */ 19411function countContainers(container) { 19412 if (!container) { 19413 return 0; 19414 } 19415 var containers = document.querySelectorAll(container); // Get all containers. 19416 if (!containers) { 19417 return 0; 19418 } 19419 return containers.length; 19420} 19421;// ./src/frontend/js/extensions/acf.js 19422/** 19423 * Create params for ALM. 19424 * 19425 * @param {Object} alm The alm object. 19426 * @return {Object} The modified object. 19427 */ 19428function acfParams(alm) { 19429 var listing = alm.listing; 19430 alm.extensions.acf = listing.dataset.acf === 'true'; 19431 if (alm.extensions.acf) { 19432 alm.extensions.acf_field_type = listing.dataset.acfFieldType; 19433 alm.extensions.acf_field_name = listing.dataset.acfFieldName; 19434 alm.extensions.acf_parent_field_name = listing.dataset.acfParentFieldName; 19435 alm.extensions.acf_row_index = listing.dataset.acfRowIndex; 19436 alm.extensions.acf_post_id = listing.dataset.acfPostId; 19437 19438 // if field type, name or post ID is empty. 19439 if (alm.extensions.acf_field_type === undefined || alm.extensions.acf_field_name === undefined || alm.extensions.acf_post_id === undefined) { 19440 alm.extensions.acf = false; 19441 } 19442 } 19443 return alm; 19444} 19445;// ./src/frontend/js/extensions/restapi.js 19446/** 19447 * Create params for ALM. 19448 * 19449 * @param {Object} alm The alm object. 19450 * @return {Object} The modified object. 19451 */ 19452function restapiParams(alm) { 19453 var listing = alm.listing; 19454 alm.extensions.restapi = listing.dataset.restapi === 'true'; 19455 if (alm.extensions.restapi) { 19456 alm.extensions.restapi_base_url = listing.dataset.restapiBaseUrl; 19457 alm.extensions.restapi_namespace = listing.dataset.restapiNamespace; 19458 alm.extensions.restapi_endpoint = listing.dataset.restapiEndpoint; 19459 alm.extensions.restapi_template_id = listing.dataset.restapiTemplateId; 19460 alm.extensions.restapi_debug = listing.dataset.restapiDebug; 19461 if (alm.extensions.restapi_template_id === '') { 19462 alm.extensions.restapi = false; 19463 } 19464 } 19465 return alm; 19466} 19467;// ./src/frontend/js/extensions/terms.js 19468/** 19469 * Create params for ALM. 19470 * 19471 * @param {Object} alm The alm object. 19472 * @return {Object} The modified object. 19473 */ 19474function termsParams(alm) { 19475 var listing = alm.listing; 19476 alm.extensions.term_query = listing.dataset.termQuery === 'true'; 19477 if (alm.extensions.term_query) { 19478 alm.extensions.term_query_taxonomy = listing.dataset.termQueryTaxonomy; 19479 alm.extensions.term_query_hide_empty = listing.dataset.termQueryHideEmpty; 19480 alm.extensions.term_query_number = listing.dataset.termQueryNumber; 19481 } 19482 return alm; 19483} 19484;// ./src/frontend/js/extensions/users.js 19485/** 19486 * Create params for ALM. 19487 * 19488 * @param {Object} alm The alm object. 19489 * @return {Object} The modified object. 19490 */ 19491function usersParams(alm) { 19492 var listing = alm.listing; 19493 alm.extensions.users = listing.dataset.users === 'true'; 19494 if (alm.extensions.users) { 19495 // Override paging params for users 19496 alm.orginal_posts_per_page = parseInt(listing.dataset.usersPerPage); 19497 alm.posts_per_page = parseInt(listing.dataset.usersPerPage); 19498 } 19499 return alm; 19500} 19501;// ./src/frontend/js/functions/apiRequest.js 19502function apiRequest_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return apiRequest_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
vendor: 4,393 bytes, lines 19502-19558
19502 var c = [][n] ? t(t([][n]())) : (apiRequest_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, apiRequest_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, apiRequest_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), apiRequest_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", apiRequest_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), apiRequest_regeneratorDefine2(u), apiRequest_regeneratorDefine2(u, o, "Generator"), apiRequest_regeneratorDefine2(u, n, function () { return this; }), apiRequest_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (apiRequest_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 19503function apiRequest_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } apiRequest_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { apiRequest_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, apiRequest_regeneratorDefine2(e, r, n, t); } 19504function apiRequest_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 19505function apiRequest_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { apiRequest_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { apiRequest_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 19506/** 19507 * Function to make an API GET request with URL parameters 19508 * 19509 * @param {string} url The base URL for the API request. 19510 * @param {Object} params Object containing key-value pairs to be converted into URL parameters. 19511 * @return {Promise<object>} A promise that resolves to the JSON response from the API. 19512 */ 19513var apiRequest = /*#__PURE__*/function () { 19514 var _ref = apiRequest_asyncToGenerator(/*#__PURE__*/apiRequest_regenerator().m(function _callee() { 19515 var url, 19516 params, 19517 api_url, 19518 response, 19519 message, 19520 _args = arguments, 19521 _t; 19522 return apiRequest_regenerator().w(function (_context) { 19523 while (1) switch (_context.p = _context.n) { 19524 case 0: 19525 url = _args.length > 0 && _args[0] !== undefined ? _args[0] : ''; 19526 params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; 19527 api_url = params ? url + '?' + new URLSearchParams(params).toString() : url; 19528 _context.p = 1; 19529 _context.n = 2; 19530 return fetch(api_url); 19531 case 2: 19532 response = _context.v; 19533 if (response.ok) { 19534 _context.n = 3; 19535 break; 19536 } 19537 throw new Error("HTTP error! status: ".concat(response.status)); 19538 case 3: 19539 _context.n = 4; 19540 return response.json(); 19541 case 4: 19542 return _context.a(2, _context.v); 19543 case 5: 19544 _context.p = 5; 19545 _t = _context.v; 19546 message = _t instanceof Error ? _t.message : 'Something went wrong'; 19547 throw new Error(message); 19548 case 6: 19549 return _context.a(2); 19550 } 19551 }, _callee, null, [[1, 5]]); 19552 })); 19553 return function apiRequest() { 19554 return _ref.apply(this, arguments); 19555 }; 19556}(); 19557;// ./src/frontend/js/functions/displayResults.js 19558function displayResults_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype);
vendor: 4,519 bytes, lines 19558-19588
19558 return displayResults_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (displayResults_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, displayResults_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, displayResults_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), displayResults_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", displayResults_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), displayResults_regeneratorDefine2(u), displayResults_regeneratorDefine2(u, o, "Generator"), displayResults_regeneratorDefine2(u, n, function () { return this; }), displayResults_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (displayResults_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 19559function displayResults_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } displayResults_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { displayResults_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, displayResults_regeneratorDefine2(e, r, n, t); } 19560function displayResults_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 19561function displayResults_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { displayResults_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { displayResults_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 19562 19563 19564 19565 19566var displayResults_imagesLoaded = __webpack_require__(7943); 19567 19568/** 19569 * Append and display Ajax results to the ALM container. 19570 * 19571 * @param {Object} alm The ALM object. 19572 * @param {Array} nodes The HTML nodes to append. 19573 * @return {Promise} The Promise object. 19574 */ 19575function displayResults(_x, _x2) { 19576 return _displayResults.apply(this, arguments); 19577} 19578 19579/** 19580 * Append and display Ajax results to the Paging container. 19581 * 19582 * @param {Object} alm The ALM object. 19583 * @param {Array} nodes The HTML nodes to append. 19584 * @return {Promise} The Promise object. 19585 */ 19586function _displayResults() { 19587 _displayResults = displayResults_asyncToGenerator(/*#__PURE__*/displayResults_regenerator().m(function _callee(alm, nodes) { 19588 var container, transition, speed, images_loaded;
19589 return displayResults_regenerator().w(function (_context) { 19590 while (1) switch (_context.n) { 19591 case 0: 19592 container = alm.listing, transition = alm.transition, speed = alm.speed, images_loaded = alm.images_loaded; 19593 _context.n = 1; 19594 return timeout(75); 19595 case 1: 19596 return _context.a(2, new Promise(function (resolve) { 19597 if (!container || !nodes) { 19598 resolve(true); 19599 return; 19600 } 19601 var useTransition = transition === 'fade' ? true : false; 19602 19603 // Add each node to the alm listing container. 19604 nodes.forEach(function (node) { 19605 var nodeName = node.nodeName.toLowerCase(); 19606 if (useTransition || images_loaded) { 19607 node.style.opacity = 0; 19608 if (useTransition) { 19609 node.style.transition = "all ".concat(speed, "ms ease"); 19610 } 19611 } 19612 19613 /** 19614 * Do not append elements that are not actual element nodes (i.e. #text node). 19615 * Add item if not in exclude array. 19616 */ 19617 if (EXCLUDED_NODES.indexOf(nodeName) === -1) { 19618 container.appendChild(node); 19619 } 19620 }); 19621 19622 // Run srcSet polyfill. 19623 srcsetPolyfill(container, alm.ua); 19624 19625 // Lazy load images. 19626 lazyImages(alm); 19627 19628 // Display the results. 19629 if (images_loaded) { 19630 displayResults_imagesLoaded(container, function () { 19631 display(alm, nodes, useTransition); 19632 }); 19633 } else { 19634 display(alm, nodes, useTransition); 19635 } 19636 resolve(true); 19637 })); 19638 } 19639 }, _callee); 19640 })); 19641 return _displayResults.apply(this, arguments); 19642} 19643function displayPagingResults(_x3, _x4) { 19644 return _displayPagingResults.apply(this, arguments); 19645} 19646 19647/** 19648 * Display the loaded results via CSS transition. 19649 * 19650 * @param {Object} alm The ALM object. 19651 * @param {Array} nodes The HTML nodes to append. 19652 * @param {boolean} useTransition Use CSS transition. 19653 */ 19654function _displayPagingResults() { 19655 _displayPagingResults = displayResults_asyncToGenerator(/*#__PURE__*/displayResults_regenerator().m(function _callee2(alm, nodes) { 19656 var addons, container; 19657 return displayResults_regenerator().w(function (_context2) { 19658 while (1) switch (_context2.n) { 19659 case 0: 19660 addons = alm.addons; 19661 container = addons.paging_container; 19662 _context2.n = 1; 19663 return timeout(125); 19664 case 1: 19665 return _context2.a(2, new Promise(function (resolve) { 19666 if (!container || !nodes) { 19667 resolve(true); 19668 return; 19669 } 19670 19671 // Clear contents of Paging container. 19672 container.style.opacity = 0; 19673 container.innerHTML = ''; 19674 19675 // Add each node to the paging container. 19676 nodes.forEach(function (node) { 19677 var nodeName = node.nodeName.toLowerCase(); 19678 /** 19679 * Do not append elements that are not actual element nodes (i.e. #text node). 19680 * Add item if not in exclude array. 19681 */ 19682 if (EXCLUDED_NODES.indexOf(nodeName) === -1) { 19683 container.appendChild(node); 19684 } 19685 }); 19686 19687 // Run srcSet polyfill. 19688 srcsetPolyfill(container, alm.ua); 19689 19690 // Lazy load images. 19691 lazyImages(alm); 19692 resolve(true); 19693 })); 19694 } 19695 }, _callee2); 19696 })); 19697 return _displayPagingResults.apply(this, arguments); 19698} 19699function display(_x5, _x6) { 19700 return _display.apply(this, arguments); 19701} 19702function _display() { 19703 _display = displayResults_asyncToGenerator(/*#__PURE__*/displayResults_regenerator().m(function _callee3(alm, nodes) { 19704 var useTransition, 19705 delay, 19706 images_loaded, 19707 offset, 19708 _args3 = arguments; 19709 return displayResults_regenerator().w(function (_context3) { 19710 while (1) switch (_context3.n) { 19711 case 0: 19712 useTransition = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : true;
19713 delay = alm.transition_delay, images_loaded = alm.images_loaded; 19714 offset = useTransition ? parseInt(delay) : 0; // Delay offset timing. 19715 _context3.n = 1; 19716 return timeout(50); 19717 case 1: 19718 // Add short delay for effect. 19719 19720 if (nodes) { 19721 if (useTransition || images_loaded) { 19722 nodes.forEach(function (node, index) { 19723 setTimeout(function () { 19724 node.style.opacity = 1; 19725 }, index * offset); 19726 }); 19727 } 19728 alm.AjaxLoadMore.transitionEnd(); 19729 } 19730 case 2: 19731 return _context3.a(2); 19732 } 19733 }, _callee3); 19734 })); 19735 return _display.apply(this, arguments); 19736} 19737;// ./src/frontend/js/functions/formatHTML.js 19738function formatHTML_toConsumableArray(r) { return formatHTML_arrayWithoutHoles(r) || formatHTML_iterableToArray(r) || formatHTML_unsupportedIterableToArray(r) || formatHTML_nonIterableSpread(); } 19739function formatHTML_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 19740function formatHTML_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return formatHTML_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? formatHTML_arrayLikeToArray(r, a) : void 0; } } 19741function formatHTML_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } 19742function formatHTML_arrayWithoutHoles(r) { if (Array.isArray(r)) return formatHTML_arrayLikeToArray(r); } 19743function formatHTML_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 19744 19745 19746 19747 19748 19749/** 19750 * Create data attributes for Single Posts, SEO and Filter paged results. 19751 * 19752 * @param {Object} alm The ALM object. 19753 * @param {Array} elements The element HTML nodes. 19754 * @return {Array} The modified elements. 19755 * @since 7.0.0 19756 */ 19757function formatHTML(alm, elements) { 19758 var _elements; 19759 if (!((_elements = elements) !== null && _elements !== void 0 && _elements.length)) { 19760 return []; 19761 } 19762 var addons = alm.addons, 19763 page = alm.page, 19764 posts_per_page = alm.posts_per_page, 19765 init = alm.init, 19766 start_page = alm.start_page, 19767 container_type = alm.container_type; 19768 19769 // Single Posts. 19770 if (addons !== null && addons !== void 0 && addons.single_post) { 19771 var singleWrap = document.createElement('div'); 19772 singleWrap.innerHTML = alm.html; 19773 singleWrap = addSinglePostsAttributes(alm, singleWrap); 19774 singleWrap = getNestedNextPageElement(singleWrap); 19775 19776 // Single Post Preview. 19777 if (addons !== null && addons !== void 0 && addons.single_post_preview && addons !== null && addons !== void 0 && addons.single_post_preview_data && typeof almSinglePostCreatePreview === 'function') { 19778 var singlePreview = almSinglePostCreatePreview(singleWrap, addons.single_post_id, addons.single_post_preview_data); 19779 if (singlePreview) { 19780 singleWrap.replaceChildren(singlePreview); 19781 } 19782 } 19783 alm.last_loaded = [singleWrap]; 19784 return [singleWrap]; 19785 } 19786 19787 // Exit if not SEO or Filters. 19788 if (!(addons !== null && addons !== void 0 && addons.seo) && !(addons !== null && addons !== void 0 && addons.filters)) { 19789 return elements; 19790 } 19791 var current = parseInt(page) + 1; 19792 current = addons !== null && addons !== void 0 && addons.preloaded ? current + 1 : current; 19793 19794 // If init and SEO or Filter start_page, set pagenum to 1. 19795 if (init && (parseInt(start_page) > 1 || (addons === null || addons === void 0 ? void 0 : addons.filters_startpage) > 1)) { 19796 current = 1; 19797 } 19798 19799 // Call to Action add-on: Add 1 if CTA is true. 19800 var per_page = addons !== null && addons !== void 0 && addons.
19800cta ? parseInt(posts_per_page) + 1 : parseInt(posts_per_page); 19801 19802 // If table, format the return data. 19803 if (container_type === 'table') { 19804 elements = formatTable(elements); 19805 } 19806 19807 /** 19808 * Split elements array into individual pages. 19809 */ 19810 var pages = []; 19811 for (var i = 0; i < ((_elements2 = elements) === null || _elements2 === void 0 ? void 0 : _elements2.length); i += per_page) { 19812 var _elements2; 19813 pages.push(elements.slice(i, per_page + i)); 19814 } 19815 19816 /** 19817 * Loop pages and modify first element in return data. 19818 */ 19819 if (pages) { 19820 for (var _i = 0; _i < pages.length; _i++) { 19821 var index = _i > 0 ? _i * per_page : 0; 19822 if (elements[index]) { 19823 if (addons !== null && addons !== void 0 && addons.seo) { 19824 elements[index] = addSEOAttributes(alm, elements[index], _i + current); 19825 } 19826 if (addons !== null && addons !== void 0 && addons.filters) { 19827 elements[index] = addFiltersAttributes(alm, elements[index], _i + current); 19828 } 19829 } 19830 } 19831 } 19832 return elements; 19833} 19834 19835/** 19836 * Format return table data. 19837 * 19838 * @param {Array} elements The element HTML nodes. 19839 * @return {Array} The modified elements. 19840 */ 19841function formatTable() { 19842 var _elements3; 19843 var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 19844 if (!elements) { 19845 return []; 19846 } 19847 var tableChildren = (_elements3 = elements) !== null && _elements3 !== void 0 && _elements3.length ? elements[0].childNodes : []; 19848 if (tableChildren) { 19849 elements = functions_stripEmptyNodes(formatHTML_toConsumableArray(tableChildren)); 19850 } 19851 return elements; 19852} 19853;// ./src/frontend/js/functions/getScrollPercentage.js 19854/** 19855 * Get the scroll distance in pixels from a percentage. 19856 * 19857 * @param {Object} alm The Ajax Load More object. 19858 * @return {number} The new distance. 19859 * @since 5.2 19860 */ 19861function getScrollPercentage(alm) { 19862 if (!alm) { 19863 return false; 19864 } 19865 var is_negative = alm.scroll_distance_orig.toString().indexOf('-') === -1 ? false : true; // Is this a negative number 19866 var raw_distance = alm.scroll_distance_orig.toString().replace('-', '').replace('%', ''); // Remove - and perc 19867 var wh = alm.window.innerHeight; // window height 19868 var height = Math.floor(wh / 100 * parseInt(raw_distance)); // Do math to get distance 19869 var newdistance = is_negative ? "-".concat(height) : height; // Set the distance 19870 19871 return parseInt(newdistance); 19872} 19873;// ./src/frontend/js/functions/getTotals.js 19874/** 19875 * Get the total posts remaining in the current query by ALM instance ID. 19876 * Note: Uses localized ALM variables. 19877 * 19878 * @see https://github.com/dcooney/wordpress-ajax-load-more/blob/main/core/classes/class-alm-localize.php 19879 * @param {string} type The type of total to retrieve. 19880 * @param {string} id An optional Ajax Load More ID. 19881 * @return {number} A total post count. 19882 */ 19883function getTotals(type) { 19884 var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 19885 // Get the ALM localized variable name. 19886 var localize_var = id ? "ajax_load_more_".concat(id.replace(/-/g, '_'), "_vars") : 'ajax_load_more_vars'; 19887 19888 // Get the localized value from the window object. 19889 var localized = window[localize_var]; 19890 if (!localized) { 19891 return null; 19892 } 19893 19894 // Deconstruct the object. 19895 var total_posts = localized.total_posts, 19896 post_count = localized.post_count, 19897 page = localized.page, 19898 pages = localized.pages; 19899 switch (type) { 19900 case 'total_posts': 19901 return total_posts ? parseInt(total_posts) : ''; 19902 case 'post_count': 19903 return post_count ? parseInt(post_count) : ''; 19904 case 'page': 19905 return page ? parseInt(page) : ''; 19906 case 'pages': 19907 return pages ? parseInt(pages) : ''; 19908 case 'remaining': 19909 if (!total_posts || !post_count) { 19910 return ''; 19911 } 19912 return parseInt(total_posts) - parseInt(post_count); 19913 } 19914} 19915;// ./src/frontend/js/functions/noResults.js 19916/** 19917 * Set the results text if required. 19918 * 19919 * @param {Element} element Target HTML element 19920 * @param {string} html Text as HTML to display. 19921 * @since 5.1 19922 */ 19923function noResults(element) { 19924 var html = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 19925 if (!html || !element) { 19926 return; // Exit if empty. 19927 } 19928 19929 // Remove empty <p/> tags. 19930 html = html.replace(/(<p><\/p>)+/g, ''); 19931 19932 // Is this a paging instance. 19933 var paging = element === null || element === void 0 ? void 0 : element.querySelector('.alm-paging-content'); 19934 if (paging) { 19935 paging.innerHTML = html; 19936 } else { 19937 element.innerHTML = html; 19938 } 19939} 19940;// ./src/frontend/js/functions/parsers.js 19941function parsers_toConsumableArray(r) { return parsers_arrayWithoutHoles(r) || parsers_iterableToArray(r) || parsers_unsupportedIterableToArray(r) || parsers_nonIterableSpread(); } 19942function parsers_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 19943function parsers_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return parsers_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? parsers_arrayLikeToArray(r, a) : void 0; } } 19944function parsers_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } 19945function parsers_arrayWithoutHoles(r) { if (Array.isArray(r)) return parsers_arrayLikeToArray(r); } 19946function parsers_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 19947 19948 19949/**
19950 * Convert a plain text string into an array of HTML nodes. 19951 * 19952 * @param {string} html The HTML string 19953 * @param {string} type The element type. 19954 * @return {Array} The HTML nodes as an array. 19955 * @since 5.0 19956 */ 19957function domParser() { 19958 var _data$body; 19959 var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 19960 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text/html'; 19961 if (!html) { 19962 return []; 19963 } 19964 var parser = new DOMParser(); 19965 var data = parser.parseFromString(html, type); 19966 var nodes = data === null || data === void 0 || (_data$body = data.body) === null || _data$body === void 0 ? void 0 : _data$body.childNodes; 19967 return nodes ? functions_stripEmptyNodes(parsers_toConsumableArray(nodes)) : []; 19968} 19969 19970/** 19971 * Convert retun table data into an array of HTML elements. 19972 * 19973 * @param {string} html Plain text HTML. 19974 * @return {Array} Array of HTML elements. 19975 * @since 5.0 19976 */ 19977function tableParser() { 19978 var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 19979 if (!html) { 19980 return []; 19981 } 19982 // Create table element and add results to table body. 19983 var tbody = document.createElement('tbody'); 19984 tbody.innerHTML = html; 19985 return [tbody]; 19986} 19987;// ./src/frontend/js/functions/getCurrentPage.js 19988/** 19989 * Get the actual page number for the current request. 19990 * This is because ALM may use zero-based or one-based indexing depending on context. 19991 * e.g. Preloaded, paging, seo_start_page, filters_startpage etc. 19992 * 19993 * @param {Object} alm The ALM object. 19994 * @param {Object} data The query data object for sending to Ajax Load More. 19995 * @return {string} The cache ID. 19996 */ 19997function getCurrentPage(alm, data) { 19998 var addons = alm.addons; 19999 var currentPage = data.page + 1; // Convert zero-based page to one-based page. 20000 20001 // Paging add-on. 20002 if (addons.paging) { 20003 return currentPage; 20004 } 20005 20006 // Preloaded add-on. 20007 if (addons.preloaded) { 20008 if (data.seo_start_page > 1 || data.filters_startpage > 1) { 20009 return currentPage; // Return current page as-is when SEO or Filters add-on is active. 20010 } 20011 return currentPage + 1; // Add another page for preloaded initial page. 20012 } 20013 if (alm.init) { 20014 // SEO add-on (First run only). 20015 if (data.seo_start_page > 1) { 20016 currentPage = "1-".concat(data.seo_start_page); // Adjust page number based on seo_start_page. 20017 } 20018 // Filters (First run only). 20019 if (data.filters_startpage > 1) { 20020 currentPage = "1-".concat(data.filters_startpage); // Adjust page number based on filters_startpage. 20021 } 20022 } 20023 return currentPage; 20024} 20025;// ./src/frontend/js/functions/queryParams.js 20026 20027 20028 20029/** 20030 * Build the data object to send with the Ajax request. 20031 * 20032 * @param {Object} alm The ALM object. 20033 * @param {string} type The query type. 20034 * @return {Object} The data object. 20035 * @since 3.6 20036 */ 20037function getAjaxParams(alm, type) { 20038 var addons = alm.addons, 20039 extensions = alm.extensions; 20040 20041 // Defaults 20042 var data = { 20043 action: 'alm_get_posts', 20044 query_type: type, 20045 id: alm.id, 20046 post_id: alm.post_id, 20047 slug: alm.slug, 20048 canonical_url: encodeURIComponent(alm.canonical_url), 20049 posts_per_page: parseInt(alm.posts_per_page), 20050 page: parseInt(alm.page), 20051 offset: parseInt(alm.offset), 20052 original_offset: parseInt(alm.offset), 20053 post_type: alm.post_type, 20054 repeater: alm.repeater, 20055 seo_start_page: alm.start_page 20056 }; 20057 20058 // Addons & Extensions 20059 20060 if (extensions.acf) { 20061 data.acf = getTypeParams(alm, 'acf'); 20062 if (extensions.acf_field_type !== 'relationship') { 20063 data.action = 'alm_acf'; 20064 } 20065 } 20066 if (addons.comments) { 20067 data.comments = getTypeParams(alm, 'comments'); 20068 data.posts_per_page = addons.comments_per_page; 20069 data.action = 'alm_comments'; 20070 } 20071 if (addons.cta) { 20072 data.cta = getTypeParams(alm, 'cta'); 20073 } 20074 if (addons.filters) { 20075 data.filters = addons.filters; 20076 data.filters_startpage = addons.filters_startpage; 20077 data.filters_target = addons.filters_target; 20078 data.facets = alm.facets; 20079 } 20080 if (addons.nextpage) { 20081 data.nextpage = getTypeParams(alm, 'nextpage'); 20082 data.action = 'alm_nextpage'; 20083 } 20084 if (addons.paging) { 20085 data.paging = addons.paging; 20086 } 20087 if (addons.preloaded) { 20088 data.preloaded = addons.preloaded; 20089 data.preloaded_amount = parseInt(addons.preloaded_amount); 20090 } 20091 if (addons.single_post) { 20092 data.single_post = getTypeParams(alm, 'single_post'); 20093 } 20094 if (extensions.term_query) { 20095 data.term_query = getTypeParams(alm, 'term_query'); 20096 data.action = 'alm_get_terms'; 20097 } 20098 if (alm.extensions.users) { 20099 data.users = getTypeParams(alm, 'users'); 20100 data.action = 'alm_users'; 20101 } 20102 if (alm.theme_repeater) { 20103 data.theme_repeater = alm.theme_repeater; 20104 } 20105 20106 // Query data params from ALM HTML element. 20107 if (alm.listing.dataset.lang) { 20108 data.lang = alm.listing.dataset.lang; 20109 } 20110 if (alm.listing.dataset.stickyPosts) { 20111 data.sticky_posts = alm.listing.dataset.stickyPosts; 20112 } 20113 if (alm.listing.dataset.postFormat) { 20114 data.post_format = alm.listing.dataset.postFormat; 20115 } 20116 if (alm.listing.dataset.category) { 20117 data.category = alm.listing.dataset.category; 20118 } 20119 if (alm.listing.dataset.categoryAnd) { 20120 data.category__and = alm.listing.dataset.categoryAnd; 20121 } 20122 if (alm.listing.dataset.categoryNotIn) { 20123 data.category__not_in = alm.listing.dataset.categoryNotIn; 20124 } 20125 if (alm.listing.dataset.tag) { 20126 data.tag = alm.listing.dataset.tag; 20127 } 20128 if (alm.listing.dataset.tagAnd) { 20129 data.tag__and = alm.listing.dataset.tagAnd; 20130 } 20131 if (alm.listing.dataset.tagNotIn) { 20132 data.tag__not_in = alm.listing.dataset.tagNotIn; 20133 } 20134 if (alm.listing.dataset.taxonomy) { 20135 data.taxonomy = alm.listing.dataset.taxonomy; 20136 } 20137 if (alm.listing.dataset.taxonomyTerms) { 20138 data.taxonomy_terms = alm.listing.dataset.taxonomyTerms; 20139 } 20140 if (alm.listing.dataset.taxonomyOperator) { 20141 data.taxonomy_operator = alm.listing.dataset.taxonomyOperator; 20142 } 20143 if (alm.listing.dataset.taxonomyIncludeChildren) { 20144 data.taxonomy_include_children = alm.listing.dataset.taxonomyIncludeChildren; 20145 } 20146 if (alm.listing.dataset.taxonomyRelation) { 20147 data.taxonomy_relation = alm.listing.dataset.taxonomyRelation; 20148 } 20149 if (alm.listing.dataset.sortKey) { 20150 data.sort_key = alm.listing.dataset.sortKey; 20151 } 20152 if (alm.listing.dataset.metaKey) { 20153 data.meta_key = alm.listing.dataset.metaKey; 20154 } 20155 if (alm.listing.dataset.metaValue) { 20156 data.meta_value = alm.listing.dataset.metaValue; 20157 } 20158 if (alm.listing.dataset.metaCompare) { 20159 data.meta_compare = alm.listing.dataset.metaCompare; 20160 } 20161 if (alm.listing.dataset.metaRelation) { 20162 data.meta_relation = alm.listing.dataset.metaRelation; 20163 } 20164 if (alm.listing.dataset.metaType) { 20165 data.meta_type = alm.listing.dataset.metaType; 20166 } 20167 if (alm.listing.dataset.dateQuery) { 20168 data.date_query = alm.listing.dataset.dateQuery; 20169 } 20170 if (alm.listing.dataset.dateQueryAfter) { 20171 data.date_query_after = alm.listing.dataset.dateQueryAfter; 20172 } 20173 if (alm.listing.dataset.dateQueryBefore) { 20174 data.date_query_before = alm.listing.dataset.dateQueryBefore; 20175 } 20176 if (alm.listing.dataset.dateQueryColumn) { 20177 data.date_query_column = alm.listing.dataset.dateQueryColumn; 20178 } 20179 if (alm.listing.dataset.dateQueryCompare) { 20180 data.date_query_compare = alm.listing.dataset.dateQueryCompare; 20181 } 20182 if (alm.listing.dataset.dateQueryInclusive) { 20183 data.date_query_inclusive = alm.listing.dataset.dateQueryInclusive; 20184 } 20185 if (alm.listing.dataset.dateQueryRelation) { 20186 data.date_query_relation = alm.listing.dataset.dateQueryRelation; 20187 } 20188 if (alm.listing.dataset.author) { 20189 data.author = alm.listing.dataset.author; 20190 } 20191 if (alm.listing.dataset.year) { 20192 data.year = alm.listing.dataset.year; 20193 } 20194 if (alm.listing.dataset.month) { 20195 data.month = alm.listing.dataset.month; 20196 } 20197 if (alm.listing.dataset.day) { 20198 data.day = alm.listing.dataset.day; 20199 } 20200 if (alm.listing.dataset.order) { 20201 data.order = alm.listing.dataset.order; 20202 } 20203 if (alm.listing.dataset.orderby) { 20204 data.orderby = alm.listing.dataset.orderby; 20205 } 20206 if (alm.listing.dataset.postStatus) { 20207 data.post_status = alm.listing.dataset.postStatus; 20208 } 20209 if (alm.listing.dataset.postIn) { 20210 data.post__in = alm.listing.dataset.postIn; 20211 } 20212 if (alm.listing.dataset.postNotIn) { 20213 data.post__not_in = alm.listing.dataset.postNotIn; 20214 } 20215 if (alm.listing.dataset.exclude) { 20216 data.exclude = alm.listing.dataset.exclude; 20217 } 20218 if (alm.listing.dataset.search) { 20219 data.search = alm.listing.dataset.search; 20220 } 20221 if (alm.listing.dataset.s) { 20222 data.search = alm.listing.dataset.s; 20223 } 20224 if (alm.listing.dataset.engine) { 20225 data.engine = alm.listing.dataset.engine; 20226 } 20227 if (alm.listing.dataset.customArgs) { 20228 data.custom_args = alm.listing.dataset.customArgs; 20229 } 20230 if (alm.listing.dataset.vars) { 20231 data.vars = alm.listing.dataset.vars; 20232 } 20233 20234 // Get the actual current page number. 20235 alm.currentPage = getCurrentPage(alm, data); 20236 data.currentPage = alm.currentPage; 20237 20238 // Cache Params 20239 if (addons.cache) { 20240 data.cache = true; 20241 data.cache_logged_in = addons.cache_logged_in; 20242 data.cache_id = getCacheId(alm, data); 20243 } 20244 return data; 20245} 20246 20247/**
20248 * Build the query params for content types. 20249 * 20250 * @param {Object} alm The ALM object. 20251 * @param {string} type The query type. 20252 * @return {Object} The query params. 20253 */ 20254function getTypeParams(alm, type) { 20255 var addons = alm.addons, 20256 extensions = alm.extensions; 20257 switch (type) { 20258 case 'acf': 20259 return { 20260 acf: 'true', 20261 post_id: extensions.acf_post_id, 20262 field_type: extensions.acf_field_type, 20263 field_name: extensions.acf_field_name, 20264 parent_field_name: extensions.acf_parent_field_name, 20265 row_index: extensions.acf_row_index 20266 }; 20267 case 'comments': 20268 return { 20269 comments: 'true', 20270 post_id: addons.comments_post_id, 20271 per_page: addons.comments_per_page, 20272 type: addons.comments_type, 20273 style: addons.comments_style, 20274 template: addons.comments_template, 20275 callback: addons.comments_callback 20276 }; 20277 case 'cta': 20278 return { 20279 cta: 'true', 20280 cta_position: addons.cta_position, 20281 cta_repeater: addons.cta_repeater, 20282 cta_theme_repeater: addons.cta_theme_repeater, 20283 cta_template: addons.cta_template 20284 }; 20285 case 'nextpage': 20286 return { 20287 nextpage: 'true', 20288 urls: addons.nextpage_urls, 20289 scroll: addons.nextpage_scroll, 20290 post_id: addons.nextpage_post_id, 20291 startpage: addons.nextpage_startpage, 20292 nested: alm.nested 20293 }; 20294 case 'single_post': 20295 return { 20296 single_post: 'true', 20297 id: addons.single_post_id, 20298 slug: addons.single_post_slug 20299 }; 20300 case 'term_query': 20301 return { 20302 term_query: 'true', 20303 taxonomy: extensions.term_query_taxonomy, 20304 hide_empty: extensions.term_query_hide_empty, 20305 number: extensions.term_query_number 20306 }; 20307 case 'users': 20308 return { 20309 users: 'true', 20310 role: alm.listing.dataset.usersRole, 20311 include: alm.listing.dataset.usersInclude, 20312 exclude: alm.listing.dataset.usersExclude, 20313 per_page: alm.posts_per_page, 20314 order: alm.listing.dataset.usersOrder, 20315 orderby: alm.listing.dataset.usersOrderby 20316 }; 20317 } 20318} 20319 20320/** 20321 * Build the REST API data object to send with REST API request. 20322 * 20323 * @param {Object} alm The ALM object. 20324 * @return {Object} The data object. 20325 * @since 3.6 20326 */ 20327function getRestParams(alm) { 20328 var addons = alm.addons; 20329 var data = { 20330 id: alm.id, 20331 post_id: parseInt(alm.post_id), 20332 posts_per_page: alm.posts_per_page, 20333 page: alm.page, 20334 offset: alm.offset, 20335 slug: alm.slug, 20336 canonical_url: encodeURIComponent(alm.canonical_url), 20337 post_type: alm.post_type, 20338 post_format: alm.listing.dataset.postFormat, 20339 category: alm.listing.dataset.category, 20340 category__not_in: alm.listing.dataset.categoryNotIn, 20341 tag: alm.listing.dataset.tag, 20342 tag__not_in: alm.listing.dataset.tagNotIn, 20343 taxonomy: alm.listing.dataset.taxonomy, 20344 taxonomy_terms: alm.listing.dataset.taxonomyTerms, 20345 taxonomy_operator: alm.listing.dataset.taxonomyOperator, 20346 taxonomy_relation: alm.listing.dataset.taxonomyRelation, 20347 meta_key: alm.listing.dataset.metaKey, 20348 meta_value: alm.listing.dataset.metaValue, 20349 meta_compare: alm.listing.dataset.metaCompare, 20350 meta_relation: alm.listing.dataset.metaRelation, 20351 meta_type: alm.listing.dataset.metaType, 20352 date_query: alm.listing.dataset.dateQuery, 20353 date_query_after: alm.listing.dataset.dateQueryAfter, 20354 date_query_before: alm.listing.dataset.dateQueryBefore, 20355 date_query_column: alm.listing.dataset.dateQueryColumn, 20356 date_query_compare: alm.listing.dataset.dateQueryCompare, 20357 date_query_inclusive: alm.listing.dataset.dateQueryInclusive, 20358 date_query_relation: alm.listing.dataset.dateQueryRelation, 20359 author: alm.listing.dataset.author, 20360 year: alm.listing.dataset.year, 20361 month: alm.listing.dataset.month, 20362 day: alm.listing.dataset.day, 20363 post_status: alm.listing.dataset.postStatus, 20364 order: alm.listing.dataset.order, 20365 orderby: alm.listing.dataset.orderby, 20366 post__in: alm.listing.dataset.postIn, 20367 post__not_in: alm.listing.dataset.postNotIn, 20368 search: alm.listing.dataset.search, 20369 s: alm.listing.dataset.s, 20370 engine: alm.listing.dataset.engine, 20371 custom_args: alm.listing.dataset.customArgs, 20372 vars: alm.listing.dataset.vars, 20373 lang: alm.lang, 20374 preloaded: alm.addons.preloaded, 20375 preloaded_amount: alm.addons.preloaded_amount, 20376 seo_start_page: alm.start_page 20377 }; 20378 20379 // Get the actual current page number. 20380 alm.currentPage = getCurrentPage(alm, data); 20381 data.currentPage = alm.currentPage; 20382 20383 // Cache Params 20384 if (addons.cache) { 20385 data.cache = true; 20386 data.cache_logged_in = addons.cache_logged_in; 20387 data.cache_id = getCacheId(alm, data); 20388 } 20389 return data; 20390} 20391;// ./src/frontend/js/functions/windowResize.js 20392/** 20393 * Trigger a window resize browser function. 20394 * 20395 * @since 5.3.1 20396 */ 20397function triggerWindowResize() { 20398 if (typeof Event === 'function') { 20399 // Modern browsers. 20400 window.dispatchEvent(new Event('resize')); 20401 } else { 20402 // Executed on old browsers and especially IE. 20403 var resizeEvent = window.document.createEvent('UIEvents'); 20404 resizeEvent.initUIEvent('resize', true, false, window, 0); 20405 window.dispatchEvent(resizeEvent); 20406 } 20407} 20408;// ./src/frontend/js/modules/almDebug.js 20409/** 20410 * Display Ajax Load More debug results. 20411 *
20412 * @see https://ajaxloadmore.com/docs/filter-hooks/#alm_debug 20413 * @param {Object} alm ALM object. 20414 * @since 5.1.6 20415 */ 20416function almDebug(alm) { 20417 if (alm && alm.debug) { 20418 var obj = { 20419 query: alm.debug, 20420 localize: alm.localize 20421 }; 20422 console.log('ALM Debug:', obj); // eslint-disable-line no-console 20423 } 20424} 20425;// ./src/frontend/js/modules/fade.js 20426/** 20427 * Fade element in. 20428 * 20429 * @param {HTMLElement} element The HTML element to fade in. 20430 * @param {number} speed The transition speed. 20431 * @return {Promise} The Promise object. 20432 */ 20433var almFadeIn = function almFadeIn(element, speed) { 20434 return new Promise(function (resolve) { 20435 if (speed === 0) { 20436 element.style.opacity = 1; 20437 element.style.height = 'auto'; 20438 resolve(true); 20439 } else { 20440 speed = speed / 10; 20441 var op = 0; // initial opacity 20442 var timer = setInterval(function () { 20443 if (op > 0.9) { 20444 element.style.opacity = 1; 20445 resolve(true); 20446 clearInterval(timer); 20447 } 20448 element.style.opacity = op; 20449 op += 0.1; 20450 }, speed); 20451 element.style.height = 'auto'; 20452 } 20453 }); 20454}; 20455 20456/** 20457 * Fade element out. 20458 * 20459 * @param {HTMLElement} element The HTML element to fade out. 20460 * @param {number} speed The transition speed. 20461 * @return {Promise} The Promise object. 20462 */ 20463var almFadeOut = function almFadeOut(element, speed) { 20464 return new Promise(function (resolve) { 20465 speed = speed / 10; 20466 element.style.opacity = 0.5; 20467 var fadeEffect = setInterval(function () { 20468 if (element.style.opacity < 0.1) { 20469 element.style.opacity = 0; 20470 clearInterval(fadeEffect); 20471 resolve(true); 20472 } else { 20473 element.style.opacity -= 0.1; 20474 } 20475 }, speed); 20476 }); 20477}; 20478;// ./src/frontend/js/modules/tableofcontents.js 20479function tableofcontents_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return tableofcontents_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (tableofcontents_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, tableofcontents_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, tableofcontents_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), tableofcontents_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", tableofcontents_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), tableofcontents_regeneratorDefine2(u), tableofcontents_regeneratorDefine2(u, o, "Generator"), tableofcontents_regeneratorDefine2(u, n, function () { return this; }), tableofcontents_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (tableofcontents_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 20480function tableofcontents_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } tableofcontents_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { tableofcontents_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, tableofcontents_regeneratorDefine2(e, r, n, t); } 20481function tableofcontents_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 20482function tableofcontents_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { tableofcontents_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { tableofcontents_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 20483 20484 20485 20486 20487/** 20488 * Create a numbered table of contents navigation. 20489 * 20490 * @param {Object} alm The alm object. 20491 * @param {boolean} init Init boolean. 20492 * @param {boolean} from_preloaded Preloaded boolean. 20493 * @since 5.2 20494 */ 20495function tableOfContents(_x) { 20496 return _tableOfContents.apply(this, arguments); 20497} 20498 20499/** 20500 * Clear table of contents. 20501 */ 20502function _tableOfContents() { 20503 _tableOfContents = tableofcontents_asyncToGenerator(/*#__PURE__*/tableofcontents_regenerator().m(function _callee(alm) { 20504 var init, 20505 from_preloaded, 20506 totalPosts, 20507 offset, 20508 startPage, 20509 filterStartPage, 20510 nextpageStartPage, 20511 page, 20512 preloaded, 20513 i, 20514 _i, 20515 _i2, 20516 _args = arguments; 20517 return tableofcontents_regenerator().w(function (_context) { 20518 while (1) switch (_context.n) { 20519 case 0: 20520 init = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
20521 from_preloaded = _args.length > 2 && _args[2] !== undefined ? _args[2] : false; 20522 totalPosts = alm.localize && alm.localize.post_count ? parseInt(alm.localize.post_count) : 0; // eslint-disable-next-line eqeqeq 20523 if (!(totalPosts == 0 && !alm.addons.single_post)) { 20524 _context.n = 1; 20525 break; 20526 } 20527 return _context.a(2, false); 20528 case 1: 20529 if (!(alm && alm.tableofcontents && alm.transition !== 'masonry')) { 20530 _context.n = 5; 20531 break; 20532 } 20533 offset = alm.tableofcontents.dataset.offset ? parseInt(alm.tableofcontents.dataset.offset) : 30; 20534 startPage = alm.start_page ? parseInt(alm.start_page) : 0; 20535 filterStartPage = alm.addons.filters_startpage ? parseInt(alm.addons.filters_startpage) : 0; 20536 nextpageStartPage = alm.addons.nextpage_startpage ? parseInt(alm.addons.nextpage_startpage) : 0; 20537 page = parseInt(alm.page); 20538 preloaded = alm.addons.preloaded ? true : false; // Exit if Paging or Next Page 20539 if (!(alm.addons.paging || alm.addons.nextpage)) { 20540 _context.n = 2; 20541 break; 20542 } 20543 return _context.a(2, false); 20544 case 2: 20545 if (!init) { 20546 _context.n = 4; 20547 break; 20548 } 20549 _context.n = 3; 20550 return timeout(100); 20551 case 3: 20552 // Add slight delay. 20553 20554 // Paged results 20555 if (alm.addons.seo && startPage > 1 || alm.addons.filters && filterStartPage > 1 || alm.addons.nextpage && nextpageStartPage > 1) { 20556 // SEO 20557 if (alm.addons.seo && startPage > 1) { 20558 for (i = 0; i < startPage; i++) { 20559 createTOCButton(alm, i, offset); 20560 } 20561 } 20562 // Filters 20563 if (alm.addons.filters && filterStartPage > 1) { 20564 for (_i = 0; _i < filterStartPage; _i++) { 20565 createTOCButton(alm, _i, offset); 20566 } 20567 } 20568 // Nextpage 20569 if (alm.addons.nextpage && nextpageStartPage > 1) { 20570 for (_i2 = 0; _i2 < nextpageStartPage; _i2++) { 20571 createTOCButton(alm, _i2, offset); 20572 } 20573 } 20574 } else { 20575 if (!from_preloaded && preloaded) { 20576 page = page + 1; 20577 } 20578 createTOCButton(alm, page, offset); 20579 } 20580 _context.n = 5; 20581 break; 20582 case 4: 20583 // Preloaded 20584 if (preloaded) { 20585 if (alm.addons.seo && startPage > 0) { 20586 page = page; 20587 } else if (alm.addons.filters && filterStartPage > 0) { 20588 page = page; 20589 } else { 20590 page = page + 1; 20591 } 20592 } 20593 createTOCButton(alm, page, offset); 20594 case 5: 20595 return _context.a(2); 20596 } 20597 }, _callee); 20598 })); 20599 return _tableOfContents.apply(this, arguments); 20600} 20601function clearTOC() { 20602 var toc = document.querySelector('.alm-toc'); 20603 if (toc) { 20604 toc.innerHTML = ''; 20605 } 20606} 20607 20608/** 20609 * Create Standard Page Button. 20610 * 20611 * @param {Object} alm The alm object. 20612 * @param {string} page Current page. 20613 * @param {number} offset The page offset. 20614 */ 20615function createTOCButton(_x2, _x3, _x4) { 20616 return _createTOCButton.apply(this, arguments); 20617} 20618/** 20619 * Get Button Label. 20620 * 20621 * @param {Object} alm The alm object. 20622 * @param {string} page The current page. 20623 * @return {string} The Label. 20624 */ 20625function _createTOCButton() { 20626 _createTOCButton = tableofcontents_asyncToGenerator(/*#__PURE__*/tableofcontents_regenerator().m(function _callee2(alm, page, offset) { 20627 var posts_per_page, button; 20628 return tableofcontents_regenerator().w(function (_context2) { 20629 while (1) switch (_context2.n) { 20630 case 0: 20631 if (alm.tableofcontents) { 20632 _context2.n = 1; 20633 break; 20634 } 20635 return _context2.a(2, false); 20636 case 1: 20637 page = parseInt(page); 20638 posts_per_page = parseInt(alm.posts_per_page); // Create button. 20639 button = document.createElement('button'); 20640 button.type = 'button'; 20641 button.innerHTML = getTOCLabel(alm, page + 1); 20642 button.dataset.page = alm.addons.single_post_target && alm.init ? page - 1 : page + 1; 20643 button.dataset.target = (page + 1) * posts_per_page - posts_per_page + 1; 20644 20645 // Add button to TOC. 20646 alm.tableofcontents.appendChild(button); 20647 20648 // Click event listener. 20649 button.addEventListener('click', function () { 20650 var current = this.dataset.page; 20651 var target = this.dataset.target; 20652 20653 // Get all listing children. 20654 var children = alm.listing.children; 20655 20656 // Find element. 20657 var element = children[target - 1]; 20658 20659 // Next Page. 20660 if (alm.addons.nextpage) { 20661 element = document.querySelector(".alm-nextpage[data-page=\"".concat(current, "\"]")); 20662 } 20663 // Single Posts. 20664 if (alm.addons.single_post_target) { 20665 element = document.querySelector(".alm-single-post[data-page=\"".concat(current, "\"]")); 20666 } 20667 if (!element) { 20668 return; // Exit if no target. 20669 } 20670 var top = typeof getOffset === 'function' ? getOffset(element).top : element.offsetTop; 20671 almScroll(top - offset); 20672 20673 // Set focus on element after slight delay. 20674 setTimeout(function () { 20675 setFocus(alm, element, target, false); 20676 }, 500); 20677 }); 20678 case 2: 20679 return _context2.a(2); 20680 } 20681 }, _callee2); 20682 })); 20683 return _createTOCButton.apply(this, arguments); 20684} 20685function getTOCLabel(alm, page) { 20686 var label = page; 20687 20688 // Single Posts 20689 if (alm.addons.single_post) { 20690 var thePage = page - 1; 20691 var element; 20692 if (alm.addons.single_post_target) { 20693 // Special functionality for Single Post with a loading target type 20694 if (alm.init) { 20695 thePage = thePage; 20696 } else { 20697 thePage = thePage + 1; 20698 } 20699 var posts = document.querySelectorAll(".alm-single-post"); 20700 if (posts) { 20701 element = posts[thePage]; 20702 } 20703 } else { 20704 element = document.querySelector(".alm-single-post[data-page=".concat(page - 1, "]")); 20705 } 20706 label = element ? element.dataset.title : label; 20707 } 20708 20709 // Dynamic function name. 20710 var funcName = "almTOCLabel_".concat(alm.id); 20711 if (typeof window[funcName] === 'function') { 20712 label = window[funcName](page, label); 20713 } 20714 return label; 20715} 20716;// ./src/frontend/js/modules/filtering.js 20717function filtering_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return filtering_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
20717 var c = [][n] ? t(t([][n]())) : (filtering_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, filtering_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, filtering_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), filtering_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", filtering_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), filtering_regeneratorDefine2(u), filtering_regeneratorDefine2(u, o, "Generator"), filtering_regeneratorDefine2(u, n, function () { return this; }), filtering_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (filtering_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 20718function filtering_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } filtering_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { filtering_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, filtering_regeneratorDefine2(e, r, n, t); } 20719function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || filtering_unsupportedIterableToArray(r, e) || _nonIterableRest(); } 20720function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 20721function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } 20722function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } 20723function filtering_toConsumableArray(r) { return filtering_arrayWithoutHoles(r) || filtering_iterableToArray(r) || filtering_unsupportedIterableToArray(r) || filtering_nonIterableSpread(); } 20724function filtering_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 20725function filtering_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return filtering_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? filtering_arrayLikeToArray(r, a) : void 0; } } 20726function filtering_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } 20727function filtering_arrayWithoutHoles(r) { if (Array.isArray(r)) return filtering_arrayLikeToArray(r); } 20728function filtering_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 20729function filtering_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 20730function filtering_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { filtering_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { filtering_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 20731 20732 20733 20734 20735/** 20736 * Filter an Ajax Load More instance. 20737 * 20738 * @param {string} transition Transition type. 20739 * @param {number} speed Transition speed. 20740 * @param {Object} data Data object. 20741 * @param {string} type Type of filter. 20742 * @since 2.6.1 20743 */ 20744function almFilter(transition) { 20745 var speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; 20746 var data = arguments.length > 2 ? arguments[2] : undefined; 20747 var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'filter'; 20748 if (data.target) { 20749 // Target has been specified. 20750 var alm = document.querySelectorAll('.ajax-load-more-wrap[data-id="' + data.target.toLowerCase() + '"]'); 20751 if (alm) { 20752 alm.forEach(function (element) { 20753 almFilterTransition(transition, speed, data, type, element); 20754 }); 20755 } 20756 } else { 20757 // Target not specified. 20758 var _alm = document.querySelectorAll('.ajax-load-more-wrap'); 20759 if (_alm) { 20760 _alm.forEach(function (element) { 20761 almFilterTransition(transition, speed, data, type, element); 20762 }); 20763 } 20764 } 20765 clearTOC(); // Clear table of contents if required 20766} 20767 20768/** 20769 * Transition Ajax Load More 20770 * 20771 * @param {string} transition Transition type. 20772 * @param {number} speed Transition speed. 20773 * @param {Object} data Data object. 20774 * @param {string} type Type of filter. 20775 * @param {Element} element Target element. 20776 * @since 2.13.1 20777 */ 20778function almFilterTransition(_x, _x2, _x3, _x4, _x5) { 20779 return _almFilterTransition.apply(this, arguments); 20780} 20781/** 20782 * Complete the filter transition. 20783 * 20784 * @param {number} speed Transition speed. 20785 * @param {Object} data Data object. 20786 * @param {string} type Type of filter. 20787 * @param {Element} element Target element. 20788 * @since 3.3 20789 */ 20790function _almFilterTransition() { 20791 _almFilterTransition = filtering_asyncToGenerator(/*#__PURE__*/filtering_regenerator().m(function _callee(transition, speed, data, type, element) { 20792 var _t; 20793 return filtering_regenerator().w(function (_context) { 20794 while (1) switch (_context.n) { 20795 case 0: 20796 if (!(transition === 'fade' || transition === 'masonry')) { 20797 _context.n = 4; 20798 break; 20799 } 20800 _t = type; 20801 _context.n = _t === 'filter' ? 1 : 2; 20802 break; 20803 case 1: 20804 element.classList.add('alm-is-filtering'); 20805 almFadeOut(element, speed); 20806 return _context.a(3, 2); 20807 case 2: 20808 _context.n = 3; 20809 return timeout(speed); 20810 case 3: 20811 almCompleteFilterTransition(speed, data, type, element); 20812 _context.n = 5; 20813 break; 20814 case 4: 20815 // No transition 20816 element.classList.add('alm-is-filtering'); 20817 almCompleteFilterTransition(speed, data, type, element); 20818 case 5: 20819 return _context.a(2); 20820 } 20821 }, _callee); 20822 })); 20823 return _almFilterTransition.apply(this, arguments); 20824} 20825function almCompleteFilterTransition(speed, data, type, element) { 20826 var btnWrap = element.querySelector('.alm-btn-wrap'); // Get `.alm-btn-wrap` element 20827 var listing = element.querySelectorAll('.alm-listing'); // Get `.alm-listing` element 20828 20829 if (!listing || !btnWrap) { 20830 return false; // Exit if elements don't exist. 20831 } 20832 20833 // Loop over all .alm-listing divs and clear HTML. 20834 filtering_toConsumableArray(listing).forEach(function (element) { 20835 // Is this a paging instance. 20836 var paging = element.querySelector('.alm-paging-content'); 20837 if (paging) { 20838 paging.innerHTML = ''; 20839 } else { 20840 element.innerHTML = ''; 20841 } 20842 }); 20843 20844 // Get Load More button 20845 var button = btnWrap.querySelector('.alm-load-more-btn'); 20846 if (button) { 20847 button.classList.remove('done'); // Reset Button 20848 } 20849 20850 // Clear paging navigation 20851 var paging = btnWrap.querySelector('.alm-paging'); 20852 if (paging) { 20853 paging.style.opacity = 0; 20854 } 20855 20856 // Reset Preloaded Amount 20857 data.preloadedAmount = 0; 20858 20859 // Dispatch Filters 20860 almSetFilters(speed, data, type, element); 20861} 20862 20863/** 20864 * Set filter parameters on .alm-listing element. 20865 * 20866 * @param {number} speed Transition speed. 20867 * @param {Object} data Data object. 20868 * @param {string} type Type of filter. 20869 * @param {Element} element Target element. 20870 * @since 2.6.1 20871 */ 20872function almSetFilters(speed, data, type, element) { 20873 // Get `alm-listing` container. 20874 var listing = element.querySelector('.alm-listing') || element.querySelector('.alm-comments'); 20875 if (!listing) { 20876 return false;
20877 } 20878 switch (type) { 20879 case 'filter': 20880 // Update data attributes 20881 for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) { 20882 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), 20883 key = _Object$entries$_i[0], 20884 value = _Object$entries$_i[1]; 20885 // Convert camelCase data atts back to dashes (-). 20886 key = key.replace(/\W+/g, '-').replace(/([a-z\d])([A-Z])/g, '$1-$2').toLowerCase(); 20887 listing.setAttribute('data-' + key, value); 20888 } 20889 almCleanFilterData(listing, data); // Cleanup Filters data 20890 20891 // Fade ALM back (Filters only) 20892 almFadeIn(element, speed); 20893 break; 20894 } 20895 20896 // Re-initiate Ajax Load More. 20897 var target = ''; 20898 if (data.target) { 20899 // Target has been specified 20900 target = document.querySelector('.ajax-load-more-wrap[data-id="' + data.target + '"]'); 20901 if (target) { 20902 window.almInit(target); 20903 } 20904 } else { 20905 // Target not specified 20906 target = document.querySelector('.ajax-load-more-wrap'); 20907 if (target) { 20908 window.almInit(target); 20909 } 20910 } 20911 switch (type) { 20912 case 'filter': 20913 // Filters Complete (not the add-on). 20914 if (typeof almFilterComplete === 'function') { 20915 almFilterComplete(); 20916 } 20917 break; 20918 } 20919} 20920 20921/** 20922 * Clean up Taxonomy and Meta Query data from filters. 20923 * 20924 * @param {HTMLElement} listing The alm-listing container. 20925 * @param {Object} data The data object containing filter parameters. 20926 */ 20927function almCleanFilterData(listing, data) { 20928 // If taxonomy is empty, remove taxonomy-related data attributes. 20929 if (data && data.taxonomy === '') { 20930 delete listing.dataset.taxonomy; 20931 if (listing.dataset.taxonomyTerms) { 20932 delete listing.dataset.taxonomy; 20933 delete listing.dataset.taxonomyTerms; 20934 delete listing.dataset.taxonomyOperator; 20935 delete listing.dataset.taxonomyIncludeChildren; 20936 } 20937 } 20938 20939 // If metaKey is empty, remove meta-related data attributes. 20940 if (data && data.metaKey === '') { 20941 delete listing.dataset.metaKey; 20942 if (listing.dataset.metaValue) { 20943 delete listing.dataset.metaValue; 20944 delete listing.dataset.metaType; 20945 delete listing.dataset.metaCompare; 20946 } 20947 } 20948} 20949;// ./src/frontend/js/modules/masonry.js 20950function masonry_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return masonry_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
20950 var c = [][n] ? t(t([][n]())) : (masonry_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, masonry_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, masonry_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), masonry_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", masonry_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), masonry_regeneratorDefine2(u), masonry_regeneratorDefine2(u, o, "Generator"), masonry_regeneratorDefine2(u, n, function () { return this; }), masonry_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (masonry_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 20951function masonry_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } masonry_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { masonry_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, masonry_regeneratorDefine2(e, r, n, t); } 20952function masonry_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 20953function masonry_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { masonry_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { masonry_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 20954 20955var masonry_imagesLoaded = __webpack_require__(7943); 20956 20957/** 20958 * Function to trigger built-in Ajax Load More Masonry. 20959 * 20960 * @param {Object} alm ALM object. 20961 * @param {boolean} init Initial run true or false. 20962 * @param {boolean} filtering Is this a filtering event. 20963 * @since 3.1 20964 */ 20965function almMasonry(alm, init, filtering) { 20966 if (!alm.masonry) { 20967 console.warn('Ajax Load More: Unable to locate Masonry settings.'); 20968 } 20969 var container = alm.listing, 20970 last_loaded = alm.last_loaded, 20971 speed = alm.speed; 20972 return new Promise(function (resolve) { 20973 var _alm$masonry; 20974 var selector = alm.masonry.selector; 20975 var animation = alm.masonry.animation; 20976 var horizontalOrder = (alm === null || alm === void 0 || (_alm$masonry = alm.masonry) === null || _alm$masonry === void 0 ? void 0 : _alm$masonry.horizontalorder) === 'true' ? true : false; 20977 var masonry_init = alm.masonry.init; 20978 var columnWidth = alm.masonry.columnwidth; 20979 var duration = (speed + 100) / 1000 + 's'; // Add 100 for some delay 20980 var hidden = 'scale(0.5)'; 20981 var visible = 'scale(1)'; 20982 if (animation === 'zoom-out') { 20983 hidden = 'translateY(-20px) scale(1.25)'; 20984 visible = 'translateY(0) scale(1)'; 20985 } 20986 if (animation === 'slide-up') { 20987 hidden = 'translateY(50px)'; 20988 visible = 'translateY(0)'; 20989 } 20990 if (animation === 'slide-down') { 20991 hidden = 'translateY(-50px)'; 20992 visible = 'translateY(0)'; 20993 } 20994 if (animation === 'none') { 20995 hidden = 'translateY(0)'; 20996 visible = 'translateY(0)'; 20997 } 20998 20999 // columnWidth 21000 if (columnWidth) { 21001 if (!isNaN(columnWidth)) { 21002 columnWidth = parseInt(columnWidth); // Check if number. 21003 } 21004 } else { 21005 columnWidth = selector; // No columnWidth, use the selector 21006 } 21007 if (!filtering) { 21008 // First Run. 21009 if (masonry_init && init) { 21010 masonry_imagesLoaded(container, function () { 21011 var _window; 21012 var defaults = { 21013 itemSelector: selector, 21014 transitionDuration: duration, 21015 columnWidth: columnWidth, 21016 // eslint-disable-line 21017 horizontalOrder: horizontalOrder, 21018 // eslint-disable-line 21019 hiddenStyle: { 21020 transform: hidden, 21021 opacity: 0 21022 }, 21023 visibleStyle: { 21024 transform: visible, 21025 opacity: 1 21026 } 21027 }; 21028 21029 // Get custom Masonry options (https://masonry.desandro.com/options.html). 21030 var alm_masonry_vars = (_window = window) === null || _window === void 0 ? void 0 : _window.alm_masonry_vars; 21031 if (alm_masonry_vars) {
21032 Object.keys(alm_masonry_vars).forEach(function (key) { 21033 // Loop object to create key:prop 21034 defaults[key] = alm_masonry_vars[key]; 21035 }); 21036 } 21037 21038 // Init Masonry, delay to allow time for items to be added to the page. 21039 setTimeout(/*#__PURE__*/masonry_asyncToGenerator(/*#__PURE__*/masonry_regenerator().m(function _callee() { 21040 return masonry_regenerator().w(function (_context) { 21041 while (1) switch (_context.n) { 21042 case 0: 21043 alm.msnry = new Masonry(container, defaults); 21044 _context.n = 1; 21045 return almFadeIn(container.parentNode, 175); 21046 case 1: 21047 resolve(true); 21048 case 2: 21049 return _context.a(2); 21050 } 21051 }, _callee); 21052 })), 25); 21053 }); 21054 } else { 21055 // Standard / Append content. 21056 // eslint-disable-next-line no-lonely-if 21057 if (last_loaded) { 21058 // ImagesLoaded & appended. 21059 masonry_imagesLoaded(container, function () { 21060 setTimeout(/*#__PURE__*/masonry_asyncToGenerator(/*#__PURE__*/masonry_regenerator().m(function _callee2() { 21061 return masonry_regenerator().w(function (_context2) { 21062 while (1) switch (_context2.n) { 21063 case 0: 21064 alm.msnry.appended(last_loaded); 21065 resolve(true); 21066 case 1: 21067 return _context2.a(2); 21068 } 21069 }, _callee2); 21070 })), 25); 21071 }); 21072 } 21073 } 21074 } else { 21075 // Reset instance. 21076 container.parentNode.style.opacity = 0; 21077 almMasonry(alm, true, false); 21078 resolve(true); 21079 } 21080 }); 21081} 21082 21083/** 21084 * Set up initial Masonry Configuration. 21085 * 21086 * @param {Object} alm ALM Object. 21087 * @return {Object} Configuration object. 21088 */ 21089function almMasonryConfig(alm) { 21090 alm.masonry = {}; 21091 alm.masonry.init = true; 21092 if (alm.msnry) { 21093 // destroy masonry if it currently exists. 21094 alm.msnry.destroy(); 21095 } else { 21096 alm.msnry = ''; 21097 } 21098 var masonry_config = JSON.parse(alm.listing.dataset.masonryConfig); 21099 if (masonry_config) { 21100 alm.masonry.selector = masonry_config.selector; 21101 alm.masonry.columnwidth = masonry_config.columnwidth; 21102 alm.masonry.animation = masonry_config.animation === '' ? 'standard' : masonry_config.animation; 21103 alm.masonry.horizontalorder = masonry_config.horizontalorder === '' ? 'true' : masonry_config.horizontalorder; 21104 alm.images_loaded = true; 21105 alm.transition_delay = 0; 21106 } else { 21107 console.warn('Ajax Load More: Unable to locate Masonry configuration settings.'); 21108 } 21109 return alm; 21110} 21111;// ./src/frontend/js/modules/placeholder.js 21112function placeholder_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return placeholder_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
21112 var c = [][n] ? t(t([][n]())) : (placeholder_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, placeholder_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, placeholder_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), placeholder_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", placeholder_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), placeholder_regeneratorDefine2(u), placeholder_regeneratorDefine2(u, o, "Generator"), placeholder_regeneratorDefine2(u, n, function () { return this; }), placeholder_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (placeholder_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 21113function placeholder_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } placeholder_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { placeholder_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, placeholder_regeneratorDefine2(e, r, n, t); } 21114function placeholder_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 21115function placeholder_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { placeholder_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { placeholder_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 21116 21117 21118 21119/** 21120 * Show placeholder div. 21121 * 21122 * @param {string} type The direction. 21123 * @param {Object} alm The ALM object. 21124 */ 21125function placeholder() { 21126 return _placeholder.apply(this, arguments); 21127} 21128function _placeholder() { 21129 _placeholder = placeholder_asyncToGenerator(/*#__PURE__*/placeholder_regenerator().m(function _callee() { 21130 var type, 21131 alm, 21132 placeholder, 21133 addons, 21134 rel, 21135 _args = arguments, 21136 _t; 21137 return placeholder_regenerator().w(function (_context) { 21138 while (1) switch (_context.n) { 21139 case 0: 21140 type = _args.length > 0 && _args[0] !== undefined ? _args[0] : 'show'; 21141 alm = _args.length > 1 ? _args[1] : undefined; 21142 placeholder = alm.placeholder, addons = alm.addons, rel = alm.rel; 21143 if (!(!placeholder || addons.paging || rel === 'prev')) { 21144 _context.n = 1; 21145 break; 21146 } 21147 return _context.a(2, false); 21148 case 1: 21149 _t = type; 21150 _context.n = _t === 'hide' ? 2 : 5; 21151 break; 21152 case 2: 21153 _context.n = 3; 21154 return almFadeOut(placeholder, 175); 21155 case 3: 21156 _context.n = 4; 21157 return timeout(75); 21158 case 4: 21159 // Add short delay for effect. 21160 placeholder.style.display = 'none'; 21161 return _context.a(3, 6); 21162 case 5: 21163 placeholder.style.display = 'block'; 21164 almFadeIn(placeholder, 175); 21165 return _context.a(3, 6); 21166 case 6: 21167 return _context.a(2); 21168 } 21169 }, _callee); 21170 })); 21171 return _placeholder.apply(this, arguments); 21172} 21173;// ./src/frontend/js/modules/resultsText.js 21174 21175 21176/** 21177 * Set the results text if required. 21178 * 21179 * @param {Object} alm ALM object. 21180 * @param {string} type Type of results. 21181 * @since 5.1 21182 */ 21183function almResultsText(alm) { 21184 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'standard'; 21185 if (!alm.resultsText || alm.nested === 'true') { 21186 return false;
21187 } 21188 var resultsType = type === 'nextpage' || type === 'woocommerce' ? type : 'standard'; 21189 almGetResultsText(alm, resultsType); 21190} 21191 21192/** 21193 * Get values for showing results text. 21194 * 21195 * @param {Object} alm ALM object. 21196 * @param {string} type Type of results. 21197 * @since 4.1 21198 */ 21199function almGetResultsText(alm) { 21200 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'standard'; 21201 if (!alm.resultsText || !alm.localize || alm.nested === 'true') { 21202 return false; 21203 } 21204 var page = 0; 21205 var pages = 0; 21206 var post_count = 0; 21207 var total_posts = 0; 21208 var posts_per_page = alm.orginal_posts_per_page; 21209 switch (type) { 21210 // Nextpage 21211 case 'nextpage': 21212 page = parseInt(alm.localize.page); 21213 post_count = page; 21214 pages = parseInt(alm.localize.total_posts); 21215 total_posts = parseInt(pages); 21216 almRenderResultsText(alm.resultsText, page, pages, post_count, total_posts, posts_per_page); 21217 break; 21218 21219 // WooCommerce 21220 case 'woocommerce': 21221 // Don't do anything 21222 break; 21223 default: 21224 page = getTotals('page', alm.id); 21225 pages = getTotals('pages', alm.id); 21226 post_count = getTotals('post_count', alm.id); 21227 total_posts = getTotals('total_posts', alm.id); 21228 almRenderResultsText(alm.resultsText, page, pages, post_count, total_posts, posts_per_page); 21229 } 21230} 21231 21232/** 21233 * Display `Showing {x} of {y} pages` text. 21234 * 21235 * @param {Object} alm ALM object. 21236 * @param {string} type Type of results. 21237 * @since 4.1 21238 */ 21239function almInitResultsText(alm) { 21240 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'standard'; 21241 if (!alm.resultsText || !alm.localize || alm.nested === 'true') { 21242 return false; 21243 } 21244 var page = 0; 21245 var pages = Math.ceil(alm.localize.total_posts / alm.orginal_posts_per_page); 21246 var post_count = parseInt(alm.localize.post_count); 21247 var total_posts = parseInt(alm.localize.total_posts); 21248 switch (type) { 21249 case 'nextpage': 21250 // Nextpage 21251 page = alm.addons.nextpage_startpage; 21252 post_count = page; 21253 pages = total_posts; 21254 almRenderResultsText(alm.resultsText, page, total_posts, post_count, total_posts, alm.posts_per_page); 21255 break; 21256 case 'preloaded': 21257 // Preloaded 21258 page = alm.addons.paging && alm.addons.seo ? alm.start_page + 1 : parseInt(alm.page) + 1; 21259 almRenderResultsText(alm.resultsText, page, pages, post_count, total_posts, alm.posts_per_page); 21260 break; 21261 case 'woocommerce': 21262 // WooCommerce 21263 // Don't do anything 21264 break; 21265 } 21266} 21267 21268/** 21269 * Render `Showing {x} of {y} results` text. 21270 * 21271 * @param {Element} el The results text HTML element. 21272 * @param {string} page The current page number. 21273 * @param {string} pages The total pages. 21274 * @param {string} post_count Total posts displayed. 21275 * @param {string} total_posts Total amount of posts in query. 21276 * @param {string} per_page Total amount of posts per page. 21277 * @since 4.1 21278 */ 21279var almRenderResultsText = function almRenderResultsText(el, page, pages, post_count, total_posts, per_page) { 21280 el.forEach(function (result) { 21281 pages = parseInt(pages); 21282 var text = pages > 0 ? alm_localize.results_text : alm_localize.no_results_text; 21283 21284 // Paging add-on. 21285 // Start and End values for posts in view. 21286 var start = page * per_page - per_page + 1; 21287 var end_val = page * per_page; 21288 var end = end_val <= total_posts ? end_val : total_posts; 21289 if (pages > 0) { 21290 text = text.replace('{num}', "<span class=\"alm-results-num\">".concat(page, "</span>")); // Deprecated 21291 text = text.replace('{page}', "<span class=\"alm-results-page\">".concat(page, "</span>")); 21292 text = text.replace('{start}', "<span class=\"alm-results-start\">".concat(start, "</span>")); 21293 text = text.replace('{end}', "<span class=\"alm-results-start\">".concat(end, "</span>")); 21294 text = text.replace('{total}', "<span class=\"alm-results-total\">".concat(pages, "</span>")); // Deprecated 21295 text = text.replace('{pages}', "<span class=\"alm-results-pages\">".concat(pages, "</span>")); 21296 text = text.replace('{post_count}', "<span class=\"alm-results-post_count\">
21296".concat(post_count, "</span>")); 21297 text = text.replace('{total_posts}', "<span class=\"alm-results-total_posts\">".concat(total_posts, "</span>")); 21298 result.innerHTML = text; 21299 } else { 21300 result.innerHTML = text; 21301 } 21302 }); 21303}; 21304;// ./src/frontend/js/modules/setLocalizedVars.js 21305 21306 21307/** 21308 * Set localized variables 21309 * 21310 * @param {Object} alm ALM object 21311 * @since 4.1 21312 */ 21313function setLocalizedVars(alm) { 21314 var addons = alm.addons; 21315 return new Promise(function (resolve) { 21316 var type = 'standard'; 21317 if (addons.nextpage) { 21318 // Nextpage 21319 type = 'nextpage'; 21320 if (addons.paging) { 21321 alm.AjaxLoadMore.setLocalizedVar('page', parseInt(alm.page) + 1); 21322 } else { 21323 alm.AjaxLoadMore.setLocalizedVar('page', parseInt(alm.page) + parseInt(addons.nextpage_startpage) + 1); 21324 } 21325 } else if (addons.woocommerce) { 21326 // WooCommerce 21327 type = 'woocommerce'; 21328 alm.AjaxLoadMore.setLocalizedVar('page', parseInt(alm.page) + 1); 21329 } else { 21330 // Standard ALM. 21331 var page = parseInt(alm.page) + 1 + (addons.preloaded && !addons.paging ? 1 : 0); // Add 1 page for preloaded. 21332 alm.AjaxLoadMore.setLocalizedVar('page', parseInt(page)); 21333 var pages = Math.ceil(alm.totalposts / alm.orginal_posts_per_page); 21334 alm.AjaxLoadMore.setLocalizedVar('pages', parseInt(pages)); 21335 } 21336 21337 // Total Posts `total_posts`. 21338 // Only update if !preloaded && !nextpage && !woocommerce 21339 if (addons.preloaded !== 'true' && !addons.nextpage && !addons.woocommerce) { 21340 alm.AjaxLoadMore.setLocalizedVar('total_posts', alm.totalposts); 21341 } 21342 21343 // Viewing count. 21344 alm.AjaxLoadMore.setLocalizedVar('post_count', getPostCount(alm)); 21345 21346 // Set Results Text (if required). 21347 almResultsText(alm, type); 21348 resolve(true); 21349 }); 21350} 21351 21352/** 21353 * Get total post_count. 21354 * 21355 * @param {Object} alm ALM object. 21356 * @return {number} Total post count. 21357 */ 21358function getPostCount(alm) { 21359 var postcount = alm.postcount, 21360 addons = alm.addons, 21361 start_page = alm.start_page; 21362 var preloaded_amount = addons.preloaded_amount; 21363 21364 // Construct post count. 21365 var count = parseInt(postcount) + parseInt(preloaded_amount); 21366 count = start_page > 1 ? count - parseInt(preloaded_amount) : count; // SEO 21367 count = addons.filters_startpage > 1 ? count - parseInt(preloaded_amount) : count; // Filters 21368 count = addons.single_post ? count + 1 : count; // Single Posts 21369 count = addons.nextpage ? count + 1 : count; // Next Page 21370 21371 return count; 21372} 21373// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js 21374var injectStylesIntoStyleTag = __webpack_require__(5072); 21375var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag); 21376// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js 21377var styleDomAPI = __webpack_require__(7825); 21378var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI); 21379// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js 21380var insertBySelector = __webpack_require__(7659); 21381var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector); 21382// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js 21383var setAttributesWithoutAttributes = __webpack_require__(5056); 21384var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes); 21385// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js 21386var insertStyleElement = __webpack_require__(540); 21387var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement); 21388// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js 21389var styleTagTransform = __webpack_require__(1113); 21390var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform); 21391// EXTERNAL MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??ruleSet[1].rules[2].use[1]!./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./src/frontend/scss/ajax-load-more.scss 21392var ajax_load_more = __webpack_require__(7435); 21393var ajax_load_more_default = /*#__PURE__*/__webpack_require__.n(ajax_load_more); 21394;// ./src/frontend/scss/ajax-load-more.scss 21395 21396 21397 21398 21399 21400 21401 21402 21403 21404 21405 21406var options = {}; 21407 21408options.styleTagTransform = (styleTagTransform_default()); 21409options.setAttributes = (setAttributesWithoutAttributes_default()); 21410 21411 options.insert = insertBySelector_default().bind(null, "head"); 21412 21413options.domAPI = (styleDomAPI_default()); 21414options.insertStyleElement = (insertStyleElement_default()); 21415 21416var update = injectStylesIntoStyleTag_default()((ajax_load_more_default()), options); 21417 21418 21419 21420 21421 /* harmony default export */ var scss_ajax_load_more = ((ajax_load_more_default()) && (ajax_load_more_default()).locals ? (ajax_load_more_default()).locals : undefined); 21422 21423;// ./src/frontend/js/ajax-load-more.js 21424function ajax_load_more_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return ajax_load_more_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf;
vendor: 4,157 bytes, lines 21424-21496
21424 var c = [][n] ? t(t([][n]())) : (ajax_load_more_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, ajax_load_more_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, ajax_load_more_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), ajax_load_more_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", ajax_load_more_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), ajax_load_more_regeneratorDefine2(u), ajax_load_more_regeneratorDefine2(u, o, "Generator"), ajax_load_more_regeneratorDefine2(u, n, function () { return this; }), ajax_load_more_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (ajax_load_more_regenerator = function _regenerator() { return { w: i, m: f }; })(); } 21425function ajax_load_more_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } ajax_load_more_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { ajax_load_more_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, ajax_load_more_regeneratorDefine2(e, r, n, t); } 21426function ajax_load_more_toConsumableArray(r) { return ajax_load_more_arrayWithoutHoles(r) || ajax_load_more_iterableToArray(r) || ajax_load_more_unsupportedIterableToArray(r) || ajax_load_more_nonIterableSpread(); } 21427function ajax_load_more_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 21428function ajax_load_more_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return ajax_load_more_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ajax_load_more_arrayLikeToArray(r, a) : void 0; } } 21429function ajax_load_more_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } 21430function ajax_load_more_arrayWithoutHoles(r) { if (Array.isArray(r)) return ajax_load_more_arrayLikeToArray(r); } 21431function ajax_load_more_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 21432function ajax_load_more_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } 21433function ajax_load_more_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ajax_load_more_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ajax_load_more_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } 21434// ALM Modules 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477// External packages. 21478var qs = __webpack_require__(5373); 21479var ajax_load_more_imagesLoaded = __webpack_require__(7943); 21480 21481// Axios Config. 21482lib_axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 21483lib_axios.interceptors.request.use(function (config) { 21484 // Axios Interceptor for nested data objects 21485 config.paramsSerializer = function (params) { 21486 // Qs is already included in the Axios package 21487 return qs.stringify(params, { 21488 arrayFormat: 'brackets', 21489 encode: false 21490 }); 21491 }; 21492 return config; 21493}); 21494 21495// Global filtering state. 21496var alm_is_filtering = false;
21497var isBlockEditor = document.body.classList.contains('wp-admin'); 21498 21499// Start ALM 21500(function () { 21501 'use strict'; 21502 21503 /** 21504 * Initiate Ajax Load More. 21505 * 21506 * @param {Element} el The Ajax Load More DOM element/container. 21507 * @param {number} index The current index number of the Ajax Load More instance. 21508 */ 21509 var ajaxloadmore = /*#__PURE__*/function () { 21510 var _ref = ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee11(el, index) { 21511 var _el$dataset, _alm, _alm2, _alm3, _alm4, _alm5, _alm6, _alm_localize, _alm7, _alm8, _alm9, _alm0, _alm1, _alm10, _alm11, _alm12, _alm13, _alm14, _alm15, _alm16, _alm_localize2, _alm17, _alm18, _alm19, _alm20, _alm21, _alm22, _alm_localize7; 21512 var alm, almChildren, almChildArray, btnWrap, alm_no_results, _alm23, buildPagination, resize; 21513 return ajax_load_more_regenerator().w(function (_context11) { 21514 while (1) switch (_context11.n) { 21515 case 0: 21516 buildPagination = function _buildPagination(alm, data) { 21517 if (alm.addons.paging && alm.addons.nextpage && typeof almBuildPagination === 'function') { 21518 window.almBuildPagination(data.totalpages, alm); 21519 alm.totalpages = data.totalpages; 21520 } else { 21521 if (alm.addons.paging && typeof almBuildPagination === 'function') { 21522 window.almBuildPagination(data.totalposts, alm); 21523 } 21524 } 21525 }; 21526 // Set ALM Variables 21527 alm = this; 21528 alm.AjaxLoadMore = {}; 21529 alm.addons = {}; 21530 alm.extensions = {}; 21531 alm.integration = {}; 21532 alm.window = window; 21533 alm.page = 0; 21534 alm.postcount = 0; 21535 alm.totalposts = 0; 21536 alm.proceed = false; 21537 alm.disable_ajax = false; 21538 alm.init = true; 21539 alm.loading = true; 21540 alm.finished = false; 21541 alm.timer = null; 21542 alm.rel = 'next'; 21543 alm.defaults = {}; 21544 alm.ua = window.navigator.userAgent ? window.navigator.userAgent : ''; // Browser User Agent 21545 alm.vendor = window.navigator.vendor ? window.navigator.vendor : ''; // Browser Vendor 21546 21547 el.classList.add('alm-' + index); // Add unique classname. 21548 el.setAttribute('data-alm-id', index); // Add unique data id. 21549 21550 // The defined or generated ID for the ALM instance. 21551 alm.master_id = el.dataset.id ? "ajax_load_more_".concat(el.dataset.id) : el.id; 21552 alm.master_id = alm.master_id.replace(/-/g, '_'); 21553 21554 // Localized <script/> variables. 21555 alm.localized_var = "".concat(alm.master_id, "_vars"); 21556 alm.localize = window[alm.localized_var]; 21557 if (!alm.localize) { 21558 window[alm.localized_var] = {}; // Create empty object if not defined. 21559 alm.localize = window[alm.localized_var]; 21560 } 21561 21562 // Add ALM object to the global window scope. 21563 window[alm.master_id] = alm; // e.g. window.ajax_load_more or window.ajax_load_more_{id} 21564 21565 // ALM Element Containers 21566 alm.main = el; // Top level DOM element 21567 alm.listing = el.querySelector('.alm-listing') || el.querySelector('.alm-comments'); 21568 alm.content = alm.listing; 21569 alm.ajax = el.querySelector('.alm-ajax'); 21570 alm.container_type = alm.listing.dataset.containerType; 21571 alm.loading_style = alm.listing.dataset.loadingStyle; 21572 21573 // Prefetch Params 21574 alm.prefetch = alm.listing.dataset.prefetch === 'true' ? true : false; 21575 alm.is_prefetching = false; 21576 alm.prefetched_data = false; 21577 21578 // Instance Params 21579 alm.canonical_url = el.dataset.canonicalUrl; 21580 alm.nested = el.dataset.nested ? el.dataset.nested : false; 21581 alm.is_search = (el === null || el === void 0 || (_el$dataset = el.dataset) === null || _el$dataset === void 0 ? void 0 : _el$dataset.search) === 'true' ? 'true' : false; 21582 alm.search_value = alm.is_search === 'true' ? alm.slug : ''; // Convert to value of slug for appending to seo url. 21583 alm.slug = el.dataset.slug; 21584 alm.post_id = parseInt(el.dataset.postId); 21585 alm.id = el.dataset.id ? el.dataset.id : ''; 21586 21587 // Shortcode Params 21588 alm.repeater = ((_alm = alm) === null || _alm === void 0 || (_alm = _alm.listing) === null || _alm === void 0 || (_alm = _alm.dataset) === null || _alm === void 0 ? void 0 : _alm.repeater) || 'default'; 21589 alm.theme_repeater = ((_alm2 = alm) === null || _alm2 === void 0 || (_alm2 = _alm2.listing) === null || _alm2 === void 0 || (_alm2 = _alm2.dataset) === null || _alm2 === void 0 ? void 0 : _alm2.themeRepeater) || false; 21590 alm.post_type = ((_alm3 = alm) === null || _alm3 === void 0 || (_alm3 = _alm3.listing) === null || _alm3 === void 0 || (_alm3 = _alm3.dataset) === null || _alm3 === void 0 ? void 0 : _alm3.postType) || 'post'; 21591 alm.sticky_posts = ((_alm4 = alm) === null || _alm4 === void 0 || (_alm4 = _alm4.listing) === null || _alm4 === void 0 || (_alm4 = _alm4.dataset) === null || _alm4 === void 0 ? void 0 : _alm4.stickyPosts) || false; 21592 alm.btnWrap = el.querySelectorAll('.alm-btn-wrap'); // Get all `.alm-button-wrap` divs 21593 alm.btnWrap = ajax_load_more_toConsumableArray(alm.btnWrap); // Convert NodeList to array 21594 alm.btnWrap[alm.btnWrap.length - 1].style.visibility = 'visible'; // Get last element (used for nesting) 21595 alm.trigger = alm.btnWrap[alm.btnWrap.length - 1]; 21596 alm.button = ((_alm5 = alm) === null || _alm5 === void 0 || (_alm5 = _alm5.trigger) === null || _alm5 === void 0 ? void 0 : _alm5.querySelector('button.alm-load-more-btn')) || null; 21597 21598 // Button Labels. 21599 alm.button_labels = { 21600 "default": purify.sanitize((_alm6 = alm) === null || _alm6 === void 0 || (_alm6 = _alm6.listing) === null || _alm6 === void 0 || (_alm6 = _alm6.dataset) === null || _alm6 === void 0 ? void 0 : _alm6.buttonLabel) || purify.sanitize((_alm_localize = alm_localize) === null || _alm_localize === void 0 ? void 0 : _alm_localize.button_label), 21601 done: purify.sanitize((_alm7 = alm) === null || _alm7 === void 0 || (_alm7 = _alm7.listing) === null || _alm7 === void 0 || (_alm7 = _alm7.dataset) === null || _alm7 === void 0 ? void 0 : _alm7.buttonDoneLabel) || null 21602 }; 21603 alm.prev_button_labels = { 21604 "default": purify.sanitize((_alm8 = alm) === null || _alm8 === void 0 || (_alm8 = _alm8.listing) === null || _alm8 === void 0 || (_alm8 = _alm8.dataset) === null || _alm8 === void 0 ? void 0 : _alm8.prevButtonLabel), 21605 done: purify.sanitize((_alm9 = alm) === null || _alm9 === void 0 || (_alm9 = _alm9.listing) === null || _alm9 === void 0 || (_alm9 = _alm9.dataset) === null || _alm9 === void 0 ? void 0 : _alm9.prevButtonDoneLabel) || null 21606 }; 21607 alm.urls = ((_alm0 = alm) === null || _alm0 === void 0 || (_alm0 = _alm0.listing) === null || _alm0 === void 0 || (_alm0 = _alm0.dataset) === null || _alm0 === void 0 ? void 0 : _alm0.urls) === 'false' ? false : true; 21608 alm.placeholder = alm.main.querySelector('.alm-placeholder') || false; 21609 alm.scroll_distance = ((_alm1 = alm) === null || _alm1 === void 0 || (_alm1 = _alm1.listing) === null || _alm1 === void 0 ? void 0 : _alm1.dataset.scrollDistance) || 100; 21610 alm.scroll_container = ((_alm10 = alm) === null || _alm10 === void 0 || (_alm10 = _alm10.listing) === null || _alm10 === void 0 ? void 0 : _alm10.dataset.scrollC
21610ontainer) || null; 21611 alm.scroll_direction = ((_alm11 = alm) === null || _alm11 === void 0 || (_alm11 = _alm11.listing) === null || _alm11 === void 0 || (_alm11 = _alm11.dataset) === null || _alm11 === void 0 ? void 0 : _alm11.scrollDirection) || 'vertical'; 21612 alm.max_pages = (_alm12 = alm) !== null && _alm12 !== void 0 && (_alm12 = _alm12.listing) !== null && _alm12 !== void 0 && (_alm12 = _alm12.dataset) !== null && _alm12 !== void 0 && _alm12.maxPages ? parseInt(alm.listing.dataset.maxPages) : 0; 21613 alm.pause_override = ((_alm13 = alm) === null || _alm13 === void 0 || (_alm13 = _alm13.listing) === null || _alm13 === void 0 || (_alm13 = _alm13.dataset) === null || _alm13 === void 0 ? void 0 : _alm13.pauseOverride) || false; // true | false 21614 alm.pause = ((_alm14 = alm) === null || _alm14 === void 0 || (_alm14 = _alm14.listing) === null || _alm14 === void 0 || (_alm14 = _alm14.dataset) === null || _alm14 === void 0 ? void 0 : _alm14.pause) || false; // true | false 21615 alm.transition = ((_alm15 = alm) === null || _alm15 === void 0 || (_alm15 = _alm15.listing) === null || _alm15 === void 0 || (_alm15 = _alm15.dataset) === null || _alm15 === void 0 ? void 0 : _alm15.transition) || 'fade'; // Transition 21616 alm.transition_delay = ((_alm16 = alm) === null || _alm16 === void 0 || (_alm16 = _alm16.listing) === null || _alm16 === void 0 || (_alm16 = _alm16.dataset) === null || _alm16 === void 0 ? void 0 : _alm16.transitionDelay) || 0; 21617 alm.speed = (_alm_localize2 = alm_localize) !== null && _alm_localize2 !== void 0 && _alm_localize2.speed ? parseInt(alm_localize.speed) : 250; 21618 alm.images_loaded = ((_alm17 = alm) === null || _alm17 === void 0 || (_alm17 = _alm17.listing) === null || _alm17 === void 0 || (_alm17 = _alm17.dataset) === null || _alm17 === void 0 ? void 0 : _alm17.imagesLoaded) === 'true'; 21619 alm.destroy_after = (_alm18 = alm) !== null && _alm18 !== void 0 && (_alm18 = _alm18.listing) !== null && _alm18 !== void 0 && (_alm18 = _alm18.dataset) !== null && _alm18 !== void 0 && _alm18.destroyAfter ? parseInt(alm.listing.dataset.destroyAfter) : false; 21620 alm.lazy_images = ((_alm19 = alm) === null || _alm19 === void 0 || (_alm19 = _alm19.listing.dataset) === null || _alm19 === void 0 ? void 0 : _alm19.lazyImages) === 'true' ? true : false; 21621 alm.integration.woocommerce = ((_alm20 = alm) === null || _alm20 === void 0 || (_alm20 = _alm20.listing) === null || _alm20 === void 0 || (_alm20 = _alm20.dataset) === null || _alm20 === void 0 ? void 0 : _alm20.woocommerce) === 'true' ? true : false; 21622 alm.scroll = ((_alm21 = alm) === null || _alm21 === void 0 || (_alm21 = _alm21.listing) === null || _alm21 === void 0 || (_alm21 = _alm21.dataset) === null || _alm21 === void 0 ? void 0 : _alm21.scroll) === 'false' ? false : true; 21623 alm.orginal_posts_per_page = parseInt(alm.listing.dataset.postsPerPage); // Used for paging add-on 21624 alm.posts_per_page = parseInt(alm.listing.dataset.postsPerPage); 21625 alm.offset = (_alm22 = alm) !== null && _alm22 !== void 0 && (_alm22 = _alm22.listing) !== null && _alm22 !== void 0 && (_alm22 = _alm22.dataset) !== null && _alm22 !== void 0 && _alm22.offset ? parseInt(alm.listing.dataset.offset) : 0; 21626 alm.paged = false; 21627 21628 // Add-on Params 21629 alm = queryLoopCreateParams(alm); // Query Loop add-on 21630 alm = elementorCreateParams(alm); // Elementor add-on 21631 alm = wooCreateParams(alm); // WooCommerce add-on 21632 alm = cacheCreateParams(alm); // Cache add-on 21633 alm = ctaCreateParams(alm); // CTA add-on 21634 alm = nextpageCreateParams(alm); // Nextpage add-on 21635 alm = singlepostsCreateParams(alm); // Single Posts add-on 21636 alm = commentsCreateParams(alm); // Comments add-on 21637 alm = preloadedCreateParams(alm); // Preloaded add-on. 21638 alm = pagingCreateParams(alm); // Paging add-on. 21639 alm = filtersCreateParams(alm); // Filters add-on. 21640 alm = seoCreateParams(alm); // SEO add-on. 21641 21642 // Extension Params 21643 alm = usersParams(alm); // Users 21644 alm = restapiParams(alm); // REST API 21645 alm = acfParams(alm); // ACF 21646 alm = termsParams(alm); // Terms 21647 21648 /* Pause */ 21649 if (alm.pause === undefined || alm.addons.seo && alm.start_page > 1) { 21650 alm.pause = false; // SEO only. 21651 } 21652 if (alm.addons.preloaded && alm.addons.seo && alm.start_page > 0) { 21653 alm.pause = false; // SEO + Preloaded. 21654 } 21655 if (alm.addons.filters && alm.addons.filters_startpage > 0) { 21656 alm.pause = false; // Filters. 21657 } 21658 if (alm.addons.preloaded && alm.addons.paging) { 21659 alm.pause = true; 21660 } 21661 21662 /* Max Pages */ 21663 alm.max_pages = alm.max_pages === undefined || alm.max_pages === 0 ? 9999 : alm.max_pages; 21664 21665 /* Scroll Distance */ 21666 alm.scroll_distance = alm.scroll_distance === undefined ? 100 : alm.scroll_distance; 21667 alm.scroll_distance_perc = false;
21668 if (alm.scroll_distance.toString().indexOf('%') === -1) { 21669 // Standard scroll_distance 21670 alm.scroll_distance = parseInt(alm.scroll_distance); 21671 } else { 21672 // Percentage scroll_distance 21673 alm.scroll_distance_perc = true; 21674 alm.scroll_distance_orig = parseInt(alm.scroll_distance); 21675 alm.scroll_distance = getScrollPercentage(alm); 21676 } 21677 21678 /* Masonry */ 21679 if (alm.transition === 'masonry') { 21680 alm = almMasonryConfig(alm); 21681 } 21682 21683 /* Paging */ 21684 if (alm.addons.paging) { 21685 // Add loading class to main container. 21686 alm.main.classList.add('alm-loading'); 21687 } else { 21688 almChildren = el.childNodes; // Get child nodes of instance [nodeList] 21689 if (almChildren) { 21690 almChildArray = ajax_load_more_toConsumableArray(almChildren); // Convert nodeList to array 21691 // Filter array to find the `.alm-btn-wrap` div 21692 btnWrap = almChildArray.filter(function (element) { 21693 if (!element.classList) { 21694 // If not element (#text node) 21695 return false; 21696 } 21697 return element.classList.contains('alm-btn-wrap'); 21698 }); 21699 alm.button = btnWrap ? btnWrap[0].querySelector('.alm-load-more-btn') : container.querySelector('.alm-btn-wrap .alm-load-more-btn'); 21700 } else { 21701 alm.button = container.querySelector('.alm-btn-wrap .alm-load-more-btn'); 21702 } 21703 21704 // Reset button state 21705 alm.button.disabled = false; 21706 alm.button.style.display = ''; 21707 } 21708 21709 /** 21710 * No Results. 21711 * Set template for showing no results HTML. 21712 */ 21713 alm_no_results = el.querySelector('.alm-no-results'); 21714 alm.no_results = alm_no_results ? alm_no_results.innerHTML : ''; 21715 21716 /** 21717 * Results Text. 21718 * Render "Showing x of y results" text. 21719 */ 21720 if (alm.integration.woocommerce) { 21721 // If woocommerce, get the default woocommerce results block 21722 alm.resultsText = document.querySelectorAll('.woocommerce-result-count'); 21723 if (((_alm23 = alm) === null || _alm23 === void 0 || (_alm23 = _alm23.resultsText) === null || _alm23 === void 0 ? void 0 : _alm23.length) < 1) { 21724 alm.resultsText = document.querySelectorAll('.alm-results-text'); 21725 } 21726 } else { 21727 alm.resultsText = document.querySelectorAll('.alm-results-text'); 21728 } 21729 if (alm.resultsText) { 21730 alm.resultsText.forEach(function (results) { 21731 results.setAttribute('aria-live', 'polite'); 21732 results.setAttribute('aria-atomic', 'true'); 21733 }); 21734 } else { 21735 alm.resultsText = false; 21736 } 21737 21738 // Table of Contents: Render 1, 2, 3 etc. when pages are loaded 21739 alm.tableofcontents = document.querySelector('.alm-toc') || false; 21740 if (alm.tableofcontents) { 21741 alm.tableofcontents.setAttribute('aria-live', 'polite'); 21742 alm.tableofcontents.setAttribute('aria-atomic', 'true'); 21743 } 21744 21745 /** 21746 * The function to get posts via Ajax/HTTP request. 21747 * 21748 * @since 2.0.0 21749 */ 21750 alm.AjaxLoadMore.loadPosts = function () { 21751 if (alm.disable_ajax) { 21752 return; 21753 } 21754 if (typeof almOnChange === 'function') { 21755 window.almOnChange(alm); 21756 } 21757 21758 // Set loading attributes. 21759 alm.loading = true; 21760 alm.main.classList.add('alm-loading'); 21761 placeholder('show', alm); 21762 21763 // Add loading styles to buttons. 21764 if (!alm.addons.paging) { 21765 if (alm.rel === 'prev') { 21766 alm.buttonPrev.classList.add('loading'); 21767 } else { 21768 alm.button.classList.add('loading'); 21769 } 21770 } 21771 21772 // Data is prefetched. 21773 if (alm.prefetched_data && alm.rel === 'next') { 21774 alm.loading = true; 21775 alm.AjaxLoadMore.render(alm.prefetched_data); 21776 alm.prefetched_data = false;
21777 return; 21778 } 21779 21780 // Dispatch Ajax request. 21781 alm.AjaxLoadMore.ajax(); 21782 }; 21783 21784 /** 21785 * Dispatch HTTP request. 21786 * 21787 * @param {string} type The type of Ajax request [standard|totalposts|totalpages]. 21788 * @since 2.6.0 21789 */ 21790 alm.AjaxLoadMore.ajax = /*#__PURE__*/ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee() { 21791 var _alm24; 21792 var type, 21793 is_restapi, 21794 params, 21795 cache, 21796 _args = arguments; 21797 return ajax_load_more_regenerator().w(function (_context) { 21798 while (1) switch (_context.n) { 21799 case 0: 21800 type = _args.length > 0 && _args[0] !== undefined ? _args[0] : 'standard'; 21801 is_restapi = alm.extensions.restapi ? true : false; 21802 params = is_restapi ? getRestParams(alm) : getAjaxParams(alm, type); // Cache. 21803 if (!((_alm24 = alm) !== null && _alm24 !== void 0 && (_alm24 = _alm24.addons) !== null && _alm24 !== void 0 && _alm24.cache)) { 21804 _context.n = 2; 21805 break; 21806 } 21807 _context.n = 1; 21808 return getCache(alm, Object.assign({}, params)); 21809 case 1: 21810 cache = _context.v; 21811 if (cache) { 21812 // Render cache results. 21813 alm.AjaxLoadMore.render(cache, type); 21814 } else { 21815 if (is_restapi) { 21816 // REST API request. 21817 alm.AjaxLoadMore.restapi(params); 21818 } else { 21819 // Standard admin-ajax.php request. 21820 alm.AjaxLoadMore.adminajax(params, type); 21821 } 21822 } 21823 _context.n = 3; 21824 break; 21825 case 2: 21826 if (is_restapi) { 21827 // REST API request. 21828 alm.AjaxLoadMore.restapi(params); 21829 } else { 21830 // Standard admin-ajax.php request. 21831 alm.AjaxLoadMore.adminajax(params, type); 21832 } 21833 case 3: 21834 return _context.a(2); 21835 } 21836 }, _callee); 21837 })); 21838 21839 /** 21840 * Send request to the admin-ajax.php 21841 * 21842 * @param {Object} params Query params. 21843 * @param {string} type The type of Ajax request [standard|totalposts|totalpages]. 21844 * @since 5.0.0 21845 */ 21846 alm.AjaxLoadMore.adminajax = /*#__PURE__*/function () { 21847 var _ref3 = ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee2(params, type) { 21848 var _alm_localize3, url, _alm_localize4, _alm_localize4$nextpa, nextpage_endpoint, _params, _params$cache_id, cache_id, is_paging_query, data; 21849 return ajax_load_more_regenerator().w(function (_context2) { 21850 while (1) switch (_context2.n) { 21851 case 0: 21852 _alm_localize3 = alm_localize, url = _alm_localize3.ajaxurl; // Get Ajax URL 21853 /** 21854 * Single Posts. 21855 * If `single_post_target`, adjust the Ajax URL to the post URL. 21856 */ 21857 if (alm.addons.single_post && alm.addons.single_post_target) { 21858 url = "".concat(alm.addons.single_post_permalink, "?id=").concat(alm.addons.single_post_id, "&alm_page=").concat(parseInt(alm.page) + 1); 21859 params = ''; 21860 } 21861 21862 // Query Loop || WooCommerce || Elementor. 21863 if (alm.addons.queryloop || alm.addons.woocommerce || alm.addons.elementor && alm.addons.elementor_type === 'posts') { 21864 url = getButtonURL(alm, alm.rel); 21865 params = ''; 21866 } 21867 if (!alm.addons.nextpage) { 21868 _context2.n = 2; 21869 break; 21870 } 21871 _alm_localize4 = alm_localize, _alm_localize4$nextpa = _alm_localize4.nextpage_endpoint, nextpage_endpoint = _alm_localize4$nextpa === void 0 ? '' : _alm_localize4$nextpa; // Pluck Next Page API URL. 21872 if (nextpage_endpoint) { 21873 _context2.n = 1; 21874 break; 21875 } 21876 console.warn('Ajax Load More: Next Page endpoint is not defined.'); 21877 return _context2.a(2); 21878 case 1: 21879 url = nextpage_endpoint; 21880 case 2: 21881 _params = params, _params$cache_id = _params.cache_id, cache_id = _params$cache_id === void 0 ? '' : _params$cache_id; // Deconstruct query params. 21882 is_paging_query = ['totalposts', 'totalpages'].includes(type); // Make API request. 21883 _context2.n = 3; 21884 return lib_axios.get(url, { 21885 params: params 21886 }).then(function (response) { 21887 var _response$data = response.data, 21888 data = _response$data === void 0 ? API_DEFAULT_DATA_SHAPE : _response$data; 21889 if (alm.addons.single_post && alm.addons.single_post_target) { 21890 return singlepostsHTML(alm, data); // Single Posts 21891 } else if (alm.addons.woocommerce) { 21892 return wooGetContent(alm, url, data); // WooCommerce. 21893 } else if (alm.addons.elementor) { 21894 return elementorGetContent(alm, url, data); // Elementor 21895 } else if (alm.addons.queryloop) { 21896 return queryLoopGetContent(alm, url, data); // Query Loop 21897 } 21898 return data; // Standard ALM. 21899 })["catch"](function (error) { 21900 alm.AjaxLoadMore.error(error); 21901 }); 21902 case 3: 21903 data = _context2.v; 21904 // Cache. 21905 createCache(alm, data, cache_id, is_paging_query
21905); 21906 alm.AjaxLoadMore.render(data, type); // Render results. 21907 case 4: 21908 return _context2.a(2); 21909 } 21910 }, _callee2); 21911 })); 21912 return function (_x3, _x4) { 21913 return _ref3.apply(this, arguments); 21914 }; 21915 }(); 21916 21917 /** 21918 * Display/render results function. 21919 * 21920 * @param {Object} data The results of the Ajax request. 21921 * @param {string} type The type of Ajax request [standard|totalposts|totalpages]. 21922 * @since 2.6.0 21923 */ 21924 alm.AjaxLoadMore.render = /*#__PURE__*/function () { 21925 var _ref4 = ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee8(data) { 21926 var _alm29; 21927 var type, 21928 html, 21929 meta, 21930 total, 21931 totalposts, 21932 nodes, 21933 temp, 21934 paging_container, 21935 currentPage, 21936 _args8 = arguments, 21937 _t; 21938 return ajax_load_more_regenerator().w(function (_context8) { 21939 while (1) switch (_context8.n) { 21940 case 0: 21941 type = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : 'standard'; 21942 if (!alm.is_prefetching) { 21943 _context8.n = 1; 21944 break; 21945 } 21946 alm.prefetched_data = data; 21947 alm.is_prefetching = false; 21948 return _context8.a(2); 21949 case 1: 21950 if (!['totalposts', 'totalpages'].includes(type)) { 21951 _context8.n = 2; 21952 break; 21953 } 21954 buildPagination(alm, data); 21955 return _context8.a(2); 21956 case 2: 21957 if (alm.addons.single_post) { 21958 alm.AjaxLoadMore.getSinglePost(); // Fetch the next post for the Single Post add-on. 21959 } 21960 21961 // Deconstruct render data. 21962 html = data.html, meta = data.meta; 21963 total = meta ? parseInt(meta.postcount) : parseInt(alm.posts_per_page); // Get current post counts. 21964 totalposts = typeof meta !== 'undefined' ? meta.totalposts : alm.posts_per_page * 5; 21965 alm.totalposts = totalposts; 21966 alm.postcount = alm.addons.paging ? total : alm.postcount + total; 21967 21968 // Set alm.html as plain text return. 21969 alm.html = html; 21970 if (!meta) { 21971 // Missing `meta` object in response. 21972 console.warn('Ajax Load More: Unable to access `meta` object in Ajax response.'); 21973 } 21974 21975 // ALM Init: First run only. 21976 if (alm.init) { 21977 if (meta) { 21978 alm.main.dataset.totalPosts = meta.totalposts ? meta.totalposts : 0; 21979 } 21980 21981 // No Results / ALM Empty. 21982 if (total === 0) { 21983 if (alm.addons.paging && typeof almPagingEmpty === 'function') { 21984 window.almPagingEmpty(alm); 21985 } 21986 if (typeof almEmpty === 'function') { 21987 window.almEmpty(alm); 21988 } 21989 if (alm.no_results) { 21990 noResults(alm.content, alm.no_results); 21991 } 21992 } 21993 21994 // Paging Add-on. 21995 if (alm.addons.paging) { 21996 // Dispatch call to build pagination. 21997 if (typeof almBuildPagination === 'function') { 21998 window.almBuildPagination(totalposts, alm, false); 21999 } 22000 if (total > 0) { 22001 // Reset container opacity. 22002 alm.addons.paging_container.style.opacity = 0; 22003 22004 // Start paging functionaity. 22005 alm.AjaxLoadMore.pagingInit(); 22006 } 22007 } 22008 22009 // SEO Offset. 22010 if (alm.addons.seo && alm.addons.seo_offset && !alm.addons.paging) { 22011 createSEOOffset(alm); 22012 } 22013 22014 /** 22015 * SEO & Filters add-on. 22016 * Handle isPaged results. 22017 */ 22018 if (alm.paged) { 22019 // Reset the posts_per_page value. 22020 if (alm.addons.seo || alm.addons.filters || alm.extensions.users) { 22021 // Reset posts per page value. 22022 alm.posts_per_page = alm.orginal_posts_per_page; 22023 } 22024 22025 // SEO add-on. 22026 if (alm.addons.seo) { 22027 alm.page = alm.start_page ? alm.start_page - 1 : alm.page; // Set new page number. 22028 } 22029 22030 // Filters add-on. 22031 if (alm.addons.filters && alm.addons.filters_startpage > 0) { 22032 alm.page = alm.addons.filters_startpage - 1; // Set new page number. 22033 } 22034 } 22035 22036 // Filters onLoad 22037 if (alm.addons.filters && typeof almFiltersOnload === 'function') { 22038 window.almFiltersOnload(alm); 22039 } 22040 } 22041 // End ALM Init. 22042 22043 /** 22044 * Set Filter Facets. 22045 */ 22046 if (alm.addons.filters && alm.facets && data.facets && typeof almFiltersFacets === 'function') { 22047 window.almFiltersFacets(data.facets); 22048 } 22049 22050 /**
22051 * Display alm_debug results. 22052 */ 22053 almDebug(alm); 22054 22055 /** 22056 * Set localized variables and Results Text. 22057 */ 22058 ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee3() { 22059 return ajax_load_more_regenerator().w(function (_context3) { 22060 while (1) switch (_context3.n) { 22061 case 0: 22062 _context3.n = 1; 22063 return setLocalizedVars(alm); 22064 case 1: 22065 return _context3.a(2); 22066 } 22067 }, _callee3); 22068 }))(); 22069 22070 // Get all returned data as an array of DOM nodes. 22071 nodes = alm.container_type === 'table' ? tableParser(alm.html) : domParser(alm.html); 22072 alm.last_loaded = nodes; 22073 22074 // Render results. 22075 if (!(total > 0)) { 22076 _context8.n = 16; 22077 break; 22078 } 22079 if (!(alm.addons.woocommerce || alm.addons.elementor || alm.addons.queryloop)) { 22080 _context8.n = 3; 22081 break; 22082 } 22083 temp = document.createElement('div'); 22084 temp.innerHTML = html; 22085 ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee4() { 22086 return ajax_load_more_regenerator().w(function (_context4) { 22087 while (1) switch (_context4.n) { 22088 case 0: 22089 if (!alm.addons.woocommerce) { 22090 _context4.n = 2; 22091 break; 22092 } 22093 _context4.n = 1; 22094 return woocommerce(temp, alm); 22095 case 1: 22096 _context4.n = 2; 22097 return woocommerceLoaded(alm); 22098 case 2: 22099 if (!alm.addons.elementor) { 22100 _context4.n = 4; 22101 break; 22102 } 22103 _context4.n = 3; 22104 return elementor(temp, alm); 22105 case 3: 22106 _context4.n = 4; 22107 return elementorLoaded(alm); 22108 case 4: 22109 if (!alm.addons.queryloop) { 22110 _context4.n = 6; 22111 break; 22112 } 22113 _context4.n = 5; 22114 return queryLoop(temp, alm); 22115 case 5: 22116 _context4.n = 6; 22117 return queryLoopLoaded(alm); 22118 case 6: 22119 return _context4.a(2); 22120 } 22121 }, _callee4); 22122 }))()["catch"](function (e) { 22123 if (alm.addons.woocommerce) { 22124 console.warn('Ajax Load More: There was an error loading WooCommerce products.', e); 22125 } 22126 if (alm.addons.elementor) { 22127 console.warn('Ajax Load More: There was an error loading Clementor items.', e); 22128 } 22129 if (alm.addons.queryloop) { 22130 console.warn('Ajax Load More: There was an error loading Query Loop items.', e); 22131 } 22132 }); 22133 alm.init = false; 22134 22135 // Prefetch next batch of data. 22136 if (alm.prefetch && alm.rel === 'next') { 22137 alm.AjaxLoadMore.prefetch(); 22138 } 22139 return _context8.a(2); 22140 case 3: 22141 if (alm.addons.paging) { 22142 _context8.n = 9; 22143 break; 22144 } 22145 /** 22146 * Infinite Scroll Results. 22147 */ 22148 nodes = formatHTML(alm, nodes); 22149 _t = alm.transition; 22150 _context8.n = _t === 'masonry' ? 4 : 6; 22151 break; 22152 case 4: 22153 _context8.n = 5;
22154 return displayResults(alm, nodes); 22155 case 5: 22156 // Wrap almMasonry in anonymous async/await function 22157 ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee5() { 22158 return ajax_load_more_regenerator().w(function (_context5) { 22159 while (1) switch (_context5.n) { 22160 case 0: 22161 _context5.n = 1; 22162 return almMasonry(alm, alm.init, alm_is_filtering); 22163 case 1: 22164 alm.masonry.init = false; 22165 triggerWindowResize(); 22166 22167 // Callback: ALM Complete 22168 if (typeof almComplete === 'function') { 22169 window.almComplete(alm); 22170 } 22171 case 2: 22172 return _context5.a(2); 22173 } 22174 }, _callee5); 22175 }))()["catch"](function () { 22176 console.error('There was an error with ALM Masonry'); //eslint-disable-line no-console 22177 }); 22178 return _context8.a(3, 8); 22179 case 6: 22180 _context8.n = 7; 22181 return displayResults(alm, nodes); 22182 case 7: 22183 return _context8.a(3, 8); 22184 case 8: 22185 // Infinite Scroll -> Images Loaded: Run complete callbacks and checks. 22186 ajax_load_more_imagesLoaded(alm.listing, function () { 22187 alm.AjaxLoadMore.nested(); // Nested ALM. 22188 22189 if (alm_is_filtering && alm.addons.filters) { 22190 if (typeof almFiltersAddonComplete === 'function') { 22191 window.almFiltersAddonComplete(el); // Callback: Filters Add-on Complete 22192 } 22193 } 22194 if (typeof almComplete === 'function' && alm.transition !== 'masonry') { 22195 window.almComplete(alm); // Callback: ALM Complete 22196 } 22197 22198 // Trigger <script /> tags in templates. 22199 modules_insertScript.init(alm.last_loaded); 22200 22201 // ALM Done. 22202 if (!alm.addons.single_post) { 22203 if (alm.addons.nextpage) { 22204 var _alm25, _alm26; 22205 // Nextpage. 22206 if (((_alm25 = alm) === null || _alm25 === void 0 || (_alm25 = _alm25.localize) === null || _alm25 === void 0 ? void 0 : _alm25.post_count) + (alm.addons.nextpage_startpage - 1) >= ((_alm26 = alm) === null || _alm26 === void 0 || (_alm26 = _alm26.localize) === null || _alm26 === void 0 ? void 0 : _alm26.total_posts)) { 22207 alm.AjaxLoadMore.triggerDone(); 22208 } 22209 } else { 22210 var _alm27, _alm28; 22211 if (((_alm27 = alm) === null || _alm27 === void 0 || (_alm27 = _alm27.localize) === null || _alm27 === void 0 ? void 0 : _alm27.post_count) >= ((_alm28 = alm) === null || _alm28 === void 0 || (_alm28 = _alm28.localize) === null || _alm28 === void 0 ? void 0 : _alm28.total_posts)) { 22212 alm.AjaxLoadMore.triggerDone(); 22213 } 22214 } 22215 } 22216 alm_is_filtering = false; 22217 }); 22218 /** 22219 * End: Infinite Scroll Results. 22220 */ 22221 _context8.n = 15; 22222 break; 22223 case 9: 22224 /** 22225 * Paging. 22226 */ 22227 paging_container = alm.addons.paging_container; 22228 if (!alm.init) { 22229 _context8.n = 12; 22230 break; 22231 } 22232 if (!paging_container) { 22233 _context8.n = 11; 22234 break; 22235 } 22236 _context8.n = 10;
22237 return displayPagingResults(alm, nodes); 22238 case 10: 22239 // Inject content. 22240 22241 // Paging -> Images Loaded: Run complete callbacks and checks. 22242 ajax_load_more_imagesLoaded(paging_container, /*#__PURE__*/ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee6() { 22243 return ajax_load_more_regenerator().w(function (_context6) { 22244 while (1) switch (_context6.n) { 22245 case 0: 22246 pagingComplete(alm, alm_is_filtering, true); 22247 alm_is_filtering = false; 22248 case 1: 22249 return _context6.a(2); 22250 } 22251 }, _callee6); 22252 }))); 22253 case 11: 22254 _context8.n = 15; 22255 break; 22256 case 12: 22257 if (!paging_container) { 22258 _context8.n = 15; 22259 break; 22260 } 22261 _context8.n = 13; 22262 return almFadeOut(paging_container, 250); 22263 case 13: 22264 _context8.n = 14; 22265 return displayPagingResults(alm, nodes); 22266 case 14: 22267 // Inject content. 22268 22269 // Paging -> Images Loaded: Run complete callbacks and checks. 22270 ajax_load_more_imagesLoaded(paging_container, /*#__PURE__*/ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee7() { 22271 return ajax_load_more_regenerator().w(function (_context7) { 22272 while (1) switch (_context7.n) { 22273 case 0: 22274 _context7.n = 1; 22275 return almFadeIn(paging_container, 250); 22276 case 1: 22277 paging_container.style.opacity = ''; 22278 pagingComplete(alm, alm_is_filtering); 22279 alm_is_filtering = false; 22280 case 2: 22281 return _context7.a(2); 22282 } 22283 }, _callee7); 22284 }))); 22285 case 15: 22286 _context8.n = 17; 22287 break; 22288 case 16: 22289 /** 22290 * No results from Ajax. 22291 */ 22292 alm.AjaxLoadMore.noresults(); 22293 alm.AjaxLoadMore.transitionEnd(); 22294 case 17: 22295 // Destroy After. 22296 if (alm.destroy_after) { 22297 currentPage = alm.page + 1; // Add 1 because alm.page starts at 0 22298 currentPage = alm.addons.preloaded ? currentPage++ : currentPage; // Add 1 for preloaded 22299 if (parseInt(currentPage) === parseInt(alm.destroy_after)) { 22300 alm.AjaxLoadMore.destroyed(); // Disable ALM if page = alm.destroy_after value. 22301 } 22302 } 22303 22304 // Display Table of Contents. 22305 tableOfContents(alm, alm.init); 22306 22307 // Set Focus for accessibility. 22308 if ((_alm29 = alm) !== null && _alm29 !== void 0 && (_alm29 = _alm29.last_loaded) !== null && _alm29 !== void 0 && _alm29.length) { 22309 setFocus(alm, alm.last_loaded[0], total, alm_is_filtering); 22310 } 22311 22312 // Remove filtering class. 22313 alm.main.classList.remove('alm-is-filtering'); 22314 if (alm.init) { 22315 // Add loaded class to main container. 22316 alm.main.classList.add('alm-is-loaded'); 22317 } 22318 alm.init = false; // Set init flag. 22319 22320 // Prefetch next batch of data. 22321 if (alm.prefetch && alm.rel === 'next' && !alm.addons.paging) { 22322 alm.AjaxLoadMore.prefetch(); 22323 } 22324 case 18: 22325 return _context8.a(2); 22326 } 22327 }, _callee8); 22328 })); 22329 return function (_x5) { 22330 return _ref4.apply(this, arguments); 22331 }; 22332 }(); 22333 22334 /** 22335 * Send request to the WP REST API 22336 * 22337 * @param {Object} params The query parameters object. 22338 * @since 5.0.0 22339 */ 22340 alm.AjaxLoadMore.restapi = function (params) { 22341 var _params$cache_id2 = params.cache_id, 22342 cache_id = _params$cache_id2 === void 0 ? '' : _params$cache_id2; // Deconstruct query params. 22343 22344 var _alm_localize5 = alm_localize, 22345 rest_api_url = _alm_localize5.rest_api_url; // Get Rest API URL 22346 var _alm$extensions = alm.extensions, 22347 restapi_base_url = _alm$extensions.restapi_base_url, 22348 restapi_namespace = _alm$extensions.restapi_namespace, 22349 restapi_endpoint = _alm$extensions.restapi_endpoint, 22350 restapi_template_id = _alm$extensions.restapi_template_id; 22351 var alm_rest_template = wp.template(restapi_template_id); 22352 var alm_rest_url = "".concat(rest_api_url).concat(restapi_base_url, "/").concat(restapi_namespace, "/").concat(restapi_endpoint); 22353 lib_axios.get(alm_rest_url, { 22354 params: params 22355 }).then(function (response) { 22356 // Success 22357 var results = response.data; // Get data from response 22358 var _results$html = results.html, 22359 items = _results$html === void 0 ? null : _results$html, 22360 _results$meta = results.meta, 22361 meta = _results$meta === void 0 ? null : _results$meta; 22362 var postcount = meta && meta.postcount ? meta.postcount : 0; 22363 var totalposts = meta && meta.totalposts ? meta.totalposts : 0; 22364 22365 // loop results to get data from each. 22366 var content = ''; 22367 for (var i = 0; i < items.length; i++) { 22368 var result = items[i]; 22369 content += alm_rest_template(result); 22370 } 22371 22372 // Rest API debug. 22373 if (alm.extensions.restapi_debug === 'true') { 22374 console.log('ALM RestAPI Debug:', items); // eslint-disable-line no-console 22375 } 22376 22377 // Create results data object. 22378 var data = { 22379 html: content, 22380 meta: { 22381 postcount: postcount, 22382 totalposts: totalposts 22383 } 22384 }; 22385 22386 // Cache. 22387 createCache(alm, data, cache_id); 22388 22389 // Show the results. 22390 alm.AjaxLoadMore.render(data); 22391 })["catch"](function (error) { 22392 alm.AjaxLoadMore.error(error); 22393 }); 22394 }; 22395 22396 /** 22397 * Function runs when no results are returned. 22398 * 22399 * @since 5.3.1 22400 */ 22401 alm.AjaxLoadMore.noresults = function () { 22402 if (!alm.addons.paging) { 22403 var _alm30, _alm31; 22404 // Add .done class, reset btn text 22405 (_alm30 = alm) === null || _alm30 === void 0 || (_alm30 = _alm30.button) === null || _alm30 === void 0 || (_alm30 = _alm30.classList) === null || _alm30 === void 0 || _alm30.remove('loading'); 22406 (_alm31 = alm) === null || _alm31 === void 0 || (_alm31 = _alm31.button) === null || _alm31 === void 0 || (_alm31 = _alm31.classList) === null || _alm31 === void 0 || _alm31.add('done'); 22407 alm.AjaxLoadMore.resetBtnText(); 22408 } 22409 22410 // Callback: ALM Complete 22411 if (typeof almComplete === 'function' && alm.transition !== 'masonry') { 22412 window.almComplete(alm); 22413 } 22414 22415 // Filters Add-on Complete 22416 if (alm_is_filtering && alm.addons.filters) { 22417 if (typeof almFiltersAddonComplete === 'function') { 22418 window.almFiltersAddonComplete(el); 22419 } 22420 alm_is_filtering = false;
22421 } 22422 22423 // Masonry, clear `alm-listing` height. 22424 if (alm.transition === 'masonry') { 22425 alm.content.style.height = 'auto'; 22426 } 22427 22428 // ALM Done 22429 alm.AjaxLoadMore.triggerDone(); 22430 }; 22431 22432 /** 22433 * Dispatch almBuildPagination function after Ajax request. 22434 * `almBuildPagination` is defined in the Paging add-on. 22435 * 22436 * @param {Object} alm The Ajax Load More object. 22437 * @param {Object} data The data object from the Ajax response. 22438 */ 22439 22440 /** 22441 * Init Paging + Preloaded add-ons. 22442 * 22443 * @param {string} html Results of Ajax request. 22444 * @since 2.11.3 22445 */ 22446 alm.AjaxLoadMore.pagingPreloadedInit = function () { 22447 var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 22448 alm.AjaxLoadMore.pagingInit(); // Set up paging functionality. 22449 22450 if (!html) { 22451 if (typeof almPagingEmpty === 'function') { 22452 window.almPagingEmpty(alm); 22453 } 22454 if (typeof almEmpty === 'function') { 22455 window.almEmpty(alm); 22456 } 22457 if (alm.no_results) { 22458 noResults(alm.content, alm.no_results); 22459 } 22460 } 22461 }; 22462 22463 /** 22464 * Init Paging + Next Page add-ons. 22465 * 22466 * @since 2.14.0 22467 */ 22468 alm.AjaxLoadMore.pagingNextpageInit = function () { 22469 alm.AjaxLoadMore.pagingInit(); // Set up paging functionality. 22470 22471 if (typeof almSetNextPageVars === 'function') { 22472 window.almSetNextPageVars(alm); // Set up Nextpage Vars. 22473 } 22474 }; 22475 22476 /** 22477 * Paging add-on initialization to create required containers. 22478 * 22479 * @since 5.0 22480 */ 22481 alm.AjaxLoadMore.pagingInit = function () { 22482 var paging_container = alm.addons.paging_container; // Get content container. 22483 22484 if (paging_container) { 22485 almFadeIn(paging_container, 150); // Fade in paging container. 22486 22487 // Delay reveal of paging content. 22488 setTimeout(function () { 22489 alm.main.classList.remove('alm-loading'); // Remove `alm-loading` class 22490 }, 150); 22491 22492 // Delay initial pagination display to avoid positioning issues. 22493 setTimeout(function () { 22494 paging_container.style.removeProperty('opacity'); // Remove initial opacity prop. 22495 22496 if (typeof almFadePageControls === 'function') { 22497 window.almFadePageControls(alm.btnWrap); // Fade in paging controls. 22498 } 22499 if (typeof almPagingSetHeight === 'function') { 22500 window.almPagingSetHeight(paging_container); // Fade in container height. 22501 } 22502 }, 250); 22503 } 22504 }; 22505 22506 /** 22507 * Automatically trigger nested ALM instances. 22508 * 22509 * @since 5.0 22510 */ 22511 alm.AjaxLoadMore.nested = function () { 22512 var nested = alm.listing.querySelectorAll('.ajax-load-more-wrap:not(.alm-is-loaded)'); // Get all new instances 22513 if (nested) { 22514 ajax_load_more_toConsumableArray(nested).forEach(function (element) { 22515 window.almInit(element); 22516 }); 22517 } 22518 }; 22519 22520 /** 22521 * Get the Single Posts post ID via ajax. 22522 * 22523 * @since 2.7.4 22524 */ 22525 alm.AjaxLoadMore.getSinglePost = /*#__PURE__*/ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee9() { 22526 var _alm_localize6, _alm_localize6$single, single_posts_endpoint, data, _ref1, _ref1$has_previous_po, has_previous_post; 22527 return ajax_load_more_regenerator().w(function (_context9) { 22528 while (1) switch (_context9.n) { 22529 case 0: 22530 if (!alm.fetchingPreviousPost) { 22531 _context9.n = 1; 22532 break; 22533 } 22534 return _context9.a(2); 22535 case 1: 22536 alm.fetchingPreviousPost = true; // Set loading flag. 22537 _alm_localize6 = alm_localize, _alm_localize6$single = _alm_localize6.single_posts_endpoint, single_posts_endpoint = _alm_localize6$single === void 0 ? '' : _alm_localize6$single; // Pluck Single Posts API URL. 22538 if (single_posts_endpoint) { 22539 _context9.n = 2; 22540 break; 22541 } 22542 console.warn('Ajax Load More: Single Posts endpoint is not defined.'); 22543 alm.fetchingPreviousPost = false;
22544 return _context9.a(2); 22545 case 2: 22546 _context9.n = 3; 22547 return apiRequest(single_posts_endpoint, singlepostsQueryParams(alm)); 22548 case 3: 22549 data = _context9.v; 22550 _ref1 = data || {}, _ref1$has_previous_po = _ref1.has_previous_post, has_previous_post = _ref1$has_previous_po === void 0 ? false : _ref1$has_previous_po; 22551 if (has_previous_post) { 22552 // Update ALM instance variables. 22553 alm.listing.dataset.singlePostId = data.prev_id; 22554 alm.addons.single_post_id = data.prev_id; 22555 alm.addons.single_post_permalink = data.prev_permalink; 22556 alm.addons.single_post_title = data.prev_title; 22557 alm.addons.single_post_slug = data.prev_slug; 22558 if (typeof window.almSetSinglePost === 'function' && data !== null && data !== void 0 && data.current_id) { 22559 window.almSetSinglePost(alm, data.current_id); 22560 } 22561 } else { 22562 alm.AjaxLoadMore.triggerDone(); // No more posts. 22563 } 22564 alm.fetchingPreviousPost = false; // Set loading flag to false. 22565 alm.addons.single_post_init = false; // Reset init flag. 22566 case 4: 22567 return _context9.a(2); 22568 } 22569 }, _callee9); 22570 })); 22571 22572 // Initialize Single Post add-on variables. 22573 if (alm.addons.single_post_id) { 22574 alm.fetchingPreviousPost = false; 22575 alm.addons.single_post_init = true; 22576 } 22577 22578 /** 22579 * Triggers various add-on functions after load complete. 22580 * 22581 * @param {Object} alm The ALM object. 22582 * @since 2.14.0 22583 */ 22584 alm.AjaxLoadMore.triggerAddons = function (alm) { 22585 if (typeof almSetNextPage === 'function' && alm.addons.nextpage) { 22586 window.almSetNextPage(alm); 22587 } 22588 if (typeof almSEO === 'function' && alm.addons.seo) { 22589 window.almSEO(alm, false); 22590 } 22591 if (typeof almWooCommerce === 'function' && alm.addons.woocommerce) { 22592 window.almWooCommerce(alm); 22593 } 22594 if (typeof almElementor === 'function' && alm.addons.elementor) { 22595 window.almElementor(alm); 22596 } 22597 }; 22598 22599 /** 22600 * Fires a set of actions and functions when ALM has no other posts to load. 22601 * 22602 * @since 2.11.3 22603 */ 22604 alm.AjaxLoadMore.triggerDone = function () { 22605 alm.loading = false; 22606 alm.finished = true; 22607 placeholder('hide', alm); 22608 if (!alm.addons.paging) { 22609 if (alm.button_labels.done) { 22610 alm.button.innerHTML = alm.button_labels.done; 22611 } 22612 alm.button.classList.add('done'); 22613 alm.button.removeAttribute('rel'); 22614 alm.button.disabled = true; 22615 } 22616 if (typeof almDone === 'function') { 22617 setTimeout(function () { 22618 window.almDone(alm); 22619 }, alm.speed + 10); // Delay done until animations complete 22620 } 22621 }; 22622 22623 /** 22624 * Fires a set of actions once ALm Previous hits the first page. 22625 * 22626 * @since 5.5.0 22627 */ 22628 alm.AjaxLoadMore.triggerDonePrev = function () { 22629 alm.loading = false; 22630 placeholder('hide', alm); 22631 if (!alm.addons.paging) { 22632 var _alm32; 22633 alm.buttonPrev.classList.add('done'); 22634 alm.buttonPrev.style.opacity = '0.5'; 22635 alm.buttonPrev.disabled = true; 22636 if ((_alm32 = alm) !== null && _alm32 !== void 0 && (_alm32 = _alm32.prev_button_labels) !== null && _alm32 !== void 0 && _alm32.done) { 22637 setTimeout(function () { 22638 alm.buttonPrev.innerHTML = alm.prev_button_labels.done; 22639 }, 75); 22640 } 22641 } 22642 22643 // almDonePrev Callback. 22644 if (typeof almDonePrev === 'function') { 22645 setTimeout(function () { 22646 window.almDonePrev(alm); 22647 }, alm.speed + 10); // Delay done until animations complete 22648 } 22649 }; 22650 22651 /** 22652 * Resets the loading button text after loading has completed. 22653 * 22654 * @since 2.8.4 22655 */ 22656 alm.AjaxLoadMore.resetBtnText = function () { 22657 var _alm33, _alm34, _alm35, _alm36; 22658 if ((_alm33 = alm) !== null && _alm33 !== void 0 && _alm33.button && (_alm34 = alm) !== null && _alm34
22658!== void 0 && (_alm34 = _alm34.button_labels) !== null && _alm34 !== void 0 && _alm34.loading) { 22659 alm.button.innerHTML = alm.button_labels["default"]; 22660 } 22661 if ((_alm35 = alm) !== null && _alm35 !== void 0 && _alm35.buttonPrev && (_alm36 = alm) !== null && _alm36 !== void 0 && (_alm36 = _alm36.prev_button_labels) !== null && _alm36 !== void 0 && _alm36.loading) { 22662 alm.buttonPrev.innerHTML = alm.prev_button_labels["default"]; 22663 } 22664 }; 22665 22666 /** 22667 * Prefetch posts function to load posts in advance. 22668 */ 22669 alm.AjaxLoadMore.prefetch = /*#__PURE__*/ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee0() { 22670 return ajax_load_more_regenerator().w(function (_context0) { 22671 while (1) switch (_context0.n) { 22672 case 0: 22673 if (!(isBlockEditor && alm.addons.queryloop || alm.is_prefetching)) { 22674 _context0.n = 1; 22675 break; 22676 } 22677 return _context0.a(2); 22678 case 1: 22679 _context0.n = 2; 22680 return timeout(125); 22681 case 2: 22682 if (!alm.finished) { 22683 _context0.n = 3; 22684 break; 22685 } 22686 return _context0.a(2); 22687 case 3: 22688 if (alm.pause !== 'true') { 22689 alm.page++; // Increment page for prefetched data. 22690 } 22691 alm.is_prefetching = true; 22692 alm.AjaxLoadMore.ajax(); 22693 case 4: 22694 return _context0.a(2); 22695 } 22696 }, _callee0); 22697 })); 22698 22699 /** 22700 * Button click handler to load posts. 22701 * 22702 * @since 4.2.0 22703 */ 22704 alm.AjaxLoadMore.click = function () { 22705 if (isBlockEditor && alm.addons.queryloop || alm.is_prefetching) { 22706 return; // Exit if in Block Editor with Query Loop add-on or already prefetching. 22707 } 22708 alm.rel = 'next'; 22709 22710 // Paused. 22711 if (alm.pause === 'true') { 22712 alm.pause = false; 22713 alm.pause_override = false; 22714 alm.AjaxLoadMore.loadPosts(); 22715 alm.button.blur(); 22716 return; 22717 } 22718 22719 // Not loading, not finished, and button not done. 22720 if (!alm.loading && !alm.finished && !alm.button.classList.contains('done')) { 22721 if (!alm.prefetch) { 22722 alm.page++; // Increment page if not prefetched data. 22723 } 22724 alm.AjaxLoadMore.loadPosts(); 22725 alm.button.blur(); 22726 return; 22727 } 22728 alm.button.blur(); // Remove button focus 22729 }; 22730 22731 /** 22732 * Button click handler for previous load more. 22733 * 22734 * @param {Object} e The target button element. 22735 * @since 5.5.0 22736 */ 22737 alm.AjaxLoadMore.prevClick = function (e) { 22738 var button = e.currentTarget || e.target; 22739 e.preventDefault(); 22740 if (!alm.loading && !button.classList.contains('done')) { 22741 alm.loading = true; 22742 alm.pagePrev--; 22743 alm.rel = 'prev'; 22744 alm.AjaxLoadMore.loadPosts(); 22745 button.blur(); // Remove button focus 22746 } 22747 }; 22748 22749 /** 22750 * Set the Load Previous button to alm object. 22751 * 22752 * @param {Element} button The button element. 22753 * @since 5.5.0 22754 */ 22755 alm.AjaxLoadMore.setPreviousButton = function (button) { 22756 alm.pagePrev = alm.page; 22757 alm.buttonPrev = button; 22758 }; 22759 22760 /** 22761 * Load More button click event handler. 22762 * 22763 * @since 1.0.0 22764 */ 22765 if (!alm.addons.paging && !alm.fetchingPreviousPost) { 22766 alm.button.onclick = alm.AjaxLoadMore.click; 22767 } 22768 22769 /** 22770 * Window resize functions for Paging, Scroll Distance Percentage etc. 22771 * 22772 * @since 2.1.2 22773 */ 22774 if (alm.addons.paging || alm.scroll_distance_perc || alm.scroll_direction === 'horizontal') { 22775 alm.window.onresize = function () { 22776 clearTimeout(resize); 22777 resize = setTimeout(function () { 22778 if (alm.addons.paging) { 22779 // Paging 22780 if (typeof almOnWindowResize === 'function') { 22781 window.almOnWindowResize(alm); 22782 } 22783 } 22784 if (alm.scroll_distance_perc) { 22785 alm.scroll_distance = getScrollPercentage(alm); 22786 } 22787 if (alm.scroll_direction === 'horizontal') { 22788 alm.AjaxLoadMore.horizontal(); 22789 } 22790 }, alm.speed); 22791 }; 22792 } 22793 22794 /** 22795 * Check to see if element is visible before loading posts. 22796 * 22797 * @since 2.1.2 22798 */ 22799 alm.AjaxLoadMore.isVisible = function () { 22800 // Check for a width and height to determine visibility 22801 alm.visible = alm.main.clientWidth > 0 && alm.main.clientHeight > 0 ? true : false;
22802 return alm.visible; 22803 }; 22804 22805 /** 22806 * Load posts as user scrolls the page. 22807 * 22808 * @since 1.0 22809 */ 22810 alm.AjaxLoadMore.scroll = function () { 22811 if (alm.timer) { 22812 clearTimeout(alm.timer); 22813 } 22814 alm.timer = setTimeout(function () { 22815 if (alm.AjaxLoadMore.isVisible() && !alm.fetchingPreviousPost) { 22816 var trigger = alm.trigger.getBoundingClientRect(); 22817 var btnPos = Math.round(trigger.top - alm.window.innerHeight) + alm.scroll_distance; 22818 var scrollTrigger = btnPos <= 0 ? true : false; 22819 22820 // Scroll Container 22821 if (alm.window !== window) { 22822 var scrollHeight = alm.main.offsetHeight; // ALM height 22823 var scrollWidth = alm.main.offsetWidth; // ALM Width 22824 var scrollPosition = ''; 22825 if (alm.scroll_direction === 'horizontal') { 22826 // Left/Right 22827 alm.AjaxLoadMore.horizontal(); 22828 scrollPosition = Math.round(alm.window.scrollLeft + alm.window.offsetWidth - alm.scroll_distance); // How far user has scrolled 22829 scrollTrigger = scrollWidth <= scrollPosition ? true : false; 22830 } else { 22831 // Up/Down 22832 scrollPosition = Math.round(alm.window.scrollTop + alm.window.offsetHeight - alm.scroll_distance); // How far user has scrolled 22833 scrollTrigger = scrollHeight <= scrollPosition ? true : false; 22834 } 22835 } 22836 22837 // If Pause && Pause Override 22838 if (!alm.loading && !alm.finished && scrollTrigger && alm.page < alm.max_pages - 1 && alm.proceed && alm.pause === 'true' && alm.pause_override === 'true') { 22839 alm.button.click(); 22840 } 22841 22842 // Standard Scroll 22843 else { 22844 if (!alm.loading && !alm.finished && scrollTrigger && alm.page < alm.max_pages - 1 && alm.proceed && alm.pause !== 'true') { 22845 alm.button.click(); 22846 } 22847 } 22848 } 22849 }, 25); 22850 }; 22851 22852 /** 22853 * Add scroll eventlisteners, only when needed. 22854 * 22855 * @since 5.2.0 22856 */ 22857 alm.AjaxLoadMore.scrollSetup = function () { 22858 if (alm.scroll && !alm.addons.paging) { 22859 if (alm.scroll_container) { 22860 // Scroll Container 22861 alm.window = document.querySelector(alm.scroll_container) ? document.querySelector(alm.scroll_container) : alm.window; 22862 setTimeout(function () { 22863 // Delay to allow for ALM container to resize on load. 22864 alm.AjaxLoadMore.horizontal(); 22865 }, 500); 22866 } 22867 alm.window.addEventListener('scroll', alm.AjaxLoadMore.scroll); // Scroll 22868 alm.window.addEventListener('touchmove', alm.AjaxLoadMore.scroll, { 22869 passive: true 22870 }); // Touch Devices 22871 alm.window.addEventListener('wheel', function (e) { 22872 // Mousewheel 22873 var direction = Math.sign(e.deltaY); 22874 if (direction > 0) { 22875 alm.AjaxLoadMore.scroll(); 22876 } 22877 }); 22878 alm.window.addEventListener('keyup', function (e) { 22879 var key = e.key; 22880 switch (key) { 22881 case 'End': 22882 case 'PageDown': 22883 alm.AjaxLoadMore.scroll(); 22884 break; 22885 } 22886 }); 22887 } 22888 }; 22889 22890 /** 22891 * Configure horizontal scroll settings. 22892 * 22893 * @since 5.3.6 22894 */ 22895 alm.AjaxLoadMore.horizontal = function () { 22896 if (alm.scroll_direction === 'horizontal') { 22897 alm.main.style.width = "".concat(alm.listing.offsetWidth, "px"); 22898 } 22899 }; 22900 22901 /** 22902 * Destroy Ajax Load More functionality. 22903 * 22904 * @since 3.4.2 22905 */ 22906 alm.AjaxLoadMore.destroyed = function () { 22907 alm.disable_ajax = true; 22908 if (!alm.addons.paging) { 22909 alm.button.style.display = 'none'; 22910 alm.AjaxLoadMore.triggerDone(); 22911 if (typeof almDestroyed === 'function') { 22912 window.almDestroyed(alm); 22913 } 22914 } 22915 }; 22916 22917 /** 22918 * Set variables after loading transition completes. 22919 * 22920 * @since 3.5 22921 */ 22922 alm.AjaxLoadMore.transitionEnd = function () { 22923 alm.main.classList.remove('alm-loading'); 22924 alm.AjaxLoadMore.resetBtnText(); 22925 22926 // Loading buttons. 22927 if (alm.rel === 'prev') { 22928 var _alm37; 22929 (_alm37 = alm) === null || _alm37 === void 0 || (_alm37 = _alm37.buttonPrev) === null || _alm37 === void 0 || (_alm37 = _alm37.classList) === null || _alm37 === void 0 || _alm37.remove('loading'); 22930 } else { 22931 var _alm38; 22932 (_alm38 = alm) === null || _alm38 === void 0 || (_alm38 = _alm38.button) === null || _alm38 === void 0 || (_alm38 = _alm38.classList) === null || _alm38 === void 0 || _alm38.remove('loading'); 22933 } 22934 alm.AjaxLoadMore.triggerAddons(alm); 22935 if (!alm.addons.paging) { 22936 alm.loading = false;
22937 } 22938 22939 // Hide loading placeholder. 22940 placeholder('hide', alm); 22941 }; 22942 22943 /** 22944 * Set individual localized variable. 22945 * 22946 * @param {string} name 22947 * @param {string} value 22948 * @since 4.1 22949 */ 22950 alm.AjaxLoadMore.setLocalizedVar = function () { 22951 var _alm39; 22952 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 22953 var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 22954 if ((_alm39 = alm) !== null && _alm39 !== void 0 && _alm39.localize && name !== '' && value !== '') { 22955 alm.localize[name] = value; // Set ALM localize var. 22956 window[alm.localized_var][name] = value; // Update vars. 22957 } 22958 }; 22959 22960 /** 22961 * Init Ajax load More functionality and add-ons. 22962 * 22963 * @since 2.0 22964 */ 22965 alm.AjaxLoadMore.init = /*#__PURE__*/ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee1() { 22966 var nextpage_pages, _alm40, nextpage_first, nextpage_total; 22967 return ajax_load_more_regenerator().w(function (_context1) { 22968 while (1) switch (_context1.n) { 22969 case 0: 22970 // Preloaded and Destroy After is 1. 22971 if (alm.addons.preloaded && alm.destroy_after === 1) { 22972 alm.AjaxLoadMore.destroyed(); 22973 } 22974 22975 // Paging Add-on. 22976 if (alm.addons.paging) { 22977 if (alm.addons.preloaded) { 22978 // Preloaded. 22979 alm.AjaxLoadMore.ajax('totalposts'); 22980 } else if (alm.addons.nextpage) { 22981 // Next Page. 22982 alm.AjaxLoadMore.ajax('totalpages'); 22983 } else { 22984 // Standard. 22985 alm.AjaxLoadMore.loadPosts(); 22986 } 22987 } 22988 22989 // Not Paging & not Single Post. 22990 if (!alm.addons.paging && !alm.addons.single_post) { 22991 if (alm.disable_ajax) { 22992 alm.finished = true; 22993 alm.button.classList.add('done'); 22994 } else { 22995 // Set button label. 22996 alm.button.innerHTML = alm.button_labels["default"]; 22997 22998 // Check pause. 22999 if (alm.pause === 'true') { 23000 alm.loading = false; 23001 } else { 23002 alm.AjaxLoadMore.loadPosts(); 23003 } 23004 } 23005 } 23006 23007 // Single Post Add-on. 23008 if (!alm.addons.single_post) { 23009 _context1.n = 3; 23010 break; 23011 } 23012 _context1.n = 1; 23013 return timeout(100); 23014 case 1: 23015 _context1.n = 2; 23016 return alm.AjaxLoadMore.getSinglePost(); 23017 case 2: 23018 // Set next post on load. 23019 23020 // Trigger done if custom query and no posts to render 23021 if (alm.addons.single_post_query && alm.addons.single_post_order === '') { 23022 alm.AjaxLoadMore.triggerDone(); 23023 } 23024 alm.loading = false; 23025 tableOfContents(alm, true, true); 23026 case 3: 23027 // Query Loop Add-on. 23028 if (alm.addons.queryloop && alm.addons.queryloop_settings) { 23029 queryLoopInit(alm); 23030 } 23031 23032 // Preloaded + SEO && !Paging. 23033 if (!(alm.addons.preloaded && alm.addons.seo && !alm.addons.paging)) { 23034 _context1.n = 5; 23035 break; 23036 } 23037 _context1.n = 4; 23038 return timeout(250); 23039 case 4: 23040 // Add delay for setup and scripts to load. 23041 if (typeof almSEO === 'function' && alm.start_page < 1) { 23042 window.almSEO(alm, true); 23043 } 23044 case 5: 23045 if (!(alm.addons.preloaded && !alm.addons.paging)) { 23046 _context1.n = 7; 23047 break; 23048 } 23049 _context1.n = 6; 23050 return timeout(250); 23051 case 6: 23052 // Add delay for setup and scripts to load. 23053 if (alm.addons.preloaded_total_posts <= alm.addons.preloaded_amount) { 23054 alm.AjaxLoadMore.triggerDone(); 23055 } 23056 // almEmpty callback. 23057 if (alm.addons.preloaded_total_posts === 0) { 23058 if (typeof almEmpty === 'function') { 23059 window.almEmpty(alm); 23060 } 23061 if (alm.no_results) { 23062 noResults(alm.content, alm.no_results); 23063 } 23064 } 23065 case 7: 23066 // Preloaded Add-on ONLY. 23067 if (alm.addons.preloaded) { 23068 if (alm.resultsText) { 23069 almInitResultsText(alm, 'preloaded'); 23070 } 23071 tableOfContents(alm, alm.init, true); 23072 } 23073 23074 // Next Page Add-on. 23075 if (alm.addons.nextpage) { 23076 // Check that posts remain on load 23077 if (alm.listing.querySelector('.alm-nextpage') && !alm.addons.paging) { 23078 nextpage_pages = alm.listing.querySelectorAll('.alm-nextpage'); // All Next Page Items. 23079 if (nextpage_pages) { 23080 nextpage_first = nextpage_pages[0]; 23081 nextpage_total = nextpage_first.dataset.totalPosts ? parseInt(nextpage_first.dataset.totalPosts) : (_alm40 = alm) === null || _alm40 === void 0 || (_alm40 = _alm40.localize) === null || _alm40 === void 0 ? void 0 : _alm40.total_posts; // Disable if last page loaded 23082 if (nextpage_pages.length === nextpage_total || parseInt(nextpage_first.dataset.page) === nextpage_total) { 23083 alm.AjaxLoadMore.triggerDone(); 23084 } 23085 } 23086 } 23087 if (alm.resultsText) { 23088 almInitResultsText(alm, 'nextpage'); 23089 } 23090 tableOfContents(alm, alm.init, true); 23091 } 23092 23093 // WooCommerce Add-on. 23094 if (alm.addons.woocommerce) { 23095 wooInit(alm); 23096 if (alm.addons.woocommerce_settings.paged >= parseInt(alm.addons.woocommerce_settings.pages)) { 23097 alm.AjaxLoadMore.triggerDone(); // Done if `paged is less than `pages`. 23098 } 23099 } 23100 23101 // Elementor Add-on. 23102 if (alm.addons.elementor && alm.addons.elementor_type && alm.addons.elementor_type === 'posts') { 23103 elementorInit(alm); 23104 if (!alm.addons.elementor_next_page) { 23105 alm.AjaxLoadMore.triggerDone(); // Done if `elementor_next_page` is false. 23106 } 23107 } 23108 23109 // Prefetch data if not paging and paused. 23110 if (alm.prefetch && !alm.addons.paging && alm.pause === 'true') { 23111 alm.AjaxLoadMore.prefetch(); 23112 } 23113 setPreloadedParams(alm); // Set preloaded params. 23114 case 8: 23115 return _context1.a(2); 23116 } 23117 }, _callee1); 23118 })); 23119 23120 // DOM Ready Handler. 23121 document.addEventListener('DOMContentLoaded', function () { 23122 if (!alm) { 23123 return; 23124 } 23125 23126 // Masonry & Preloaded. 23127 if (alm.transition === 'masonry' && alm.addons.preloaded) { 23128 // Wrap almMasonry in anonymous async/await function 23129 ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee10() { 23130 return ajax_load_more_regenerator().w(function (_context10) { 23131 while (1) switch (_context10.n) { 23132 case 0: 23133 _context10.n = 1; 23134 return almMasonry(alm, true, false); 23135 case 1: 23136 alm.masonry.init = false;
23137 case 2: 23138 return _context10.a(2); 23139 } 23140 }, _callee10); 23141 }))()["catch"](function () { 23142 console.error('There was an error with ALM Masonry'); 23143 }); 23144 } 23145 23146 // Filters, Facets & Preloaded Facets 23147 if (alm.addons.preloaded && alm.addons.filters && alm.facets) { 23148 if (typeof almFiltersFacets === 'function') { 23149 var _alm41; 23150 var facets = (_alm41 = alm) === null || _alm41 === void 0 || (_alm41 = _alm41.localize) === null || _alm41 === void 0 ? void 0 : _alm41.facets; 23151 if (facets) { 23152 window.almFiltersFacets(facets); 23153 } 23154 } 23155 } 23156 23157 // Window Load Callback. 23158 if (typeof almOnLoad === 'function') { 23159 window.almOnLoad(alm); // eslint-disable-line 23160 } 23161 }); 23162 23163 /** 23164 * Handle API errors by reseting the loading state and button text. 23165 * 23166 * @param {string} error The error message. 23167 * @since 2.6.0 23168 */ 23169 alm.AjaxLoadMore.error = function (error) { 23170 console.error('Ajax Load More: There was an error with the Ajax request.', error); //eslint-disable-line no-console 23171 alm.loading = false; 23172 if (!alm.addons.paging) { 23173 alm.button.classList.remove('loading'); 23174 alm.AjaxLoadMore.resetBtnText(); 23175 } 23176 }; 23177 23178 /** 23179 * Update Current Page. 23180 * Note: Callback function triggered from Paging add-on. 23181 * 23182 * @param {number} current Current page number. 23183 * @param {Object} obj Optional object (Deprecated). 23184 * @param {Object} alm The ALM object. 23185 * @since 2.7.0 23186 */
23187 window.almUpdateCurrentPage = function (current, obj, alm) { 23188 // eslint-disable-line 23189 alm.page = current; 23190 alm.page = alm.addons.nextpage && !alm.addons.paging ? alm.page - 1 : alm.page; // Next Page add-on 23191 23192 var target = alm.listing; 23193 var data = target === null || target === void 0 ? void 0 : target.innerHTML; // Get content 23194 23195 if (alm.addons.paging_init && alm.addons.preloaded) { 23196 // Paging + Preloaded Firstrun. 23197 alm.addons.preloaded_amount = 0; // Reset preloaded_amount param. 23198 alm.AjaxLoadMore.pagingPreloadedInit(data); 23199 alm.addons.paging_init = false; 23200 alm.init = false; 23201 } else if (alm.addons.paging_init && alm.addons.nextpage) { 23202 // Paging + Next Page on firstrun. 23203 alm.AjaxLoadMore.pagingNextpageInit(); 23204 alm.addons.paging_init = false; 23205 alm.init = false; 23206 } else { 23207 // Standard Paging 23208 alm.AjaxLoadMore.loadPosts(); 23209 } 23210 }; 23211 23212 /** 23213 * Get the parent ALM container. 23214 * 23215 * @return {HTMLElement} The ALM listing container. 23216 * @since 2.7.0 23217 */ 23218 window.almGetParentContainer = function () { 23219 var _alm42; 23220 return (_alm42 = alm) === null || _alm42 === void 0 ? void 0 : _alm42.listing; 23221 }; 23222 23223 /** 23224 * Returns the current ALM obj. 23225 * 23226 * @param {string} obj The ALM object to return. 23227 * @return {Object} The ALM object. 23228 * @since 2.7.0 23229 */ 23230 window.almGetObj = function () { 23231 var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 23232 if (obj) { 23233 return alm[obj]; // Return specific param. 23234 } 23235 return alm; // Return the entire alm object 23236 }; 23237 23238 /** 23239 * Trigger ajaxloadmore from any element on page. 23240 * 23241 * @since 2.12.0 23242 */ 23243 window.almTriggerClick = function () { 23244 alm.button.click(); 23245 }; 23246 23247 // Delay to prevent immediate loading of posts on initial page load via scroll. 23248 setTimeout(function () { 23249 alm.proceed = true; 23250 alm.AjaxLoadMore.scrollSetup(); 23251 }, 1000); 23252 23253 // Init Ajax Load More.
23254 alm.AjaxLoadMore.init(); 23255 if (((_alm_localize7 = alm_localize) === null || _alm_localize7 === void 0 ? void 0 : _alm_localize7.scrolltop) === 'true') { 23256 window.scrollTo(0, 0); // Move user to top of page to prevent loading on initial page load. 23257 } 23258 case 1: 23259 return _context11.a(2); 23260 } 23261 }, _callee11, this); 23262 })); 23263 return function ajaxloadmore(_x, _x2) { 23264 return _ref.apply(this, arguments); 23265 }; 23266 }(); 23267 23268 // End ajaxloadmore 23269 23270 /** 23271 * Initiate instance of Ajax load More 23272 * 23273 * @param {HTMLElement} el The ALM element. 23274 * @param {number} id The ALM instance ID. 23275 * @since 5.0 23276 */ 23277 window.almInit = function (el) { 23278 var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 23279 new ajaxloadmore(el, id); 23280 }; 23281 23282 /** 23283 * Initiate Ajax load More if div is present on screen 23284 * 23285 * @since 2.1.2 23286 */ 23287 var alm_instances = document.querySelectorAll('.ajax-load-more-wrap'); 23288 if (alm_instances.length) { 23289 ajax_load_more_toConsumableArray(alm_instances).forEach(function (alm, index) { 23290 new ajaxloadmore(alm, index); 23291 }); 23292 } 23293})(); 23294 23295/** 23296 * Filter an Ajax Load More instance. 23297 * 23298 * @param {string} transition The transition type. 23299 * @param {string} speed The speed of the filter transition. 23300 * @param {Object} data Query data as an object. 23301 * @since 5.0 23302 */ 23303var filter = function filter() { 23304 var transition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fade'; 23305 var speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; 23306 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 23307 if (!transition || !speed || !data) { 23308 return false; 23309 } 23310 alm_is_filtering = true; 23311 almFilter(transition, speed, data, 'filter'); 23312}; 23313 23314/** 23315 * Reset an Ajax Load More instance. 23316 * 23317 * @since 5.3.8 23318 * @param {Object} props The ALM props as an object. 23319 */ 23320var ajax_load_more_reset = function reset() { 23321 var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 23322 var data = {}; 23323 alm_is_filtering = true; 23324 if (props && props.target) { 23325 data = { 23326 target: target 23327 }; 23328 } 23329 if (props && props.type === 'woocommerce') { 23330 // WooCommerce 23331 ajax_load_more_asyncToGenerator(/*#__PURE__*/ajax_load_more_regenerator().m(function _callee12() { 23332 var instance, settings; 23333 return ajax_load_more_regenerator().w(function (_context12) { 23334 while (1) switch (_context12.n) { 23335 case 0: 23336 instance = document.querySelector('.ajax-load-more-wrap .alm-listing[data-woo="true"]'); // Get ALM instance 23337 _context12.n = 1; 23338 return wooReset(); 23339 case 1: 23340 settings = _context12.v; 23341 // Get WooCommerce `settings` via Ajax 23342 if (settings) { 23343 instance.dataset.wooSettings = settings; // Update data atts 23344 almFilter('fade', '100', data, 'filter'); 23345 } 23346 case 2: 23347 return _context12.a(2); 23348 } 23349 }, _callee12); 23350 }))()["catch"](function () { 23351 console.warn('Ajax Load More: There was an issue resetting the Ajax Load More instance.'); 23352 }); 23353 } else { 23354 // Standard ALM 23355 almFilter('fade', 200, data, 'filter'); 23356 } 23357}; 23358 23359/** 23360 * Get the total post count in the current query by ALM instance ID. 23361 * Note: Uses localized ALM variables. 23362 * 23363 * @see https://github.com/dcooney/wordpress-ajax-load-more/blob/main/core/classes/class-alm-localize.php 23364 * @param {string} id An optional Ajax Load More ID. 23365 * @return {number} The results from the localized variable. 23366 */ 23367var ajax_load_more_getPostCount = function getPostCount() { 23368 var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 23369 return getTotals('post_count', id); 23370}; 23371 23372/** 23373 * Get the total number of posts by ALM instance ID. 23374 * Note: Uses localized ALM variables. 23375 * 23376 * @param {string} id An optional Ajax Load More ID. 23377 * @return {number} The results from the localized variable. 23378 */ 23379var getTotalPosts = function getTotalPosts() { 23380 var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 23381 return getTotals('total_posts', id); 23382}; 23383 23384/** 23385 * Get the total posts remaining in the current query by ALM instance ID. 23386 * Note: Uses localized ALM variables. 23387 * 23388 * @see https://github.com/dcooney/wordpress-ajax-load-more/blob/main/core/classe
23388s/class-alm-localize.php 23389 * @param {string} id An optional Ajax Load More ID. 23390 * @return {number} The total remaining posts. 23391 */ 23392var getTotalRemaining = function getTotalRemaining() { 23393 var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 23394 return getTotals('remaining', id); 23395}; 23396 23397/** 23398 * Track Page Views and Analytics 23399 * 23400 * @since 5.0 23401 * @param {string} type The add-on type that is triggering the analytics. 23402 */ 23403var analytics = function analytics() { 23404 var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 23405 var _window$location = window.location, 23406 _window$location$path = _window$location.pathname, 23407 pathname = _window$location$path === void 0 ? '' : _window$location$path, 23408 _window$location$sear = _window$location.search, 23409 search = _window$location$sear === void 0 ? '' : _window$location$sear; 23410 23411 /** 23412 * ALM Callback Function (URL Change) 23413 * 23414 * @see https://ajaxloadmore.com/docs/callback-functions/#url-update 23415 */ 23416 if (typeof almUrlUpdate === 'function') { 23417 window.almUrlUpdate(pathname + search, type); 23418 } 23419 23420 /** 23421 * ALM Callback Function 23422 */ 23423 if (typeof almAnalytics === 'function') { 23424 window.almAnalytics(pathname + search, type); 23425 } 23426}; 23427 23428/** 23429 * Trigger Ajax Load More from other events. 23430 * 23431 * @since 5.0 23432 * @param {Element} instance The HTML element. 23433 */ 23434var start = function start(instance) { 23435 if (!instance) { 23436 return false; 23437 } 23438 window.almInit(instance); 23439}; 23440 23441/** 23442 * Scroll window to position (global function). 23443 * 23444 * @since 5.0 23445 * @param {string} position The position to scroll. 23446 */ 23447var almScroll = function almScroll(position) { 23448 if (!position) { 23449 return false; 23450 } 23451 window.scrollTo({ 23452 top: position, 23453 behavior: 'smooth' 23454 }); 23455}; 23456 23457/** 23458 * Get the current top/left coordinates of an element relative to the document. 23459 * 23460 * @since 5.0 23461 * @param {HTMLElement} el The HTML element. 23462 * @return {Object} The top/left coordinates. 23463 */ 23464var getOffset = function getOffset() { 23465 var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 23466 if (!el) { 23467 return false; 23468 } 23469 var rect = el.getBoundingClientRect(); 23470 var scrollLeft = window.scrollX || document.documentElement.scrollLeft; 23471 var scrollTop = window.scrollY || document.documentElement.scrollTop; 23472 return { 23473 top: rect.top + scrollTop, 23474 left: rect.left + scrollLeft 23475 }; 23476}; 23477 23478/** 23479 * Trigger a click event to load Ajax Load More content. 23480 * 23481 * @param {string} id The Ajax Load More ID. 23482 */ 23483var click = function click() { 23484 var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 23485 var alm = document.querySelector('.ajax-load-more-wrap'); 23486 var button = ''; 23487 if (!id && alm) { 23488 // Default ALM element. 23489 button = alm.querySelector('button.alm-load-more-btn'); 23490 if (button) { 23491 button.click(); 23492 } 23493 } else { 23494 // Ajax Load More by ID. 23495 alm = document.querySelector(".ajax-load-more-wrap[data-id=\"".concat(id, "\"]")); 23496 if (alm) { 23497 button = alm.querySelector('button.alm-load-more-btn'); 23498 if (button) { 23499 button.click(); 23500 } 23501 } 23502 } 23503}; 23504 23505/** 23506 * Load ALM inside the WP Block Editor. 23507 * 23508 * @since 7.1.0 23509 * @param {Element} instance The HTML element. 23510 */ 23511var wpblock = function wpblock(instance) { 23512 var listing = instance.querySelector('.alm-listing'); 23513 if (!listing || instance.dataset.blockLoaded === 'true') { 23514 return; // Exit if does not exist or block already loaded. 23515 } 23516 instance.dataset.blockLoaded = 'true'; 23517 listing.dataset.scroll = 'false'; // Remove scroll. 23518 start(instance); 23519}; 23520}(); 23521ajaxloadmore = __webpack_exports__; 23522/******/ })() 23523;
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.