(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[221,10],{ /***/ "1uat": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha512.js ***! \******************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./x64-core */ "MlIO")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Hasher = C_lib.Hasher; var C_x64 = C.x64; var X64Word = C_x64.Word; var X64WordArray = C_x64.WordArray; var C_algo = C.algo; function X64Word_create() { return X64Word.create.apply(X64Word, arguments); } // Constants var K = [ X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) ]; // Reusable objects var W = []; (function () { for (var i = 0; i < 80; i++) { W[i] = X64Word_create(); } }()); /** * SHA-512 hash algorithm. */ var SHA512 = C_algo.SHA512 = Hasher.extend({ _doReset: function () { this._hash = new X64WordArray.init([ new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) ]); }, _doProcessBlock: function (M, offset) { // Shortcuts var H = this._hash.words; var H0 = H[0]; var H1 = H[1]; var H2 = H[2]; var H3 = H[3]; var H4 = H[4]; var H5 = H[5]; var H6 = H[6]; var H7 = H[7]; var H0h = H0.high; var H0l = H0.low; var H1h = H1.high; var H1l = H1.low; var H2h = H2.high; var H2l = H2.low; var H3h = H3.high; var H3l = H3.low; var H4h = H4.high; var H4l = H4.low; var H5h = H5.high; var H5l = H5.low; var H6h = H6.high; var H6l = H6.low; var H7h = H7.high; var H7l = H7.low; // Working variables var ah = H0h; var al = H0l; var bh = H1h; var bl = H1l; var ch = H2h; var cl = H2l; var dh = H3h; var dl = H3l; var eh = H4h; var el = H4l; var fh = H5h; var fl = H5l; var gh = H6h; var gl = H6l; var hh = H7h; var hl = H7l; // Rounds for (var i = 0; i < 80; i++) { var Wil; var Wih; // Shortcut var Wi = W[i]; // Extend message if (i < 16) { Wih = Wi.high = M[offset + i * 2] | 0; Wil = Wi.low = M[offset + i * 2 + 1] | 0; } else { // Gamma0 var gamma0x = W[i - 15]; var gamma0xh = gamma0x.high; var gamma0xl = gamma0x.low; var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); // Gamma1 var gamma1x = W[i - 2]; var gamma1xh = gamma1x.high; var gamma1xl = gamma1x.low; var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] var Wi7 = W[i - 7]; var Wi7h = Wi7.high; var Wi7l = Wi7.low; var Wi16 = W[i - 16]; var Wi16h = Wi16.high; var Wi16l = Wi16.low; Wil = gamma0l + Wi7l; Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); Wil = Wil + gamma1l; Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); Wil = Wil + Wi16l; Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); Wi.high = Wih; Wi.low = Wil; } var chh = (eh & fh) ^ (~eh & gh); var chl = (el & fl) ^ (~el & gl); var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); var majl = (al & bl) ^ (al & cl) ^ (bl & cl); var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); // t1 = h + sigma1 + ch + K[i] + W[i] var Ki = K[i]; var Kih = Ki.high; var Kil = Ki.low; var t1l = hl + sigma1l; var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); var t1l = t1l + chl; var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); var t1l = t1l + Kil; var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); var t1l = t1l + Wil; var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); // t2 = sigma0 + maj var t2l = sigma0l + majl; var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); // Update working variables hh = gh; hl = gl; gh = fh; gl = fl; fh = eh; fl = el; el = (dl + t1l) | 0; eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; dh = ch; dl = cl; ch = bh; cl = bl; bh = ah; bl = al; al = (t1l + t2l) | 0; ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; } // Intermediate hash value H0l = H0.low = (H0l + al); H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); H1l = H1.low = (H1l + bl); H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); H2l = H2.low = (H2l + cl); H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); H3l = H3.low = (H3l + dl); H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); H4l = H4.low = (H4l + el); H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); H5l = H5.low = (H5l + fl); H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); H6l = H6.low = (H6l + gl); H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); H7l = H7.low = (H7l + hl); H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Convert hash to 32-bit word array before returning var hash = this._hash.toX32(); // Return final computed hash return hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; }, blockSize: 1024/32 }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA512('message'); * var hash = CryptoJS.SHA512(wordArray); */ C.SHA512 = Hasher._createHelper(SHA512); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA512(message, key); */ C.HmacSHA512 = Hasher._createHmacHelper(SHA512); }()); return CryptoJS.SHA512; })); /***/ }), /***/ "2kYD": /*!****************************************************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/components/SelectFilePathModal/index.less?modules ***! \****************************************************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin module.exports = {"flex_box_center":"flex_box_center___1mi8J","flex_space_between":"flex_space_between___2dzBd","flex_box_vertical_center":"flex_box_vertical_center___2cGiq","flex_box_center_end":"flex_box_center_end___3tw8h","flex_box_column":"flex_box_column___1dR6o","wrap":"wrap___3kKju","content":"content___3U3bi","mainPathWrap":"mainPathWrap___3EIrO","colorBlue":"colorBlue___2WYVN","empty":"empty___2FHZ0"}; /***/ }), /***/ "3y9D": /*!****************************************!*\ !*** ./node_modules/crypto-js/sha1.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Reusable object var W = []; /** * SHA-1 hash algorithm. */ var SHA1 = C_algo.SHA1 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; var e = H[4]; // Computation for (var i = 0; i < 80; i++) { if (i < 16) { W[i] = M[offset + i] | 0; } else { var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; W[i] = (n << 1) | (n >>> 31); } var t = ((a << 5) | (a >>> 27)) + e + W[i]; if (i < 20) { t += ((b & c) | (~b & d)) + 0x5a827999; } else if (i < 40) { t += (b ^ c ^ d) + 0x6ed9eba1; } else if (i < 60) { t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; } else /* if (i < 80) */ { t += (b ^ c ^ d) - 0x359d3e2a; } e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; H[4] = (H[4] + e) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA1('message'); * var hash = CryptoJS.SHA1(wordArray); */ C.SHA1 = Hasher._createHelper(SHA1); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA1(message, key); */ C.HmacSHA1 = Hasher._createHmacHelper(SHA1); }()); return CryptoJS.SHA1; })); /***/ }), /***/ 4: /*!************************!*\ !*** crypto (ignored) ***! \************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports) { /* (ignored) */ /***/ }), /***/ "5hvy": /*!****************************************!*\ !*** ./node_modules/crypto-js/sha3.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./x64-core */ "MlIO")); } else {} }(this, function (CryptoJS) { (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_x64 = C.x64; var X64Word = C_x64.Word; var C_algo = C.algo; // Constants tables var RHO_OFFSETS = []; var PI_INDEXES = []; var ROUND_CONSTANTS = []; // Compute Constants (function () { // Compute rho offset constants var x = 1, y = 0; for (var t = 0; t < 24; t++) { RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; var newX = y % 5; var newY = (2 * x + 3 * y) % 5; x = newX; y = newY; } // Compute pi index constants for (var x = 0; x < 5; x++) { for (var y = 0; y < 5; y++) { PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; } } // Compute round constants var LFSR = 0x01; for (var i = 0; i < 24; i++) { var roundConstantMsw = 0; var roundConstantLsw = 0; for (var j = 0; j < 7; j++) { if (LFSR & 0x01) { var bitPosition = (1 << j) - 1; if (bitPosition < 32) { roundConstantLsw ^= 1 << bitPosition; } else /* if (bitPosition >= 32) */ { roundConstantMsw ^= 1 << (bitPosition - 32); } } // Compute next LFSR if (LFSR & 0x80) { // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 LFSR = (LFSR << 1) ^ 0x71; } else { LFSR <<= 1; } } ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); } }()); // Reusable objects for temporary values var T = []; (function () { for (var i = 0; i < 25; i++) { T[i] = X64Word.create(); } }()); /** * SHA-3 hash algorithm. */ var SHA3 = C_algo.SHA3 = Hasher.extend({ /** * Configuration options. * * @property {number} outputLength * The desired number of bits in the output hash. * Only values permitted are: 224, 256, 384, 512. * Default: 512 */ cfg: Hasher.cfg.extend({ outputLength: 512 }), _doReset: function () { var state = this._state = [] for (var i = 0; i < 25; i++) { state[i] = new X64Word.init(); } this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; }, _doProcessBlock: function (M, offset) { // Shortcuts var state = this._state; var nBlockSizeLanes = this.blockSize / 2; // Absorb for (var i = 0; i < nBlockSizeLanes; i++) { // Shortcuts var M2i = M[offset + 2 * i]; var M2i1 = M[offset + 2 * i + 1]; // Swap endian M2i = ( (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) ); M2i1 = ( (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) ); // Absorb message into state var lane = state[i]; lane.high ^= M2i1; lane.low ^= M2i; } // Rounds for (var round = 0; round < 24; round++) { // Theta for (var x = 0; x < 5; x++) { // Mix column lanes var tMsw = 0, tLsw = 0; for (var y = 0; y < 5; y++) { var lane = state[x + 5 * y]; tMsw ^= lane.high; tLsw ^= lane.low; } // Temporary values var Tx = T[x]; Tx.high = tMsw; Tx.low = tLsw; } for (var x = 0; x < 5; x++) { // Shortcuts var Tx4 = T[(x + 4) % 5]; var Tx1 = T[(x + 1) % 5]; var Tx1Msw = Tx1.high; var Tx1Lsw = Tx1.low; // Mix surrounding columns var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); for (var y = 0; y < 5; y++) { var lane = state[x + 5 * y]; lane.high ^= tMsw; lane.low ^= tLsw; } } // Rho Pi for (var laneIndex = 1; laneIndex < 25; laneIndex++) { var tMsw; var tLsw; // Shortcuts var lane = state[laneIndex]; var laneMsw = lane.high; var laneLsw = lane.low; var rhoOffset = RHO_OFFSETS[laneIndex]; // Rotate lanes if (rhoOffset < 32) { tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); } else /* if (rhoOffset >= 32) */ { tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); } // Transpose lanes var TPiLane = T[PI_INDEXES[laneIndex]]; TPiLane.high = tMsw; TPiLane.low = tLsw; } // Rho pi at x = y = 0 var T0 = T[0]; var state0 = state[0]; T0.high = state0.high; T0.low = state0.low; // Chi for (var x = 0; x < 5; x++) { for (var y = 0; y < 5; y++) { // Shortcuts var laneIndex = x + 5 * y; var lane = state[laneIndex]; var TLane = T[laneIndex]; var Tx1Lane = T[((x + 1) % 5) + 5 * y]; var Tx2Lane = T[((x + 2) % 5) + 5 * y]; // Mix rows lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); } } // Iota var lane = state[0]; var roundConstant = ROUND_CONSTANTS[round]; lane.high ^= roundConstant.high; lane.low ^= roundConstant.low; } }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; var blockSizeBits = this.blockSize * 32; // Add padding dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Shortcuts var state = this._state; var outputLengthBytes = this.cfg.outputLength / 8; var outputLengthLanes = outputLengthBytes / 8; // Squeeze var hashWords = []; for (var i = 0; i < outputLengthLanes; i++) { // Shortcuts var lane = state[i]; var laneMsw = lane.high; var laneLsw = lane.low; // Swap endian laneMsw = ( (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) ); laneLsw = ( (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) ); // Squeeze state to retrieve hash hashWords.push(laneLsw); hashWords.push(laneMsw); } // Return final computed hash return new WordArray.init(hashWords, outputLengthBytes); }, clone: function () { var clone = Hasher.clone.call(this); var state = clone._state = this._state.slice(0); for (var i = 0; i < 25; i++) { state[i] = state[i].clone(); } return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA3('message'); * var hash = CryptoJS.SHA3(wordArray); */ C.SHA3 = Hasher._createHelper(SHA3); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA3(message, key); */ C.HmacSHA3 = Hasher._createHmacHelper(SHA3); }(Math)); return CryptoJS.SHA3; })); /***/ }), /***/ "7Cbv": /*!**************************************************************!*\ !*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***! \**************************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js // Unique ID creation requires a high quality random # generator. In the browser we therefore // require the crypto API and do not support built-in fallback to lower quality random number // generators (like Math.random()). // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, // find the complete implementation of crypto (msCrypto) on IE11. var getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); var rnds8 = new Uint8Array(16); function rng() { if (!getRandomValues) { throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); } return getRandomValues(rnds8); } // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js /* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js function validate(uuid) { return typeof uuid === 'string' && regex.test(uuid); } /* harmony default export */ var esm_browser_validate = (validate); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var stringify_i = 0; stringify_i < 256; ++stringify_i) { byteToHex.push((stringify_i + 0x100).toString(16).substr(1)); } function stringify(arr) { var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one // of the following: // - One or more input array values don't map to a hex octet (leading to // "undefined" in the uuid) // - Invalid input values for the RFC `version` or `variant` fields if (!esm_browser_validate(uuid)) { throw TypeError('Stringified UUID is invalid'); } return uuid; } /* harmony default export */ var esm_browser_stringify = (stringify); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = rnds[6] & 0x0f | 0x40; rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided if (buf) { offset = offset || 0; for (var i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return esm_browser_stringify(rnds); } /* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4); /***/ }), /***/ "7ixt": /*!**************************************************!*\ !*** ./node_modules/rc-tooltip/es/placements.js ***! \**************************************************/ /*! exports provided: placements, default */ /*! exports used: placements */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return placements; }); var autoAdjustOverflow = { adjustX: 1, adjustY: 1 }; var targetOffset = [0, 0]; var placements = { left: { points: ['cr', 'cl'], overflow: autoAdjustOverflow, offset: [-4, 0], targetOffset: targetOffset }, right: { points: ['cl', 'cr'], overflow: autoAdjustOverflow, offset: [4, 0], targetOffset: targetOffset }, top: { points: ['bc', 'tc'], overflow: autoAdjustOverflow, offset: [0, -4], targetOffset: targetOffset }, bottom: { points: ['tc', 'bc'], overflow: autoAdjustOverflow, offset: [0, 4], targetOffset: targetOffset }, topLeft: { points: ['bl', 'tl'], overflow: autoAdjustOverflow, offset: [0, -4], targetOffset: targetOffset }, leftTop: { points: ['tr', 'tl'], overflow: autoAdjustOverflow, offset: [-4, 0], targetOffset: targetOffset }, topRight: { points: ['br', 'tr'], overflow: autoAdjustOverflow, offset: [0, -4], targetOffset: targetOffset }, rightTop: { points: ['tl', 'tr'], overflow: autoAdjustOverflow, offset: [4, 0], targetOffset: targetOffset }, bottomRight: { points: ['tr', 'br'], overflow: autoAdjustOverflow, offset: [0, 4], targetOffset: targetOffset }, rightBottom: { points: ['bl', 'br'], overflow: autoAdjustOverflow, offset: [4, 0], targetOffset: targetOffset }, bottomLeft: { points: ['tl', 'bl'], overflow: autoAdjustOverflow, offset: [0, 4], targetOffset: targetOffset }, leftBottom: { points: ['br', 'bl'], overflow: autoAdjustOverflow, offset: [-4, 0], targetOffset: targetOffset } }; /* unused harmony default export */ var _unused_webpack_default_export = (placements); /***/ }), /***/ "93VE": /*!****************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/RankingSetting/challenge-nav.less ***! \****************************************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "9OqN": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-ctr.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { /** * Counter block mode. */ CryptoJS.mode.CTR = (function () { var CTR = CryptoJS.lib.BlockCipherMode.extend(); var Encryptor = CTR.Encryptor = CTR.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher var blockSize = cipher.blockSize; var iv = this._iv; var counter = this._counter; // Generate keystream if (iv) { counter = this._counter = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } var keystream = counter.slice(0); cipher.encryptBlock(keystream, 0); // Increment counter counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } }); CTR.Decryptor = Encryptor; return CTR; }()); return CryptoJS.mode.CTR; })); /***/ }), /***/ "9ZNV": /*!**********************************************!*\ !*** ./src/components/FixedButton/index.tsx ***! \**********************************************/ /*! exports provided: FixedButton */ /*! exports used: FixedButton */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FixedButton; }); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */ "0Owb"); /* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/button/style */ "+L6B"); /* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/button */ "2/Rp"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "cDcd"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./index.less?modules */ "UUDw"); /* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "TSYQ"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__); var FixedButton = function FixedButton(_ref) { var _ref$cancelText = _ref.cancelText, cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText, _ref$okText = _ref.okText, okText = _ref$okText === void 0 ? '确定' : _ref$okText, _ref$loading = _ref.loading, loading = _ref$loading === void 0 ? false : _ref$loading, _ref$hasOkBtn = _ref.hasOkBtn, hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn, _ref$okButtonProps = _ref.okButtonProps, okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps, _ref$onCancel = _ref.onCancel, onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel, _ref$onOk = _ref.onOk, onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk, _ref$className = _ref.className, className = _ref$className === void 0 ? '' : _ref$className; return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: classnames__WEBPACK_IMPORTED_MODULE_5___default()(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.buttonFixed, className) }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.buttonWrap }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], { size: "large", className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.button, " mr20"), onClick: onCancel }, cancelText), hasOkBtn && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ size: "large", type: "primary", className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.button, " mr20"), loading: loading, onClick: onOk }, okButtonProps), okText))); }; /***/ }), /***/ "ALsQ": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-cfb.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { /** * Cipher Feedback block mode. */ CryptoJS.mode.CFB = (function () { var CFB = CryptoJS.lib.BlockCipherMode.extend(); CFB.Encryptor = CFB.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); // Remember this block to use with next block this._prevBlock = words.slice(offset, offset + blockSize); } }); CFB.Decryptor = CFB.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; // Remember this block to use with next block var thisBlock = words.slice(offset, offset + blockSize); generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); // This block becomes the previous block this._prevBlock = thisBlock; } }); function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { var keystream; // Shortcut var iv = this._iv; // Generate keystream if (iv) { keystream = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } else { keystream = this._prevBlock; } cipher.encryptBlock(keystream, 0); // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } return CFB; }()); return CryptoJS.mode.CFB; })); /***/ }), /***/ "B7Ph": /*!**************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/components/UploadFile/index.tsx ***! \**************************************************************************************/ /*! exports provided: dealList, UploadTable, default */ /*! exports used: UploadTable, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export dealList */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UploadTable; }); /* harmony import */ var antd_es_input_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/input/style */ "5NDa"); /* harmony import */ var antd_es_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/input */ "5rEg"); /* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/button/style */ "+L6B"); /* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/es/button */ "2/Rp"); /* harmony import */ var antd_es_modal_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/es/modal/style */ "2qtc"); /* harmony import */ var antd_es_modal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/modal */ "kLXV"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw"); /* harmony import */ var antd_es_message_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/es/message/style */ "miYZ"); /* harmony import */ var antd_es_message__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd/es/message */ "tsqr"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray */ "oBTY"); /* harmony import */ var antd_es_upload_style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd/es/upload/style */ "DZo9"); /* harmony import */ var antd_es_upload__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd/es/upload */ "8z0m"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react */ "cDcd"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./index.less?modules */ "Bvq2"); /* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var _nodata_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./nodata.svg */ "nj2k"); /* harmony import */ var _nodata_svg__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_nodata_svg__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ali-oss */ "mxV5"); /* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(ali_oss__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var _components_UploadFile__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/UploadFile */ "KhGG"); /* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/utils/fetch */ "ErOA"); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! uuid */ "7Cbv"); /* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/utils/util */ "1vsH"); var Dragger = antd_es_upload__WEBPACK_IMPORTED_MODULE_13__[/* default */ "a"].Dragger; var dealList = function dealList(item) { var str = function str(s) { if (!s) { return s; } return s.substring(0, s.lastIndexOf(".")); }; var list = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(item), flag = 0, data = []; for (var i = 0; i < list.length; i++) { var az = ''; for (var j = 0; j < data.length; j++) { if (str(data[j][0].name) == str(list[i].name)) { flag = 1; az = j; break; } } if (flag == 1) { data[az].push(list[i]); flag = 0; } else if (flag == 0) { var wdy = new Array(); wdy.push(list[i]); data.push(wdy); } } var items = data.map(function (e) { if (e[0].name.includes('.in')) { if (e.length === 2) { return e; } else { return [e[0], {}]; } } if (e[0].name.includes('.out')) { if (e.length === 2) { return e.reverse(); } else { return [{}, e[0]]; } } }); return items; }; var UploadFile = function UploadFile(_ref) { var onClose = _ref.onClose, onOK = _ref.onOK, visible = _ref.visible, wrapClassName = _ref.wrapClassName, rootIdentifier = _ref.rootIdentifier; var _useState = Object(react__WEBPACK_IMPORTED_MODULE_15__["useState"])([]), _useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState, 2), fileList = _useState2[0], setFileList = _useState2[1]; var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_15__["useState"])({}), _useState4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState3, 2), OSSData = _useState4[0], setOSSData = _useState4[1]; var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_15__["useState"])(false), _useState6 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState5, 2), btnLoading = _useState6[0], setBtnLoading = _useState6[1]; // const [uploadIndex, setUploadIndex] = useState(0); var savedFileList = Object(react__WEBPACK_IMPORTED_MODULE_15__["useRef"])([]); var uploadIndex = Object(react__WEBPACK_IMPORTED_MODULE_15__["useRef"])(0); var handleCancel = function handleCancel() { onClose(); }; Object(react__WEBPACK_IMPORTED_MODULE_15__["useEffect"])(function () { init(); }, []); Object(react__WEBPACK_IMPORTED_MODULE_15__["useEffect"])(function () { if (visible) { savedFileList.current = []; uploadIndex.current = 0; setFileList([]); } }, [visible]); var init = /*#__PURE__*/function () { var _ref2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee() { var _OSSData, data; return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; _context.next = 3; return Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_20__[/* default */ "a"])('/api/buckets/get_upload_token_for_big_files', { method: "get" }); case 3: _OSSData = _context.sent; data = JSON.parse(Object(_components_UploadFile__WEBPACK_IMPORTED_MODULE_19__[/* decrypt */ "a"])(_OSSData.data)); setOSSData(data); _context.next = 11; break; case 8: _context.prev = 8; _context.t0 = _context["catch"](0); antd_es_message__WEBPACK_IMPORTED_MODULE_8__[/* default */ "b"].error(_context.t0); case 11: case "end": return _context.stop(); } } }, _callee, null, [[0, 8]]); })); return function init() { return _ref2.apply(this, arguments); }; }(); var str = function str(s) { if (!s) { return s; } return s.substring(0, s.lastIndexOf(".")); }; var handleRemove = function handleRemove(item) { var _item$, _item$2; var name = str((_item$ = item[0]) === null || _item$ === void 0 ? void 0 : _item$.name) || str((_item$2 = item[1]) === null || _item$2 === void 0 ? void 0 : _item$2.name); var files = fileList.filter(function (v) { return str(v.name) !== name; }); savedFileList.current = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(files); setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(files)); }; var _uploadFiles = function _uploadFiles(file) { var client = new ali_oss__WEBPACK_IMPORTED_MODULE_18___default.a({ endpoint: OSSData.end_point, region: OSSData.region, accessKeyId: OSSData.access_key_id, accessKeySecret: OSSData.access_key_secret, bucket: OSSData.bucket, stsToken: OSSData.security_token }); var name = file.name; var obj = { container_type: 'TestSet', file_name: name }; var filename = Object(uuid__WEBPACK_IMPORTED_MODULE_21__[/* default */ "a"])(); var url = "testsets/".concat(rootIdentifier, "/").concat(filename).concat(name.indexOf(".") > -1 ? '.' + name.split(".").pop() : ""); if (rootIdentifier === null) { url = "testsets/".concat(filename).concat(name.indexOf(".") > -1 ? '.' + name.split(".").pop() : ""); } client.multipartUpload(url, new Blob([file.file], { type: file.file.type }), { timeout: 3600 * 1000, partSize: 1002400, callback: { customValue: { id: name + '' }, url: OSSData === null || OSSData === void 0 ? void 0 : OSSData.callback_url, host: OSSData === null || OSSData === void 0 ? void 0 : OSSData.bucket_host, body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&' + Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_20__[/* parseParams */ "e"])(obj) } }).then(function (result) { if (result.data.status === 0) { uploadIndex.current = uploadIndex.current + 1; var files = savedFileList.current.map(function (v) { var _result$data, _result$data$data; if (v.name === ((_result$data = result.data) === null || _result$data === void 0 ? void 0 : (_result$data$data = _result$data.data) === null || _result$data$data === void 0 ? void 0 : _result$data$data.file_name)) { var _result$data2, _result$data2$data, _result$data2$data$fi; var _obj = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, v); if ((_result$data2 = result.data) !== null && _result$data2 !== void 0 && (_result$data2$data = _result$data2.data) !== null && _result$data2$data !== void 0 && (_result$data2$data$fi = _result$data2$data.file_name) !== null && _result$data2$data$fi !== void 0 && _result$data2$data$fi.includes('.in')) { var _result$data3, _result$data3$data, _result$data4, _result$data4$data, _result$data5, _result$data5$data; _obj.in_object_key = (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : (_result$data3$data = _result$data3.data) === null || _result$data3$data === void 0 ? void 0 : _result$data3$data.object; _obj.in_object_size = (_result$data4 = result.data) === null || _result$data4 === void 0 ? void 0 : (_result$data4$data = _result$data4.data) === null || _result$data4$data === void 0 ? void 0 : _result$data4$data.size; _obj.input = (_result$data5 = result.data) === null || _result$data5 === void 0 ? void 0 : (_result$data5$data = _result$data5.data) === null || _result$data5$data === void 0 ? void 0 : _result$data5$data.file_name; _obj.in_file = file; } else { var _result$data6, _result$data6$data, _result$data7, _result$data7$data, _result$data8, _result$data8$data; _obj.out_object_key = (_result$data6 = result.data) === null || _result$data6 === void 0 ? void 0 : (_result$data6$data = _result$data6.data) === null || _result$data6$data === void 0 ? void 0 : _result$data6$data.object; _obj.out_object_size = (_result$data7 = result.data) === null || _result$data7 === void 0 ? void 0 : (_result$data7$data = _result$data7.data) === null || _result$data7$data === void 0 ? void 0 : _result$data7$data.size; _obj.output = (_result$data8 = result.data) === null || _result$data8 === void 0 ? void 0 : (_result$data8$data = _result$data8.data) === null || _result$data8$data === void 0 ? void 0 : _result$data8$data.file_name; _obj.out_file = file; } return _obj; } return v; }); savedFileList.current = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(files); setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(files)); if (uploadIndex.current > 0 && uploadIndex.current === fileList.length) { setBtnLoading(false); var array = dealList(files); array = array.filter(function (e) { var _e$, _e$2; return !!((_e$ = e[0]) !== null && _e$ !== void 0 && _e$.name && (_e$2 = e[1]) !== null && _e$2 !== void 0 && _e$2.name); }); array = array.map(function (e) { return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, e[0]), e[1]), {}, { is_file: true }); }); onOK(array); onClose(); } } }); }; var handleOk = function handleOk() { if (fileList.length === 0) { antd_es_message__WEBPACK_IMPORTED_MODULE_8__[/* default */ "b"].warn('请选择上传文件'); return; } setBtnLoading(true); var s = dealList(fileList); if (s.some(function (e) { var _e$3, _e$4; return !((_e$3 = e[0]) !== null && _e$3 !== void 0 && _e$3.name && (_e$4 = e[1]) !== null && _e$4 !== void 0 && _e$4.name); })) { antd_es_modal__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].confirm({ centered: true, okText: '确定', cancelText: '取消', title: '提示', content: '上传的测试用例中存在未配对的文件,请确认是否仅保存已配对的测试用例?', onOk: function () { var _onOk = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee3() { return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: fileList.map( /*#__PURE__*/function () { var _ref3 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee2(item) { return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _uploadFiles(item); case 1: case "end": return _context2.stop(); } } }, _callee2); })); return function (_x) { return _ref3.apply(this, arguments); }; }()); case 1: case "end": return _context3.stop(); } } }, _callee3); })); function onOk() { return _onOk.apply(this, arguments); } return onOk; }(), onCancel: function onCancel() { setBtnLoading(false); } }); return; } fileList.map( /*#__PURE__*/function () { var _ref4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.mark(function _callee4(item) { return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_14___default.a.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _uploadFiles(item); case 1: case "end": return _context4.stop(); } } }, _callee4); })); return function (_x2) { return _ref4.apply(this, arguments); }; }()); }; var props = { name: 'file', fileList: fileList, multiple: true, accept: ".in, .out", showUploadList: false, // action: `/api/attachments.json`, // onChange: handleChangeFile, // onRemove, beforeUpload: function beforeUpload(info) { if (fileList !== null && fileList !== void 0 && fileList.some(function (e) { return e.name === info.name; })) { antd_es_message__WEBPACK_IMPORTED_MODULE_8__[/* default */ "b"].info("".concat(info.name, "\u6587\u4EF6\u5DF2\u5B58\u5728")); return false; } if (info.size / 1024 / 1024 > 100) { antd_es_message__WEBPACK_IMPORTED_MODULE_8__[/* default */ "b"].info("文件超过100M,不符合上传要求"); return false; } if (!/\.(in|out|IN|OUT)$/.test(info.name)) { antd_es_message__WEBPACK_IMPORTED_MODULE_8__[/* default */ "b"].warn('输入文件只能上传.in和.out类型的文本文件'); return false; } var param = { name: info.name, uid: info.uid, file: info, percent: 0 }; fileList.push(param); savedFileList.current = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(fileList); setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"])(fileList)); return false; } }; var fileItems = dealList(fileList); console.log(fileList, fileItems, 'fileList'); return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(antd_es_modal__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], { visible: visible, wrapClassName: wrapClassName, onOk: handleOk, centered: true, okText: '确认', cancelText: "\u53D6\u6D88", okButtonProps: { loading: btnLoading }, onCancel: handleCancel, width: "1000px", title: "\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B" }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.wrap }, !fileList.length ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.noData }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("img", { src: _nodata_svg__WEBPACK_IMPORTED_MODULE_17___default.a, alt: "" }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(antd_es_upload__WEBPACK_IMPORTED_MODULE_13__[/* default */ "a"], props, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.btn }, "\u4E0A\u4F20\u6587\u4EF6"))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(antd_es_upload__WEBPACK_IMPORTED_MODULE_13__[/* default */ "a"], props, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.btnS }, "\u4E0A\u4F20\u6587\u4EF6")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(UploadTable, { data: fileItems, onRemove: handleRemove })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.text }, "\u4E0A\u4F20\u9650\u5236\uFF1A", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("br", null), "1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("br", null), "2\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("br", null), "3\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002"))); }; var UploadTable = function UploadTable(_ref5) { var _ref5$data = _ref5.data, data = _ref5$data === void 0 ? [] : _ref5$data, onRemove = _ref5.onRemove, _ref5$width = _ref5.width, width = _ref5$width === void 0 ? 'auto' : _ref5$width, _ref5$showScore = _ref5.showScore, showScore = _ref5$showScore === void 0 ? false : _ref5$showScore, _ref5$disabled = _ref5.disabled, disabled = _ref5$disabled === void 0 ? false : _ref5$disabled, inputChange = _ref5.inputChange; var downloadLocal = function downloadLocal(item) { var a = document.createElement("a"); document.body.appendChild(a); var objUrl = URL.createObjectURL(item.file); a.href = objUrl; a.download = item.name; //文件名 a.click(); URL.revokeObjectURL(objUrl); // 释放内存 document.body.removeChild(a); }; var downloadOss = function downloadOss(objUrl, name) { Object(_utils_util__WEBPACK_IMPORTED_MODULE_22__[/* download */ "w"])(objUrl, name); // let a = document.createElement("a"); // document.body.appendChild(a) // a.href = objUrl; // a.target = "_blank" // a.download = name //文件名 // a.click(); // URL.revokeObjectURL(objUrl); // 释放内存 // document.body.removeChild(a); }; var itemDelete = function itemDelete(e, i) { antd_es_modal__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].confirm({ centered: true, okText: '确定', cancelText: '取消', title: '提示', content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: "tc font16" }, "\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"), onOk: function onOk() { onRemove(e, i); }, onCancel: function onCancel() {} }); }; if (!data.length) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_15___default.a.Fragment, null); } return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: width } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.head }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: '20%' } }, "\u7528\u4F8B"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: showScore ? '25%' : '35%' } }, "\u8F93\u5165"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: showScore ? '25%' : '35%' } }, "\u8F93\u51FA"), showScore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: '20%' } }, "\u5F97\u5206\u6BD4\u4F8B"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: '10%' } }, "\u64CD\u4F5C")), data.map(function (e, i) { var _e$5, _e$6, _e$7, _e$8; return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { key: i, className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.list }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: '20%' } }, "\u6D4B\u8BD5\u7528\u4F8B", i + 1), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.info, style: { width: showScore ? '25%' : '35%' } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("span", { title: e.input || ((_e$5 = e[0]) === null || _e$5 === void 0 ? void 0 : _e$5.name), onClick: function onClick() { if (e.input) { if (e.input_file_url) { downloadOss(e.input_file_url, e.input); } else { downloadLocal(e.in_file); } } else { downloadLocal(e[0]); } } }, e.input || ((_e$6 = e[0]) === null || _e$6 === void 0 ? void 0 : _e$6.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.info, style: { width: showScore ? '25%' : '35%' } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("span", { title: e.output || ((_e$7 = e[1]) === null || _e$7 === void 0 ? void 0 : _e$7.name), onClick: function onClick() { if (e.input) { if (e.output_file_url) { downloadOss(e.output_file_url, e.output); } else { downloadLocal(e.out_file); } } else { downloadLocal(e[1]); } } }, e.output || ((_e$8 = e[1]) === null || _e$8 === void 0 ? void 0 : _e$8.name))), showScore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { style: { width: '20%' } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement(antd_es_input__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], { disabled: disabled, style: { width: '70%' }, onChange: function onChange(e) { return inputChange(e, i); }, value: e.score }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("span", null, "\xA0%")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("div", { onClick: function onClick() { return itemDelete(e, i); }, style: { width: '10%' } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_15___default.a.createElement("span", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.del }, "\u5220\u9664"))); })); }; /* harmony default export */ __webpack_exports__["b"] = (UploadFile); /***/ }), /***/ "BU3w": /*!***************************************************!*\ !*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***! \***************************************************/ /*! exports provided: injectCSS, updateCSS */ /*! exports used: updateCSS */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export injectCSS */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateCSS; }); /* harmony import */ var _canUseDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./canUseDom */ "MNnm"); var MARK_KEY = "rc-util-key"; function getContainer(option) { if (option.attachTo) { return option.attachTo; } var head = document.querySelector('head'); return head || document.body; } function injectCSS(css) { var _option$csp; var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (!Object(_canUseDom__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])()) { return null; } var styleNode = document.createElement('style'); if ((_option$csp = option.csp) === null || _option$csp === void 0 ? void 0 : _option$csp.nonce) { var _option$csp2; styleNode.nonce = (_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce; } styleNode.innerHTML = css; var container = getContainer(option); var firstChild = container.firstChild; if (option.prepend && container.prepend) { // Use `prepend` first container.prepend(styleNode); } else if (option.prepend && firstChild) { // Fallback to `insertBefore` like IE not support `prepend` container.insertBefore(styleNode, firstChild); } else { container.appendChild(styleNode); } return styleNode; } var containerCache = new Map(); function updateCSS(css, key) { var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var container = getContainer(option); // Get real parent if (!containerCache.has(container)) { var placeholderStyle = injectCSS('', option); var parentNode = placeholderStyle.parentNode; containerCache.set(container, parentNode); parentNode.removeChild(placeholderStyle); } var existNode = Array.from(containerCache.get(container).children).find(function (node) { return node.tagName === 'STYLE' && node[MARK_KEY] === key; }); if (existNode) { var _option$csp3, _option$csp4; if (((_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce) && existNode.nonce !== ((_option$csp4 = option.csp) === null || _option$csp4 === void 0 ? void 0 : _option$csp4.nonce)) { var _option$csp5; existNode.nonce = (_option$csp5 = option.csp) === null || _option$csp5 === void 0 ? void 0 : _option$csp5.nonce; } if (existNode.innerHTML !== css) { existNode.innerHTML = css; } return existNode; } var newNode = injectCSS(css, option); newNode[MARK_KEY] = key; return newNode; } /***/ }), /***/ "Bvq2": /*!***********************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/components/UploadFile/index.less?modules ***! \***********************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin module.exports = {"wrap":"wrap___2zRY4","colorBlue":"colorBlue___XalpT","repeatedName":"repeatedName___2Tfh4","text":"text___1sYHg","noData":"noData___3pdB4","btn":"btn___3WWjB","btnS":"btnS___2M_9t","head":"head____NWmz","list":"list___2fE4M","del":"del___2BO6Y","info":"info___3GJ70"}; /***/ }), /***/ "E4JC": /*!******************************************!*\ !*** ./node_modules/crypto-js/rabbit.js ***! \******************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./enc-base64 */ "ETIr"), __webpack_require__(/*! ./md5 */ "cv67"), __webpack_require__(/*! ./evpkdf */ "K3mO"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var StreamCipher = C_lib.StreamCipher; var C_algo = C.algo; // Reusable objects var S = []; var C_ = []; var G = []; /** * Rabbit stream cipher algorithm */ var Rabbit = C_algo.Rabbit = StreamCipher.extend({ _doReset: function () { // Shortcuts var K = this._key.words; var iv = this.cfg.iv; // Swap endian for (var i = 0; i < 4; i++) { K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); } // Generate initial state values var X = this._X = [ K[0], (K[3] << 16) | (K[2] >>> 16), K[1], (K[0] << 16) | (K[3] >>> 16), K[2], (K[1] << 16) | (K[0] >>> 16), K[3], (K[2] << 16) | (K[1] >>> 16) ]; // Generate initial counter values var C = this._C = [ (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) ]; // Carry bit this._b = 0; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } // Modify the counters for (var i = 0; i < 8; i++) { C[i] ^= X[(i + 4) & 7]; } // IV setup if (iv) { // Shortcuts var IV = iv.words; var IV_0 = IV[0]; var IV_1 = IV[1]; // Generate four subvectors var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); var i1 = (i0 >>> 16) | (i2 & 0xffff0000); var i3 = (i2 << 16) | (i0 & 0x0000ffff); // Modify counter values C[0] ^= i0; C[1] ^= i1; C[2] ^= i2; C[3] ^= i3; C[4] ^= i0; C[5] ^= i1; C[6] ^= i2; C[7] ^= i3; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } } }, _doProcessBlock: function (M, offset) { // Shortcut var X = this._X; // Iterate the system nextState.call(this); // Generate four keystream words S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); for (var i = 0; i < 4; i++) { // Swap endian S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); // Encrypt M[offset + i] ^= S[i]; } }, blockSize: 128/32, ivSize: 64/32 }); function nextState() { // Shortcuts var X = this._X; var C = this._C; // Save old counter values for (var i = 0; i < 8; i++) { C_[i] = C[i]; } // Calculate new counter values C[0] = (C[0] + 0x4d34d34d + this._b) | 0; C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; // Calculate the g-values for (var i = 0; i < 8; i++) { var gx = X[i] + C[i]; // Construct high and low argument for squaring var ga = gx & 0xffff; var gb = gx >>> 16; // Calculate high and low result of squaring var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); // High XOR low G[i] = gh ^ gl; } // Calculate new state values X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); */ C.Rabbit = StreamCipher._createHelper(Rabbit); }()); return CryptoJS.Rabbit; })); /***/ }), /***/ "ELcG": /*!*********************************************!*\ !*** ./node_modules/crypto-js/ripemd160.js ***! \*********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 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. 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. */ (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Constants table var _zl = WordArray.create([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); var _zr = WordArray.create([ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); var _sl = WordArray.create([ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); var _sr = WordArray.create([ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); /** * RIPEMD160 hash algorithm. */ var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ _doReset: function () { this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); }, _doProcessBlock: function (M, offset) { // Swap endian for (var i = 0; i < 16; i++) { // Shortcuts var offset_i = offset + i; var M_offset_i = M[offset_i]; // Swap M[offset_i] = ( (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) ); } // Shortcut var H = this._hash.words; var hl = _hl.words; var hr = _hr.words; var zl = _zl.words; var zr = _zr.words; var sl = _sl.words; var sr = _sr.words; // Working variables var al, bl, cl, dl, el; var ar, br, cr, dr, er; ar = al = H[0]; br = bl = H[1]; cr = cl = H[2]; dr = dl = H[3]; er = el = H[4]; // Computation var t; for (var i = 0; i < 80; i += 1) { t = (al + M[offset+zl[i]])|0; if (i<16){ t += f1(bl,cl,dl) + hl[0]; } else if (i<32) { t += f2(bl,cl,dl) + hl[1]; } else if (i<48) { t += f3(bl,cl,dl) + hl[2]; } else if (i<64) { t += f4(bl,cl,dl) + hl[3]; } else {// if (i<80) { t += f5(bl,cl,dl) + hl[4]; } t = t|0; t = rotl(t,sl[i]); t = (t+el)|0; al = el; el = dl; dl = rotl(cl, 10); cl = bl; bl = t; t = (ar + M[offset+zr[i]])|0; if (i<16){ t += f5(br,cr,dr) + hr[0]; } else if (i<32) { t += f4(br,cr,dr) + hr[1]; } else if (i<48) { t += f3(br,cr,dr) + hr[2]; } else if (i<64) { t += f2(br,cr,dr) + hr[3]; } else {// if (i<80) { t += f1(br,cr,dr) + hr[4]; } t = t|0; t = rotl(t,sr[i]) ; t = (t+er)|0; ar = er; er = dr; dr = rotl(cr, 10); cr = br; br = t; } // Intermediate hash value t = (H[1] + cl + dr)|0; H[1] = (H[2] + dl + er)|0; H[2] = (H[3] + el + ar)|0; H[3] = (H[4] + al + br)|0; H[4] = (H[0] + bl + cr)|0; H[0] = t; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) ); data.sigBytes = (dataWords.length + 1) * 4; // Hash final blocks this._process(); // Shortcuts var hash = this._hash; var H = hash.words; // Swap endian for (var i = 0; i < 5; i++) { // Shortcut var H_i = H[i]; // Swap H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); } // Return final computed hash return hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); function f1(x, y, z) { return ((x) ^ (y) ^ (z)); } function f2(x, y, z) { return (((x)&(y)) | ((~x)&(z))); } function f3(x, y, z) { return (((x) | (~(y))) ^ (z)); } function f4(x, y, z) { return (((x) & (z)) | ((y)&(~(z)))); } function f5(x, y, z) { return ((x) ^ ((y) |(~(z)))); } function rotl(x,n) { return (x<>>(32-n)); } /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.RIPEMD160('message'); * var hash = CryptoJS.RIPEMD160(wordArray); */ C.RIPEMD160 = Hasher._createHelper(RIPEMD160); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacRIPEMD160(message, key); */ C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); }(Math)); return CryptoJS.RIPEMD160; })); /***/ }), /***/ "ETIr": /*!**********************************************!*\ !*** ./node_modules/crypto-js/enc-base64.js ***! \**********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_enc = C.enc; /** * Base64 encoding strategy. */ var Base64 = C_enc.Base64 = { /** * Converts a word array to a Base64 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Base64 string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; var map = this._map; // Clamp excess bits wordArray.clamp(); // Convert var base64Chars = []; for (var i = 0; i < sigBytes; i += 3) { var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; var triplet = (byte1 << 16) | (byte2 << 8) | byte3; for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); } } // Add padding var paddingChar = map.charAt(64); if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar); } } return base64Chars.join(''); }, /** * Converts a Base64 string to a word array. * * @param {string} base64Str The Base64 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64.parse(base64String); */ parse: function (base64Str) { // Shortcuts var base64StrLength = base64Str.length; var map = this._map; var reverseMap = this._reverseMap; if (!reverseMap) { reverseMap = this._reverseMap = []; for (var j = 0; j < map.length; j++) { reverseMap[map.charCodeAt(j)] = j; } } // Ignore padding var paddingChar = map.charAt(64); if (paddingChar) { var paddingIndex = base64Str.indexOf(paddingChar); if (paddingIndex !== -1) { base64StrLength = paddingIndex; } } // Convert return parseLoop(base64Str, base64StrLength, reverseMap); }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' }; function parseLoop(base64Str, base64StrLength, reverseMap) { var words = []; var nBytes = 0; for (var i = 0; i < base64StrLength; i++) { if (i % 4) { var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); var bitsCombined = bits1 | bits2; words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); nBytes++; } } return WordArray.create(words, nBytes); } }()); return CryptoJS.enc.Base64; })); /***/ }), /***/ "F+F2": /*!***************************************************!*\ !*** ./node_modules/crypto-js/lib-typedarrays.js ***! \***************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function () { // Check if typed arrays are supported if (typeof ArrayBuffer != 'function') { return; } // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; // Reference original init var superInit = WordArray.init; // Augment WordArray.init to handle typed arrays var subInit = WordArray.init = function (typedArray) { // Convert buffers to uint8 if (typedArray instanceof ArrayBuffer) { typedArray = new Uint8Array(typedArray); } // Convert other array views to uint8 if ( typedArray instanceof Int8Array || (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array ) { typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); } // Handle Uint8Array if (typedArray instanceof Uint8Array) { // Shortcut var typedArrayByteLength = typedArray.byteLength; // Extract bytes var words = []; for (var i = 0; i < typedArrayByteLength; i++) { words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); } // Initialize this word array superInit.call(this, words, typedArrayByteLength); } else { // Else call normal init superInit.apply(this, arguments); } }; subInit.prototype = WordArray; }()); return CryptoJS.lib.WordArray; })); /***/ }), /***/ "F8wB": /*!********************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.less?modules ***! \********************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin module.exports = {"loading":"loading___1SIOG"}; /***/ }), /***/ "GRuw": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha224.js ***! \******************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./sha256 */ "lPiR")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_algo = C.algo; var SHA256 = C_algo.SHA256; /** * SHA-224 hash algorithm. */ var SHA224 = C_algo.SHA224 = SHA256.extend({ _doReset: function () { this._hash = new WordArray.init([ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]); }, _doFinalize: function () { var hash = SHA256._doFinalize.call(this); hash.sigBytes -= 4; return hash; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA224('message'); * var hash = CryptoJS.SHA224(wordArray); */ C.SHA224 = SHA256._createHelper(SHA224); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA224(message, key); */ C.HmacSHA224 = SHA256._createHmacHelper(SHA224); }()); return CryptoJS.SHA224; })); /***/ }), /***/ "GfqC": /*!********************************************************!*\ !*** ./node_modules/rc-upload/es/index.js + 6 modules ***! \********************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); var external_window_React_default = /*#__PURE__*/__webpack_require__.n(external_window_React_); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("TSYQ"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // CONCATENATED MODULE: ./node_modules/rc-upload/es/request.js function getError(option, xhr) { var msg = 'cannot ' + option.method + ' ' + option.action + ' ' + xhr.status + '\''; var err = new Error(msg); err.status = xhr.status; err.method = option.method; err.url = option.action; return err; } function getBody(xhr) { var text = xhr.responseText || xhr.response; if (!text) { return text; } try { return JSON.parse(text); } catch (e) { return text; } } // option { // onProgress: (event: { percent: number }): void, // onError: (event: Error, body?: Object): void, // onSuccess: (body: Object): void, // data: Object, // filename: String, // file: File, // withCredentials: Boolean, // action: String, // headers: Object, // } function upload(option) { // eslint-disable-next-line no-undef var xhr = new XMLHttpRequest(); if (option.onProgress && xhr.upload) { xhr.upload.onprogress = function progress(e) { if (e.total > 0) { e.percent = e.loaded / e.total * 100; } option.onProgress(e); }; } // eslint-disable-next-line no-undef var formData = new FormData(); if (option.data) { Object.keys(option.data).forEach(function (key) { var value = option.data[key]; // support key-value array data if (Array.isArray(value)) { value.forEach(function (item) { // { list: [ 11, 22 ] } // formData.append('list[]', 11); formData.append(key + '[]', item); }); return; } formData.append(key, option.data[key]); }); } // eslint-disable-next-line no-undef if (option.file instanceof Blob) { formData.append(option.filename, option.file, option.file.name); } else { formData.append(option.filename, option.file); } xhr.onerror = function error(e) { option.onError(e); }; xhr.onload = function onload() { // allow success when 2xx status // see https://github.com/react-component/upload/issues/34 if (xhr.status < 200 || xhr.status >= 300) { return option.onError(getError(option, xhr), getBody(xhr)); } return option.onSuccess(getBody(xhr), xhr); }; xhr.open(option.method, option.action, true); // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 if (option.withCredentials && 'withCredentials' in xhr) { xhr.withCredentials = true; } var headers = option.headers || {}; // when set headers['X-Requested-With'] = null , can close default XHR header // see https://github.com/react-component/upload/issues/33 if (headers['X-Requested-With'] !== null) { xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); } Object.keys(headers).forEach(function (h) { if (headers[h] !== null) { xhr.setRequestHeader(h, headers[h]); } }); xhr.send(formData); return { abort: function abort() { xhr.abort(); } }; } // CONCATENATED MODULE: ./node_modules/rc-upload/es/uid.js var now = +new Date(); var index = 0; function uid_uid() { return "rc-upload-" + now + "-" + ++index; } // CONCATENATED MODULE: ./node_modules/rc-upload/es/attr-accept.js function endsWith(str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; } /* harmony default export */ var attr_accept = (function (file, acceptedFiles) { if (file && acceptedFiles) { var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(','); var fileName = file.name || ''; var mimeType = file.type || ''; var baseMimeType = mimeType.replace(/\/.*$/, ''); return acceptedFilesArray.some(function (type) { var validType = type.trim(); if (validType.charAt(0) === '.') { return endsWith(fileName.toLowerCase(), validType.toLowerCase()); } else if (/\/\*$/.test(validType)) { // This is something like a image/* mime type return baseMimeType === validType.replace(/\/.*$/, ''); } return mimeType === validType; }); } return true; }); // CONCATENATED MODULE: ./node_modules/rc-upload/es/traverseFileTree.js function loopFiles(item, callback) { var dirReader = item.createReader(); var fileList = []; function sequence() { dirReader.readEntries(function (entries) { var entryList = Array.prototype.slice.apply(entries); fileList = fileList.concat(entryList); // Check if all the file has been viewed var isFinished = !entryList.length; if (isFinished) { callback(fileList); } else { sequence(); } }); } sequence(); } var traverseFileTree = function traverseFileTree(files, callback, isAccepted) { var _traverseFileTree = function _traverseFileTree(item, path) { path = path || ''; if (item.isFile) { item.file(function (file) { if (isAccepted(file)) { // https://github.com/ant-design/ant-design/issues/16426 if (item.fullPath && !file.webkitRelativePath) { Object.defineProperties(file, { webkitRelativePath: { writable: true } }); file.webkitRelativePath = item.fullPath.replace(/^\//, ''); Object.defineProperties(file, { webkitRelativePath: { writable: false } }); } callback([file]); } }); } else if (item.isDirectory) { loopFiles(item, function (entries) { entries.forEach(function (entryItem) { _traverseFileTree(entryItem, '' + path + item.name + '/'); }); }); } }; files.forEach(function (file) { _traverseFileTree(file.webkitGetAsEntry()); }); }; /* harmony default export */ var es_traverseFileTree = (traverseFileTree); // CONCATENATED MODULE: ./node_modules/rc-upload/es/AjaxUploader.js var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */ var dataOrAriaAttributeProps = function dataOrAriaAttributeProps(props) { return Object.keys(props).reduce(function (acc, key) { if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') { acc[key] = props[key]; } return acc; }, {}); }; var AjaxUploader_AjaxUploader = function (_Component) { _inherits(AjaxUploader, _Component); function AjaxUploader() { var _ref; var _temp, _this, _ret; _classCallCheck(this, AjaxUploader); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AjaxUploader.__proto__ || Object.getPrototypeOf(AjaxUploader)).call.apply(_ref, [this].concat(args))), _this), _this.state = { uid: uid_uid() }, _this.reqs = {}, _this.onChange = function (e) { var files = e.target.files; _this.uploadFiles(files); _this.reset(); }, _this.onClick = function (e) { var el = _this.fileInput; if (!el) { return; } var _this$props = _this.props, children = _this$props.children, onClick = _this$props.onClick; if (children && children.type === 'button') { el.parentNode.focus(); el.parentNode.querySelector('button').blur(); } el.click(); if (onClick) { onClick(e); } }, _this.onKeyDown = function (e) { if (e.key === 'Enter') { _this.onClick(); } }, _this.onFileDrop = function (e) { var multiple = _this.props.multiple; e.preventDefault(); if (e.type === 'dragover') { return; } if (_this.props.directory) { es_traverseFileTree(Array.prototype.slice.call(e.dataTransfer.items), _this.uploadFiles, function (_file) { return attr_accept(_file, _this.props.accept); }); } else { var files = Array.prototype.slice.call(e.dataTransfer.files).filter(function (file) { return attr_accept(file, _this.props.accept); }); if (multiple === false) { files = files.slice(0, 1); } _this.uploadFiles(files); } }, _this.uploadFiles = function (files) { var postFiles = Array.prototype.slice.call(files); postFiles.map(function (file) { file.uid = uid_uid(); return file; }).forEach(function (file) { _this.upload(file, postFiles); }); }, _this.saveFileInput = function (node) { _this.fileInput = node; }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(AjaxUploader, [{ key: 'componentDidMount', value: function componentDidMount() { this._isMounted = true; } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this._isMounted = false; this.abort(); } }, { key: 'upload', value: function upload(file, fileList) { var _this2 = this; var props = this.props; if (!props.beforeUpload) { // always async in case use react state to keep fileList return setTimeout(function () { return _this2.post(file); }, 0); } var before = props.beforeUpload(file, fileList); if (before && before.then) { before.then(function (processedFile) { var processedFileType = Object.prototype.toString.call(processedFile); if (processedFileType === '[object File]' || processedFileType === '[object Blob]') { return _this2.post(processedFile); } return _this2.post(file); })['catch'](function (e) { // eslint-disable-next-line no-console console.log(e); }); } else if (before !== false) { setTimeout(function () { return _this2.post(file); }, 0); } return undefined; } }, { key: 'post', value: function post(file) { var _this3 = this; if (!this._isMounted) { return; } var props = this.props; var onStart = props.onStart, onProgress = props.onProgress, _props$transformFile = props.transformFile, transformFile = _props$transformFile === undefined ? function (originFile) { return originFile; } : _props$transformFile; new Promise(function (resolve) { var action = props.action; if (typeof action === 'function') { action = action(file); } return resolve(action); }).then(function (action) { var uid = file.uid; var request = props.customRequest || upload; var transform = Promise.resolve(transformFile(file)).then(function (transformedFile) { var data = props.data; if (typeof data === 'function') { data = data(transformedFile); } return Promise.all([transformedFile, data]); })['catch'](function (e) { console.error(e); // eslint-disable-line no-console }); transform.then(function (_ref2) { var _ref3 = _slicedToArray(_ref2, 2), transformedFile = _ref3[0], data = _ref3[1]; var requestOption = { action: action, filename: props.name, data: data, file: transformedFile, headers: props.headers, withCredentials: props.withCredentials, method: props.method || 'post', onProgress: onProgress ? function (e) { onProgress(e, file); } : null, onSuccess: function onSuccess(ret, xhr) { delete _this3.reqs[uid]; props.onSuccess(ret, file, xhr); }, onError: function onError(err, ret) { delete _this3.reqs[uid]; props.onError(err, ret, file); } }; onStart(file); _this3.reqs[uid] = request(requestOption); }); }); } }, { key: 'reset', value: function reset() { this.setState({ uid: uid_uid() }); } }, { key: 'abort', value: function abort(file) { var reqs = this.reqs; if (file) { var uid = file; if (file && file.uid) { uid = file.uid; } if (reqs[uid] && reqs[uid].abort) { reqs[uid].abort(); } delete reqs[uid]; } else { Object.keys(reqs).forEach(function (uid) { if (reqs[uid] && reqs[uid].abort) { reqs[uid].abort(); } delete reqs[uid]; }); } } }, { key: 'render', value: function render() { var _classNames; var _props = this.props, Tag = _props.component, prefixCls = _props.prefixCls, className = _props.className, disabled = _props.disabled, id = _props.id, style = _props.style, multiple = _props.multiple, accept = _props.accept, children = _props.children, directory = _props.directory, openFileDialogOnClick = _props.openFileDialogOnClick, onMouseEnter = _props.onMouseEnter, onMouseLeave = _props.onMouseLeave, otherProps = _objectWithoutProperties(_props, ['component', 'prefixCls', 'className', 'disabled', 'id', 'style', 'multiple', 'accept', 'children', 'directory', 'openFileDialogOnClick', 'onMouseEnter', 'onMouseLeave']); var cls = classnames_default()((_classNames = {}, _defineProperty(_classNames, prefixCls, true), _defineProperty(_classNames, prefixCls + '-disabled', disabled), _defineProperty(_classNames, className, className), _classNames)); var events = disabled ? {} : { onClick: openFileDialogOnClick ? this.onClick : function () {}, onKeyDown: openFileDialogOnClick ? this.onKeyDown : function () {}, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onDrop: this.onFileDrop, onDragOver: this.onFileDrop, tabIndex: '0' }; return external_window_React_default.a.createElement( Tag, _extends({}, events, { className: cls, role: 'button', style: style }), external_window_React_default.a.createElement('input', _extends({}, dataOrAriaAttributeProps(otherProps), { id: id, type: 'file', ref: this.saveFileInput, onClick: function onClick(e) { return e.stopPropagation(); } // https://github.com/ant-design/ant-design/issues/19948 , key: this.state.uid, style: { display: 'none' }, accept: accept, directory: directory ? 'directory' : null, webkitdirectory: directory ? 'webkitdirectory' : null, multiple: multiple, onChange: this.onChange })), children ); } }]); return AjaxUploader; }(external_window_React_["Component"]); /* harmony default export */ var es_AjaxUploader = (AjaxUploader_AjaxUploader); // CONCATENATED MODULE: ./node_modules/rc-upload/es/Upload.js var Upload_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var Upload_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function Upload_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Upload_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function Upload_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/prop-types:0 */ function empty() {} var Upload_Upload = function (_Component) { Upload_inherits(Upload, _Component); function Upload() { var _ref; var _temp, _this, _ret; Upload_classCallCheck(this, Upload); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = Upload_possibleConstructorReturn(this, (_ref = Upload.__proto__ || Object.getPrototypeOf(Upload)).call.apply(_ref, [this].concat(args))), _this), _this.saveUploader = function (node) { _this.uploader = node; }, _temp), Upload_possibleConstructorReturn(_this, _ret); } Upload_createClass(Upload, [{ key: 'abort', value: function abort(file) { this.uploader.abort(file); } }, { key: 'render', value: function render() { return external_window_React_default.a.createElement(es_AjaxUploader, Upload_extends({}, this.props, { ref: this.saveUploader })); } }]); return Upload; }(external_window_React_["Component"]); Upload_Upload.defaultProps = { component: 'span', prefixCls: 'rc-upload', data: {}, headers: {}, name: 'file', multipart: false, onStart: empty, onError: empty, onSuccess: empty, multiple: false, beforeUpload: null, customRequest: null, withCredentials: false, openFileDialogOnClick: true }; /* harmony default export */ var es_Upload = (Upload_Upload); // CONCATENATED MODULE: ./node_modules/rc-upload/es/index.js // export this package's api /* harmony default export */ var es = __webpack_exports__["a"] = (es_Upload); /***/ }), /***/ "Gytx": /*!********************************************!*\ !*** ./node_modules/shallowequal/index.js ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports) { // module.exports = function shallowEqual(objA, objB, compare, compareContext) { var ret = compare ? compare.call(compareContext, objA, objB) : void 0; if (ret !== void 0) { return !!ret; } if (objA === objB) { return true; } if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); // Test for A's keys different from B. for (var idx = 0; idx < keysA.length; idx++) { var key = keysA[idx]; if (!bHasOwnProperty(key)) { return false; } var valueA = objA[key]; var valueB = objB[key]; ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0; if (ret === false || (ret === void 0 && valueA !== valueB)) { return false; } } return true; }; /***/ }), /***/ "I8Z2": /*!**********************************************************!*\ !*** ./node_modules/mini-store/esm/index.js + 3 modules ***! \**********************************************************/ /*! exports provided: Provider, connect, create */ /*! exports used: Provider, connect, create */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ Provider_Provider; }); __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ connect; }); __webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ create; }); // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); // CONCATENATED MODULE: ./node_modules/mini-store/esm/Provider.js var __extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var MiniStoreContext = external_window_React_["createContext"](null); var Provider_Provider = /** @class */ (function (_super) { __extends(Provider, _super); function Provider() { return _super !== null && _super.apply(this, arguments) || this; } Provider.prototype.render = function () { return (external_window_React_["createElement"](MiniStoreContext.Provider, { value: this.props.store }, this.props.children)); }; return Provider; }(external_window_React_["Component"])); // EXTERNAL MODULE: ./node_modules/shallowequal/index.js var shallowequal = __webpack_require__("Gytx"); var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal); // EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js var hoist_non_react_statics_cjs = __webpack_require__("2mql"); var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs); // CONCATENATED MODULE: ./node_modules/mini-store/esm/connect.js var connect_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (undefined && undefined.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || 'Component'; } var defaultMapStateToProps = function () { return ({}); }; function connect(mapStateToProps, options) { if (options === void 0) { options = {}; } var shouldSubscribe = !!mapStateToProps; var finalMapStateToProps = mapStateToProps || defaultMapStateToProps; return function wrapWithConnect(WrappedComponent) { var Connect = /** @class */ (function (_super) { connect_extends(Connect, _super); function Connect(props, context) { var _this = _super.call(this, props, context) || this; _this.unsubscribe = null; _this.handleChange = function () { if (!_this.unsubscribe) { return; } var nextState = finalMapStateToProps(_this.store.getState(), _this.props); _this.setState({ subscribed: nextState }); }; _this.store = _this.context; _this.state = { subscribed: finalMapStateToProps(_this.store.getState(), props), store: _this.store, props: props, }; return _this; } Connect.getDerivedStateFromProps = function (props, prevState) { // using ownProps if (mapStateToProps && mapStateToProps.length === 2 && props !== prevState.props) { return { subscribed: finalMapStateToProps(prevState.store.getState(), props), props: props, }; } return { props: props }; }; Connect.prototype.componentDidMount = function () { this.trySubscribe(); }; Connect.prototype.componentWillUnmount = function () { this.tryUnsubscribe(); }; Connect.prototype.shouldComponentUpdate = function (nextProps, nextState) { return (!shallowequal_default()(this.props, nextProps) || !shallowequal_default()(this.state.subscribed, nextState.subscribed)); }; Connect.prototype.trySubscribe = function () { if (shouldSubscribe) { this.unsubscribe = this.store.subscribe(this.handleChange); this.handleChange(); } }; Connect.prototype.tryUnsubscribe = function () { if (this.unsubscribe) { this.unsubscribe(); this.unsubscribe = null; } }; Connect.prototype.render = function () { var props = __assign(__assign(__assign({}, this.props), this.state.subscribed), { store: this.store }); return external_window_React_["createElement"](WrappedComponent, __assign({}, props, { ref: this.props.miniStoreForwardedRef })); }; Connect.displayName = "Connect(" + getDisplayName(WrappedComponent) + ")"; Connect.contextType = MiniStoreContext; return Connect; }(external_window_React_["Component"])); if (options.forwardRef) { var forwarded = external_window_React_["forwardRef"](function (props, ref) { return external_window_React_["createElement"](Connect, __assign({}, props, { miniStoreForwardedRef: ref })); }); return hoist_non_react_statics_cjs_default()(forwarded, WrappedComponent); } return hoist_non_react_statics_cjs_default()(Connect, WrappedComponent); }; } // CONCATENATED MODULE: ./node_modules/mini-store/esm/create.js var create_assign = (undefined && undefined.__assign) || function () { create_assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return create_assign.apply(this, arguments); }; function create(initialState) { var state = initialState; var listeners = []; function setState(partial) { state = create_assign(create_assign({}, state), partial); for (var i = 0; i < listeners.length; i++) { listeners[i](); } } function getState() { return state; } function subscribe(listener) { listeners.push(listener); return function unsubscribe() { var index = listeners.indexOf(listener); listeners.splice(index, 1); }; } return { setState: setState, getState: getState, subscribe: subscribe, }; } // CONCATENATED MODULE: ./node_modules/mini-store/esm/index.js /***/ }), /***/ "Ib8C": /*!****************************************!*\ !*** ./node_modules/crypto-js/core.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(); } else {} }(this, function () { /*globals window, global, require*/ /** * CryptoJS core components. */ var CryptoJS = CryptoJS || (function (Math, undefined) { var crypto; // Native crypto from window (Browser) if (typeof window !== 'undefined' && window.crypto) { crypto = window.crypto; } // Native crypto in web worker (Browser) if (typeof self !== 'undefined' && self.crypto) { crypto = self.crypto; } // Native crypto from worker if (typeof globalThis !== 'undefined' && globalThis.crypto) { crypto = globalThis.crypto; } // Native (experimental IE 11) crypto from window (Browser) if (!crypto && typeof window !== 'undefined' && window.msCrypto) { crypto = window.msCrypto; } // Native crypto from global (NodeJS) if (!crypto && typeof global !== 'undefined' && global.crypto) { crypto = global.crypto; } // Native crypto import via require (NodeJS) if (!crypto && "function" === 'function') { try { crypto = __webpack_require__(/*! crypto */ 4); } catch (err) {} } /* * Cryptographically secure pseudorandom number generator * * As Math.random() is cryptographically not safe to use */ var cryptoSecureRandomInt = function () { if (crypto) { // Use getRandomValues method (Browser) if (typeof crypto.getRandomValues === 'function') { try { return crypto.getRandomValues(new Uint32Array(1))[0]; } catch (err) {} } // Use randomBytes method (NodeJS) if (typeof crypto.randomBytes === 'function') { try { return crypto.randomBytes(4).readInt32LE(); } catch (err) {} } } throw new Error('Native crypto module could not be used to get secure random number.'); }; /* * Local polyfill of Object.create */ var create = Object.create || (function () { function F() {} return function (obj) { var subtype; F.prototype = obj; subtype = new F(); F.prototype = null; return subtype; }; }()); /** * CryptoJS namespace. */ var C = {}; /** * Library namespace. */ var C_lib = C.lib = {}; /** * Base object for prototypal inheritance. */ var Base = C_lib.Base = (function () { return { /** * Creates a new object that inherits from this object. * * @param {Object} overrides Properties to copy into the new object. * * @return {Object} The new object. * * @static * * @example * * var MyType = CryptoJS.lib.Base.extend({ * field: 'value', * * method: function () { * } * }); */ extend: function (overrides) { // Spawn var subtype = create(this); // Augment if (overrides) { subtype.mixIn(overrides); } // Create default initializer if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { subtype.init = function () { subtype.$super.init.apply(this, arguments); }; } // Initializer's prototype is the subtype object subtype.init.prototype = subtype; // Reference supertype subtype.$super = this; return subtype; }, /** * Extends this object and runs the init method. * Arguments to create() will be passed to init(). * * @return {Object} The new object. * * @static * * @example * * var instance = MyType.create(); */ create: function () { var instance = this.extend(); instance.init.apply(instance, arguments); return instance; }, /** * Initializes a newly created object. * Override this method to add some logic when your objects are created. * * @example * * var MyType = CryptoJS.lib.Base.extend({ * init: function () { * // ... * } * }); */ init: function () { }, /** * Copies properties into this object. * * @param {Object} properties The properties to mix in. * * @example * * MyType.mixIn({ * field: 'value' * }); */ mixIn: function (properties) { for (var propertyName in properties) { if (properties.hasOwnProperty(propertyName)) { this[propertyName] = properties[propertyName]; } } // IE won't copy toString using the loop above if (properties.hasOwnProperty('toString')) { this.toString = properties.toString; } }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = instance.clone(); */ clone: function () { return this.init.prototype.extend(this); } }; }()); /** * An array of 32-bit words. * * @property {Array} words The array of 32-bit words. * @property {number} sigBytes The number of significant bytes in this word array. */ var WordArray = C_lib.WordArray = Base.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of 32-bit words. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.lib.WordArray.create(); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); */ init: function (words, sigBytes) { words = this.words = words || []; if (sigBytes != undefined) { this.sigBytes = sigBytes; } else { this.sigBytes = words.length * 4; } }, /** * Converts this word array to a string. * * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex * * @return {string} The stringified word array. * * @example * * var string = wordArray + ''; * var string = wordArray.toString(); * var string = wordArray.toString(CryptoJS.enc.Utf8); */ toString: function (encoder) { return (encoder || Hex).stringify(this); }, /** * Concatenates a word array to this word array. * * @param {WordArray} wordArray The word array to append. * * @return {WordArray} This word array. * * @example * * wordArray1.concat(wordArray2); */ concat: function (wordArray) { // Shortcuts var thisWords = this.words; var thatWords = wordArray.words; var thisSigBytes = this.sigBytes; var thatSigBytes = wordArray.sigBytes; // Clamp excess bits this.clamp(); // Concat if (thisSigBytes % 4) { // Copy one byte at a time for (var i = 0; i < thatSigBytes; i++) { var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); } } else { // Copy one word at a time for (var j = 0; j < thatSigBytes; j += 4) { thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; } } this.sigBytes += thatSigBytes; // Chainable return this; }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function () { // Shortcuts var words = this.words; var sigBytes = this.sigBytes; // Clamp words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); words.length = Math.ceil(sigBytes / 4); }, /** * Creates a copy of this word array. * * @return {WordArray} The clone. * * @example * * var clone = wordArray.clone(); */ clone: function () { var clone = Base.clone.call(this); clone.words = this.words.slice(0); return clone; }, /** * Creates a word array filled with random bytes. * * @param {number} nBytes The number of random bytes to generate. * * @return {WordArray} The random word array. * * @static * * @example * * var wordArray = CryptoJS.lib.WordArray.random(16); */ random: function (nBytes) { var words = []; for (var i = 0; i < nBytes; i += 4) { words.push(cryptoSecureRandomInt()); } return new WordArray.init(words, nBytes); } }); /** * Encoder namespace. */ var C_enc = C.enc = {}; /** * Hex encoding strategy. */ var Hex = C_enc.Hex = { /** * Converts a word array to a hex string. * * @param {WordArray} wordArray The word array. * * @return {string} The hex string. * * @static * * @example * * var hexString = CryptoJS.enc.Hex.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var hexChars = []; for (var i = 0; i < sigBytes; i++) { var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; hexChars.push((bite >>> 4).toString(16)); hexChars.push((bite & 0x0f).toString(16)); } return hexChars.join(''); }, /** * Converts a hex string to a word array. * * @param {string} hexStr The hex string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Hex.parse(hexString); */ parse: function (hexStr) { // Shortcut var hexStrLength = hexStr.length; // Convert var words = []; for (var i = 0; i < hexStrLength; i += 2) { words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); } return new WordArray.init(words, hexStrLength / 2); } }; /** * Latin1 encoding strategy. */ var Latin1 = C_enc.Latin1 = { /** * Converts a word array to a Latin1 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Latin1 string. * * @static * * @example * * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var latin1Chars = []; for (var i = 0; i < sigBytes; i++) { var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; latin1Chars.push(String.fromCharCode(bite)); } return latin1Chars.join(''); }, /** * Converts a Latin1 string to a word array. * * @param {string} latin1Str The Latin1 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); */ parse: function (latin1Str) { // Shortcut var latin1StrLength = latin1Str.length; // Convert var words = []; for (var i = 0; i < latin1StrLength; i++) { words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); } return new WordArray.init(words, latin1StrLength); } }; /** * UTF-8 encoding strategy. */ var Utf8 = C_enc.Utf8 = { /** * Converts a word array to a UTF-8 string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-8 string. * * @static * * @example * * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); */ stringify: function (wordArray) { try { return decodeURIComponent(escape(Latin1.stringify(wordArray))); } catch (e) { throw new Error('Malformed UTF-8 data'); } }, /** * Converts a UTF-8 string to a word array. * * @param {string} utf8Str The UTF-8 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); */ parse: function (utf8Str) { return Latin1.parse(unescape(encodeURIComponent(utf8Str))); } }; /** * Abstract buffered block algorithm template. * * The property blockSize must be implemented in a concrete subtype. * * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 */ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function () { // Initial values this._data = new WordArray.init(); this._nDataBytes = 0; }, /** * Adds new data to this block algorithm's buffer. * * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. * * @example * * bufferedBlockAlgorithm._append('data'); * bufferedBlockAlgorithm._append(wordArray); */ _append: function (data) { // Convert string to WordArray, else assume WordArray already if (typeof data == 'string') { data = Utf8.parse(data); } // Append this._data.concat(data); this._nDataBytes += data.sigBytes; }, /** * Processes available data blocks. * * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. * * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. * * @return {WordArray} The processed data. * * @example * * var processedData = bufferedBlockAlgorithm._process(); * var processedData = bufferedBlockAlgorithm._process(!!'flush'); */ _process: function (doFlush) { var processedWords; // Shortcuts var data = this._data; var dataWords = data.words; var dataSigBytes = data.sigBytes; var blockSize = this.blockSize; var blockSizeBytes = blockSize * 4; // Count blocks ready var nBlocksReady = dataSigBytes / blockSizeBytes; if (doFlush) { // Round up to include partial blocks nBlocksReady = Math.ceil(nBlocksReady); } else { // Round down to include only full blocks, // less the number of blocks that must remain in the buffer nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); } // Count words ready var nWordsReady = nBlocksReady * blockSize; // Count bytes ready var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); // Process blocks if (nWordsReady) { for (var offset = 0; offset < nWordsReady; offset += blockSize) { // Perform concrete-algorithm logic this._doProcessBlock(dataWords, offset); } // Remove processed words processedWords = dataWords.splice(0, nWordsReady); data.sigBytes -= nBytesReady; } // Return processed words return new WordArray.init(processedWords, nBytesReady); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = bufferedBlockAlgorithm.clone(); */ clone: function () { var clone = Base.clone.call(this); clone._data = this._data.clone(); return clone; }, _minBufferSize: 0 }); /** * Abstract hasher template. * * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) */ var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ /** * Configuration options. */ cfg: Base.extend(), /** * Initializes a newly created hasher. * * @param {Object} cfg (Optional) The configuration options to use for this hash computation. * * @example * * var hasher = CryptoJS.algo.SHA256.create(); */ init: function (cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Set initial values this.reset(); }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this); // Perform concrete-hasher logic this._doReset(); }, /** * Updates this hasher with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {Hasher} This hasher. * * @example * * hasher.update('message'); * hasher.update(wordArray); */ update: function (messageUpdate) { // Append this._append(messageUpdate); // Update the hash this._process(); // Chainable return this; }, /** * Finalizes the hash computation. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The hash. * * @example * * var hash = hasher.finalize(); * var hash = hasher.finalize('message'); * var hash = hasher.finalize(wordArray); */ finalize: function (messageUpdate) { // Final message update if (messageUpdate) { this._append(messageUpdate); } // Perform concrete-hasher logic var hash = this._doFinalize(); return hash; }, blockSize: 512/32, /** * Creates a shortcut function to a hasher's object interface. * * @param {Hasher} hasher The hasher to create a helper for. * * @return {Function} The shortcut function. * * @static * * @example * * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); */ _createHelper: function (hasher) { return function (message, cfg) { return new hasher.init(cfg).finalize(message); }; }, /** * Creates a shortcut function to the HMAC's object interface. * * @param {Hasher} hasher The hasher to use in this HMAC helper. * * @return {Function} The shortcut function. * * @static * * @example * * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); */ _createHmacHelper: function (hasher) { return function (message, key) { return new C_algo.HMAC.init(hasher, key).finalize(message); }; } }); /** * Algorithm namespace. */ var C_algo = C.algo = {}; return C; }(Math)); return CryptoJS; })); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../@umijs/deps/compiled/webpack/4/global.js */ "IyRk"))) /***/ }), /***/ "K3mO": /*!******************************************!*\ !*** ./node_modules/crypto-js/evpkdf.js ***! \******************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./sha1 */ "3y9D"), __webpack_require__(/*! ./hmac */ "WYAk")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var WordArray = C_lib.WordArray; var C_algo = C.algo; var MD5 = C_algo.MD5; /** * This key derivation function is meant to conform with EVP_BytesToKey. * www.openssl.org/docs/crypto/EVP_BytesToKey.html */ var EvpKDF = C_algo.EvpKDF = Base.extend({ /** * Configuration options. * * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) * @property {Hasher} hasher The hash algorithm to use. Default: MD5 * @property {number} iterations The number of iterations to perform. Default: 1 */ cfg: Base.extend({ keySize: 128/32, hasher: MD5, iterations: 1 }), /** * Initializes a newly created key derivation function. * * @param {Object} cfg (Optional) The configuration options to use for the derivation. * * @example * * var kdf = CryptoJS.algo.EvpKDF.create(); * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); */ init: function (cfg) { this.cfg = this.cfg.extend(cfg); }, /** * Derives a key from a password. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * * @return {WordArray} The derived key. * * @example * * var key = kdf.compute(password, salt); */ compute: function (password, salt) { var block; // Shortcut var cfg = this.cfg; // Init hasher var hasher = cfg.hasher.create(); // Initial values var derivedKey = WordArray.create(); // Shortcuts var derivedKeyWords = derivedKey.words; var keySize = cfg.keySize; var iterations = cfg.iterations; // Generate key while (derivedKeyWords.length < keySize) { if (block) { hasher.update(block); } block = hasher.update(password).finalize(salt); hasher.reset(); // Iterations for (var i = 1; i < iterations; i++) { block = hasher.finalize(block); hasher.reset(); } derivedKey.concat(block); } derivedKey.sigBytes = keySize * 4; return derivedKey; } }); /** * Derives a key from a password. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * @param {Object} cfg (Optional) The configuration options to use for this computation. * * @return {WordArray} The derived key. * * @static * * @example * * var key = CryptoJS.EvpKDF(password, salt); * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); */ C.EvpKDF = function (password, salt, cfg) { return EvpKDF.create(cfg).compute(password, salt); }; }()); return CryptoJS.EvpKDF; })); /***/ }), /***/ "KhGG": /*!*********************************************!*\ !*** ./src/components/UploadFile/index.tsx ***! \*********************************************/ /*! exports provided: decrypt, uploadFile, UploadFile, default */ /*! exports used: decrypt, default, uploadFile */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return decrypt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return uploadFile; }); /* unused harmony export UploadFile */ /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */ "0Owb"); /* harmony import */ var antd_es_message_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/message/style */ "miYZ"); /* harmony import */ var antd_es_message__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/message */ "tsqr"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray */ "oBTY"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */ "PpiC"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8"); /* harmony import */ var antd_es_upload_style__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd/es/upload/style */ "DZo9"); /* harmony import */ var antd_es_upload__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd/es/upload */ "8z0m"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS"); /* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "cDcd"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/utils/fetch */ "ErOA"); /* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! crypto-js */ "NFKh"); /* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! uuid */ "7Cbv"); /* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! umi */ "9kvl"); /* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ali-oss */ "mxV5"); /* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(ali_oss__WEBPACK_IMPORTED_MODULE_16__); var Dragger = antd_es_upload__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].Dragger; var decrypt = function decrypt(word) { var ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; var IV = "5183666c72eec9e4"; var key = crypto_js__WEBPACK_IMPORTED_MODULE_13___default.a.enc.Utf8.parse(ENC_KEY); var iv = crypto_js__WEBPACK_IMPORTED_MODULE_13___default.a.enc.Utf8.parse(IV); var decrypt = crypto_js__WEBPACK_IMPORTED_MODULE_13___default.a.AES.decrypt(word, key, { iv: iv, mode: crypto_js__WEBPACK_IMPORTED_MODULE_13___default.a.mode.CBC // padding: CryptoJS.pad.ZeroPadding }); return decrypt.toString(crypto_js__WEBPACK_IMPORTED_MODULE_13___default.a.enc.Utf8); }; var tempCheckpoint; var uploadFile = /*#__PURE__*/function () { var _ref = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.mark(function _callee(file, obj, config) { var _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6; var res, name, client; return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: obj.file_name = file.name; _context.next = 3; return Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_12__[/* default */ "a"])('/api/buckets/get_upload_token.json', { method: "get" }); case 3: res = _context.sent; console.log("decrypt(res.data):", decrypt(res.data)); res.data = JSON.parse(decrypt(res.data)); name = Object(uuid__WEBPACK_IMPORTED_MODULE_14__[/* default */ "a"])(); // const name = file.name client = new ali_oss__WEBPACK_IMPORTED_MODULE_16___default.a({ endpoint: res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.end_point, region: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.region, accessKeyId: res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.access_key_id, accessKeySecret: res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.access_key_secret, bucket: res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.bucket, stsToken: res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.security_token }); return _context.abrupt("return", new Promise(function (resolve, reject) { var _res$data7; client.multipartUpload("".concat(name), new Blob([file], { type: file.type }), Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({ timeout: 200 * 1000, partSize: 102400 }, config), {}, { callback: { url: res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.callback_url, host: res === null || res === void 0 ? void 0 : res.data.bucket_host, body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&' + Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_12__[/* parseParams */ "e"])(obj) // body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&login=' + obj.login + '&container_id=' + obj.container_id + '&container_type='+obj.container_type, } })).then(function (result) { var _result$data; file.response = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.data; resolve(result === null || result === void 0 ? void 0 : result.data); }).catch(function (err) { reject(err); console.log("err:", err); }); })); case 9: case "end": return _context.stop(); } } }, _callee); })); return function uploadFile(_x, _x2, _x3) { return _ref.apply(this, arguments); }; }(); var UploadFile = function UploadFile(_ref2) { var user = _ref2.user, cancelUpload = _ref2.cancelUpload, props = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(_ref2, ["user", "cancelUpload"]); var _useState = Object(react__WEBPACK_IMPORTED_MODULE_11__["useState"])([]), _useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(_useState, 2), fileList = _useState2[0], setFileList = _useState2[1]; var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_11__["useState"])(), _useState4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(_useState3, 2), client = _useState4[0], setClient = _useState4[1]; var _props = { onRemove: function onRemove(e) { setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(fileList.filter(function (item) { return item.name !== e.name; }))); props.onChange(fileList.filter(function (item) { return item.name !== e.name; })); }, disabled: props.disabled, multiple: true, fileList: fileList === null || fileList === void 0 ? void 0 : fileList.map(function (item) { return item.file; }), customRequest: function customRequest() {}, beforeUpload: function () { var _beforeUpload = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.mark(function _callee2(file) { var fileSize; return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: fileSize = props.maxSize || 1024 * 1024 * 1024 * 1; if (!fileList.filter(function (item) { return item.name === file.name; }).length) { _context2.next = 4; break; } antd_es_message__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].info("".concat(file.name, "\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")); return _context2.abrupt("return"); case 4: if (!((file === null || file === void 0 ? void 0 : file.size) > fileSize)) { _context2.next = 7; break; } antd_es_message__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].info("\u6587\u4EF6\u8D85\u8FC7".concat(fileSize / 1024 / 1024 / 1024, "GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")); return _context2.abrupt("return", false); case 7: fileList.push({ name: file.name, file: file }); setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(fileList)); props.onChange(fileList); return _context2.abrupt("return", false); case 11: case "end": return _context2.stop(); } } }, _callee2); })); function beforeUpload(_x4) { return _beforeUpload.apply(this, arguments); } return beforeUpload; }() }; var _uploadFiles = /*#__PURE__*/function () { var _ref3 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.mark(function _callee3(file, obj) { var _res$data8, _res$data9, _res$data10, _res$data11, _res$data12, _res$data13; var name, res, filename; return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: obj.file_name = file.name; name = file.name; _context3.next = 4; return Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_12__[/* default */ "a"])('/api/buckets/get_upload_token_for_big_files.json', { method: "get" }); case 4: res = _context3.sent; res.data = JSON.parse(decrypt(res.data)); if (!((res === null || res === void 0 ? void 0 : res.status) !== 0)) { _context3.next = 12; break; } fileList[fileList.findIndex(function (item) { return item.name === name; })]['status'] = 'error'; fileList[fileList.findIndex(function (item) { return item.name === name; })]['file']['status'] = 'error'; props.onChange(fileList); antd_es_message__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].warn("上传失败,请重新尝试"); return _context3.abrupt("return"); case 12: client = new ali_oss__WEBPACK_IMPORTED_MODULE_16___default.a({ endpoint: res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.end_point, region: res === null || res === void 0 ? void 0 : (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.region, accessKeyId: res === null || res === void 0 ? void 0 : (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.access_key_id, accessKeySecret: res === null || res === void 0 ? void 0 : (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.access_key_secret, bucket: res === null || res === void 0 ? void 0 : (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : _res$data12.bucket, stsToken: res === null || res === void 0 ? void 0 : (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.security_token }); console.log(file, 'file'); setClient(client); filename = Object(uuid__WEBPACK_IMPORTED_MODULE_14__[/* default */ "a"])(); return _context3.abrupt("return", new Promise(function (resolve, reject) { try { var _res$data14; client.multipartUpload("".concat(props.identifier, "/").concat(filename).concat(name.indexOf(".") > -1 ? '.' + name.split(".").pop() : ""), new Blob([file.file], { type: file.file.type }), { timeout: 3600 * 1000, partSize: 1002400, progress: function progress(p, checkpoint, res) { try { console.log("进度", p, checkpoint, res); var index = fileList.findIndex(function (item) { return item.name === name; }); fileList[index]['file']['percent'] = p * 100; // if (p === 1) { // fileList[index]['status'] = 'done' // fileList[index]['file']['status'] = 'done' // props.onChange(fileList) // } // if (p === 1) { // fileList[index]['status'] = 'done' // fileList[index]['file']['status'] = 'done' // props.onChange(fileList) // } fileList[index].tempCheckpoint = checkpoint; setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(fileList)); } catch (e) {} }, checkpoint: fileList[fileList.findIndex(function (item) { return item.name === name; })].tempCheckpoint, callback: { customValue: { id: name + '' }, url: res === null || res === void 0 ? void 0 : (_res$data14 = res.data) === null || _res$data14 === void 0 ? void 0 : _res$data14.callback_url, host: res === null || res === void 0 ? void 0 : res.data.bucket_host, body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&' + Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_12__[/* parseParams */ "e"])(obj) } }).then(function (result) { var _result$data2; var index = fileList.findIndex(function (item) { return item.name === name; }); var status = 'done'; if (((_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.status) === 0) { var _result$data3; file.response = (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : _result$data3.data; var _index = fileList.findIndex(function (item) { return item.name === name; }); fileList[_index]['status'] = 'done'; fileList[_index]['file']['status'] = 'done'; } else { var _result$data4; antd_es_message__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].warn((_result$data4 = result.data) === null || _result$data4 === void 0 ? void 0 : _result$data4.message); status = 'error'; } fileList[index]['status'] = status; fileList[index]['file']['status'] = status; props.onChange(fileList); resolve(result === null || result === void 0 ? void 0 : result.data); }).catch(function (err) { fileList[fileList.findIndex(function (item) { return item.name === name; })]['status'] = 'error'; fileList[fileList.findIndex(function (item) { return item.name === name; })]['file']['status'] = 'error'; antd_es_message__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"].warn("上传失败,请重新尝试"); setFileList(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(fileList)); props.onChange(fileList); reject(err); console.log("err:", err); }); } catch (e) {} })); case 17: case "end": return _context3.stop(); } } }, _callee3); })); return function _uploadFiles(_x5, _x6) { return _ref3.apply(this, arguments); }; }(); Object(react__WEBPACK_IMPORTED_MODULE_11__["useEffect"])(function () { if (fileList.every(function (item) { return item === 'done' || item === 'error'; })) { props.onComplete(fileList); } }, [fileList]); Object(react__WEBPACK_IMPORTED_MODULE_11__["useEffect"])(function () { if (cancelUpload) { var _client; (_client = client) === null || _client === void 0 ? void 0 : _client.cancel(); } }, [cancelUpload]); Object(react__WEBPACK_IMPORTED_MODULE_11__["useEffect"])(function () { if (props.uploading) fileList.map( /*#__PURE__*/function () { var _ref4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.mark(function _callee4(item) { var _user$userInfo, res; return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_10___default.a.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: if (!((!item.status || item.status === 'error') && !cancelUpload)) { _context4.next = 6; break; } item.status = 'uploading'; item.file.status = 'uploading'; _context4.next = 5; return _uploadFiles(item, { login: user === null || user === void 0 ? void 0 : (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, container_type: props.container_type, container_id: props.container_id, description: props.description }); case 5: res = _context4.sent; case 6: case "end": return _context4.stop(); } } }, _callee4); })); return function (_x7) { return _ref4.apply(this, arguments); }; }()); }, [props.uploading]); return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement(Dragger, Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, _props, { height: props.height, className: props.className }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("p", { className: "ant-upload-hint" }, props.text || '拖拽文件或者点击上传')); }; /* harmony default export */ __webpack_exports__["b"] = (Object(umi__WEBPACK_IMPORTED_MODULE_15__[/* connect */ "a"])(function (_ref5) { var loading = _ref5.loading, globalSetting = _ref5.globalSetting, user = _ref5.user; return { globalSetting: globalSetting, loading: loading.models.competitions, user: user }; })(UploadFile)); /***/ }), /***/ "KmYQ": /*!***************************************************!*\ !*** ./node_modules/crypto-js/pad-zeropadding.js ***! \***************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { /** * Zero padding strategy. */ CryptoJS.pad.ZeroPadding = { pad: function (data, blockSize) { // Shortcut var blockSizeBytes = blockSize * 4; // Pad data.clamp(); data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); }, unpad: function (data) { // Shortcut var dataWords = data.words; // Unpad var i = data.sigBytes - 1; for (var i = data.sigBytes - 1; i >= 0; i--) { if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { data.sigBytes = i + 1; break; } } } }; return CryptoJS.pad.ZeroPadding; })); /***/ }), /***/ "LdHM": /*!********************************************************!*\ !*** ./node_modules/rc-select/es/index.js + 6 modules ***! \********************************************************/ /*! exports provided: Option, OptGroup, default */ /*! exports used: OptGroup, Option, default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/TransBtn.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/generate.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/commonUtil.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/valueUtil.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMemo.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/pickAttrs.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ es_Option; }); __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ es_OptGroup; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__("1OyB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__("vuIU"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js var inherits = __webpack_require__("Ji7U"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules var createSuper = __webpack_require__("LK+K"); // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("rePB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__("Ff2n"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules var slicedToArray = __webpack_require__("ODXe"); // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js var KeyCode = __webpack_require__("4IlW"); // EXTERNAL MODULE: ./node_modules/rc-util/es/pickAttrs.js var pickAttrs = __webpack_require__("bX4T"); // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMemo.js var useMemo = __webpack_require__("YrtM"); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("TSYQ"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/rc-virtual-list/es/index.js + 19 modules var es = __webpack_require__("+nKL"); // EXTERNAL MODULE: ./node_modules/rc-select/es/TransBtn.js var TransBtn = __webpack_require__("8OUc"); // CONCATENATED MODULE: ./node_modules/rc-select/es/OptionList.js /** * Using virtual list of option display. * Will fallback to dom if use customize render. */ var OptionList_OptionList = function OptionList(_ref, ref) { var prefixCls = _ref.prefixCls, id = _ref.id, flattenOptions = _ref.flattenOptions, childrenAsData = _ref.childrenAsData, values = _ref.values, searchValue = _ref.searchValue, multiple = _ref.multiple, defaultActiveFirstOption = _ref.defaultActiveFirstOption, height = _ref.height, itemHeight = _ref.itemHeight, notFoundContent = _ref.notFoundContent, open = _ref.open, menuItemSelectedIcon = _ref.menuItemSelectedIcon, virtual = _ref.virtual, onSelect = _ref.onSelect, onToggleOpen = _ref.onToggleOpen, onActiveValue = _ref.onActiveValue, onScroll = _ref.onScroll, onMouseEnter = _ref.onMouseEnter; var itemPrefixCls = "".concat(prefixCls, "-item"); var memoFlattenOptions = Object(useMemo["a" /* default */])(function () { return flattenOptions; }, [open, flattenOptions], function (prev, next) { return next[0] && prev[1] !== next[1]; }); // =========================== List =========================== var listRef = external_window_React_["useRef"](null); var onListMouseDown = function onListMouseDown(event) { event.preventDefault(); }; var scrollIntoView = function scrollIntoView(index) { if (listRef.current) { listRef.current.scrollTo({ index: index }); } }; // ========================== Active ========================== var getEnabledActiveIndex = function getEnabledActiveIndex(index) { var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var len = memoFlattenOptions.length; for (var i = 0; i < len; i += 1) { var current = (index + i * offset + len) % len; var _memoFlattenOptions$c = memoFlattenOptions[current], group = _memoFlattenOptions$c.group, data = _memoFlattenOptions$c.data; if (!group && !data.disabled) { return current; } } return -1; }; var _React$useState = external_window_React_["useState"](function () { return getEnabledActiveIndex(0); }), _React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2), activeIndex = _React$useState2[0], setActiveIndex = _React$useState2[1]; var setActive = function setActive(index) { setActiveIndex(index); // Trigger active event var flattenItem = memoFlattenOptions[index]; if (!flattenItem) { onActiveValue(null, -1); return; } onActiveValue(flattenItem.data.value, index); }; // Auto active first item when list length or searchValue changed external_window_React_["useEffect"](function () { setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1); }, [memoFlattenOptions.length, searchValue]); // Auto scroll to item position in single mode external_window_React_["useEffect"](function () { /** * React will skip `onChange` when component update. * `setActive` function will call root accessibility state update which makes re-render. * So we need to delay to let Input component trigger onChange first. */ var timeoutId = setTimeout(function () { if (!multiple && open && values.size === 1) { var value = Array.from(values)[0]; var index = memoFlattenOptions.findIndex(function (_ref2) { var data = _ref2.data; return data.value === value; }); setActive(index); scrollIntoView(index); } }); return function () { return clearTimeout(timeoutId); }; }, [open]); // ========================== Values ========================== var onSelectValue = function onSelectValue(value) { if (value !== undefined) { onSelect(value, { selected: !values.has(value) }); } // Single mode should always close by select if (!multiple) { onToggleOpen(false); } }; // ========================= Keyboard ========================= external_window_React_["useImperativeHandle"](ref, function () { return { onKeyDown: function onKeyDown(event) { var which = event.which; switch (which) { // >>> Arrow keys case KeyCode["a" /* default */].UP: case KeyCode["a" /* default */].DOWN: { var offset = 0; if (which === KeyCode["a" /* default */].UP) { offset = -1; } else if (which === KeyCode["a" /* default */].DOWN) { offset = 1; } if (offset !== 0) { var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset); scrollIntoView(nextActiveIndex); setActive(nextActiveIndex); } break; } // >>> Select case KeyCode["a" /* default */].ENTER: { // value var item = memoFlattenOptions[activeIndex]; if (item && !item.data.disabled) { onSelectValue(item.data.value); } else { onSelectValue(undefined); } if (open) { event.preventDefault(); } break; } // >>> Close case KeyCode["a" /* default */].ESC: { onToggleOpen(false); } } }, onKeyUp: function onKeyUp() {}, scrollTo: function scrollTo(index) { scrollIntoView(index); } }; }); // ========================== Render ========================== if (memoFlattenOptions.length === 0) { return external_window_React_["createElement"]("div", { role: "listbox", id: "".concat(id, "_list"), className: "".concat(itemPrefixCls, "-empty"), onMouseDown: onListMouseDown }, notFoundContent); } function renderItem(index) { var item = memoFlattenOptions[index]; if (!item) return null; var itemData = item.data || {}; var value = itemData.value, label = itemData.label, children = itemData.children; var attrs = Object(pickAttrs["a" /* default */])(itemData, true); var mergedLabel = childrenAsData ? children : label; return item ? external_window_React_["createElement"]("div", Object.assign({ "aria-label": typeof mergedLabel === 'string' ? mergedLabel : null }, attrs, { key: index, role: "option", id: "".concat(id, "_list_").concat(index), "aria-selected": values.has(value) }), value) : null; } return external_window_React_["createElement"](external_window_React_["Fragment"], null, external_window_React_["createElement"]("div", { role: "listbox", id: "".concat(id, "_list"), style: { height: 0, width: 0, overflow: 'hidden' } }, renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), external_window_React_["createElement"](es["a" /* default */], { itemKey: "key", ref: listRef, data: memoFlattenOptions, height: height, itemHeight: itemHeight, fullHeight: false, onMouseDown: onListMouseDown, onScroll: onScroll, virtual: virtual, onMouseEnter: onMouseEnter }, function (_ref3, itemIndex) { var _classNames; var group = _ref3.group, groupOption = _ref3.groupOption, data = _ref3.data; var label = data.label, key = data.key; // Group if (group) { return external_window_React_["createElement"]("div", { className: classnames_default()(itemPrefixCls, "".concat(itemPrefixCls, "-group")) }, label !== undefined ? label : key); } var disabled = data.disabled, value = data.value, title = data.title, children = data.children, style = data.style, className = data.className, otherProps = Object(objectWithoutProperties["a" /* default */])(data, ["disabled", "value", "title", "children", "style", "className"]); // Option var selected = values.has(value); var optionPrefixCls = "".concat(itemPrefixCls, "-option"); var optionClassName = classnames_default()(itemPrefixCls, optionPrefixCls, className, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(optionPrefixCls, "-grouped"), groupOption), Object(defineProperty["a" /* default */])(_classNames, "".concat(optionPrefixCls, "-active"), activeIndex === itemIndex && !disabled), Object(defineProperty["a" /* default */])(_classNames, "".concat(optionPrefixCls, "-disabled"), disabled), Object(defineProperty["a" /* default */])(_classNames, "".concat(optionPrefixCls, "-selected"), selected), _classNames)); var mergedLabel = childrenAsData ? children : label; var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected; return external_window_React_["createElement"]("div", Object.assign({}, otherProps, { "aria-selected": selected, className: optionClassName, title: title, onMouseMove: function onMouseMove() { if (activeIndex === itemIndex || disabled) { return; } setActive(itemIndex); }, onClick: function onClick() { if (!disabled) { onSelectValue(value); } }, style: style }), external_window_React_["createElement"]("div", { className: "".concat(optionPrefixCls, "-content") }, mergedLabel || value), external_window_React_["isValidElement"](menuItemSelectedIcon) || selected, iconVisible && external_window_React_["createElement"](TransBtn["a" /* default */], { className: "".concat(itemPrefixCls, "-option-state"), customizeIcon: menuItemSelectedIcon, customizeIconProps: { isSelected: selected } }, selected ? '✓' : null)); })); }; var RefOptionList = external_window_React_["forwardRef"](OptionList_OptionList); RefOptionList.displayName = 'OptionList'; /* harmony default export */ var es_OptionList = (RefOptionList); // CONCATENATED MODULE: ./node_modules/rc-select/es/Option.js /** This is a placeholder, not real render in dom */ var Option = function Option() { return null; }; Option.isSelectOption = true; /* harmony default export */ var es_Option = (Option); // CONCATENATED MODULE: ./node_modules/rc-select/es/OptGroup.js /** This is a placeholder, not real render in dom */ var OptGroup = function OptGroup() { return null; }; OptGroup.isSelectOptGroup = true; /* harmony default export */ var es_OptGroup = (OptGroup); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__("VTBJ"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js var toArray = __webpack_require__("Zm9Q"); // CONCATENATED MODULE: ./node_modules/rc-select/es/utils/legacyUtil.js function convertNodeToOption(node) { var key = node.key, _node$props = node.props, children = _node$props.children, value = _node$props.value, restProps = Object(objectWithoutProperties["a" /* default */])(_node$props, ["children", "value"]); return Object(objectSpread2["a" /* default */])({ key: key, value: value !== undefined ? value : key, children: children }, restProps); } function convertChildrenToData(nodes) { var optionOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return Object(toArray["a" /* default */])(nodes).map(function (node, index) { if (!external_window_React_["isValidElement"](node) || !node.type) { return null; } var isSelectOptGroup = node.type.isSelectOptGroup, key = node.key, _node$props2 = node.props, children = _node$props2.children, restProps = Object(objectWithoutProperties["a" /* default */])(_node$props2, ["children"]); if (optionOnly || !isSelectOptGroup) { return convertNodeToOption(node); } return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({ key: "__RC_SELECT_GRP__".concat(key === null ? index : key, "__"), label: key }, restProps), {}, { options: convertChildrenToData(children) }); }).filter(function (data) { return data; }); } // EXTERNAL MODULE: ./node_modules/rc-select/es/utils/valueUtil.js var valueUtil = __webpack_require__("2Qr1"); // EXTERNAL MODULE: ./node_modules/rc-select/es/generate.js + 11 modules var generate = __webpack_require__("qNPg"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__("U8pU"); // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js var warning = __webpack_require__("Kwbf"); // EXTERNAL MODULE: ./node_modules/rc-select/es/utils/commonUtil.js var commonUtil = __webpack_require__("WKfj"); // CONCATENATED MODULE: ./node_modules/rc-select/es/utils/warningPropsUtil.js function warningProps(props) { var mode = props.mode, options = props.options, children = props.children, backfill = props.backfill, allowClear = props.allowClear, placeholder = props.placeholder, getInputElement = props.getInputElement, showSearch = props.showSearch, onSearch = props.onSearch, defaultOpen = props.defaultOpen, autoFocus = props.autoFocus, labelInValue = props.labelInValue, value = props.value, inputValue = props.inputValue, optionLabelProp = props.optionLabelProp; var multiple = mode === 'multiple' || mode === 'tags'; var mergedShowSearch = showSearch !== undefined ? showSearch : multiple || mode === 'combobox'; var mergedOptions = options || convertChildrenToData(children); // `tags` should not set option as disabled Object(warning["a" /* default */])(mode !== 'tags' || mergedOptions.every(function (opt) { return !opt.disabled; }), 'Please avoid setting option to disabled in tags mode since user can always type text as tag.'); // `combobox` & `tags` should option be `string` type if (mode === 'tags' || mode === 'combobox') { var hasNumberValue = mergedOptions.some(function (item) { if (item.options) { return item.options.some(function (opt) { return typeof ('value' in opt ? opt.value : opt.key) === 'number'; }); } return typeof ('value' in item ? item.value : item.key) === 'number'; }); Object(warning["a" /* default */])(!hasNumberValue, '`value` of Option should not use number type when `mode` is `tags` or `combobox`.'); } // `combobox` should not use `optionLabelProp` Object(warning["a" /* default */])(mode !== 'combobox' || !optionLabelProp, '`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly.'); // Only `combobox` support `backfill` Object(warning["a" /* default */])(mode === 'combobox' || !backfill, '`backfill` only works with `combobox` mode.'); // Only `combobox` support `getInputElement` Object(warning["a" /* default */])(mode === 'combobox' || !getInputElement, '`getInputElement` only work with `combobox` mode.'); // Customize `getInputElement` should not use `allowClear` & `placeholder` Object(warning["b" /* noteOnce */])(mode !== 'combobox' || !getInputElement || !allowClear || !placeholder, 'Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`.'); // `onSearch` should use in `combobox` or `showSearch` if (onSearch && !mergedShowSearch && mode !== 'combobox' && mode !== 'tags') { Object(warning["a" /* default */])(false, '`onSearch` should work with `showSearch` instead of use alone.'); } Object(warning["b" /* noteOnce */])(!defaultOpen || autoFocus, '`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed.'); if (value !== undefined && value !== null) { var values = Object(commonUtil["d" /* toArray */])(value); Object(warning["a" /* default */])(!labelInValue || values.every(function (val) { return Object(esm_typeof["a" /* default */])(val) === 'object' && ('key' in val || 'value' in val); }), '`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`'); Object(warning["a" /* default */])(!multiple || Array.isArray(value), '`value` should be array when `mode` is `multiple` or `tags`'); } // Syntactic sugar should use correct children type if (children) { var invalidateChildType = null; Object(toArray["a" /* default */])(children).some(function (node) { if (!external_window_React_["isValidElement"](node) || !node.type) { return false; } var type = node.type; if (type.isSelectOption) { return false; } if (type.isSelectOptGroup) { var allChildrenValid = Object(toArray["a" /* default */])(node.props.children).every(function (subNode) { if (!external_window_React_["isValidElement"](subNode) || !node.type || subNode.type.isSelectOption) { return true; } invalidateChildType = subNode.type; return false; }); if (allChildrenValid) { return false; } return true; } invalidateChildType = type; return true; }); if (invalidateChildType) { Object(warning["a" /* default */])(false, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(invalidateChildType.displayName || invalidateChildType.name || invalidateChildType, "`.")); } Object(warning["a" /* default */])(inputValue === undefined, '`inputValue` is deprecated, please use `searchValue` instead.'); } } /* harmony default export */ var warningPropsUtil = (warningProps); // CONCATENATED MODULE: ./node_modules/rc-select/es/Select.js /** * To match accessibility requirement, we always provide an input in the component. * Other element will not set `tabIndex` to avoid `onBlur` sequence problem. * For focused select, we set `aria-live="polite"` to update the accessibility content. * * ref: * - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions * * New api: * - listHeight * - listItemHeight * - component * * Remove deprecated api: * - multiple * - tags * - combobox * - firstActiveValue * - dropdownMenuStyle * - openClassName (Not list in api) * * Update: * - `backfill` only support `combobox` mode * - `combobox` mode not support `labelInValue` since it's meaningless * - `getInputElement` only support `combobox` mode * - `onChange` return OptionData instead of ReactNode * - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode * - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option * - `combobox` mode not support `optionLabelProp` */ var RefSelect = Object(generate["a" /* default */])({ prefixCls: 'rc-select', components: { optionList: es_OptionList }, convertChildrenToData: convertChildrenToData, flattenOptions: valueUtil["d" /* flattenOptions */], getLabeledValue: valueUtil["e" /* getLabeledValue */], filterOptions: valueUtil["b" /* filterOptions */], isValueDisabled: valueUtil["g" /* isValueDisabled */], findValueOption: valueUtil["c" /* findValueOption */], warningProps: warningPropsUtil, fillOptionsWithMissingValue: valueUtil["a" /* fillOptionsWithMissingValue */] }); /** * Typescript not support generic with function component, * we have to wrap an class component to handle this. */ var Select_Select = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(Select, _React$Component); var _super = Object(createSuper["a" /* default */])(Select); function Select() { var _this; Object(classCallCheck["a" /* default */])(this, Select); _this = _super.apply(this, arguments); _this.selectRef = external_window_React_["createRef"](); _this.focus = function () { _this.selectRef.current.focus(); }; _this.blur = function () { _this.selectRef.current.blur(); }; return _this; } Object(createClass["a" /* default */])(Select, [{ key: "render", value: function render() { return external_window_React_["createElement"](RefSelect, Object.assign({ ref: this.selectRef }, this.props)); } }]); return Select; }(external_window_React_["Component"]); Select_Select.Option = es_Option; Select_Select.OptGroup = es_OptGroup; /* harmony default export */ var es_Select = (Select_Select); // CONCATENATED MODULE: ./node_modules/rc-select/es/index.js /* harmony default export */ var rc_select_es = __webpack_exports__["c"] = (es_Select); /***/ }), /***/ "MlIO": /*!********************************************!*\ !*** ./node_modules/crypto-js/x64-core.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var X32WordArray = C_lib.WordArray; /** * x64 namespace. */ var C_x64 = C.x64 = {}; /** * A 64-bit word. */ var X64Word = C_x64.Word = Base.extend({ /** * Initializes a newly created 64-bit word. * * @param {number} high The high 32 bits. * @param {number} low The low 32 bits. * * @example * * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); */ init: function (high, low) { this.high = high; this.low = low; } /** * Bitwise NOTs this word. * * @return {X64Word} A new x64-Word object after negating. * * @example * * var negated = x64Word.not(); */ // not: function () { // var high = ~this.high; // var low = ~this.low; // return X64Word.create(high, low); // }, /** * Bitwise ANDs this word with the passed word. * * @param {X64Word} word The x64-Word to AND with this word. * * @return {X64Word} A new x64-Word object after ANDing. * * @example * * var anded = x64Word.and(anotherX64Word); */ // and: function (word) { // var high = this.high & word.high; // var low = this.low & word.low; // return X64Word.create(high, low); // }, /** * Bitwise ORs this word with the passed word. * * @param {X64Word} word The x64-Word to OR with this word. * * @return {X64Word} A new x64-Word object after ORing. * * @example * * var ored = x64Word.or(anotherX64Word); */ // or: function (word) { // var high = this.high | word.high; // var low = this.low | word.low; // return X64Word.create(high, low); // }, /** * Bitwise XORs this word with the passed word. * * @param {X64Word} word The x64-Word to XOR with this word. * * @return {X64Word} A new x64-Word object after XORing. * * @example * * var xored = x64Word.xor(anotherX64Word); */ // xor: function (word) { // var high = this.high ^ word.high; // var low = this.low ^ word.low; // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the left. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftL(25); */ // shiftL: function (n) { // if (n < 32) { // var high = (this.high << n) | (this.low >>> (32 - n)); // var low = this.low << n; // } else { // var high = this.low << (n - 32); // var low = 0; // } // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the right. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftR(7); */ // shiftR: function (n) { // if (n < 32) { // var low = (this.low >>> n) | (this.high << (32 - n)); // var high = this.high >>> n; // } else { // var low = this.high >>> (n - 32); // var high = 0; // } // return X64Word.create(high, low); // }, /** * Rotates this word n bits to the left. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotL(25); */ // rotL: function (n) { // return this.shiftL(n).or(this.shiftR(64 - n)); // }, /** * Rotates this word n bits to the right. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotR(7); */ // rotR: function (n) { // return this.shiftR(n).or(this.shiftL(64 - n)); // }, /** * Adds this word with the passed word. * * @param {X64Word} word The x64-Word to add with this word. * * @return {X64Word} A new x64-Word object after adding. * * @example * * var added = x64Word.add(anotherX64Word); */ // add: function (word) { // var low = (this.low + word.low) | 0; // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; // var high = (this.high + word.high + carry) | 0; // return X64Word.create(high, low); // } }); /** * An array of 64-bit words. * * @property {Array} words The array of CryptoJS.x64.Word objects. * @property {number} sigBytes The number of significant bytes in this word array. */ var X64WordArray = C_x64.WordArray = Base.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.x64.WordArray.create(); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ]); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ], 10); */ init: function (words, sigBytes) { words = this.words = words || []; if (sigBytes != undefined) { this.sigBytes = sigBytes; } else { this.sigBytes = words.length * 8; } }, /** * Converts this 64-bit word array to a 32-bit word array. * * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. * * @example * * var x32WordArray = x64WordArray.toX32(); */ toX32: function () { // Shortcuts var x64Words = this.words; var x64WordsLength = x64Words.length; // Convert var x32Words = []; for (var i = 0; i < x64WordsLength; i++) { var x64Word = x64Words[i]; x32Words.push(x64Word.high); x32Words.push(x64Word.low); } return X32WordArray.create(x32Words, this.sigBytes); }, /** * Creates a copy of this word array. * * @return {X64WordArray} The clone. * * @example * * var clone = x64WordArray.clone(); */ clone: function () { var clone = Base.clone.call(this); // Clone "words" array var words = clone.words = this.words.slice(0); // Clone each X64Word object var wordsLength = words.length; for (var i = 0; i < wordsLength; i++) { words[i] = words[i].clone(); } return clone; } }); }()); return CryptoJS; })); /***/ }), /***/ "NFKh": /*!*****************************************!*\ !*** ./node_modules/crypto-js/index.js ***! \*****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./x64-core */ "MlIO"), __webpack_require__(/*! ./lib-typedarrays */ "F+F2"), __webpack_require__(/*! ./enc-utf16 */ "qM6L"), __webpack_require__(/*! ./enc-base64 */ "ETIr"), __webpack_require__(/*! ./enc-base64url */ "wbyO"), __webpack_require__(/*! ./md5 */ "cv67"), __webpack_require__(/*! ./sha1 */ "3y9D"), __webpack_require__(/*! ./sha256 */ "lPiR"), __webpack_require__(/*! ./sha224 */ "GRuw"), __webpack_require__(/*! ./sha512 */ "1uat"), __webpack_require__(/*! ./sha384 */ "uGsb"), __webpack_require__(/*! ./sha3 */ "5hvy"), __webpack_require__(/*! ./ripemd160 */ "ELcG"), __webpack_require__(/*! ./hmac */ "WYAk"), __webpack_require__(/*! ./pbkdf2 */ "e7zE"), __webpack_require__(/*! ./evpkdf */ "K3mO"), __webpack_require__(/*! ./cipher-core */ "OLod"), __webpack_require__(/*! ./mode-cfb */ "ALsQ"), __webpack_require__(/*! ./mode-ctr */ "9OqN"), __webpack_require__(/*! ./mode-ctr-gladman */ "qu8F"), __webpack_require__(/*! ./mode-ofb */ "S6kV"), __webpack_require__(/*! ./mode-ecb */ "gb/T"), __webpack_require__(/*! ./pad-ansix923 */ "qBft"), __webpack_require__(/*! ./pad-iso10126 */ "oRuE"), __webpack_require__(/*! ./pad-iso97971 */ "jO9C"), __webpack_require__(/*! ./pad-zeropadding */ "KmYQ"), __webpack_require__(/*! ./pad-nopadding */ "uGxW"), __webpack_require__(/*! ./format-hex */ "bQjk"), __webpack_require__(/*! ./aes */ "wZgz"), __webpack_require__(/*! ./tripledes */ "pA7S"), __webpack_require__(/*! ./rc4 */ "w7YG"), __webpack_require__(/*! ./rabbit */ "E4JC"), __webpack_require__(/*! ./rabbit-legacy */ "PVpz")); } else {} }(this, function (CryptoJS) { return CryptoJS; })); /***/ }), /***/ "OLES": /*!*********************************************************!*\ !*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***! \*********************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__("U8pU"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__("VTBJ"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__("Ff2n"); // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); // EXTERNAL MODULE: ./node_modules/rc-trigger/es/index.js + 5 modules var es = __webpack_require__("uciX"); // EXTERNAL MODULE: ./node_modules/rc-tooltip/es/placements.js var placements = __webpack_require__("7ixt"); // CONCATENATED MODULE: ./node_modules/rc-tooltip/es/Content.js var Content_Content = function Content(props) { var overlay = props.overlay, prefixCls = props.prefixCls, id = props.id, overlayInnerStyle = props.overlayInnerStyle; return external_window_React_["createElement"]("div", { className: "".concat(prefixCls, "-inner"), id: id, role: "tooltip", style: overlayInnerStyle }, typeof overlay === 'function' ? overlay() : overlay); }; /* harmony default export */ var es_Content = (Content_Content); // CONCATENATED MODULE: ./node_modules/rc-tooltip/es/Tooltip.js var Tooltip_Tooltip = function Tooltip(props, ref) { var overlayClassName = props.overlayClassName, _props$trigger = props.trigger, trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger, _props$mouseEnterDela = props.mouseEnterDelay, mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela, _props$mouseLeaveDela = props.mouseLeaveDelay, mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela, overlayStyle = props.overlayStyle, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls, children = props.children, onVisibleChange = props.onVisibleChange, afterVisibleChange = props.afterVisibleChange, transitionName = props.transitionName, animation = props.animation, _props$placement = props.placement, placement = _props$placement === void 0 ? 'right' : _props$placement, _props$align = props.align, align = _props$align === void 0 ? {} : _props$align, _props$destroyTooltip = props.destroyTooltipOnHide, destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip, defaultVisible = props.defaultVisible, getTooltipContainer = props.getTooltipContainer, overlayInnerStyle = props.overlayInnerStyle, restProps = Object(objectWithoutProperties["a" /* default */])(props, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle"]); var domRef = Object(external_window_React_["useRef"])(null); Object(external_window_React_["useImperativeHandle"])(ref, function () { return domRef.current; }); var extraProps = Object(objectSpread2["a" /* default */])({}, restProps); if ('visible' in props) { extraProps.popupVisible = props.visible; } var getPopupElement = function getPopupElement() { var _props$arrowContent = props.arrowContent, arrowContent = _props$arrowContent === void 0 ? null : _props$arrowContent, overlay = props.overlay, id = props.id; return [external_window_React_["createElement"]("div", { className: "".concat(prefixCls, "-arrow"), key: "arrow" }, arrowContent), external_window_React_["createElement"](es_Content, { key: "content", prefixCls: prefixCls, id: id, overlay: overlay, overlayInnerStyle: overlayInnerStyle })]; }; var destroyTooltip = false; var autoDestroy = false; if (typeof destroyTooltipOnHide === 'boolean') { destroyTooltip = destroyTooltipOnHide; } else if (destroyTooltipOnHide && Object(esm_typeof["a" /* default */])(destroyTooltipOnHide) === 'object') { var keepParent = destroyTooltipOnHide.keepParent; destroyTooltip = keepParent === true; autoDestroy = keepParent === false; } return external_window_React_["createElement"](es["a" /* default */], Object.assign({ popupClassName: overlayClassName, prefixCls: prefixCls, popup: getPopupElement, action: trigger, builtinPlacements: placements["a" /* placements */], popupPlacement: placement, ref: domRef, popupAlign: align, getPopupContainer: getTooltipContainer, onPopupVisibleChange: onVisibleChange, afterPopupVisibleChange: afterVisibleChange, popupTransitionName: transitionName, popupAnimation: animation, defaultPopupVisible: defaultVisible, destroyPopupOnHide: destroyTooltip, autoDestroy: autoDestroy, mouseLeaveDelay: mouseLeaveDelay, popupStyle: overlayStyle, mouseEnterDelay: mouseEnterDelay }, extraProps), children); }; /* harmony default export */ var es_Tooltip = (Object(external_window_React_["forwardRef"])(Tooltip_Tooltip)); // CONCATENATED MODULE: ./node_modules/rc-tooltip/es/index.js /* harmony default export */ var rc_tooltip_es = __webpack_exports__["a"] = (es_Tooltip); /***/ }), /***/ "OLod": /*!***********************************************!*\ !*** ./node_modules/crypto-js/cipher-core.js ***! \***********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./evpkdf */ "K3mO")); } else {} }(this, function (CryptoJS) { /** * Cipher core components. */ CryptoJS.lib.Cipher || (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var WordArray = C_lib.WordArray; var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; var C_enc = C.enc; var Utf8 = C_enc.Utf8; var Base64 = C_enc.Base64; var C_algo = C.algo; var EvpKDF = C_algo.EvpKDF; /** * Abstract base cipher template. * * @property {number} keySize This cipher's key size. Default: 4 (128 bits) * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. */ var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ /** * Configuration options. * * @property {WordArray} iv The IV to use for this operation. */ cfg: Base.extend(), /** * Creates this cipher in encryption mode. * * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {Cipher} A cipher instance. * * @static * * @example * * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); */ createEncryptor: function (key, cfg) { return this.create(this._ENC_XFORM_MODE, key, cfg); }, /** * Creates this cipher in decryption mode. * * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {Cipher} A cipher instance. * * @static * * @example * * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); */ createDecryptor: function (key, cfg) { return this.create(this._DEC_XFORM_MODE, key, cfg); }, /** * Initializes a newly created cipher. * * @param {number} xformMode Either the encryption or decryption transormation mode constant. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @example * * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); */ init: function (xformMode, key, cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Store transform mode and key this._xformMode = xformMode; this._key = key; // Set initial values this.reset(); }, /** * Resets this cipher to its initial state. * * @example * * cipher.reset(); */ reset: function () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this); // Perform concrete-cipher logic this._doReset(); }, /** * Adds data to be encrypted or decrypted. * * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. * * @return {WordArray} The data after processing. * * @example * * var encrypted = cipher.process('data'); * var encrypted = cipher.process(wordArray); */ process: function (dataUpdate) { // Append this._append(dataUpdate); // Process available blocks return this._process(); }, /** * Finalizes the encryption or decryption process. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. * * @return {WordArray} The data after final processing. * * @example * * var encrypted = cipher.finalize(); * var encrypted = cipher.finalize('data'); * var encrypted = cipher.finalize(wordArray); */ finalize: function (dataUpdate) { // Final data update if (dataUpdate) { this._append(dataUpdate); } // Perform concrete-cipher logic var finalProcessedData = this._doFinalize(); return finalProcessedData; }, keySize: 128/32, ivSize: 128/32, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, /** * Creates shortcut functions to a cipher's object interface. * * @param {Cipher} cipher The cipher to create a helper for. * * @return {Object} An object with encrypt and decrypt shortcut functions. * * @static * * @example * * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); */ _createHelper: (function () { function selectCipherStrategy(key) { if (typeof key == 'string') { return PasswordBasedCipher; } else { return SerializableCipher; } } return function (cipher) { return { encrypt: function (message, key, cfg) { return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); }, decrypt: function (ciphertext, key, cfg) { return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); } }; }; }()) }); /** * Abstract base stream cipher template. * * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) */ var StreamCipher = C_lib.StreamCipher = Cipher.extend({ _doFinalize: function () { // Process partial blocks var finalProcessedBlocks = this._process(!!'flush'); return finalProcessedBlocks; }, blockSize: 1 }); /** * Mode namespace. */ var C_mode = C.mode = {}; /** * Abstract base block cipher mode template. */ var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ /** * Creates this mode for encryption. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @static * * @example * * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); */ createEncryptor: function (cipher, iv) { return this.Encryptor.create(cipher, iv); }, /** * Creates this mode for decryption. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @static * * @example * * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); */ createDecryptor: function (cipher, iv) { return this.Decryptor.create(cipher, iv); }, /** * Initializes a newly created mode. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @example * * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); */ init: function (cipher, iv) { this._cipher = cipher; this._iv = iv; } }); /** * Cipher Block Chaining mode. */ var CBC = C_mode.CBC = (function () { /** * Abstract base CBC mode. */ var CBC = BlockCipherMode.extend(); /** * CBC encryptor. */ CBC.Encryptor = CBC.extend({ /** * Processes the data block at offset. * * @param {Array} words The data words to operate on. * @param {number} offset The offset where the block starts. * * @example * * mode.processBlock(data.words, offset); */ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; // XOR and encrypt xorBlock.call(this, words, offset, blockSize); cipher.encryptBlock(words, offset); // Remember this block to use with next block this._prevBlock = words.slice(offset, offset + blockSize); } }); /** * CBC decryptor. */ CBC.Decryptor = CBC.extend({ /** * Processes the data block at offset. * * @param {Array} words The data words to operate on. * @param {number} offset The offset where the block starts. * * @example * * mode.processBlock(data.words, offset); */ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; // Remember this block to use with next block var thisBlock = words.slice(offset, offset + blockSize); // Decrypt and XOR cipher.decryptBlock(words, offset); xorBlock.call(this, words, offset, blockSize); // This block becomes the previous block this._prevBlock = thisBlock; } }); function xorBlock(words, offset, blockSize) { var block; // Shortcut var iv = this._iv; // Choose mixing block if (iv) { block = iv; // Remove IV for subsequent blocks this._iv = undefined; } else { block = this._prevBlock; } // XOR blocks for (var i = 0; i < blockSize; i++) { words[offset + i] ^= block[i]; } } return CBC; }()); /** * Padding namespace. */ var C_pad = C.pad = {}; /** * PKCS #5/7 padding strategy. */ var Pkcs7 = C_pad.Pkcs7 = { /** * Pads data using the algorithm defined in PKCS #5/7. * * @param {WordArray} data The data to pad. * @param {number} blockSize The multiple that the data should be padded to. * * @static * * @example * * CryptoJS.pad.Pkcs7.pad(wordArray, 4); */ pad: function (data, blockSize) { // Shortcut var blockSizeBytes = blockSize * 4; // Count padding bytes var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; // Create padding word var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; // Create padding var paddingWords = []; for (var i = 0; i < nPaddingBytes; i += 4) { paddingWords.push(paddingWord); } var padding = WordArray.create(paddingWords, nPaddingBytes); // Add padding data.concat(padding); }, /** * Unpads data that had been padded using the algorithm defined in PKCS #5/7. * * @param {WordArray} data The data to unpad. * * @static * * @example * * CryptoJS.pad.Pkcs7.unpad(wordArray); */ unpad: function (data) { // Get number of padding bytes from last byte var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; // Remove padding data.sigBytes -= nPaddingBytes; } }; /** * Abstract base block cipher template. * * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) */ var BlockCipher = C_lib.BlockCipher = Cipher.extend({ /** * Configuration options. * * @property {Mode} mode The block mode to use. Default: CBC * @property {Padding} padding The padding strategy to use. Default: Pkcs7 */ cfg: Cipher.cfg.extend({ mode: CBC, padding: Pkcs7 }), reset: function () { var modeCreator; // Reset cipher Cipher.reset.call(this); // Shortcuts var cfg = this.cfg; var iv = cfg.iv; var mode = cfg.mode; // Reset block mode if (this._xformMode == this._ENC_XFORM_MODE) { modeCreator = mode.createEncryptor; } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { modeCreator = mode.createDecryptor; // Keep at least one block in the buffer for unpadding this._minBufferSize = 1; } if (this._mode && this._mode.__creator == modeCreator) { this._mode.init(this, iv && iv.words); } else { this._mode = modeCreator.call(mode, this, iv && iv.words); this._mode.__creator = modeCreator; } }, _doProcessBlock: function (words, offset) { this._mode.processBlock(words, offset); }, _doFinalize: function () { var finalProcessedBlocks; // Shortcut var padding = this.cfg.padding; // Finalize if (this._xformMode == this._ENC_XFORM_MODE) { // Pad data padding.pad(this._data, this.blockSize); // Process final blocks finalProcessedBlocks = this._process(!!'flush'); } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { // Process final blocks finalProcessedBlocks = this._process(!!'flush'); // Unpad data padding.unpad(finalProcessedBlocks); } return finalProcessedBlocks; }, blockSize: 128/32 }); /** * A collection of cipher parameters. * * @property {WordArray} ciphertext The raw ciphertext. * @property {WordArray} key The key to this ciphertext. * @property {WordArray} iv The IV used in the ciphering operation. * @property {WordArray} salt The salt used with a key derivation function. * @property {Cipher} algorithm The cipher algorithm. * @property {Mode} mode The block mode used in the ciphering operation. * @property {Padding} padding The padding scheme used in the ciphering operation. * @property {number} blockSize The block size of the cipher. * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. */ var CipherParams = C_lib.CipherParams = Base.extend({ /** * Initializes a newly created cipher params object. * * @param {Object} cipherParams An object with any of the possible cipher parameters. * * @example * * var cipherParams = CryptoJS.lib.CipherParams.create({ * ciphertext: ciphertextWordArray, * key: keyWordArray, * iv: ivWordArray, * salt: saltWordArray, * algorithm: CryptoJS.algo.AES, * mode: CryptoJS.mode.CBC, * padding: CryptoJS.pad.PKCS7, * blockSize: 4, * formatter: CryptoJS.format.OpenSSL * }); */ init: function (cipherParams) { this.mixIn(cipherParams); }, /** * Converts this cipher params object to a string. * * @param {Format} formatter (Optional) The formatting strategy to use. * * @return {string} The stringified cipher params. * * @throws Error If neither the formatter nor the default formatter is set. * * @example * * var string = cipherParams + ''; * var string = cipherParams.toString(); * var string = cipherParams.toString(CryptoJS.format.OpenSSL); */ toString: function (formatter) { return (formatter || this.formatter).stringify(this); } }); /** * Format namespace. */ var C_format = C.format = {}; /** * OpenSSL formatting strategy. */ var OpenSSLFormatter = C_format.OpenSSL = { /** * Converts a cipher params object to an OpenSSL-compatible string. * * @param {CipherParams} cipherParams The cipher params object. * * @return {string} The OpenSSL-compatible string. * * @static * * @example * * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); */ stringify: function (cipherParams) { var wordArray; // Shortcuts var ciphertext = cipherParams.ciphertext; var salt = cipherParams.salt; // Format if (salt) { wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); } else { wordArray = ciphertext; } return wordArray.toString(Base64); }, /** * Converts an OpenSSL-compatible string to a cipher params object. * * @param {string} openSSLStr The OpenSSL-compatible string. * * @return {CipherParams} The cipher params object. * * @static * * @example * * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); */ parse: function (openSSLStr) { var salt; // Parse base64 var ciphertext = Base64.parse(openSSLStr); // Shortcut var ciphertextWords = ciphertext.words; // Test for salt if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { // Extract salt salt = WordArray.create(ciphertextWords.slice(2, 4)); // Remove salt from ciphertext ciphertextWords.splice(0, 4); ciphertext.sigBytes -= 16; } return CipherParams.create({ ciphertext: ciphertext, salt: salt }); } }; /** * A cipher wrapper that returns ciphertext as a serializable cipher params object. */ var SerializableCipher = C_lib.SerializableCipher = Base.extend({ /** * Configuration options. * * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL */ cfg: Base.extend({ format: OpenSSLFormatter }), /** * Encrypts a message. * * @param {Cipher} cipher The cipher algorithm to use. * @param {WordArray|string} message The message to encrypt. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {CipherParams} A cipher params object. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); */ encrypt: function (cipher, message, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Encrypt var encryptor = cipher.createEncryptor(key, cfg); var ciphertext = encryptor.finalize(message); // Shortcut var cipherCfg = encryptor.cfg; // Create and return serializable cipher params return CipherParams.create({ ciphertext: ciphertext, key: key, iv: cipherCfg.iv, algorithm: cipher, mode: cipherCfg.mode, padding: cipherCfg.padding, blockSize: cipher.blockSize, formatter: cfg.format }); }, /** * Decrypts serialized ciphertext. * * @param {Cipher} cipher The cipher algorithm to use. * @param {CipherParams|string} ciphertext The ciphertext to decrypt. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {WordArray} The plaintext. * * @static * * @example * * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); */ decrypt: function (cipher, ciphertext, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format); // Decrypt var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); return plaintext; }, /** * Converts serialized ciphertext to CipherParams, * else assumed CipherParams already and returns ciphertext unchanged. * * @param {CipherParams|string} ciphertext The ciphertext. * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. * * @return {CipherParams} The unserialized ciphertext. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); */ _parse: function (ciphertext, format) { if (typeof ciphertext == 'string') { return format.parse(ciphertext, this); } else { return ciphertext; } } }); /** * Key derivation function namespace. */ var C_kdf = C.kdf = {}; /** * OpenSSL key derivation function. */ var OpenSSLKdf = C_kdf.OpenSSL = { /** * Derives a key and IV from a password. * * @param {string} password The password to derive from. * @param {number} keySize The size in words of the key to generate. * @param {number} ivSize The size in words of the IV to generate. * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. * * @return {CipherParams} A cipher params object with the key, IV, and salt. * * @static * * @example * * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); */ execute: function (password, keySize, ivSize, salt) { // Generate random salt if (!salt) { salt = WordArray.random(64/8); } // Derive key and IV var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); // Separate key and IV var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); key.sigBytes = keySize * 4; // Return params return CipherParams.create({ key: key, iv: iv, salt: salt }); } }; /** * A serializable cipher wrapper that derives the key from a password, * and returns ciphertext as a serializable cipher params object. */ var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ /** * Configuration options. * * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL */ cfg: SerializableCipher.cfg.extend({ kdf: OpenSSLKdf }), /** * Encrypts a message using a password. * * @param {Cipher} cipher The cipher algorithm to use. * @param {WordArray|string} message The message to encrypt. * @param {string} password The password. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {CipherParams} A cipher params object. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); */ encrypt: function (cipher, message, password, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Derive key and other params var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); // Add IV to config cfg.iv = derivedParams.iv; // Encrypt var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); // Mix in derived params ciphertext.mixIn(derivedParams); return ciphertext; }, /** * Decrypts serialized ciphertext using a password. * * @param {Cipher} cipher The cipher algorithm to use. * @param {CipherParams|string} ciphertext The ciphertext to decrypt. * @param {string} password The password. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {WordArray} The plaintext. * * @static * * @example * * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); */ decrypt: function (cipher, ciphertext, password, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format); // Derive key and other params var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); // Add IV to config cfg.iv = derivedParams.iv; // Decrypt var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); return plaintext; } }); }()); })); /***/ }), /***/ "PVpz": /*!*************************************************!*\ !*** ./node_modules/crypto-js/rabbit-legacy.js ***! \*************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./enc-base64 */ "ETIr"), __webpack_require__(/*! ./md5 */ "cv67"), __webpack_require__(/*! ./evpkdf */ "K3mO"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var StreamCipher = C_lib.StreamCipher; var C_algo = C.algo; // Reusable objects var S = []; var C_ = []; var G = []; /** * Rabbit stream cipher algorithm. * * This is a legacy version that neglected to convert the key to little-endian. * This error doesn't affect the cipher's security, * but it does affect its compatibility with other implementations. */ var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ _doReset: function () { // Shortcuts var K = this._key.words; var iv = this.cfg.iv; // Generate initial state values var X = this._X = [ K[0], (K[3] << 16) | (K[2] >>> 16), K[1], (K[0] << 16) | (K[3] >>> 16), K[2], (K[1] << 16) | (K[0] >>> 16), K[3], (K[2] << 16) | (K[1] >>> 16) ]; // Generate initial counter values var C = this._C = [ (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) ]; // Carry bit this._b = 0; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } // Modify the counters for (var i = 0; i < 8; i++) { C[i] ^= X[(i + 4) & 7]; } // IV setup if (iv) { // Shortcuts var IV = iv.words; var IV_0 = IV[0]; var IV_1 = IV[1]; // Generate four subvectors var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); var i1 = (i0 >>> 16) | (i2 & 0xffff0000); var i3 = (i2 << 16) | (i0 & 0x0000ffff); // Modify counter values C[0] ^= i0; C[1] ^= i1; C[2] ^= i2; C[3] ^= i3; C[4] ^= i0; C[5] ^= i1; C[6] ^= i2; C[7] ^= i3; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } } }, _doProcessBlock: function (M, offset) { // Shortcut var X = this._X; // Iterate the system nextState.call(this); // Generate four keystream words S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); for (var i = 0; i < 4; i++) { // Swap endian S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); // Encrypt M[offset + i] ^= S[i]; } }, blockSize: 128/32, ivSize: 64/32 }); function nextState() { // Shortcuts var X = this._X; var C = this._C; // Save old counter values for (var i = 0; i < 8; i++) { C_[i] = C[i]; } // Calculate new counter values C[0] = (C[0] + 0x4d34d34d + this._b) | 0; C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; // Calculate the g-values for (var i = 0; i < 8; i++) { var gx = X[i] + C[i]; // Construct high and low argument for squaring var ga = gx & 0xffff; var gb = gx >>> 16; // Calculate high and low result of squaring var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); // High XOR low G[i] = gh ^ gl; } // Calculate new state values X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); */ C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); }()); return CryptoJS.RabbitLegacy; })); /***/ }), /***/ "S6kV": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-ofb.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { /** * Output Feedback block mode. */ CryptoJS.mode.OFB = (function () { var OFB = CryptoJS.lib.BlockCipherMode.extend(); var Encryptor = OFB.Encryptor = OFB.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher var blockSize = cipher.blockSize; var iv = this._iv; var keystream = this._keystream; // Generate keystream if (iv) { keystream = this._keystream = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } cipher.encryptBlock(keystream, 0); // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } }); OFB.Decryptor = Encryptor; return OFB; }()); return CryptoJS.mode.OFB; })); /***/ }), /***/ "UUDw": /*!*******************************************************!*\ !*** ./src/components/FixedButton/index.less?modules ***! \*******************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin module.exports = {"buttonFixed":"buttonFixed___2zLVJ","button":"button___-JgFH","buttonWrap":"buttonWrap___aZhhk"}; /***/ }), /***/ "WYAk": /*!****************************************!*\ !*** ./node_modules/crypto-js/hmac.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var C_enc = C.enc; var Utf8 = C_enc.Utf8; var C_algo = C.algo; /** * HMAC algorithm. */ var HMAC = C_algo.HMAC = Base.extend({ /** * Initializes a newly created HMAC. * * @param {Hasher} hasher The hash algorithm to use. * @param {WordArray|string} key The secret key. * * @example * * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); */ init: function (hasher, key) { // Init hasher hasher = this._hasher = new hasher.init(); // Convert string to WordArray, else assume WordArray already if (typeof key == 'string') { key = Utf8.parse(key); } // Shortcuts var hasherBlockSize = hasher.blockSize; var hasherBlockSizeBytes = hasherBlockSize * 4; // Allow arbitrary length keys if (key.sigBytes > hasherBlockSizeBytes) { key = hasher.finalize(key); } // Clamp excess bits key.clamp(); // Clone key for inner and outer pads var oKey = this._oKey = key.clone(); var iKey = this._iKey = key.clone(); // Shortcuts var oKeyWords = oKey.words; var iKeyWords = iKey.words; // XOR keys with pad constants for (var i = 0; i < hasherBlockSize; i++) { oKeyWords[i] ^= 0x5c5c5c5c; iKeyWords[i] ^= 0x36363636; } oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; // Set initial values this.reset(); }, /** * Resets this HMAC to its initial state. * * @example * * hmacHasher.reset(); */ reset: function () { // Shortcut var hasher = this._hasher; // Reset hasher.reset(); hasher.update(this._iKey); }, /** * Updates this HMAC with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {HMAC} This HMAC instance. * * @example * * hmacHasher.update('message'); * hmacHasher.update(wordArray); */ update: function (messageUpdate) { this._hasher.update(messageUpdate); // Chainable return this; }, /** * Finalizes the HMAC computation. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The HMAC. * * @example * * var hmac = hmacHasher.finalize(); * var hmac = hmacHasher.finalize('message'); * var hmac = hmacHasher.finalize(wordArray); */ finalize: function (messageUpdate) { // Shortcut var hasher = this._hasher; // Compute HMAC var innerHash = hasher.finalize(messageUpdate); hasher.reset(); var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); return hmac; } }); }()); })); /***/ }), /***/ "Xmps": /*!*********************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/index.less?modules ***! \*********************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin module.exports = {"flex_box_center":"flex_box_center___wWw1O","flex_space_between":"flex_space_between___3LkUu","flex_box_vertical_center":"flex_box_vertical_center___3qN5V","flex_box_center_end":"flex_box_center_end___3KU-R","flex_box_column":"flex_box_column___IbGRA","bg":"bg___TCDRd","radioStyle":"radioStyle___30gQW","formWrap":"formWrap___3it4O","onePart":"onePart___3-uUM","twoPart":"twoPart___33MNe","title":"title___3DHfV","threePart":"threePart___3zNZU","flexRowCenter":"flexRowCenter___2hu6Z","fourPart":"fourPart___3qGir","testJi":"testJi___2FQtu","upBtn":"upBtn___22Oey","checkboxs":"checkboxs___19C_o","averageWarp":"averageWarp___24RW3","averageCustom":"averageCustom___37H4G","groupWrap":"groupWrap___3ZQ-0","customInput":"customInput___7M4Cd"}; /***/ }), /***/ "Y1PL": /*!**********************************************************!*\ !*** ./node_modules/rc-textarea/es/index.js + 7 modules ***! \**********************************************************/ /*! exports provided: ResizableTextArea, default */ /*! all exports used */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "ResizableTextArea", function() { return /* reexport */ es_ResizableTextArea; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__("wx14"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__("1OyB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__("vuIU"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js var inherits = __webpack_require__("Ji7U"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules var createSuper = __webpack_require__("LK+K"); // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__("VTBJ"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("rePB"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js var toArray = __webpack_require__("Zm9Q"); // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js var warning = __webpack_require__("Kwbf"); // EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js var ref = __webpack_require__("c+Xe"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js var findDOMNode = __webpack_require__("m+aA"); // EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js var ResizeObserver_es = __webpack_require__("bdgK"); // CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/utils/observerUtil.js // =============================== Const =============================== var elementListeners = new Map(); function observerUtil_onResize(entities) { entities.forEach(function (entity) { var _elementListeners$get; var target = entity.target; (_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function (listener) { return listener(target); }); }); } // Note: ResizeObserver polyfill not support option to measure border-box resize var resizeObserver = new ResizeObserver_es["default"](observerUtil_onResize); // Dev env only var _el = false ? undefined : null; // eslint-disable-line var _rs = false ? undefined : null; // eslint-disable-line // ============================== Observe ============================== function observe(element, callback) { if (!elementListeners.has(element)) { elementListeners.set(element, new Set()); resizeObserver.observe(element); } elementListeners.get(element).add(callback); } function unobserve(element, callback) { if (elementListeners.has(element)) { elementListeners.get(element).delete(callback); if (!elementListeners.get(element).size) { resizeObserver.unobserve(element); elementListeners.delete(element); } } } // CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js /** * Fallback to findDOMNode if origin ref do not provide any dom element */ var DomWrapper_DomWrapper = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(DomWrapper, _React$Component); var _super = Object(createSuper["a" /* default */])(DomWrapper); function DomWrapper() { Object(classCallCheck["a" /* default */])(this, DomWrapper); return _super.apply(this, arguments); } Object(createClass["a" /* default */])(DomWrapper, [{ key: "render", value: function render() { return this.props.children; } }]); return DomWrapper; }(external_window_React_["Component"]); // CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/Collection.js var CollectionContext = /*#__PURE__*/external_window_React_["createContext"](null); /** * Collect all the resize event from children ResizeObserver */ function Collection(_ref) { var children = _ref.children, onBatchResize = _ref.onBatchResize; var resizeIdRef = external_window_React_["useRef"](0); var resizeInfosRef = external_window_React_["useRef"]([]); var onCollectionResize = external_window_React_["useContext"](CollectionContext); var onResize = external_window_React_["useCallback"](function (size, element, data) { resizeIdRef.current += 1; var currentId = resizeIdRef.current; resizeInfosRef.current.push({ size: size, element: element, data: data }); Promise.resolve().then(function () { if (currentId === resizeIdRef.current) { onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current); resizeInfosRef.current = []; } }); // Continue bubbling if parent exist onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data); }, [onBatchResize, onCollectionResize]); return /*#__PURE__*/external_window_React_["createElement"](CollectionContext.Provider, { value: onResize }, children); } // CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/index.js function SingleObserver(props) { var children = props.children, disabled = props.disabled; var elementRef = external_window_React_["useRef"](null); var wrapperRef = external_window_React_["useRef"](null); var onCollectionResize = external_window_React_["useContext"](CollectionContext); // ============================= Size ============================= var sizeRef = external_window_React_["useRef"]({ width: -1, height: -1, offsetWidth: -1, offsetHeight: -1 }); // ============================= Ref ============================== var canRef = /*#__PURE__*/external_window_React_["isValidElement"](children) && Object(ref["c" /* supportRef */])(children); var originRef = canRef ? children.ref : null; var mergedRef = external_window_React_["useMemo"](function () { return Object(ref["a" /* composeRef */])(originRef, elementRef); }, [originRef, elementRef]); // =========================== Observe ============================ var propsRef = external_window_React_["useRef"](props); propsRef.current = props; // Handler var onInternalResize = external_window_React_["useCallback"](function (target) { var _propsRef$current = propsRef.current, onResize = _propsRef$current.onResize, data = _propsRef$current.data; var _target$getBoundingCl = target.getBoundingClientRect(), width = _target$getBoundingCl.width, height = _target$getBoundingCl.height; var offsetWidth = target.offsetWidth, offsetHeight = target.offsetHeight; /** * Resize observer trigger when content size changed. * In most case we just care about element size, * let's use `boundary` instead of `contentRect` here to avoid shaking. */ var fixedWidth = Math.floor(width); var fixedHeight = Math.floor(height); if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) { var size = { width: fixedWidth, height: fixedHeight, offsetWidth: offsetWidth, offsetHeight: offsetHeight }; sizeRef.current = size; // IE is strange, right? var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth; var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight; var sizeInfo = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, size), {}, { offsetWidth: mergedOffsetWidth, offsetHeight: mergedOffsetHeight }); // Let collection know what happened onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data); if (onResize) { // defer the callback but not defer to next frame Promise.resolve().then(function () { onResize(sizeInfo, target); }); } } }, []); // Dynamic observe external_window_React_["useEffect"](function () { var currentElement = Object(findDOMNode["a" /* default */])(elementRef.current) || Object(findDOMNode["a" /* default */])(wrapperRef.current); if (currentElement && !disabled) { observe(currentElement, onInternalResize); } return function () { return unobserve(currentElement, onInternalResize); }; }, [elementRef.current, disabled]); // ============================ Render ============================ return /*#__PURE__*/external_window_React_["createElement"](DomWrapper_DomWrapper, { ref: wrapperRef }, canRef ? /*#__PURE__*/external_window_React_["cloneElement"](children, { ref: mergedRef }) : children); } // CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/index.js var INTERNAL_PREFIX_KEY = 'rc-observer-key'; function ResizeObserver(props) { var children = props.children; var childNodes = Object(toArray["a" /* default */])(children); if (false) {} return childNodes.map(function (child, index) { var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index); return /*#__PURE__*/external_window_React_["createElement"](SingleObserver, Object(esm_extends["a" /* default */])({}, props, { key: key }), child); }); } ResizeObserver.Collection = Collection; /* harmony default export */ var es = (ResizeObserver); // EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js var omit = __webpack_require__("bT9E"); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("TSYQ"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // CONCATENATED MODULE: ./node_modules/rc-textarea/es/calculateNodeHeight.js // Thanks to https://github.com/andreypopp/react-textarea-autosize/ /** * calculateNodeHeight(uiTextNode, useCache = false) */ var HIDDEN_TEXTAREA_STYLE = "\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n"; var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing', 'word-break']; var computedStyleCache = {}; var hiddenTextarea; function calculateNodeStyling(node) { var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name'); if (useCache && computedStyleCache[nodeRef]) { return computedStyleCache[nodeRef]; } var style = window.getComputedStyle(node); var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing'); var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top')); var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width')); var sizingStyle = SIZING_STYLE.map(function (name) { return "".concat(name, ":").concat(style.getPropertyValue(name)); }).join(';'); var nodeInfo = { sizingStyle: sizingStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing }; if (useCache && nodeRef) { computedStyleCache[nodeRef] = nodeInfo; } return nodeInfo; } function calculateNodeHeight(uiTextNode) { var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; if (!hiddenTextarea) { hiddenTextarea = document.createElement('textarea'); hiddenTextarea.setAttribute('tab-index', '-1'); hiddenTextarea.setAttribute('aria-hidden', 'true'); document.body.appendChild(hiddenTextarea); } // Fix wrap="off" issue // https://github.com/ant-design/ant-design/issues/6577 if (uiTextNode.getAttribute('wrap')) { hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap')); } else { hiddenTextarea.removeAttribute('wrap'); } // Copy all CSS properties that have an impact on the height of the content in // the textbox var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache), paddingSize = _calculateNodeStyling.paddingSize, borderSize = _calculateNodeStyling.borderSize, boxSizing = _calculateNodeStyling.boxSizing, sizingStyle = _calculateNodeStyling.sizingStyle; // Need to have the overflow attribute to hide the scrollbar otherwise // text-lines will not calculated properly as the shadow will technically be // narrower for content hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE)); hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || ''; var minHeight = Number.MIN_SAFE_INTEGER; var maxHeight = Number.MAX_SAFE_INTEGER; var height = hiddenTextarea.scrollHeight; var overflowY; if (boxSizing === 'border-box') { // border-box: add border, since height = content + padding + border height += borderSize; } else if (boxSizing === 'content-box') { // remove padding, since height = content height -= paddingSize; } if (minRows !== null || maxRows !== null) { // measure height of a textarea with a single row hiddenTextarea.value = ' '; var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize; if (minRows !== null) { minHeight = singleRowHeight * minRows; if (boxSizing === 'border-box') { minHeight = minHeight + paddingSize + borderSize; } height = Math.max(minHeight, height); } if (maxRows !== null) { maxHeight = singleRowHeight * maxRows; if (boxSizing === 'border-box') { maxHeight = maxHeight + paddingSize + borderSize; } overflowY = height > maxHeight ? '' : 'hidden'; height = Math.min(maxHeight, height); } } return { height: height, minHeight: minHeight, maxHeight: maxHeight, overflowY: overflowY, resize: 'none' }; } // EXTERNAL MODULE: ./node_modules/shallowequal/index.js var shallowequal = __webpack_require__("Gytx"); var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal); // CONCATENATED MODULE: ./node_modules/rc-textarea/es/ResizableTextArea.js // eslint-disable-next-line @typescript-eslint/naming-convention var RESIZE_STATUS; (function (RESIZE_STATUS) { RESIZE_STATUS[RESIZE_STATUS["NONE"] = 0] = "NONE"; RESIZE_STATUS[RESIZE_STATUS["RESIZING"] = 1] = "RESIZING"; RESIZE_STATUS[RESIZE_STATUS["RESIZED"] = 2] = "RESIZED"; })(RESIZE_STATUS || (RESIZE_STATUS = {})); var ResizableTextArea_ResizableTextArea = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(ResizableTextArea, _React$Component); var _super = Object(createSuper["a" /* default */])(ResizableTextArea); function ResizableTextArea(props) { var _this; Object(classCallCheck["a" /* default */])(this, ResizableTextArea); _this = _super.call(this, props); _this.nextFrameActionId = void 0; _this.resizeFrameId = void 0; _this.textArea = void 0; _this.saveTextArea = function (textArea) { _this.textArea = textArea; }; _this.handleResize = function (size) { var resizeStatus = _this.state.resizeStatus; var _this$props = _this.props, autoSize = _this$props.autoSize, onResize = _this$props.onResize; if (resizeStatus !== RESIZE_STATUS.NONE) { return; } if (typeof onResize === 'function') { onResize(size); } if (autoSize) { _this.resizeOnNextFrame(); } }; _this.resizeOnNextFrame = function () { cancelAnimationFrame(_this.nextFrameActionId); _this.nextFrameActionId = requestAnimationFrame(_this.resizeTextarea); }; _this.resizeTextarea = function () { var autoSize = _this.props.autoSize; if (!autoSize || !_this.textArea) { return; } var minRows = autoSize.minRows, maxRows = autoSize.maxRows; var textareaStyles = calculateNodeHeight(_this.textArea, false, minRows, maxRows); _this.setState({ textareaStyles: textareaStyles, resizeStatus: RESIZE_STATUS.RESIZING }, function () { cancelAnimationFrame(_this.resizeFrameId); _this.resizeFrameId = requestAnimationFrame(function () { _this.setState({ resizeStatus: RESIZE_STATUS.RESIZED }, function () { _this.resizeFrameId = requestAnimationFrame(function () { _this.setState({ resizeStatus: RESIZE_STATUS.NONE }); _this.fixFirefoxAutoScroll(); }); }); }); }); }; _this.renderTextArea = function () { var _this$props2 = _this.props, _this$props2$prefixCl = _this$props2.prefixCls, prefixCls = _this$props2$prefixCl === void 0 ? 'rc-textarea' : _this$props2$prefixCl, autoSize = _this$props2.autoSize, onResize = _this$props2.onResize, className = _this$props2.className, disabled = _this$props2.disabled; var _this$state = _this.state, textareaStyles = _this$state.textareaStyles, resizeStatus = _this$state.resizeStatus; var otherProps = Object(omit["a" /* default */])(_this.props, ['prefixCls', 'onPressEnter', 'autoSize', 'defaultValue', 'onResize']); var cls = classnames_default()(prefixCls, className, Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-disabled"), disabled)); // Fix https://github.com/ant-design/ant-design/issues/6776 // Make sure it could be reset when using form.getFieldDecorator if ('value' in otherProps) { otherProps.value = otherProps.value || ''; } var style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this.props.style), textareaStyles), resizeStatus === RESIZE_STATUS.RESIZING ? // React will warning when mix `overflow` & `overflowY`. // We need to define this separately. { overflowX: 'hidden', overflowY: 'hidden' } : null); return /*#__PURE__*/external_window_React_["createElement"](es, { onResize: _this.handleResize, disabled: !(autoSize || onResize) }, /*#__PURE__*/external_window_React_["createElement"]("textarea", Object(esm_extends["a" /* default */])({}, otherProps, { className: cls, style: style, ref: _this.saveTextArea }))); }; _this.state = { textareaStyles: {}, resizeStatus: RESIZE_STATUS.NONE }; return _this; } Object(createClass["a" /* default */])(ResizableTextArea, [{ key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { // Re-render with the new content or new autoSize property then recalculate the height as required. if (prevProps.value !== this.props.value || !shallowequal_default()(prevProps.autoSize, this.props.autoSize)) { this.resizeTextarea(); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { cancelAnimationFrame(this.nextFrameActionId); cancelAnimationFrame(this.resizeFrameId); } // https://github.com/ant-design/ant-design/issues/21870 }, { key: "fixFirefoxAutoScroll", value: function fixFirefoxAutoScroll() { try { if (document.activeElement === this.textArea) { var currentStart = this.textArea.selectionStart; var currentEnd = this.textArea.selectionEnd; this.textArea.setSelectionRange(currentStart, currentEnd); } } catch (e) {// Fix error in Chrome: // Failed to read the 'selectionStart' property from 'HTMLInputElement' // http://stackoverflow.com/q/21177489/3040605 } } }, { key: "render", value: function render() { return this.renderTextArea(); } }]); return ResizableTextArea; }(external_window_React_["Component"]); /* harmony default export */ var es_ResizableTextArea = (ResizableTextArea_ResizableTextArea); // CONCATENATED MODULE: ./node_modules/rc-textarea/es/index.js var es_TextArea = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(TextArea, _React$Component); var _super = Object(createSuper["a" /* default */])(TextArea); function TextArea(props) { var _this; Object(classCallCheck["a" /* default */])(this, TextArea); _this = _super.call(this, props); _this.resizableTextArea = void 0; _this.focus = function () { _this.resizableTextArea.textArea.focus(); }; _this.saveTextArea = function (resizableTextArea) { _this.resizableTextArea = resizableTextArea; }; _this.handleChange = function (e) { var onChange = _this.props.onChange; _this.setValue(e.target.value, function () { _this.resizableTextArea.resizeTextarea(); }); if (onChange) { onChange(e); } }; _this.handleKeyDown = function (e) { var _this$props = _this.props, onPressEnter = _this$props.onPressEnter, onKeyDown = _this$props.onKeyDown; if (e.keyCode === 13 && onPressEnter) { onPressEnter(e); } if (onKeyDown) { onKeyDown(e); } }; var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value; _this.state = { value: value }; return _this; } Object(createClass["a" /* default */])(TextArea, [{ key: "setValue", value: function setValue(value, callback) { if (!('value' in this.props)) { this.setState({ value: value }, callback); } } }, { key: "blur", value: function blur() { this.resizableTextArea.textArea.blur(); } }, { key: "render", value: function render() { return /*#__PURE__*/external_window_React_["createElement"](es_ResizableTextArea, Object(esm_extends["a" /* default */])({}, this.props, { value: this.state.value, onKeyDown: this.handleKeyDown, onChange: this.handleChange, ref: this.saveTextArea })); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(nextProps) { if ('value' in nextProps) { return { value: nextProps.value }; } return null; } }]); return TextArea; }(external_window_React_["Component"]); /* harmony default export */ var rc_textarea_es = __webpack_exports__["default"] = (es_TextArea); /***/ }), /***/ "ZpRC": /*!*************************************************************************!*\ !*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***! \*************************************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.module.js function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeighte||o>t&&l=e&&d>=n?o-t-r:l>e&&dn?l-e+i:0}/* harmony default export */ var index_module = (function(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}); //# sourceMappingURL=index.module.js.map // CONCATENATED MODULE: ./node_modules/scroll-into-view-if-needed/es/index.js function isOptionsObject(options) { return options === Object(options) && Object.keys(options).length !== 0; } function defaultBehavior(actions, behavior) { if (behavior === void 0) { behavior = 'auto'; } var canSmoothScroll = ('scrollBehavior' in document.body.style); actions.forEach(function (_ref) { var el = _ref.el, top = _ref.top, left = _ref.left; if (el.scroll && canSmoothScroll) { el.scroll({ top: top, left: left, behavior: behavior }); } else { el.scrollTop = top; el.scrollLeft = left; } }); } function getOptions(options) { if (options === false) { return { block: 'end', inline: 'nearest' }; } if (isOptionsObject(options)) { return options; } return { block: 'start', inline: 'nearest' }; } function scrollIntoView(target, options) { var targetIsDetached = !target.ownerDocument.documentElement.contains(target); if (isOptionsObject(options) && typeof options.behavior === 'function') { return options.behavior(targetIsDetached ? [] : index_module(target, options)); } if (targetIsDetached) { return; } var computeOptions = getOptions(options); return defaultBehavior(index_module(target, computeOptions), computeOptions.behavior); } /* harmony default export */ var es = __webpack_exports__["a"] = (scrollIntoView); /***/ }), /***/ "bQjk": /*!**********************************************!*\ !*** ./node_modules/crypto-js/format-hex.js ***! \**********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var CipherParams = C_lib.CipherParams; var C_enc = C.enc; var Hex = C_enc.Hex; var C_format = C.format; var HexFormatter = C_format.Hex = { /** * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. * * @param {CipherParams} cipherParams The cipher params object. * * @return {string} The hexadecimally encoded string. * * @static * * @example * * var hexString = CryptoJS.format.Hex.stringify(cipherParams); */ stringify: function (cipherParams) { return cipherParams.ciphertext.toString(Hex); }, /** * Converts a hexadecimally encoded ciphertext string to a cipher params object. * * @param {string} input The hexadecimally encoded string. * * @return {CipherParams} The cipher params object. * * @static * * @example * * var cipherParams = CryptoJS.format.Hex.parse(hexString); */ parse: function (input) { var ciphertext = Hex.parse(input); return CipherParams.create({ ciphertext: ciphertext }); } }; }()); return CryptoJS.format.Hex; })); /***/ }), /***/ "bT9E": /*!*****************************************!*\ !*** ./node_modules/rc-util/es/omit.js ***! \*****************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return omit; }); /* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "VTBJ"); function omit(obj, fields) { var clone = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, obj); if (Array.isArray(fields)) { fields.forEach(function (key) { delete clone[key]; }); } return clone; } /***/ }), /***/ "cv67": /*!***************************************!*\ !*** ./node_modules/crypto-js/md5.js ***! \***************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Constants table var T = []; // Compute constants (function () { for (var i = 0; i < 64; i++) { T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; } }()); /** * MD5 hash algorithm. */ var MD5 = C_algo.MD5 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 ]); }, _doProcessBlock: function (M, offset) { // Swap endian for (var i = 0; i < 16; i++) { // Shortcuts var offset_i = offset + i; var M_offset_i = M[offset_i]; M[offset_i] = ( (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) ); } // Shortcuts var H = this._hash.words; var M_offset_0 = M[offset + 0]; var M_offset_1 = M[offset + 1]; var M_offset_2 = M[offset + 2]; var M_offset_3 = M[offset + 3]; var M_offset_4 = M[offset + 4]; var M_offset_5 = M[offset + 5]; var M_offset_6 = M[offset + 6]; var M_offset_7 = M[offset + 7]; var M_offset_8 = M[offset + 8]; var M_offset_9 = M[offset + 9]; var M_offset_10 = M[offset + 10]; var M_offset_11 = M[offset + 11]; var M_offset_12 = M[offset + 12]; var M_offset_13 = M[offset + 13]; var M_offset_14 = M[offset + 14]; var M_offset_15 = M[offset + 15]; // Working varialbes var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; // Computation a = FF(a, b, c, d, M_offset_0, 7, T[0]); d = FF(d, a, b, c, M_offset_1, 12, T[1]); c = FF(c, d, a, b, M_offset_2, 17, T[2]); b = FF(b, c, d, a, M_offset_3, 22, T[3]); a = FF(a, b, c, d, M_offset_4, 7, T[4]); d = FF(d, a, b, c, M_offset_5, 12, T[5]); c = FF(c, d, a, b, M_offset_6, 17, T[6]); b = FF(b, c, d, a, M_offset_7, 22, T[7]); a = FF(a, b, c, d, M_offset_8, 7, T[8]); d = FF(d, a, b, c, M_offset_9, 12, T[9]); c = FF(c, d, a, b, M_offset_10, 17, T[10]); b = FF(b, c, d, a, M_offset_11, 22, T[11]); a = FF(a, b, c, d, M_offset_12, 7, T[12]); d = FF(d, a, b, c, M_offset_13, 12, T[13]); c = FF(c, d, a, b, M_offset_14, 17, T[14]); b = FF(b, c, d, a, M_offset_15, 22, T[15]); a = GG(a, b, c, d, M_offset_1, 5, T[16]); d = GG(d, a, b, c, M_offset_6, 9, T[17]); c = GG(c, d, a, b, M_offset_11, 14, T[18]); b = GG(b, c, d, a, M_offset_0, 20, T[19]); a = GG(a, b, c, d, M_offset_5, 5, T[20]); d = GG(d, a, b, c, M_offset_10, 9, T[21]); c = GG(c, d, a, b, M_offset_15, 14, T[22]); b = GG(b, c, d, a, M_offset_4, 20, T[23]); a = GG(a, b, c, d, M_offset_9, 5, T[24]); d = GG(d, a, b, c, M_offset_14, 9, T[25]); c = GG(c, d, a, b, M_offset_3, 14, T[26]); b = GG(b, c, d, a, M_offset_8, 20, T[27]); a = GG(a, b, c, d, M_offset_13, 5, T[28]); d = GG(d, a, b, c, M_offset_2, 9, T[29]); c = GG(c, d, a, b, M_offset_7, 14, T[30]); b = GG(b, c, d, a, M_offset_12, 20, T[31]); a = HH(a, b, c, d, M_offset_5, 4, T[32]); d = HH(d, a, b, c, M_offset_8, 11, T[33]); c = HH(c, d, a, b, M_offset_11, 16, T[34]); b = HH(b, c, d, a, M_offset_14, 23, T[35]); a = HH(a, b, c, d, M_offset_1, 4, T[36]); d = HH(d, a, b, c, M_offset_4, 11, T[37]); c = HH(c, d, a, b, M_offset_7, 16, T[38]); b = HH(b, c, d, a, M_offset_10, 23, T[39]); a = HH(a, b, c, d, M_offset_13, 4, T[40]); d = HH(d, a, b, c, M_offset_0, 11, T[41]); c = HH(c, d, a, b, M_offset_3, 16, T[42]); b = HH(b, c, d, a, M_offset_6, 23, T[43]); a = HH(a, b, c, d, M_offset_9, 4, T[44]); d = HH(d, a, b, c, M_offset_12, 11, T[45]); c = HH(c, d, a, b, M_offset_15, 16, T[46]); b = HH(b, c, d, a, M_offset_2, 23, T[47]); a = II(a, b, c, d, M_offset_0, 6, T[48]); d = II(d, a, b, c, M_offset_7, 10, T[49]); c = II(c, d, a, b, M_offset_14, 15, T[50]); b = II(b, c, d, a, M_offset_5, 21, T[51]); a = II(a, b, c, d, M_offset_12, 6, T[52]); d = II(d, a, b, c, M_offset_3, 10, T[53]); c = II(c, d, a, b, M_offset_10, 15, T[54]); b = II(b, c, d, a, M_offset_1, 21, T[55]); a = II(a, b, c, d, M_offset_8, 6, T[56]); d = II(d, a, b, c, M_offset_15, 10, T[57]); c = II(c, d, a, b, M_offset_6, 15, T[58]); b = II(b, c, d, a, M_offset_13, 21, T[59]); a = II(a, b, c, d, M_offset_4, 6, T[60]); d = II(d, a, b, c, M_offset_11, 10, T[61]); c = II(c, d, a, b, M_offset_2, 15, T[62]); b = II(b, c, d, a, M_offset_9, 21, T[63]); // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); var nBitsTotalL = nBitsTotal; dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) ); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) ); data.sigBytes = (dataWords.length + 1) * 4; // Hash final blocks this._process(); // Shortcuts var hash = this._hash; var H = hash.words; // Swap endian for (var i = 0; i < 4; i++) { // Shortcut var H_i = H[i]; H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); } // Return final computed hash return hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); function FF(a, b, c, d, x, s, t) { var n = a + ((b & c) | (~b & d)) + x + t; return ((n << s) | (n >>> (32 - s))) + b; } function GG(a, b, c, d, x, s, t) { var n = a + ((b & d) | (c & ~d)) + x + t; return ((n << s) | (n >>> (32 - s))) + b; } function HH(a, b, c, d, x, s, t) { var n = a + (b ^ c ^ d) + x + t; return ((n << s) | (n >>> (32 - s))) + b; } function II(a, b, c, d, x, s, t) { var n = a + (c ^ (b | ~d)) + x + t; return ((n << s) | (n >>> (32 - s))) + b; } /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.MD5('message'); * var hash = CryptoJS.MD5(wordArray); */ C.MD5 = Hasher._createHelper(MD5); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacMD5(message, key); */ C.HmacMD5 = Hasher._createHmacHelper(MD5); }(Math)); return CryptoJS.MD5; })); /***/ }), /***/ "dmUQ": /*!**************************************************************!*\ !*** ./node_modules/rc-input-number/es/index.js + 1 modules ***! \**************************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__("Ff2n"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("rePB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__("1OyB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__("vuIU"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js var inherits = __webpack_require__("Ji7U"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__("md7G"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js var getPrototypeOf = __webpack_require__("foSv"); // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); var external_window_React_default = /*#__PURE__*/__webpack_require__.n(external_window_React_); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("TSYQ"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js var KeyCode = __webpack_require__("4IlW"); // CONCATENATED MODULE: ./node_modules/rc-input-number/es/InputNumber.js function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable react/prop-types */ function noop() {} function preventDefault(e) { e.preventDefault(); } var defaultParser = function defaultParser(input) { return input.replace(/[^\w.-]+/g, ''); }; /** * When click and hold on a button - the speed of auto changin the value. */ var SPEED = 200; /** * When click and hold on a button - the delay before auto changin the value. */ var DELAY = 600; /** * Max Safe Integer -- on IE this is not available, so manually set the number in that case. * The reason this is used, instead of Infinity is because numbers above the MSI are unstable */ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; var isValidProps = function isValidProps(value) { return value !== undefined && value !== null; }; var isEqual = function isEqual(oldValue, newValue) { return newValue === oldValue || typeof newValue === 'number' && typeof oldValue === 'number' && isNaN(newValue) && isNaN(oldValue); }; var InputNumber_InputNumber = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(InputNumber, _React$Component); var _super = _createSuper(InputNumber); function InputNumber(props) { var _this; Object(classCallCheck["a" /* default */])(this, InputNumber); _this = _super.call(this, props); _this.onKeyDown = function (e) { var _this$props = _this.props, onKeyDown = _this$props.onKeyDown, onPressEnter = _this$props.onPressEnter; if (e.keyCode === KeyCode["a" /* default */].UP) { var ratio = _this.getRatio(e); _this.up(e, ratio, null); _this.stop(); } else if (e.keyCode === KeyCode["a" /* default */].DOWN) { var _ratio = _this.getRatio(e); _this.down(e, _ratio, null); _this.stop(); } else if (e.keyCode === KeyCode["a" /* default */].ENTER && onPressEnter) { onPressEnter(e); } // Trigger user key down _this.recordCursorPosition(); _this.lastKeyCode = e.keyCode; if (onKeyDown) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } onKeyDown.apply(void 0, [e].concat(args)); } }; _this.onKeyUp = function (e) { var onKeyUp = _this.props.onKeyUp; _this.stop(); _this.recordCursorPosition(); // Trigger user key up if (onKeyUp) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } onKeyUp.apply(void 0, [e].concat(args)); } }; _this.onChange = function (e) { var onChange = _this.props.onChange; if (_this.state.focused) { _this.inputting = true; } _this.rawInput = _this.props.parser(_this.getValueFromEvent(e)); _this.setState({ inputValue: _this.rawInput }); onChange(_this.toNumber(_this.rawInput)); // valid number or invalid string }; _this.onMouseUp = function () { var onMouseUp = _this.props.onMouseUp; _this.recordCursorPosition(); if (onMouseUp) { onMouseUp.apply(void 0, arguments); } }; _this.onFocus = function () { var _this$props2; _this.setState({ focused: true }); (_this$props2 = _this.props).onFocus.apply(_this$props2, arguments); }; _this.onBlur = function () { var onBlur = _this.props.onBlur; _this.inputting = false; _this.setState({ focused: false }); var value = _this.getCurrentValidValue(_this.state.inputValue); var newValue = _this.setValue(value, noop); if (onBlur) { var originValue = _this.input.value; var displayValue = _this.getInputDisplayValue({ focus: false, value: newValue }); _this.input.value = displayValue ? Number(displayValue) : displayValue; onBlur.apply(void 0, arguments); _this.input.value = originValue; } }; _this.getRatio = function (e) { var ratio = 1; if (e.metaKey || e.ctrlKey) { ratio = 0.1; } else if (e.shiftKey) { ratio = 10; } return ratio; }; _this.getFullNum = function (num) { if (isNaN(num)) { return num; } if (!/e/i.test(String(num))) { return num; } return Number(num).toFixed(18).replace(/\.?0+$/, ''); }; _this.getPrecision = function (value) { if (isValidProps(_this.props.precision)) { return _this.props.precision; } var valueString = String(value); if (valueString.indexOf('e-') >= 0) { return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10); } var precision = 0; if (valueString.indexOf('.') >= 0) { precision = valueString.length - valueString.indexOf('.') - 1; } return precision; }; _this.getInputDisplayValue = function (state) { var _ref = state || _this.state, focused = _ref.focused, inputValue = _ref.inputValue, value = _ref.value; var inputDisplayValue; if (focused) { inputDisplayValue = inputValue; } else { inputDisplayValue = _this.toPrecisionAsStep(value); } if (inputDisplayValue === undefined || inputDisplayValue === null) { inputDisplayValue = ''; } var inputDisplayValueFormat = _this.formatWrapper(inputDisplayValue); if (isValidProps(_this.props.decimalSeparator)) { inputDisplayValueFormat = inputDisplayValueFormat.toString().replace('.', _this.props.decimalSeparator); } return inputDisplayValueFormat; }; _this.recordCursorPosition = function () { // Record position try { _this.cursorStart = _this.input.selectionStart; _this.cursorEnd = _this.input.selectionEnd; _this.currentValue = _this.input.value; _this.cursorBefore = _this.input.value.substring(0, _this.cursorStart); _this.cursorAfter = _this.input.value.substring(_this.cursorEnd); } catch (e) {// Fix error in Chrome: // Failed to read the 'selectionStart' property from 'HTMLInputElement' // http://stackoverflow.com/q/21177489/3040605 } }; _this.restoreByAfter = function (str) { if (str === undefined) return false; var fullStr = _this.input.value; var index = fullStr.lastIndexOf(str); if (index === -1) return false; var prevCursorPos = _this.cursorBefore.length; if (_this.lastKeyCode === KeyCode["a" /* default */].DELETE && _this.cursorBefore.charAt(prevCursorPos - 1) === str[0]) { _this.fixCaret(prevCursorPos, prevCursorPos); return true; } if (index + str.length === fullStr.length) { _this.fixCaret(index, index); return true; } return false; }; _this.partRestoreByAfter = function (str) { if (str === undefined) return false; // For loop from full str to the str with last char to map. e.g. 123 // -> 123 // -> 23 // -> 3 return Array.prototype.some.call(str, function (_, start) { var partStr = str.substring(start); return _this.restoreByAfter(partStr); }); }; // '1.' '1x' 'xx' '' => are not complete numbers _this.isNotCompleteNumber = function (num) { return isNaN(num) || num === '' || num === null || num && num.toString().indexOf('.') === num.toString().length - 1; }; _this.stop = function () { if (_this.autoStepTimer) { clearTimeout(_this.autoStepTimer); } }; _this.down = function (e, ratio, recursive) { _this.pressingUpOrDown = true; _this.step('down', e, ratio, recursive); }; _this.up = function (e, ratio, recursive) { _this.pressingUpOrDown = true; _this.step('up', e, ratio, recursive); }; _this.saveInput = function (node) { _this.input = node; }; var value = props.value; if (value === undefined) { value = props.defaultValue; } _this.state = { focused: props.autoFocus }; var validValue = _this.getValidValue(_this.toNumber(value)); _this.state = _objectSpread(_objectSpread({}, _this.state), {}, { inputValue: _this.toPrecisionAsStep(validValue), value: validValue }); return _this; } Object(createClass["a" /* default */])(InputNumber, [{ key: "componentDidMount", value: function componentDidMount() { this.componentDidUpdate(null); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props3 = this.props, value = _this$props3.value, onChange = _this$props3.onChange, max = _this$props3.max, min = _this$props3.min; var focused = this.state.focused; // Don't trigger in componentDidMount if (prevProps) { if (!isEqual(prevProps.value, value) || !isEqual(prevProps.max, max) || !isEqual(prevProps.min, min)) { var validValue = focused ? value : this.getValidValue(value); var nextInputValue; if (this.pressingUpOrDown) { nextInputValue = validValue; } else if (this.inputting) { nextInputValue = this.rawInput; } else { nextInputValue = this.toPrecisionAsStep(validValue); } this.setState({ // eslint-disable-line value: validValue, inputValue: nextInputValue }); } // Trigger onChange when max or min change // https://github.com/ant-design/ant-design/issues/11574 var nextValue = 'value' in this.props ? value : this.state.value; // ref: null < 20 === true // https://github.com/ant-design/ant-design/issues/14277 if ('max' in this.props && prevProps.max !== max && typeof nextValue === 'number' && nextValue > max && onChange) { onChange(max); } if ('min' in this.props && prevProps.min !== min && typeof nextValue === 'number' && nextValue < min && onChange) { onChange(min); } } // Restore cursor try { // Firefox set the input cursor after it get focused. // This caused that if an input didn't init with the selection, // set will cause cursor not correct when first focus. // Safari will focus input if set selection. We need skip this. if (this.cursorStart !== undefined && this.state.focused) { // In most cases, the string after cursor is stable. // We can move the cursor before it if ( // If not match full str, try to match part of str !this.partRestoreByAfter(this.cursorAfter) && this.state.value !== this.props.value) { // If not match any of then, let's just keep the position // TODO: Logic should not reach here, need check if happens var pos = this.cursorStart + 1; // If not have last string, just position to the end if (!this.cursorAfter) { pos = this.input.value.length; } else if (this.lastKeyCode === KeyCode["a" /* default */].BACKSPACE) { pos = this.cursorStart - 1; } else if (this.lastKeyCode === KeyCode["a" /* default */].DELETE) { pos = this.cursorStart; } this.fixCaret(pos, pos); } else if (this.currentValue === this.input.value) { // Handle some special key code switch (this.lastKeyCode) { case KeyCode["a" /* default */].BACKSPACE: this.fixCaret(this.cursorStart - 1, this.cursorStart - 1); break; case KeyCode["a" /* default */].DELETE: this.fixCaret(this.cursorStart + 1, this.cursorStart + 1); break; default: // Do nothing } } } } catch (e) {// Do nothing } // Reset last key this.lastKeyCode = null; // pressingUpOrDown is true means that someone just click up or down button if (!this.pressingUpOrDown) { return; } if (this.props.focusOnUpDown && this.state.focused) { if (document.activeElement !== this.input) { this.focus(); } } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.stop(); } }, { key: "getCurrentValidValue", value: function getCurrentValidValue(value) { var val = value; if (val === '') { val = ''; } else if (!this.isNotCompleteNumber(parseFloat(val))) { val = this.getValidValue(val); } else { val = this.state.value; } return this.toNumber(val); } }, { key: "getValueFromEvent", value: function getValueFromEvent(e) { // optimize for chinese input expierence // https://github.com/ant-design/ant-design/issues/8196 var value = e.target.value.trim().replace(/。/g, '.'); if (isValidProps(this.props.decimalSeparator)) { value = value.replace(this.props.decimalSeparator, '.'); } return value; } }, { key: "getValidValue", value: function getValidValue(value) { var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props.min; var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.props.max; var val = parseFloat(value); // https://github.com/ant-design/ant-design/issues/7358 if (isNaN(val)) { return value; } if (val < min) { val = min; } if (val > max) { val = max; } return val; } }, { key: "setValue", value: function setValue(v, callback) { // trigger onChange var precision = this.props.precision; var newValue = this.isNotCompleteNumber(parseFloat(v)) ? null : parseFloat(v); var _this$state$value = this.state.value, value = _this$state$value === void 0 ? null : _this$state$value; var _this$state$inputValu = this.state.inputValue, inputValue = _this$state$inputValu === void 0 ? null : _this$state$inputValu; // https://github.com/ant-design/ant-design/issues/7363 // https://github.com/ant-design/ant-design/issues/16622 var newValueInString = typeof newValue === 'number' ? newValue.toFixed(precision) : "".concat(newValue); var changed = newValue !== value || newValueInString !== "".concat(inputValue); if (!('value' in this.props)) { this.setState({ value: newValue, inputValue: this.toPrecisionAsStep(v) }, callback); } else { // always set input value same as value inputValue = this.toPrecisionAsStep(this.state.value); this.setState({ inputValue: inputValue }, callback); } if (changed) { this.props.onChange(newValue); } return newValue; } // step={1.0} value={1.51} // press + // then value should be 2.51, rather than 2.5 // if this.props.precision is undefined // https://github.com/react-component/input-number/issues/39 }, { key: "getMaxPrecision", value: function getMaxPrecision(currentValue) { var ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var _this$props4 = this.props, precision = _this$props4.precision, step = _this$props4.step; if (isValidProps(precision)) { return precision; } var ratioPrecision = this.getPrecision(ratio); var stepPrecision = this.getPrecision(step); var currentValuePrecision = this.getPrecision(currentValue); if (!currentValue) { return ratioPrecision + stepPrecision; } return Math.max(currentValuePrecision, ratioPrecision + stepPrecision); } }, { key: "getPrecisionFactor", value: function getPrecisionFactor(currentValue) { var ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var precision = this.getMaxPrecision(currentValue, ratio); return Math.pow(10, precision); } }, { key: "focus", value: function focus() { this.input.focus(); this.recordCursorPosition(); } }, { key: "blur", value: function blur() { this.input.blur(); } }, { key: "select", value: function select() { this.input.select(); } }, { key: "formatWrapper", value: function formatWrapper(num) { // http://2ality.com/2012/03/signedzero.html // https://github.com/ant-design/ant-design/issues/9439 if (this.props.formatter) { return this.props.formatter(num); } return num; } }, { key: "toPrecisionAsStep", value: function toPrecisionAsStep(num) { if (this.isNotCompleteNumber(num) || num === '') { return num; } var precision = Math.abs(this.getMaxPrecision(num)); if (!isNaN(precision)) { return Number(num).toFixed(precision); } return num.toString(); } }, { key: "toNumber", value: function toNumber(num) { var precision = this.props.precision; var focused = this.state.focused; // num.length > 16 => This is to prevent input of large numbers var numberIsTooLarge = num && num.length > 16 && focused; if (this.isNotCompleteNumber(num) || numberIsTooLarge) { return num; } if (isValidProps(precision)) { return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision); } return Number(num); } }, { key: "upStep", value: function upStep(val, rat) { var step = this.props.step; var precisionFactor = this.getPrecisionFactor(val, rat); var precision = Math.abs(this.getMaxPrecision(val, rat)); var result = ((precisionFactor * val + precisionFactor * step * rat) / precisionFactor).toFixed(precision); return this.toNumber(result); } }, { key: "downStep", value: function downStep(val, rat) { var step = this.props.step; var precisionFactor = this.getPrecisionFactor(val, rat); var precision = Math.abs(this.getMaxPrecision(val, rat)); var result = ((precisionFactor * val - precisionFactor * step * rat) / precisionFactor).toFixed(precision); return this.toNumber(result); } }, { key: "step", value: function step(type, e) { var _this2 = this; var ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; var recursive = arguments.length > 3 ? arguments[3] : undefined; this.stop(); if (e) { e.persist(); e.preventDefault(); } var props = this.props; if (props.disabled) { return; } var value = this.getCurrentValidValue(this.state.inputValue) || 0; if (this.isNotCompleteNumber(value)) { return; } var val = this["".concat(type, "Step")](value, ratio); var outOfRange = val > props.max || val < props.min; if (val > props.max) { val = props.max; } else if (val < props.min) { val = props.min; } this.setValue(val, null); this.setState({ focused: true }, function () { _this2.pressingUpOrDown = false; }); if (outOfRange) { return; } this.autoStepTimer = setTimeout(function () { _this2[type](e, ratio, true); }, recursive ? SPEED : DELAY); } }, { key: "fixCaret", value: function fixCaret(start, end) { if (start === undefined || end === undefined || !this.input || !this.input.value) { return; } try { var currentStart = this.input.selectionStart; var currentEnd = this.input.selectionEnd; if (start !== currentStart || end !== currentEnd) { this.input.setSelectionRange(start, end); } } catch (e) {// Fix error in Chrome: // Failed to read the 'selectionStart' property from 'HTMLInputElement' // http://stackoverflow.com/q/21177489/3040605 } } }, { key: "render", value: function render() { var _classNames; var _this$props5 = this.props, prefixCls = _this$props5.prefixCls, disabled = _this$props5.disabled, readOnly = _this$props5.readOnly, useTouch = _this$props5.useTouch, autoComplete = _this$props5.autoComplete, upHandler = _this$props5.upHandler, downHandler = _this$props5.downHandler, className = _this$props5.className, max = _this$props5.max, min = _this$props5.min, style = _this$props5.style, title = _this$props5.title, onMouseEnter = _this$props5.onMouseEnter, onMouseLeave = _this$props5.onMouseLeave, onMouseOver = _this$props5.onMouseOver, onMouseOut = _this$props5.onMouseOut, required = _this$props5.required, onClick = _this$props5.onClick, tabIndex = _this$props5.tabIndex, type = _this$props5.type, placeholder = _this$props5.placeholder, id = _this$props5.id, inputMode = _this$props5.inputMode, pattern = _this$props5.pattern, step = _this$props5.step, maxLength = _this$props5.maxLength, autoFocus = _this$props5.autoFocus, name = _this$props5.name, onPaste = _this$props5.onPaste, onInput = _this$props5.onInput, rest = Object(objectWithoutProperties["a" /* default */])(_this$props5, ["prefixCls", "disabled", "readOnly", "useTouch", "autoComplete", "upHandler", "downHandler", "className", "max", "min", "style", "title", "onMouseEnter", "onMouseLeave", "onMouseOver", "onMouseOut", "required", "onClick", "tabIndex", "type", "placeholder", "id", "inputMode", "pattern", "step", "maxLength", "autoFocus", "name", "onPaste", "onInput"]); var _this$state = this.state, value = _this$state.value, focused = _this$state.focused; var classes = classnames_default()(prefixCls, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, className, !!className), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-disabled"), disabled), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-focused"), focused), _classNames)); var dataOrAriaAttributeProps = {}; Object.keys(rest).forEach(function (key) { if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') { dataOrAriaAttributeProps[key] = rest[key]; } }); var editable = !readOnly && !disabled; // focus state, show input value // unfocus state, show valid value var inputDisplayValue = this.getInputDisplayValue(null); var upDisabled = (value || value === 0) && (isNaN(value) || Number(value) >= max); var downDisabled = (value || value === 0) && (isNaN(value) || Number(value) <= min); var isUpDisabled = upDisabled || disabled || readOnly; var isDownDisabled = downDisabled || disabled || readOnly; var upClassName = classnames_default()("".concat(prefixCls, "-handler"), "".concat(prefixCls, "-handler-up"), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-handler-up-disabled"), isUpDisabled)); var downClassName = classnames_default()("".concat(prefixCls, "-handler"), "".concat(prefixCls, "-handler-down"), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-handler-down-disabled"), isDownDisabled)); var upEvents = useTouch ? { onTouchStart: isUpDisabled ? noop : this.up, onTouchEnd: this.stop } : { onMouseDown: isUpDisabled ? noop : this.up, onMouseUp: this.stop, onMouseLeave: this.stop }; var downEvents = useTouch ? { onTouchStart: isDownDisabled ? noop : this.down, onTouchEnd: this.stop } : { onMouseDown: isDownDisabled ? noop : this.down, onMouseUp: this.stop, onMouseLeave: this.stop }; return external_window_React_default.a.createElement("div", { className: classes, style: style, title: title, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onFocus: function onFocus() { return null; }, onBlur: function onBlur() { return null; } }, external_window_React_default.a.createElement("div", { className: "".concat(prefixCls, "-handler-wrap") }, external_window_React_default.a.createElement("span", Object.assign({ unselectable: "on" }, upEvents, { role: "button", "aria-label": "Increase Value", "aria-disabled": isUpDisabled, className: upClassName }), upHandler || external_window_React_default.a.createElement("span", { unselectable: "on", className: "".concat(prefixCls, "-handler-up-inner"), onClick: preventDefault })), external_window_React_default.a.createElement("span", Object.assign({ unselectable: "on" }, downEvents, { role: "button", "aria-label": "Decrease Value", "aria-disabled": isDownDisabled, className: downClassName }), downHandler || external_window_React_default.a.createElement("span", { unselectable: "on", className: "".concat(prefixCls, "-handler-down-inner"), onClick: preventDefault }))), external_window_React_default.a.createElement("div", { className: "".concat(prefixCls, "-input-wrap") }, external_window_React_default.a.createElement("input", Object.assign({ role: "spinbutton", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, required: required, type: type, placeholder: placeholder, onPaste: onPaste, onClick: onClick, onMouseUp: this.onMouseUp, className: "".concat(prefixCls, "-input"), tabIndex: tabIndex, autoComplete: autoComplete, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: editable ? this.onKeyDown : noop, onKeyUp: editable ? this.onKeyUp : noop, autoFocus: autoFocus, maxLength: maxLength, readOnly: readOnly, disabled: disabled, max: max, min: min, step: step, name: name, title: title, id: id, onChange: this.onChange, ref: this.saveInput, value: this.getFullNum(inputDisplayValue), pattern: pattern, inputMode: inputMode, onInput: onInput }, dataOrAriaAttributeProps)))); } }]); return InputNumber; }(external_window_React_default.a.Component); InputNumber_InputNumber.defaultProps = { focusOnUpDown: true, useTouch: false, prefixCls: 'rc-input-number', max: MAX_SAFE_INTEGER, min: -MAX_SAFE_INTEGER, step: 1, style: {}, onChange: noop, onKeyDown: noop, onPressEnter: noop, onFocus: noop, onBlur: noop, parser: defaultParser, required: false, autoComplete: 'off' }; /* harmony default export */ var es_InputNumber = (InputNumber_InputNumber); // CONCATENATED MODULE: ./node_modules/rc-input-number/es/index.js /* harmony default export */ var es = __webpack_exports__["a"] = (es_InputNumber); /***/ }), /***/ "e7zE": /*!******************************************!*\ !*** ./node_modules/crypto-js/pbkdf2.js ***! \******************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./sha1 */ "3y9D"), __webpack_require__(/*! ./hmac */ "WYAk")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var WordArray = C_lib.WordArray; var C_algo = C.algo; var SHA1 = C_algo.SHA1; var HMAC = C_algo.HMAC; /** * Password-Based Key Derivation Function 2 algorithm. */ var PBKDF2 = C_algo.PBKDF2 = Base.extend({ /** * Configuration options. * * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) * @property {Hasher} hasher The hasher to use. Default: SHA1 * @property {number} iterations The number of iterations to perform. Default: 1 */ cfg: Base.extend({ keySize: 128/32, hasher: SHA1, iterations: 1 }), /** * Initializes a newly created key derivation function. * * @param {Object} cfg (Optional) The configuration options to use for the derivation. * * @example * * var kdf = CryptoJS.algo.PBKDF2.create(); * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); */ init: function (cfg) { this.cfg = this.cfg.extend(cfg); }, /** * Computes the Password-Based Key Derivation Function 2. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * * @return {WordArray} The derived key. * * @example * * var key = kdf.compute(password, salt); */ compute: function (password, salt) { // Shortcut var cfg = this.cfg; // Init HMAC var hmac = HMAC.create(cfg.hasher, password); // Initial values var derivedKey = WordArray.create(); var blockIndex = WordArray.create([0x00000001]); // Shortcuts var derivedKeyWords = derivedKey.words; var blockIndexWords = blockIndex.words; var keySize = cfg.keySize; var iterations = cfg.iterations; // Generate key while (derivedKeyWords.length < keySize) { var block = hmac.update(salt).finalize(blockIndex); hmac.reset(); // Shortcuts var blockWords = block.words; var blockWordsLength = blockWords.length; // Iterations var intermediate = block; for (var i = 1; i < iterations; i++) { intermediate = hmac.finalize(intermediate); hmac.reset(); // Shortcut var intermediateWords = intermediate.words; // XOR intermediate with block for (var j = 0; j < blockWordsLength; j++) { blockWords[j] ^= intermediateWords[j]; } } derivedKey.concat(block); blockIndexWords[0]++; } derivedKey.sigBytes = keySize * 4; return derivedKey; } }); /** * Computes the Password-Based Key Derivation Function 2. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * @param {Object} cfg (Optional) The configuration options to use for this computation. * * @return {WordArray} The derived key. * * @static * * @example * * var key = CryptoJS.PBKDF2(password, salt); * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); */ C.PBKDF2 = function (password, salt, cfg) { return PBKDF2.create(cfg).compute(password, salt); }; }()); return CryptoJS.PBKDF2; })); /***/ }), /***/ "fnXi": /*!***************************************************************************************!*\ !*** ./src/pages/Shixuns/Edit/body/Level/Challenges/RankingSetting/challenge-nav.tsx ***! \***************************************************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var antd_es_modal_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/modal/style */ "2qtc"); /* harmony import */ var antd_es_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/modal */ "kLXV"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "cDcd"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! umi */ "Ty5D"); /* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! umi */ "9kvl"); /* harmony import */ var _challenge_nav_less__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./challenge-nav.less */ "93VE"); /* harmony import */ var _challenge_nav_less__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_challenge_nav_less__WEBPACK_IMPORTED_MODULE_5__); var ChallengeNav = function ChallengeNav(_ref) { var activeIndex = _ref.activeIndex, _ref$isEdit = _ref.isEdit, isEdit = _ref$isEdit === void 0 ? true : _ref$isEdit, dispatch = _ref.dispatch, practiceSetting = _ref.practiceSetting; var params = Object(umi__WEBPACK_IMPORTED_MODULE_3__[/* useParams */ "i"])(); var id = params.id, challengesId = params.challengesId; var navs = Object(react__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { return [{ name: '本关任务', url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/editcheckpoint") }, { name: '评测设置', url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/tab=2") }, { name: '参考答案', url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/tab=3") }, { name: '关卡排行榜', url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/tab=4") }]; }, [id, challengesId]); var handleClick = function handleClick(url) { var _practiceSetting$side; var toNext = function toNext() { umi__WEBPACK_IMPORTED_MODULE_4__[/* history */ "d"].push(url); dispatch({ type: 'practiceSetting/setSideBarTabs', payload: { confirmLeave: false } }); }; if (practiceSetting !== null && practiceSetting !== void 0 && (_practiceSetting$side = practiceSetting.sideBar) !== null && _practiceSetting$side !== void 0 && _practiceSetting$side.confirmLeave) { antd_es_modal__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].confirm({ title: "离开此页提示", content: "系统可能不会保存您所做的更改。", okText: "离开", cancelText: "取消", onOk: function onOk() { toNext(); } }); } else { toNext(); } }; return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("ul", { className: "challenge-nav" }, isEdit ? navs.map(function (item, index) { if (activeIndex === index) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("li", { key: item.url }, " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("a", { className: "active" }, item.name), " "); } else { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("li", { key: item.url }, " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("a", { onClick: function onClick() { return handleClick(item.url); } }, item.name), " "); } }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("li", { key: navs[0].url }, " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("a", { className: "active" }, navs[0].name), " ")); }; /* harmony default export */ __webpack_exports__["a"] = (Object(umi__WEBPACK_IMPORTED_MODULE_4__[/* connect */ "a"])(function (_ref2) { var globalSetting = _ref2.globalSetting, practiceSetting = _ref2.practiceSetting; return { globalSetting: globalSetting, practiceSetting: practiceSetting }; })(ChallengeNav)); /***/ }), /***/ "gb/T": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-ecb.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { /** * Electronic Codebook block mode. */ CryptoJS.mode.ECB = (function () { var ECB = CryptoJS.lib.BlockCipherMode.extend(); ECB.Encryptor = ECB.extend({ processBlock: function (words, offset) { this._cipher.encryptBlock(words, offset); } }); ECB.Decryptor = ECB.extend({ processBlock: function (words, offset) { this._cipher.decryptBlock(words, offset); } }); return ECB; }()); return CryptoJS.mode.ECB; })); /***/ }), /***/ "jO9C": /*!************************************************!*\ !*** ./node_modules/crypto-js/pad-iso97971.js ***! \************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C"), __webpack_require__(/*! ./cipher-core */ "OLod")); } else {} }(this, function (CryptoJS) { /** * ISO/IEC 9797-1 Padding Method 2. */ CryptoJS.pad.Iso97971 = { pad: function (data, blockSize) { // Add 0x80 byte data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); // Zero pad the rest CryptoJS.pad.ZeroPadding.pad(data, blockSize); }, unpad: function (data) { // Remove zero padding CryptoJS.pad.ZeroPadding.unpad(data); // Remove one more byte -- the 0x80 byte data.sigBytes--; } }; return CryptoJS.pad.Iso97971; })); /***/ }), /***/ "k3GJ": /*!*******************************************************!*\ !*** ./node_modules/rc-tabs/es/index.js + 50 modules ***! \*******************************************************/ /*! exports provided: TabPane, default */ /*! exports used: TabPane, default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/mini-store/esm/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/raf/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-align/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-dropdown/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-resize-observer/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/addEventListener.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/canUseDom.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/contains.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Portal.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/createChainedFunction.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMergedState.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/raf.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with external "window.ReactDOM" (<- Module is not an ECMAScript module) */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ TabPane; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("rePB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules var slicedToArray = __webpack_require__("ODXe"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__("Ff2n"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js var objectSpread2 = __webpack_require__("VTBJ"); // EXTERNAL MODULE: external "window.React" var external_window_React_ = __webpack_require__("cDcd"); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__("TSYQ"); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js var toArray = __webpack_require__("Zm9Q"); // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMergedState.js var useMergedState = __webpack_require__("6cGi"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules var toConsumableArray = __webpack_require__("KQm4"); // EXTERNAL MODULE: ./node_modules/raf/index.js var raf = __webpack_require__("xEkU"); var raf_default = /*#__PURE__*/__webpack_require__.n(raf); // EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js var es = __webpack_require__("t23M"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useRaf.js function useRaf(callback) { var rafRef = Object(external_window_React_["useRef"])(); var removedRef = Object(external_window_React_["useRef"])(false); function trigger() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (!removedRef.current) { raf_default.a.cancel(rafRef.current); rafRef.current = raf_default()(function () { callback.apply(void 0, args); }); } } Object(external_window_React_["useEffect"])(function () { return function () { removedRef.current = true; raf_default.a.cancel(rafRef.current); }; }, []); return trigger; } function useRafState(defaultState) { var batchRef = Object(external_window_React_["useRef"])([]); var _useState = Object(external_window_React_["useState"])({}), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), forceUpdate = _useState2[1]; var state = Object(external_window_React_["useRef"])(typeof defaultState === 'function' ? defaultState() : defaultState); var flushUpdate = useRaf(function () { var current = state.current; batchRef.current.forEach(function (callback) { current = callback(current); }); batchRef.current = []; state.current = current; forceUpdate({}); }); function updater(callback) { batchRef.current.push(callback); flushUpdate(); } return [state.current, updater]; } // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js var KeyCode = __webpack_require__("4IlW"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/TabNode.js function TabNode(_ref, ref) { var _classNames; var prefixCls = _ref.prefixCls, id = _ref.id, active = _ref.active, rtl = _ref.rtl, _ref$tab = _ref.tab, key = _ref$tab.key, tab = _ref$tab.tab, disabled = _ref$tab.disabled, closeIcon = _ref$tab.closeIcon, tabBarGutter = _ref.tabBarGutter, tabPosition = _ref.tabPosition, closable = _ref.closable, renderWrapper = _ref.renderWrapper, removeAriaLabel = _ref.removeAriaLabel, editable = _ref.editable, onClick = _ref.onClick, onRemove = _ref.onRemove, onFocus = _ref.onFocus; var tabPrefix = "".concat(prefixCls, "-tab"); external_window_React_["useEffect"](function () { return onRemove; }, []); var nodeStyle = {}; if (tabPosition === 'top' || tabPosition === 'bottom') { nodeStyle[rtl ? 'marginLeft' : 'marginRight'] = tabBarGutter; } else { nodeStyle.marginBottom = tabBarGutter; } var removable = editable && closable !== false && !disabled; function onInternalClick(e) { if (disabled) return; onClick(e); } function onRemoveTab(event) { event.preventDefault(); event.stopPropagation(); editable.onEdit('remove', { key: key, event: event }); } var node = external_window_React_["createElement"]("div", { key: key, ref: ref, className: classnames_default()(tabPrefix, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(tabPrefix, "-with-remove"), removable), Object(defineProperty["a" /* default */])(_classNames, "".concat(tabPrefix, "-active"), active), Object(defineProperty["a" /* default */])(_classNames, "".concat(tabPrefix, "-disabled"), disabled), _classNames)), style: nodeStyle, onClick: onInternalClick }, external_window_React_["createElement"]("div", { role: "tab", "aria-selected": active, id: id && "".concat(id, "-tab-").concat(key), className: "".concat(tabPrefix, "-btn"), "aria-controls": id && "".concat(id, "-panel-").concat(key), "aria-disabled": disabled, tabIndex: disabled ? null : 0, onClick: function onClick(e) { e.stopPropagation(); onInternalClick(e); }, onKeyDown: function onKeyDown(e) { if ([KeyCode["a" /* default */].SPACE, KeyCode["a" /* default */].ENTER].includes(e.which)) { e.preventDefault(); onInternalClick(e); } }, onFocus: onFocus }, tab), removable && external_window_React_["createElement"]("button", { type: "button", "aria-label": removeAriaLabel || 'remove', tabIndex: 0, className: "".concat(tabPrefix, "-remove"), onClick: function onClick(e) { e.stopPropagation(); onRemoveTab(e); } }, closeIcon || editable.removeIcon || '×')); if (renderWrapper) { node = renderWrapper(node); } return node; } /* harmony default export */ var TabNavList_TabNode = (external_window_React_["forwardRef"](TabNode)); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useOffsets.js var DEFAULT_SIZE = { width: 0, height: 0, left: 0, top: 0 }; function useOffsets(tabs, tabSizes, holderScrollWidth) { return Object(external_window_React_["useMemo"])(function () { var _tabs$; var map = new Map(); var lastOffset = tabSizes.get((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key) || DEFAULT_SIZE; var rightOffset = lastOffset.left + lastOffset.width; for (var i = 0; i < tabs.length; i += 1) { var key = tabs[i].key; var data = tabSizes.get(key); // Reuse last one when not exist yet if (!data) { var _tabs; data = tabSizes.get((_tabs = tabs[i - 1]) === null || _tabs === void 0 ? void 0 : _tabs.key) || DEFAULT_SIZE; } var entity = map.get(key) || Object(objectSpread2["a" /* default */])({}, data); // Right entity.right = rightOffset - entity.left - entity.width; // Update entity map.set(key, entity); } return map; }, [tabs.map(function (tab) { return tab.key; }).join('_'), tabSizes, holderScrollWidth]); } // CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useVisibleRange.js var useVisibleRange_DEFAULT_SIZE = { width: 0, height: 0, left: 0, top: 0, right: 0 }; function useVisibleRange(tabOffsets, containerSize, tabContentNodeSize, addNodeSize, _ref) { var tabs = _ref.tabs, tabPosition = _ref.tabPosition, rtl = _ref.rtl; var unit; var position; var transformSize; if (['top', 'bottom'].includes(tabPosition)) { unit = 'width'; position = rtl ? 'right' : 'left'; transformSize = Math.abs(containerSize.left); } else { unit = 'height'; position = 'top'; transformSize = -containerSize.top; } var basicSize = containerSize[unit]; var tabContentSize = tabContentNodeSize[unit]; var addSize = addNodeSize[unit]; var mergedBasicSize = basicSize; if (tabContentSize + addSize > basicSize) { mergedBasicSize = basicSize - addSize; } return Object(external_window_React_["useMemo"])(function () { if (!tabs.length) { return [0, 0]; } var len = tabs.length; var endIndex = len; for (var i = 0; i < len; i += 1) { var offset = tabOffsets.get(tabs[i].key) || useVisibleRange_DEFAULT_SIZE; if (offset[position] + offset[unit] > transformSize + mergedBasicSize) { endIndex = i - 1; break; } } var startIndex = 0; for (var _i = len - 1; _i >= 0; _i -= 1) { var _offset = tabOffsets.get(tabs[_i].key) || useVisibleRange_DEFAULT_SIZE; if (_offset[position] < transformSize) { startIndex = _i + 1; break; } } return [startIndex, endIndex]; }, [tabOffsets, transformSize, mergedBasicSize, tabPosition, tabs.map(function (tab) { return tab.key; }).join('_'), rtl]); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__("wx14"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__("1OyB"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__("vuIU"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js var assertThisInitialized = __webpack_require__("JX7q"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js var inherits = __webpack_require__("Ji7U"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules var createSuper = __webpack_require__("LK+K"); // EXTERNAL MODULE: ./node_modules/mini-store/esm/index.js + 3 modules var esm = __webpack_require__("I8Z2"); // EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js var omit = __webpack_require__("bT9E"); // EXTERNAL MODULE: ./node_modules/rc-util/es/createChainedFunction.js var createChainedFunction = __webpack_require__("2GS6"); // EXTERNAL MODULE: ./node_modules/shallowequal/index.js var shallowequal = __webpack_require__("Gytx"); var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__("U8pU"); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/utils/isMobile.js // MIT License from https://github.com/kaimallea/isMobile var applePhone = /iPhone/i; var appleIpod = /iPod/i; var appleTablet = /iPad/i; var androidPhone = /\bAndroid(?:.+)Mobile\b/i; // Match 'Android' AND 'Mobile' var androidTablet = /Android/i; var amazonPhone = /\bAndroid(?:.+)SD4930UR\b/i; var amazonTablet = /\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i; var windowsPhone = /Windows Phone/i; var windowsTablet = /\bWindows(?:.+)ARM\b/i; // Match 'Windows' AND 'ARM' var otherBlackberry = /BlackBerry/i; var otherBlackberry10 = /BB10/i; var otherOpera = /Opera Mini/i; var otherChrome = /\b(CriOS|Chrome)(?:.+)Mobile/i; var otherFirefox = /Mobile(?:.+)Firefox\b/i; // Match 'Mobile' AND 'Firefox' function match(regex, userAgent) { return regex.test(userAgent); } function isMobile(userAgent) { var ua = userAgent || (typeof navigator !== 'undefined' ? navigator.userAgent : ''); // Facebook mobile app's integrated browser adds a bunch of strings that // match everything. Strip it out if it exists. var tmp = (ua || '').split('[FBAN'); if (typeof tmp[1] !== 'undefined') { var _tmp = tmp; var _tmp2 = Object(slicedToArray["a" /* default */])(_tmp, 1); ua = _tmp2[0]; } // Twitter mobile app's integrated browser on iPad adds a "Twitter for // iPhone" string. Same probably happens on other tablet platforms. // This will confuse detection so strip it out if it exists. tmp = ua.split('Twitter'); if (typeof tmp[1] !== 'undefined') { var _tmp3 = tmp; var _tmp4 = Object(slicedToArray["a" /* default */])(_tmp3, 1); ua = _tmp4[0]; } var result = { apple: { phone: match(applePhone, ua) && !match(windowsPhone, ua), ipod: match(appleIpod, ua), tablet: !match(applePhone, ua) && match(appleTablet, ua) && !match(windowsPhone, ua), device: (match(applePhone, ua) || match(appleIpod, ua) || match(appleTablet, ua)) && !match(windowsPhone, ua) }, amazon: { phone: match(amazonPhone, ua), tablet: !match(amazonPhone, ua) && match(amazonTablet, ua), device: match(amazonPhone, ua) || match(amazonTablet, ua) }, android: { phone: !match(windowsPhone, ua) && match(amazonPhone, ua) || !match(windowsPhone, ua) && match(androidPhone, ua), tablet: !match(windowsPhone, ua) && !match(amazonPhone, ua) && !match(androidPhone, ua) && (match(amazonTablet, ua) || match(androidTablet, ua)), device: !match(windowsPhone, ua) && (match(amazonPhone, ua) || match(amazonTablet, ua) || match(androidPhone, ua) || match(androidTablet, ua)) || match(/\bokhttp\b/i, ua) }, windows: { phone: match(windowsPhone, ua), tablet: match(windowsTablet, ua), device: match(windowsPhone, ua) || match(windowsTablet, ua) }, other: { blackberry: match(otherBlackberry, ua), blackberry10: match(otherBlackberry10, ua), opera: match(otherOpera, ua), firefox: match(otherFirefox, ua), chrome: match(otherChrome, ua), device: match(otherBlackberry, ua) || match(otherBlackberry10, ua) || match(otherOpera, ua) || match(otherFirefox, ua) || match(otherChrome, ua) }, // Additional any: null, phone: null, tablet: null }; result.any = result.apple.device || result.android.device || result.windows.device || result.other.device; // excludes 'other' devices and ipods, targeting touchscreen phones result.phone = result.apple.phone || result.android.phone || result.windows.phone; result.tablet = result.apple.tablet || result.android.tablet || result.windows.tablet; return result; } var defaultResult = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, isMobile()), {}, { isMobile: isMobile }); /* harmony default export */ var utils_isMobile = (defaultResult); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/util.js function noop() {} function getKeyFromChildrenIndex(child, menuEventKey, index) { var prefix = menuEventKey || ''; return child.key || "".concat(prefix, "item_").concat(index); } function getMenuIdFromSubMenuEventKey(eventKey) { return "".concat(eventKey, "-menu-"); } function loopMenuItem(children, cb) { var index = -1; external_window_React_["Children"].forEach(children, function (c) { index += 1; if (c && c.type && c.type.isMenuItemGroup) { external_window_React_["Children"].forEach(c.props.children, function (c2) { index += 1; cb(c2, index); }); } else { cb(c, index); } }); } function loopMenuItemRecursively(children, keys, ret) { /* istanbul ignore if */ if (!children || ret.find) { return; } external_window_React_["Children"].forEach(children, function (c) { if (c) { var construct = c.type; if (!construct || !(construct.isSubMenu || construct.isMenuItem || construct.isMenuItemGroup)) { return; } if (keys.indexOf(c.key) !== -1) { // eslint-disable-next-line no-param-reassign ret.find = true; } else if (c.props.children) { loopMenuItemRecursively(c.props.children, keys, ret); } } }); } var menuAllProps = ['defaultSelectedKeys', 'selectedKeys', 'defaultOpenKeys', 'openKeys', 'mode', 'getPopupContainer', 'onSelect', 'onDeselect', 'onDestroy', 'openTransitionName', 'openAnimation', 'subMenuOpenDelay', 'subMenuCloseDelay', 'forceSubMenuRender', 'triggerSubMenuAction', 'level', 'selectable', 'multiple', 'onOpenChange', 'visible', 'focusable', 'defaultActiveFirst', 'prefixCls', 'inlineIndent', 'parentMenu', 'title', 'rootPrefixCls', 'eventKey', 'active', 'onItemHover', 'onTitleMouseEnter', 'onTitleMouseLeave', 'onTitleClick', 'popupAlign', 'popupOffset', 'isOpen', 'renderMenuItem', 'manualRef', 'subMenuKey', 'disabled', 'index', 'isSelected', 'store', 'activeKey', 'builtinPlacements', 'overflowedIndicator', 'motion', // the following keys found need to be removed from test regression 'attribute', 'value', 'popupClassName', 'inlineCollapsed', 'menu', 'theme', 'itemIcon', 'expandIcon']; // ref: https://github.com/ant-design/ant-design/issues/14007 // ref: https://bugs.chromium.org/p/chromium/issues/detail?id=360889 // getBoundingClientRect return the full precision value, which is // not the same behavior as on chrome. Set the precision to 6 to // unify their behavior var getWidth = function getWidth(elem) { var includeMargin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var width = elem && typeof elem.getBoundingClientRect === 'function' && elem.getBoundingClientRect().width; if (width) { if (includeMargin) { var _getComputedStyle = getComputedStyle(elem), marginLeft = _getComputedStyle.marginLeft, marginRight = _getComputedStyle.marginRight; width += +marginLeft.replace('px', '') + +marginRight.replace('px', ''); } width = +width.toFixed(6); } return width || 0; }; var util_setStyle = function setStyle(elem, styleProperty, value) { if (elem && Object(esm_typeof["a" /* default */])(elem.style) === 'object') { // eslint-disable-next-line no-param-reassign elem.style[styleProperty] = value; } }; var util_isMobileDevice = function isMobileDevice() { return utils_isMobile.any; }; // EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js var ResizeObserver_es = __webpack_require__("bdgK"); // EXTERNAL MODULE: external "window.ReactDOM" var external_window_ReactDOM_ = __webpack_require__("faye"); var external_window_ReactDOM_default = /*#__PURE__*/__webpack_require__.n(external_window_ReactDOM_); // EXTERNAL MODULE: ./node_modules/rc-util/es/raf.js var es_raf = __webpack_require__("wgJM"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/contains.js var contains = __webpack_require__("l4aY"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js var findDOMNode = __webpack_require__("m+aA"); // EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js var es_ref = __webpack_require__("c+Xe"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/addEventListener.js var addEventListener = __webpack_require__("zT1h"); // EXTERNAL MODULE: ./node_modules/rc-util/es/Portal.js var Portal = __webpack_require__("QC+M"); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/utils/alignUtil.js function isPointsEq(a1, a2, isAlignPoint) { if (isAlignPoint) { return a1[0] === a2[0]; } return a1[0] === a2[0] && a1[1] === a2[1]; } function getAlignFromPlacement(builtinPlacements, placementStr, align) { var baseAlign = builtinPlacements[placementStr] || {}; return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, baseAlign), align); } function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) { var points = align.points; var placements = Object.keys(builtinPlacements); for (var i = 0; i < placements.length; i += 1) { var placement = placements[i]; if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) { return "".concat(prefixCls, "-placement-").concat(placement); } } return ''; } // CONCATENATED MODULE: ./node_modules/rc-util/es/isMobile.js /* harmony default export */ var es_isMobile = (function () { if (typeof navigator === 'undefined' || typeof window === 'undefined') { return false; } var agent = navigator.userAgent || navigator.vendor || window.opera; if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4))) { return true; } return false; }); // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js var canUseDom = __webpack_require__("MNnm"); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/util/motion.js // ================= Transition ================= // Event wrapper. Copy from react source code function makePrefixMap(styleProp, eventName) { var prefixes = {}; prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName); prefixes["Moz".concat(styleProp)] = "moz".concat(eventName); prefixes["ms".concat(styleProp)] = "MS".concat(eventName); prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase()); return prefixes; } function getVendorPrefixes(domSupport, win) { var prefixes = { animationend: makePrefixMap('Animation', 'AnimationEnd'), transitionend: makePrefixMap('Transition', 'TransitionEnd') }; if (domSupport) { if (!('AnimationEvent' in win)) { delete prefixes.animationend.animation; } if (!('TransitionEvent' in win)) { delete prefixes.transitionend.transition; } } return prefixes; } var vendorPrefixes = getVendorPrefixes(Object(canUseDom["a" /* default */])(), typeof window !== 'undefined' ? window : {}); var motion_style = {}; if (Object(canUseDom["a" /* default */])()) { var _document$createEleme = document.createElement('div'); motion_style = _document$createEleme.style; } var prefixedEventNames = {}; function getVendorPrefixedEventName(eventName) { if (prefixedEventNames[eventName]) { return prefixedEventNames[eventName]; } var prefixMap = vendorPrefixes[eventName]; if (prefixMap) { var stylePropList = Object.keys(prefixMap); var len = stylePropList.length; for (var i = 0; i < len; i += 1) { var styleProp = stylePropList[i]; if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in motion_style) { prefixedEventNames[eventName] = prefixMap[styleProp]; return prefixedEventNames[eventName]; } } } return ''; } var internalAnimationEndName = getVendorPrefixedEventName('animationend'); var internalTransitionEndName = getVendorPrefixedEventName('transitionend'); var supportTransition = !!(internalAnimationEndName && internalTransitionEndName); var animationEndName = internalAnimationEndName || 'animationend'; var transitionEndName = internalTransitionEndName || 'transitionend'; function getTransitionName(transitionName, transitionType) { if (!transitionName) return null; if (Object(esm_typeof["a" /* default */])(transitionName) === 'object') { var type = transitionType.replace(/-\w/g, function (match) { return match[1].toUpperCase(); }); return transitionName[type]; } return "".concat(transitionName, "-").concat(transitionType); } // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/interface.js var STATUS_NONE = 'none'; var STATUS_APPEAR = 'appear'; var STATUS_ENTER = 'enter'; var STATUS_LEAVE = 'leave'; var STEP_NONE = 'none'; var STEP_PREPARE = 'prepare'; var STEP_START = 'start'; var STEP_ACTIVE = 'active'; var STEP_ACTIVATED = 'end'; // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useState.js function useMountStatus(defaultValue) { var destroyRef = Object(external_window_React_["useRef"])(false); var _useState = Object(external_window_React_["useState"])(defaultValue), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), val = _useState2[0], setVal = _useState2[1]; function setValue(next) { if (!destroyRef.current) { setVal(next); } } Object(external_window_React_["useEffect"])(function () { return function () { destroyRef.current = true; }; }, []); return [val, setValue]; } // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js // It's safe to use `useLayoutEffect` but the warning is annoying var useIsomorphicLayoutEffect = Object(canUseDom["a" /* default */])() ? external_window_React_["useLayoutEffect"] : external_window_React_["useEffect"]; /* harmony default export */ var hooks_useIsomorphicLayoutEffect = (useIsomorphicLayoutEffect); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useNextFrame.js /* harmony default export */ var useNextFrame = (function () { var nextFrameRef = external_window_React_["useRef"](null); function cancelNextFrame() { es_raf["a" /* default */].cancel(nextFrameRef.current); } function nextFrame(callback) { var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; cancelNextFrame(); var nextFrameId = Object(es_raf["a" /* default */])(function () { if (delay <= 1) { callback({ isCanceled: function isCanceled() { return nextFrameId !== nextFrameRef.current; } }); } else { nextFrame(callback, delay - 1); } }); nextFrameRef.current = nextFrameId; } external_window_React_["useEffect"](function () { return function () { cancelNextFrame(); }; }, []); return [nextFrame, cancelNextFrame]; }); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useStepQueue.js var STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED]; /** Skip current step */ var SkipStep = false; /** Current step should be update in */ var DoStep = true; function useStepQueue_isActive(step) { return step === STEP_ACTIVE || step === STEP_ACTIVATED; } /* harmony default export */ var useStepQueue = (function (status, callback) { var _React$useState = external_window_React_["useState"](STEP_NONE), _React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2), step = _React$useState2[0], setStep = _React$useState2[1]; var _useNextFrame = useNextFrame(), _useNextFrame2 = Object(slicedToArray["a" /* default */])(_useNextFrame, 2), nextFrame = _useNextFrame2[0], cancelNextFrame = _useNextFrame2[1]; function startQueue() { setStep(STEP_PREPARE); } hooks_useIsomorphicLayoutEffect(function () { if (step !== STEP_NONE && step !== STEP_ACTIVATED) { var index = STEP_QUEUE.indexOf(step); var nextStep = STEP_QUEUE[index + 1]; var result = callback(step); if (result === SkipStep) { // Skip when no needed setStep(nextStep); } else { // Do as frame for step update nextFrame(function (info) { function doNext() { // Skip since current queue is ood if (info.isCanceled()) return; setStep(nextStep); } if (result === true) { doNext(); } else { // Only promise should be async Promise.resolve(result).then(doNext); } }); } } }, [status, step]); external_window_React_["useEffect"](function () { return function () { cancelNextFrame(); }; }, []); return [startQueue, step]; }); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useDomMotionEvents.js /* harmony default export */ var useDomMotionEvents = (function (callback) { var cacheElementRef = Object(external_window_React_["useRef"])(); // Cache callback var callbackRef = Object(external_window_React_["useRef"])(callback); callbackRef.current = callback; // Internal motion event handler var onInternalMotionEnd = external_window_React_["useCallback"](function (event) { callbackRef.current(event); }, []); // Remove events function removeMotionEvents(element) { if (element) { element.removeEventListener(transitionEndName, onInternalMotionEnd); element.removeEventListener(animationEndName, onInternalMotionEnd); } } // Patch events function patchMotionEvents(element) { if (cacheElementRef.current && cacheElementRef.current !== element) { removeMotionEvents(cacheElementRef.current); } if (element && element !== cacheElementRef.current) { element.addEventListener(transitionEndName, onInternalMotionEnd); element.addEventListener(animationEndName, onInternalMotionEnd); // Save as cache in case dom removed trigger by `motionDeadline` cacheElementRef.current = element; } } // Clean up when removed external_window_React_["useEffect"](function () { return function () { removeMotionEvents(cacheElementRef.current); }; }, []); return [patchMotionEvents, removeMotionEvents]; }); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/hooks/useStatus.js function useStatus(supportMotion, visible, getElement, _ref) { var _ref$motionEnter = _ref.motionEnter, motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter, _ref$motionAppear = _ref.motionAppear, motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear, _ref$motionLeave = _ref.motionLeave, motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave, motionDeadline = _ref.motionDeadline, motionLeaveImmediately = _ref.motionLeaveImmediately, onAppearPrepare = _ref.onAppearPrepare, onEnterPrepare = _ref.onEnterPrepare, onLeavePrepare = _ref.onLeavePrepare, onAppearStart = _ref.onAppearStart, onEnterStart = _ref.onEnterStart, onLeaveStart = _ref.onLeaveStart, onAppearActive = _ref.onAppearActive, onEnterActive = _ref.onEnterActive, onLeaveActive = _ref.onLeaveActive, onAppearEnd = _ref.onAppearEnd, onEnterEnd = _ref.onEnterEnd, onLeaveEnd = _ref.onLeaveEnd, onVisibleChanged = _ref.onVisibleChanged; // Used for outer render usage to avoid `visible: false & status: none` to render nothing var _useState = useMountStatus(), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), asyncVisible = _useState2[0], setAsyncVisible = _useState2[1]; var _useState3 = useMountStatus(STATUS_NONE), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), status = _useState4[0], setStatus = _useState4[1]; var _useState5 = useMountStatus(null), _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), style = _useState6[0], setStyle = _useState6[1]; var mountedRef = Object(external_window_React_["useRef"])(false); var deadlineRef = Object(external_window_React_["useRef"])(null); var destroyedRef = Object(external_window_React_["useRef"])(false); // =========================== Dom Node =========================== var cacheElementRef = Object(external_window_React_["useRef"])(null); function getDomElement() { var element = getElement(); return element || cacheElementRef.current; } // ========================== Motion End ========================== var activeRef = Object(external_window_React_["useRef"])(false); function onInternalMotionEnd(event) { var element = getDomElement(); if (event && !event.deadline && event.target !== element) { // event exists // not initiated by deadline // transitionEnd not fired by inner elements return; } var canEnd; if (status === STATUS_APPEAR && activeRef.current) { canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event); } else if (status === STATUS_ENTER && activeRef.current) { canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event); } else if (status === STATUS_LEAVE && activeRef.current) { canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event); } // Only update status when `canEnd` and not destroyed if (canEnd !== false && !destroyedRef.current) { setStatus(STATUS_NONE); setStyle(null); } } var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = Object(slicedToArray["a" /* default */])(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0]; // ============================= Step ============================= var eventHandlers = external_window_React_["useMemo"](function () { var _ref2, _ref3, _ref4; switch (status) { case 'appear': return _ref2 = {}, Object(defineProperty["a" /* default */])(_ref2, STEP_PREPARE, onAppearPrepare), Object(defineProperty["a" /* default */])(_ref2, STEP_START, onAppearStart), Object(defineProperty["a" /* default */])(_ref2, STEP_ACTIVE, onAppearActive), _ref2; case 'enter': return _ref3 = {}, Object(defineProperty["a" /* default */])(_ref3, STEP_PREPARE, onEnterPrepare), Object(defineProperty["a" /* default */])(_ref3, STEP_START, onEnterStart), Object(defineProperty["a" /* default */])(_ref3, STEP_ACTIVE, onEnterActive), _ref3; case 'leave': return _ref4 = {}, Object(defineProperty["a" /* default */])(_ref4, STEP_PREPARE, onLeavePrepare), Object(defineProperty["a" /* default */])(_ref4, STEP_START, onLeaveStart), Object(defineProperty["a" /* default */])(_ref4, STEP_ACTIVE, onLeaveActive), _ref4; default: return {}; } }, [status]); var _useStepQueue = useStepQueue(status, function (newStep) { // Only prepare step can be skip if (newStep === STEP_PREPARE) { var onPrepare = eventHandlers[STEP_PREPARE]; if (!onPrepare) { return SkipStep; } return onPrepare(getDomElement()); } // Rest step is sync update // Rest step is sync update if (step in eventHandlers) { var _eventHandlers$step; setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null); } if (step === STEP_ACTIVE) { // Patch events when motion needed patchMotionEvents(getDomElement()); if (motionDeadline > 0) { clearTimeout(deadlineRef.current); deadlineRef.current = setTimeout(function () { onInternalMotionEnd({ deadline: true }); }, motionDeadline); } } return DoStep; }), _useStepQueue2 = Object(slicedToArray["a" /* default */])(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1]; var active = useStepQueue_isActive(step); activeRef.current = active; // ============================ Status ============================ // Update with new status hooks_useIsomorphicLayoutEffect(function () { setAsyncVisible(visible); var isMounted = mountedRef.current; mountedRef.current = true; if (!supportMotion) { return; } var nextStatus; // Appear if (!isMounted && visible && motionAppear) { nextStatus = STATUS_APPEAR; } // Enter if (isMounted && visible && motionEnter) { nextStatus = STATUS_ENTER; } // Leave if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) { nextStatus = STATUS_LEAVE; } // Update to next status if (nextStatus) { setStatus(nextStatus); startStep(); } }, [visible]); // ============================ Effect ============================ // Reset when motion changed Object(external_window_React_["useEffect"])(function () { if ( // Cancel appear status === STATUS_APPEAR && !motionAppear || // Cancel enter status === STATUS_ENTER && !motionEnter || // Cancel leave status === STATUS_LEAVE && !motionLeave) { setStatus(STATUS_NONE); } }, [motionAppear, motionEnter, motionLeave]); Object(external_window_React_["useEffect"])(function () { return function () { clearTimeout(deadlineRef.current); destroyedRef.current = true; }; }, []); // Trigger `onVisibleChanged` Object(external_window_React_["useEffect"])(function () { if (asyncVisible !== undefined && status === STATUS_NONE) { onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible); } }, [asyncVisible, status]); // ============================ Styles ============================ var mergedStyle = style; if (eventHandlers[STEP_PREPARE] && step === STEP_START) { mergedStyle = Object(objectSpread2["a" /* default */])({ transition: 'none' }, mergedStyle); } return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible]; } // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/DomWrapper.js var DomWrapper_DomWrapper = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(DomWrapper, _React$Component); var _super = Object(createSuper["a" /* default */])(DomWrapper); function DomWrapper() { Object(classCallCheck["a" /* default */])(this, DomWrapper); return _super.apply(this, arguments); } Object(createClass["a" /* default */])(DomWrapper, [{ key: "render", value: function render() { return this.props.children; } }]); return DomWrapper; }(external_window_React_["Component"]); /* harmony default export */ var es_DomWrapper = (DomWrapper_DomWrapper); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/CSSMotion.js /* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */ /** * `transitionSupport` is used for none transition test case. * Default we use browser transition event support check. */ function genCSSMotion(config) { var transitionSupport = config; if (Object(esm_typeof["a" /* default */])(config) === 'object') { transitionSupport = config.transitionSupport; } function isSupportTransition(props) { return !!(props.motionName && transitionSupport); } var CSSMotion = /*#__PURE__*/external_window_React_["forwardRef"](function (props, ref) { var _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, _props$removeOnLeave = props.removeOnLeave, removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave, forceRender = props.forceRender, children = props.children, motionName = props.motionName, leavedClassName = props.leavedClassName, eventProps = props.eventProps; var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement var nodeRef = Object(external_window_React_["useRef"])(); // Ref to the dom wrapper in case ref can not pass to HTMLElement var wrapperNodeRef = Object(external_window_React_["useRef"])(); function getDomElement() { try { return Object(findDOMNode["a" /* default */])(nodeRef.current || wrapperNodeRef.current); } catch (e) { // Only happen when `motionDeadline` trigger but element removed. return null; } } var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = Object(slicedToArray["a" /* default */])(_useStatus, 4), status = _useStatus2[0], statusStep = _useStatus2[1], statusStyle = _useStatus2[2], mergedVisible = _useStatus2[3]; // Record whether content has rended // Will return null for un-rendered even when `removeOnLeave={false}` var renderedRef = external_window_React_["useRef"](mergedVisible); if (mergedVisible) { renderedRef.current = true; } // ====================== Refs ====================== var originRef = Object(external_window_React_["useRef"])(ref); originRef.current = ref; var setNodeRef = external_window_React_["useCallback"](function (node) { nodeRef.current = node; Object(es_ref["b" /* fillRef */])(originRef.current, node); }, []); // ===================== Render ===================== var motionChildren; var mergedProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, eventProps), {}, { visible: visible }); if (!children) { // No children motionChildren = null; } else if (status === STATUS_NONE || !isSupportTransition(props)) { // Stable children if (mergedVisible) { motionChildren = children(Object(objectSpread2["a" /* default */])({}, mergedProps), setNodeRef); } else if (!removeOnLeave && renderedRef.current) { motionChildren = children(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedProps), {}, { className: leavedClassName }), setNodeRef); } else if (forceRender) { motionChildren = children(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedProps), {}, { style: { display: 'none' } }), setNodeRef); } else { motionChildren = null; } } else { var _classNames; // In motion var statusSuffix; if (statusStep === STEP_PREPARE) { statusSuffix = 'prepare'; } else if (useStepQueue_isActive(statusStep)) { statusSuffix = 'active'; } else if (statusStep === STEP_START) { statusSuffix = 'start'; } motionChildren = children(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedProps), {}, { className: classnames_default()(getTransitionName(motionName, status), (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix)), statusSuffix), Object(defineProperty["a" /* default */])(_classNames, motionName, typeof motionName === 'string'), _classNames)), style: statusStyle }), setNodeRef); } return /*#__PURE__*/external_window_React_["createElement"](es_DomWrapper, { ref: wrapperNodeRef }, motionChildren); }); CSSMotion.displayName = 'CSSMotion'; return CSSMotion; } /* harmony default export */ var es_CSSMotion = (genCSSMotion(supportTransition)); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/util/diff.js var STATUS_ADD = 'add'; var STATUS_KEEP = 'keep'; var STATUS_REMOVE = 'remove'; var STATUS_REMOVED = 'removed'; function wrapKeyToObject(key) { var keyObj; if (key && Object(esm_typeof["a" /* default */])(key) === 'object' && 'key' in key) { keyObj = key; } else { keyObj = { key: key }; } return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, keyObj), {}, { key: String(keyObj.key) }); } function parseKeys() { var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; return keys.map(wrapKeyToObject); } function diffKeys() { var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var list = []; var currentIndex = 0; var currentLen = currentKeys.length; var prevKeyObjects = parseKeys(prevKeys); var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep prevKeyObjects.forEach(function (keyObj) { var hit = false; for (var i = currentIndex; i < currentLen; i += 1) { var currentKeyObj = currentKeyObjects[i]; if (currentKeyObj.key === keyObj.key) { // New added keys should add before current key if (currentIndex < i) { list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) { return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, obj), {}, { status: STATUS_ADD }); })); currentIndex = i; } list.push(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, currentKeyObj), {}, { status: STATUS_KEEP })); currentIndex += 1; hit = true; break; } } // If not hit, it means key is removed if (!hit) { list.push(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, keyObj), {}, { status: STATUS_REMOVE })); } }); // Add rest to the list if (currentIndex < currentLen) { list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) { return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, obj), {}, { status: STATUS_ADD }); })); } /** * Merge same key when it remove and add again: * [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep] */ var keys = {}; list.forEach(function (_ref) { var key = _ref.key; keys[key] = (keys[key] || 0) + 1; }); var duplicatedKeys = Object.keys(keys).filter(function (key) { return keys[key] > 1; }); duplicatedKeys.forEach(function (matchKey) { // Remove `STATUS_REMOVE` node. list = list.filter(function (_ref2) { var key = _ref2.key, status = _ref2.status; return key !== matchKey || status !== STATUS_REMOVE; }); // Update `STATUS_ADD` to `STATUS_KEEP` list.forEach(function (node) { if (node.key === matchKey) { // eslint-disable-next-line no-param-reassign node.status = STATUS_KEEP; } }); }); return list; } // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/CSSMotionList.js /* eslint react/prop-types: 0 */ var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd']; /** * Generate a CSSMotionList component with config * @param transitionSupport No need since CSSMotionList no longer depends on transition support * @param CSSMotion CSSMotion component */ function genCSSMotionList(transitionSupport) { var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : es_CSSMotion; var CSSMotionList = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(CSSMotionList, _React$Component); var _super = Object(createSuper["a" /* default */])(CSSMotionList); function CSSMotionList() { var _this; Object(classCallCheck["a" /* default */])(this, CSSMotionList); _this = _super.apply(this, arguments); _this.state = { keyEntities: [] }; _this.removeKey = function (removeKey) { _this.setState(function (_ref) { var keyEntities = _ref.keyEntities; return { keyEntities: keyEntities.map(function (entity) { if (entity.key !== removeKey) return entity; return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, entity), {}, { status: STATUS_REMOVED }); }) }; }); }; return _this; } Object(createClass["a" /* default */])(CSSMotionList, [{ key: "render", value: function render() { var _this2 = this; var keyEntities = this.state.keyEntities; var _this$props = this.props, component = _this$props.component, children = _this$props.children, _onVisibleChanged = _this$props.onVisibleChanged, restProps = Object(objectWithoutProperties["a" /* default */])(_this$props, ["component", "children", "onVisibleChanged"]); var Component = component || external_window_React_["Fragment"]; var motionProps = {}; MOTION_PROP_NAMES.forEach(function (prop) { motionProps[prop] = restProps[prop]; delete restProps[prop]; }); delete restProps.keys; return /*#__PURE__*/external_window_React_["createElement"](Component, restProps, keyEntities.map(function (_ref2) { var status = _ref2.status, eventProps = Object(objectWithoutProperties["a" /* default */])(_ref2, ["status"]); var visible = status === STATUS_ADD || status === STATUS_KEEP; return /*#__PURE__*/external_window_React_["createElement"](CSSMotion, Object(esm_extends["a" /* default */])({}, motionProps, { key: eventProps.key, visible: visible, eventProps: eventProps, onVisibleChanged: function onVisibleChanged(changedVisible) { _onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, { key: eventProps.key }); if (!changedVisible) { _this2.removeKey(eventProps.key); } } }), children); })); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(_ref3, _ref4) { var keys = _ref3.keys; var keyEntities = _ref4.keyEntities; var parsedKeyObjects = parseKeys(keys); var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects); return { keyEntities: mixedKeyEntities.filter(function (entity) { var prevEntity = keyEntities.find(function (_ref5) { var key = _ref5.key; return entity.key === key; }); // Remove if already mark as removed if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) { return false; } return true; }) }; } }]); return CSSMotionList; }(external_window_React_["Component"]); CSSMotionList.defaultProps = { component: 'div' }; return CSSMotionList; } /* harmony default export */ var es_CSSMotionList = (genCSSMotionList(supportTransition)); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-motion/es/index.js /* harmony default export */ var rc_motion_es = (es_CSSMotion); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/utils/legacyUtil.js function getMotion(_ref) { var prefixCls = _ref.prefixCls, motion = _ref.motion, animation = _ref.animation, transitionName = _ref.transitionName; if (motion) { return motion; } if (animation) { return { motionName: "".concat(prefixCls, "-").concat(animation) }; } if (transitionName) { return { motionName: transitionName }; } return null; } // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/Mask.js function Mask(props) { var prefixCls = props.prefixCls, visible = props.visible, zIndex = props.zIndex, mask = props.mask, maskMotion = props.maskMotion, maskAnimation = props.maskAnimation, maskTransitionName = props.maskTransitionName; if (!mask) { return null; } var motion = {}; if (maskMotion || maskTransitionName || maskAnimation) { motion = Object(objectSpread2["a" /* default */])({ motionAppear: true }, getMotion({ motion: maskMotion, prefixCls: prefixCls, transitionName: maskTransitionName, animation: maskAnimation })); } return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({}, motion, { visible: visible, removeOnLeave: true }), function (_ref) { var className = _ref.className; return /*#__PURE__*/external_window_React_["createElement"]("div", { style: { zIndex: zIndex }, className: classnames_default()("".concat(prefixCls, "-mask"), className) }); }); } // EXTERNAL MODULE: ./node_modules/rc-align/es/index.js + 5 modules var rc_align_es = __webpack_require__("9mu1"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js var regenerator = __webpack_require__("o0o1"); var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js var asyncToGenerator = __webpack_require__("HaE+"); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/useVisibleStatus.js var StatusQueue = ['measure', 'align', null, 'motion']; /* harmony default export */ var useVisibleStatus = (function (visible, doMeasure) { var _useState = Object(external_window_React_["useState"])(null), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), status = _useState2[0], setInternalStatus = _useState2[1]; var rafRef = Object(external_window_React_["useRef"])(); var destroyRef = Object(external_window_React_["useRef"])(false); function setStatus(nextStatus) { if (!destroyRef.current) { setInternalStatus(nextStatus); } } function cancelRaf() { es_raf["a" /* default */].cancel(rafRef.current); } function goNextStatus(callback) { cancelRaf(); rafRef.current = Object(es_raf["a" /* default */])(function () { // Only align should be manually trigger setStatus(function (prev) { switch (status) { case 'align': return 'motion'; case 'motion': return 'stable'; default: } return prev; }); callback === null || callback === void 0 ? void 0 : callback(); }); } // Init status Object(external_window_React_["useEffect"])(function () { setStatus('measure'); }, [visible]); // Go next status Object(external_window_React_["useEffect"])(function () { switch (status) { case 'measure': doMeasure(); break; default: } if (status) { rafRef.current = Object(es_raf["a" /* default */])( /*#__PURE__*/Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee() { var index, nextStatus; return regenerator_default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: index = StatusQueue.indexOf(status); nextStatus = StatusQueue[index + 1]; if (nextStatus && index !== -1) { setStatus(nextStatus); } case 3: case "end": return _context.stop(); } } }, _callee); }))); } }, [status]); Object(external_window_React_["useEffect"])(function () { return function () { destroyRef.current = true; cancelRaf(); }; }, []); return [status, goNextStatus]; }); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/useStretchStyle.js /* harmony default export */ var useStretchStyle = (function (stretch) { var _React$useState = external_window_React_["useState"]({ width: 0, height: 0 }), _React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2), targetSize = _React$useState2[0], setTargetSize = _React$useState2[1]; function measureStretch(element) { setTargetSize({ width: element.offsetWidth, height: element.offsetHeight }); } // Merge stretch style var style = external_window_React_["useMemo"](function () { var sizeStyle = {}; if (stretch) { var width = targetSize.width, height = targetSize.height; // Stretch with target if (stretch.indexOf('height') !== -1 && height) { sizeStyle.height = height; } else if (stretch.indexOf('minHeight') !== -1 && height) { sizeStyle.minHeight = height; } if (stretch.indexOf('width') !== -1 && width) { sizeStyle.width = width; } else if (stretch.indexOf('minWidth') !== -1 && width) { sizeStyle.minWidth = width; } } return sizeStyle; }, [stretch, targetSize]); return [style, measureStretch]; }); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/PopupInner.js var PopupInner = /*#__PURE__*/external_window_React_["forwardRef"](function (props, ref) { var visible = props.visible, prefixCls = props.prefixCls, className = props.className, style = props.style, children = props.children, zIndex = props.zIndex, stretch = props.stretch, destroyPopupOnHide = props.destroyPopupOnHide, forceRender = props.forceRender, align = props.align, point = props.point, getRootDomNode = props.getRootDomNode, getClassNameFromAlign = props.getClassNameFromAlign, onAlign = props.onAlign, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onMouseDown = props.onMouseDown, onTouchStart = props.onTouchStart; var alignRef = Object(external_window_React_["useRef"])(); var elementRef = Object(external_window_React_["useRef"])(); var _useState = Object(external_window_React_["useState"])(), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), alignedClassName = _useState2[0], setAlignedClassName = _useState2[1]; // ======================= Measure ======================== var _useStretchStyle = useStretchStyle(stretch), _useStretchStyle2 = Object(slicedToArray["a" /* default */])(_useStretchStyle, 2), stretchStyle = _useStretchStyle2[0], measureStretchStyle = _useStretchStyle2[1]; function doMeasure() { if (stretch) { measureStretchStyle(getRootDomNode()); } } // ======================== Status ======================== var _useVisibleStatus = useVisibleStatus(visible, doMeasure), _useVisibleStatus2 = Object(slicedToArray["a" /* default */])(_useVisibleStatus, 2), status = _useVisibleStatus2[0], goNextStatus = _useVisibleStatus2[1]; // ======================== Aligns ======================== var prepareResolveRef = Object(external_window_React_["useRef"])(); // `target` on `rc-align` can accept as a function to get the bind element or a point. // ref: https://www.npmjs.com/package/rc-align function getAlignTarget() { if (point) { return point; } return getRootDomNode; } function forceAlign() { var _alignRef$current; (_alignRef$current = alignRef.current) === null || _alignRef$current === void 0 ? void 0 : _alignRef$current.forceAlign(); } function onInternalAlign(popupDomNode, matchAlign) { var nextAlignedClassName = getClassNameFromAlign(matchAlign); if (alignedClassName !== nextAlignedClassName) { setAlignedClassName(nextAlignedClassName); } if (status === 'align') { // Repeat until not more align needed if (alignedClassName !== nextAlignedClassName) { Promise.resolve().then(function () { forceAlign(); }); } else { goNextStatus(function () { var _prepareResolveRef$cu; (_prepareResolveRef$cu = prepareResolveRef.current) === null || _prepareResolveRef$cu === void 0 ? void 0 : _prepareResolveRef$cu.call(prepareResolveRef); }); } onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign); } } // ======================== Motion ======================== var motion = Object(objectSpread2["a" /* default */])({}, getMotion(props)); ['onAppearEnd', 'onEnterEnd', 'onLeaveEnd'].forEach(function (eventName) { var originHandler = motion[eventName]; motion[eventName] = function (element, event) { goNextStatus(); return originHandler === null || originHandler === void 0 ? void 0 : originHandler(element, event); }; }); function onShowPrepare() { return new Promise(function (resolve) { prepareResolveRef.current = resolve; }); } // Go to stable directly when motion not provided external_window_React_["useEffect"](function () { if (!motion.motionName && status === 'motion') { goNextStatus(); } }, [motion.motionName, status]); // ========================= Refs ========================= external_window_React_["useImperativeHandle"](ref, function () { return { forceAlign: forceAlign, getElement: function getElement() { return elementRef.current; } }; }); // ======================== Render ======================== var mergedStyle = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, stretchStyle), {}, { zIndex: zIndex, opacity: status === 'motion' || status === 'stable' || !visible ? undefined : 0, pointerEvents: status === 'stable' ? undefined : 'none' }, style); // Align status var alignDisabled = true; if ((align === null || align === void 0 ? void 0 : align.points) && (status === 'align' || status === 'stable')) { alignDisabled = false; } var childNode = children; // Wrapper when multiple children if (external_window_React_["Children"].count(children) > 1) { childNode = /*#__PURE__*/external_window_React_["createElement"]("div", { className: "".concat(prefixCls, "-content") }, children); } return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({ visible: visible, ref: elementRef, leavedClassName: "".concat(prefixCls, "-hidden") }, motion, { onAppearPrepare: onShowPrepare, onEnterPrepare: onShowPrepare, removeOnLeave: destroyPopupOnHide, forceRender: forceRender }), function (_ref, motionRef) { var motionClassName = _ref.className, motionStyle = _ref.style; var mergedClassName = classnames_default()(prefixCls, className, alignedClassName, motionClassName); return /*#__PURE__*/external_window_React_["createElement"](rc_align_es["a" /* default */], { target: getAlignTarget(), key: "popup", ref: alignRef, monitorWindowResize: true, disabled: alignDisabled, align: align, onAlign: onInternalAlign }, /*#__PURE__*/external_window_React_["createElement"]("div", { ref: motionRef, className: mergedClassName, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseDownCapture: onMouseDown, onTouchStartCapture: onTouchStart, style: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, motionStyle), mergedStyle) }, childNode)); }); }); PopupInner.displayName = 'PopupInner'; /* harmony default export */ var Popup_PopupInner = (PopupInner); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/MobilePopupInner.js var MobilePopupInner = /*#__PURE__*/external_window_React_["forwardRef"](function (props, ref) { var prefixCls = props.prefixCls, visible = props.visible, zIndex = props.zIndex, children = props.children, _props$mobile = props.mobile; _props$mobile = _props$mobile === void 0 ? {} : _props$mobile; var popupClassName = _props$mobile.popupClassName, popupStyle = _props$mobile.popupStyle, _props$mobile$popupMo = _props$mobile.popupMotion, popupMotion = _props$mobile$popupMo === void 0 ? {} : _props$mobile$popupMo, popupRender = _props$mobile.popupRender; var elementRef = external_window_React_["useRef"](); // ========================= Refs ========================= external_window_React_["useImperativeHandle"](ref, function () { return { forceAlign: function forceAlign() {}, getElement: function getElement() { return elementRef.current; } }; }); // ======================== Render ======================== var mergedStyle = Object(objectSpread2["a" /* default */])({ zIndex: zIndex }, popupStyle); var childNode = children; // Wrapper when multiple children if (external_window_React_["Children"].count(children) > 1) { childNode = /*#__PURE__*/external_window_React_["createElement"]("div", { className: "".concat(prefixCls, "-content") }, children); } // Mobile support additional render if (popupRender) { childNode = popupRender(childNode); } return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({ visible: visible, ref: elementRef, removeOnLeave: true }, popupMotion), function (_ref, motionRef) { var motionClassName = _ref.className, motionStyle = _ref.style; var mergedClassName = classnames_default()(prefixCls, popupClassName, motionClassName); return /*#__PURE__*/external_window_React_["createElement"]("div", { ref: motionRef, className: mergedClassName, style: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, motionStyle), mergedStyle) }, childNode); }); }); MobilePopupInner.displayName = 'MobilePopupInner'; /* harmony default export */ var Popup_MobilePopupInner = (MobilePopupInner); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/Popup/index.js var _excluded = ["visible", "mobile"]; var Popup = /*#__PURE__*/external_window_React_["forwardRef"](function (_ref, ref) { var visible = _ref.visible, mobile = _ref.mobile, props = Object(objectWithoutProperties["a" /* default */])(_ref, _excluded); var _useState = Object(external_window_React_["useState"])(visible), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), innerVisible = _useState2[0], serInnerVisible = _useState2[1]; var _useState3 = Object(external_window_React_["useState"])(false), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), inMobile = _useState4[0], setInMobile = _useState4[1]; var cloneProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props), {}, { visible: innerVisible }); // We check mobile in visible changed here. // And this also delay set `innerVisible` to avoid popup component render flash Object(external_window_React_["useEffect"])(function () { serInnerVisible(visible); if (visible && mobile) { setInMobile(es_isMobile()); } }, [visible, mobile]); var popupNode = inMobile ? /*#__PURE__*/external_window_React_["createElement"](Popup_MobilePopupInner, Object(esm_extends["a" /* default */])({}, cloneProps, { mobile: mobile, ref: ref })) : /*#__PURE__*/external_window_React_["createElement"](Popup_PopupInner, Object(esm_extends["a" /* default */])({}, cloneProps, { ref: ref })); // We can use fragment directly but this may failed some selector usage. Keep as origin logic return /*#__PURE__*/external_window_React_["createElement"]("div", null, /*#__PURE__*/external_window_React_["createElement"](Mask, cloneProps), popupNode); }); Popup.displayName = 'Popup'; /* harmony default export */ var es_Popup = (Popup); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/context.js var TriggerContext = /*#__PURE__*/external_window_React_["createContext"](null); /* harmony default export */ var context = (TriggerContext); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-trigger/es/index.js function es_noop() {} function returnEmptyString() { return ''; } function returnDocument(element) { if (element) { return element.ownerDocument; } return window.document; } var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu']; /** * Internal usage. Do not use in your code since this will be removed. */ function generateTrigger(PortalComponent) { var Trigger = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(Trigger, _React$Component); var _super = Object(createSuper["a" /* default */])(Trigger); function Trigger(props) { var _this; Object(classCallCheck["a" /* default */])(this, Trigger); _this = _super.call(this, props); _this.popupRef = /*#__PURE__*/external_window_React_["createRef"](); _this.triggerRef = /*#__PURE__*/external_window_React_["createRef"](); _this.attachId = void 0; _this.clickOutsideHandler = void 0; _this.touchOutsideHandler = void 0; _this.contextMenuOutsideHandler1 = void 0; _this.contextMenuOutsideHandler2 = void 0; _this.mouseDownTimeout = void 0; _this.focusTime = void 0; _this.preClickTime = void 0; _this.preTouchTime = void 0; _this.delayTimer = void 0; _this.hasPopupMouseDown = void 0; _this.onMouseEnter = function (e) { var mouseEnterDelay = _this.props.mouseEnterDelay; _this.fireEvents('onMouseEnter', e); _this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e); }; _this.onMouseMove = function (e) { _this.fireEvents('onMouseMove', e); _this.setPoint(e); }; _this.onMouseLeave = function (e) { _this.fireEvents('onMouseLeave', e); _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay); }; _this.onPopupMouseEnter = function () { _this.clearDelayTimer(); }; _this.onPopupMouseLeave = function (e) { var _this$popupRef$curren; // https://github.com/react-component/trigger/pull/13 // react bug? if (e.relatedTarget && !e.relatedTarget.setTimeout && Object(contains["a" /* default */])((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e.relatedTarget)) { return; } _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay); }; _this.onFocus = function (e) { _this.fireEvents('onFocus', e); // incase focusin and focusout _this.clearDelayTimer(); if (_this.isFocusToShow()) { _this.focusTime = Date.now(); _this.delaySetPopupVisible(true, _this.props.focusDelay); } }; _this.onMouseDown = function (e) { _this.fireEvents('onMouseDown', e); _this.preClickTime = Date.now(); }; _this.onTouchStart = function (e) { _this.fireEvents('onTouchStart', e); _this.preTouchTime = Date.now(); }; _this.onBlur = function (e) { _this.fireEvents('onBlur', e); _this.clearDelayTimer(); if (_this.isBlurToHide()) { _this.delaySetPopupVisible(false, _this.props.blurDelay); } }; _this.onContextMenu = function (e) { e.preventDefault(); _this.fireEvents('onContextMenu', e); _this.setPopupVisible(true, e); }; _this.onContextMenuClose = function () { if (_this.isContextMenuToShow()) { _this.close(); } }; _this.onClick = function (event) { _this.fireEvents('onClick', event); // focus will trigger click if (_this.focusTime) { var preTime; if (_this.preClickTime && _this.preTouchTime) { preTime = Math.min(_this.preClickTime, _this.preTouchTime); } else if (_this.preClickTime) { preTime = _this.preClickTime; } else if (_this.preTouchTime) { preTime = _this.preTouchTime; } if (Math.abs(preTime - _this.focusTime) < 20) { return; } _this.focusTime = 0; } _this.preClickTime = 0; _this.preTouchTime = 0; // Only prevent default when all the action is click. // https://github.com/ant-design/ant-design/issues/17043 // https://github.com/ant-design/ant-design/issues/17291 if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) { event.preventDefault(); } var nextVisible = !_this.state.popupVisible; if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) { _this.setPopupVisible(!_this.state.popupVisible, event); } }; _this.onPopupMouseDown = function () { _this.hasPopupMouseDown = true; clearTimeout(_this.mouseDownTimeout); _this.mouseDownTimeout = window.setTimeout(function () { _this.hasPopupMouseDown = false; }, 0); if (_this.context) { var _this$context; (_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments); } }; _this.onDocumentClick = function (event) { if (_this.props.mask && !_this.props.maskClosable) { return; } var target = event.target; var root = _this.getRootDomNode(); var popupNode = _this.getPopupDomNode(); if ( // mousedown on the target should also close popup when action is contextMenu. // https://github.com/ant-design/ant-design/issues/29853 (!Object(contains["a" /* default */])(root, target) || _this.isContextMenuOnly()) && !Object(contains["a" /* default */])(popupNode, target) && !_this.hasPopupMouseDown) { _this.close(); } }; _this.getRootDomNode = function () { var getTriggerDOMNode = _this.props.getTriggerDOMNode; if (getTriggerDOMNode) { return getTriggerDOMNode(_this.triggerRef.current); } try { var domNode = Object(findDOMNode["a" /* default */])(_this.triggerRef.current); if (domNode) { return domNode; } } catch (err) {// Do nothing } return external_window_ReactDOM_default.a.findDOMNode(Object(assertThisInitialized["a" /* default */])(_this)); }; _this.getPopupClassNameFromAlign = function (align) { var className = []; var _this$props = _this.props, popupPlacement = _this$props.popupPlacement, builtinPlacements = _this$props.builtinPlacements, prefixCls = _this$props.prefixCls, alignPoint = _this$props.alignPoint, getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign; if (popupPlacement && builtinPlacements) { className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint)); } if (getPopupClassNameFromAlign) { className.push(getPopupClassNameFromAlign(align)); } return className.join(' '); }; _this.getComponent = function () { var _this$props2 = _this.props, prefixCls = _this$props2.prefixCls, destroyPopupOnHide = _this$props2.destroyPopupOnHide, popupClassName = _this$props2.popupClassName, onPopupAlign = _this$props2.onPopupAlign, popupMotion = _this$props2.popupMotion, popupAnimation = _this$props2.popupAnimation, popupTransitionName = _this$props2.popupTransitionName, popupStyle = _this$props2.popupStyle, mask = _this$props2.mask, maskAnimation = _this$props2.maskAnimation, maskTransitionName = _this$props2.maskTransitionName, maskMotion = _this$props2.maskMotion, zIndex = _this$props2.zIndex, popup = _this$props2.popup, stretch = _this$props2.stretch, alignPoint = _this$props2.alignPoint, mobile = _this$props2.mobile, forceRender = _this$props2.forceRender; var _this$state = _this.state, popupVisible = _this$state.popupVisible, point = _this$state.point; var align = _this.getPopupAlign(); var mouseProps = {}; if (_this.isMouseEnterToShow()) { mouseProps.onMouseEnter = _this.onPopupMouseEnter; } if (_this.isMouseLeaveToHide()) { mouseProps.onMouseLeave = _this.onPopupMouseLeave; } mouseProps.onMouseDown = _this.onPopupMouseDown; mouseProps.onTouchStart = _this.onPopupMouseDown; return /*#__PURE__*/external_window_React_["createElement"](es_Popup, Object(esm_extends["a" /* default */])({ prefixCls: prefixCls, destroyPopupOnHide: destroyPopupOnHide, visible: popupVisible, point: alignPoint && point, className: popupClassName, align: align, onAlign: onPopupAlign, animation: popupAnimation, getClassNameFromAlign: _this.getPopupClassNameFromAlign }, mouseProps, { stretch: stretch, getRootDomNode: _this.getRootDomNode, style: popupStyle, mask: mask, zIndex: zIndex, transitionName: popupTransitionName, maskAnimation: maskAnimation, maskTransitionName: maskTransitionName, maskMotion: maskMotion, ref: _this.popupRef, motion: popupMotion, mobile: mobile, forceRender: forceRender }), typeof popup === 'function' ? popup() : popup); }; _this.attachParent = function (popupContainer) { es_raf["a" /* default */].cancel(_this.attachId); var _this$props3 = _this.props, getPopupContainer = _this$props3.getPopupContainer, getDocument = _this$props3.getDocument; var domNode = _this.getRootDomNode(); var mountNode; if (!getPopupContainer) { mountNode = getDocument(_this.getRootDomNode()).body; } else if (domNode || getPopupContainer.length === 0) { // Compatible for legacy getPopupContainer with domNode argument. // If no need `domNode` argument, will call directly. // https://codesandbox.io/s/eloquent-mclean-ss93m?file=/src/App.js mountNode = getPopupContainer(domNode); } if (mountNode) { mountNode.appendChild(popupContainer); } else { // Retry after frame render in case parent not ready _this.attachId = Object(es_raf["a" /* default */])(function () { _this.attachParent(popupContainer); }); } }; _this.getContainer = function () { var getDocument = _this.props.getDocument; var popupContainer = getDocument(_this.getRootDomNode()).createElement('div'); // Make sure default popup container will never cause scrollbar appearing // https://github.com/react-component/trigger/issues/41 popupContainer.style.position = 'absolute'; popupContainer.style.top = '0'; popupContainer.style.left = '0'; popupContainer.style.width = '100%'; _this.attachParent(popupContainer); return popupContainer; }; _this.setPoint = function (point) { var alignPoint = _this.props.alignPoint; if (!alignPoint || !point) return; _this.setState({ point: { pageX: point.pageX, pageY: point.pageY } }); }; _this.handlePortalUpdate = function () { if (_this.state.prevPopupVisible !== _this.state.popupVisible) { _this.props.afterPopupVisibleChange(_this.state.popupVisible); } }; _this.triggerContextValue = { onPopupMouseDown: _this.onPopupMouseDown }; var _popupVisible; if ('popupVisible' in props) { _popupVisible = !!props.popupVisible; } else { _popupVisible = !!props.defaultPopupVisible; } _this.state = { prevPopupVisible: _popupVisible, popupVisible: _popupVisible }; ALL_HANDLERS.forEach(function (h) { _this["fire".concat(h)] = function (e) { _this.fireEvents(h, e); }; }); return _this; } Object(createClass["a" /* default */])(Trigger, [{ key: "componentDidMount", value: function componentDidMount() { this.componentDidUpdate(); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var props = this.props; var state = this.state; // We must listen to `mousedown` or `touchstart`, edge case: // https://github.com/ant-design/ant-design/issues/5804 // https://github.com/react-component/calendar/issues/250 // https://github.com/react-component/trigger/issues/50 if (state.popupVisible) { var currentDocument; if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) { currentDocument = props.getDocument(this.getRootDomNode()); this.clickOutsideHandler = Object(addEventListener["a" /* default */])(currentDocument, 'mousedown', this.onDocumentClick); } // always hide on mobile if (!this.touchOutsideHandler) { currentDocument = currentDocument || props.getDocument(this.getRootDomNode()); this.touchOutsideHandler = Object(addEventListener["a" /* default */])(currentDocument, 'touchstart', this.onDocumentClick); } // close popup when trigger type contains 'onContextMenu' and document is scrolling. if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) { currentDocument = currentDocument || props.getDocument(this.getRootDomNode()); this.contextMenuOutsideHandler1 = Object(addEventListener["a" /* default */])(currentDocument, 'scroll', this.onContextMenuClose); } // close popup when trigger type contains 'onContextMenu' and window is blur. if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) { this.contextMenuOutsideHandler2 = Object(addEventListener["a" /* default */])(window, 'blur', this.onContextMenuClose); } return; } this.clearOutsideHandler(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.clearDelayTimer(); this.clearOutsideHandler(); clearTimeout(this.mouseDownTimeout); es_raf["a" /* default */].cancel(this.attachId); } }, { key: "getPopupDomNode", value: function getPopupDomNode() { var _this$popupRef$curren2; // for test return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null; } }, { key: "getPopupAlign", value: function getPopupAlign() { var props = this.props; var popupPlacement = props.popupPlacement, popupAlign = props.popupAlign, builtinPlacements = props.builtinPlacements; if (popupPlacement && builtinPlacements) { return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign); } return popupAlign; } }, { key: "setPopupVisible", value: /** * @param popupVisible Show or not the popup element * @param event SyntheticEvent, used for `pointAlign` */ function setPopupVisible(popupVisible, event) { var alignPoint = this.props.alignPoint; var prevPopupVisible = this.state.popupVisible; this.clearDelayTimer(); if (prevPopupVisible !== popupVisible) { if (!('popupVisible' in this.props)) { this.setState({ popupVisible: popupVisible, prevPopupVisible: prevPopupVisible }); } this.props.onPopupVisibleChange(popupVisible); } // Always record the point position since mouseEnterDelay will delay the show if (alignPoint && event && popupVisible) { this.setPoint(event); } } }, { key: "delaySetPopupVisible", value: function delaySetPopupVisible(visible, delayS, event) { var _this2 = this; var delay = delayS * 1000; this.clearDelayTimer(); if (delay) { var point = event ? { pageX: event.pageX, pageY: event.pageY } : null; this.delayTimer = window.setTimeout(function () { _this2.setPopupVisible(visible, point); _this2.clearDelayTimer(); }, delay); } else { this.setPopupVisible(visible, event); } } }, { key: "clearDelayTimer", value: function clearDelayTimer() { if (this.delayTimer) { clearTimeout(this.delayTimer); this.delayTimer = null; } } }, { key: "clearOutsideHandler", value: function clearOutsideHandler() { if (this.clickOutsideHandler) { this.clickOutsideHandler.remove(); this.clickOutsideHandler = null; } if (this.contextMenuOutsideHandler1) { this.contextMenuOutsideHandler1.remove(); this.contextMenuOutsideHandler1 = null; } if (this.contextMenuOutsideHandler2) { this.contextMenuOutsideHandler2.remove(); this.contextMenuOutsideHandler2 = null; } if (this.touchOutsideHandler) { this.touchOutsideHandler.remove(); this.touchOutsideHandler = null; } } }, { key: "createTwoChains", value: function createTwoChains(event) { var childPros = this.props.children.props; var props = this.props; if (childPros[event] && props[event]) { return this["fire".concat(event)]; } return childPros[event] || props[event]; } }, { key: "isClickToShow", value: function isClickToShow() { var _this$props4 = this.props, action = _this$props4.action, showAction = _this$props4.showAction; return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1; } }, { key: "isContextMenuOnly", value: function isContextMenuOnly() { var action = this.props.action; return action === 'contextMenu' || action.length === 1 && action[0] === 'contextMenu'; } }, { key: "isContextMenuToShow", value: function isContextMenuToShow() { var _this$props5 = this.props, action = _this$props5.action, showAction = _this$props5.showAction; return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1; } }, { key: "isClickToHide", value: function isClickToHide() { var _this$props6 = this.props, action = _this$props6.action, hideAction = _this$props6.hideAction; return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1; } }, { key: "isMouseEnterToShow", value: function isMouseEnterToShow() { var _this$props7 = this.props, action = _this$props7.action, showAction = _this$props7.showAction; return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1; } }, { key: "isMouseLeaveToHide", value: function isMouseLeaveToHide() { var _this$props8 = this.props, action = _this$props8.action, hideAction = _this$props8.hideAction; return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1; } }, { key: "isFocusToShow", value: function isFocusToShow() { var _this$props9 = this.props, action = _this$props9.action, showAction = _this$props9.showAction; return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1; } }, { key: "isBlurToHide", value: function isBlurToHide() { var _this$props10 = this.props, action = _this$props10.action, hideAction = _this$props10.hideAction; return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1; } }, { key: "forcePopupAlign", value: function forcePopupAlign() { if (this.state.popupVisible) { var _this$popupRef$curren3; (_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign(); } } }, { key: "fireEvents", value: function fireEvents(type, e) { var childCallback = this.props.children.props[type]; if (childCallback) { childCallback(e); } var callback = this.props[type]; if (callback) { callback(e); } } }, { key: "close", value: function close() { this.setPopupVisible(false); } }, { key: "render", value: function render() { var popupVisible = this.state.popupVisible; var _this$props11 = this.props, children = _this$props11.children, forceRender = _this$props11.forceRender, alignPoint = _this$props11.alignPoint, className = _this$props11.className, autoDestroy = _this$props11.autoDestroy; var child = external_window_React_["Children"].only(children); var newChildProps = { key: 'trigger' }; // ============================== Visible Handlers ============================== // >>> ContextMenu if (this.isContextMenuToShow()) { newChildProps.onContextMenu = this.onContextMenu; } else { newChildProps.onContextMenu = this.createTwoChains('onContextMenu'); } // >>> Click if (this.isClickToHide() || this.isClickToShow()) { newChildProps.onClick = this.onClick; newChildProps.onMouseDown = this.onMouseDown; newChildProps.onTouchStart = this.onTouchStart; } else { newChildProps.onClick = this.createTwoChains('onClick'); newChildProps.onMouseDown = this.createTwoChains('onMouseDown'); newChildProps.onTouchStart = this.createTwoChains('onTouchStart'); } // >>> Hover(enter) if (this.isMouseEnterToShow()) { newChildProps.onMouseEnter = this.onMouseEnter; // Point align if (alignPoint) { newChildProps.onMouseMove = this.onMouseMove; } } else { newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter'); } // >>> Hover(leave) if (this.isMouseLeaveToHide()) { newChildProps.onMouseLeave = this.onMouseLeave; } else { newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave'); } // >>> Focus if (this.isFocusToShow() || this.isBlurToHide()) { newChildProps.onFocus = this.onFocus; newChildProps.onBlur = this.onBlur; } else { newChildProps.onFocus = this.createTwoChains('onFocus'); newChildProps.onBlur = this.createTwoChains('onBlur'); } // =================================== Render =================================== var childrenClassName = classnames_default()(child && child.props && child.props.className, className); if (childrenClassName) { newChildProps.className = childrenClassName; } var cloneProps = Object(objectSpread2["a" /* default */])({}, newChildProps); if (Object(es_ref["c" /* supportRef */])(child)) { cloneProps.ref = Object(es_ref["a" /* composeRef */])(this.triggerRef, child.ref); } var trigger = /*#__PURE__*/external_window_React_["cloneElement"](child, cloneProps); var portal; // prevent unmounting after it's rendered if (popupVisible || this.popupRef.current || forceRender) { portal = /*#__PURE__*/external_window_React_["createElement"](PortalComponent, { key: "portal", getContainer: this.getContainer, didUpdate: this.handlePortalUpdate }, this.getComponent()); } if (!popupVisible && autoDestroy) { portal = null; } return /*#__PURE__*/external_window_React_["createElement"](context.Provider, { value: this.triggerContextValue }, trigger, portal); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(_ref, prevState) { var popupVisible = _ref.popupVisible; var newState = {}; if (popupVisible !== undefined && prevState.popupVisible !== popupVisible) { newState.popupVisible = popupVisible; newState.prevPopupVisible = prevState.popupVisible; } return newState; } }]); return Trigger; }(external_window_React_["Component"]); Trigger.contextType = context; Trigger.defaultProps = { prefixCls: 'rc-trigger-popup', getPopupClassNameFromAlign: returnEmptyString, getDocument: returnDocument, onPopupVisibleChange: es_noop, afterPopupVisibleChange: es_noop, onPopupAlign: es_noop, popupClassName: '', mouseEnterDelay: 0, mouseLeaveDelay: 0.1, focusDelay: 0, blurDelay: 0.15, popupStyle: {}, destroyPopupOnHide: false, popupAlign: {}, defaultPopupVisible: false, mask: false, maskClosable: true, action: [], showAction: [], hideAction: [], autoDestroy: false }; return Trigger; } /* harmony default export */ var rc_trigger_es = (generateTrigger(Portal["a" /* default */])); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/placements.js var autoAdjustOverflow = { adjustX: 1, adjustY: 1 }; var placements = { topLeft: { points: ['bl', 'tl'], overflow: autoAdjustOverflow, offset: [0, -7] }, bottomLeft: { points: ['tl', 'bl'], overflow: autoAdjustOverflow, offset: [0, 7] }, leftTop: { points: ['tr', 'tl'], overflow: autoAdjustOverflow, offset: [-4, 0] }, rightTop: { points: ['tl', 'tr'], overflow: autoAdjustOverflow, offset: [4, 0] } }; var placementsRtl = { topLeft: { points: ['bl', 'tl'], overflow: autoAdjustOverflow, offset: [0, -7] }, bottomLeft: { points: ['tl', 'bl'], overflow: autoAdjustOverflow, offset: [0, 7] }, rightTop: { points: ['tr', 'tl'], overflow: autoAdjustOverflow, offset: [-4, 0] }, leftTop: { points: ['tl', 'tr'], overflow: autoAdjustOverflow, offset: [4, 0] } }; /* harmony default export */ var es_placements = (placements); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/SubMenu.js var guid = 0; var popupPlacementMap = { horizontal: 'bottomLeft', vertical: 'rightTop', 'vertical-left': 'rightTop', 'vertical-right': 'leftTop' }; var SubMenu_updateDefaultActiveFirst = function updateDefaultActiveFirst(store, eventKey, defaultActiveFirst) { var menuId = getMenuIdFromSubMenuEventKey(eventKey); var state = store.getState(); store.setState({ defaultActiveFirst: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, state.defaultActiveFirst), {}, Object(defineProperty["a" /* default */])({}, menuId, defaultActiveFirst)) }); }; var SubMenu_SubMenu = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(SubMenu, _React$Component); var _super = Object(createSuper["a" /* default */])(SubMenu); function SubMenu(props) { var _this; Object(classCallCheck["a" /* default */])(this, SubMenu); _this = _super.call(this, props); _this.onDestroy = function (key) { _this.props.onDestroy(key); }; /** * note: * This legacy code that `onKeyDown` is called by parent instead of dom self. * which need return code to check if this event is handled */ _this.onKeyDown = function (e) { var keyCode = e.keyCode; var menu = _this.menuInstance; var store = _this.props.store; var visible = _this.getVisible(); if (keyCode === KeyCode["a" /* default */].ENTER) { _this.onTitleClick(e); SubMenu_updateDefaultActiveFirst(store, _this.props.eventKey, true); return true; } if (keyCode === KeyCode["a" /* default */].RIGHT) { if (visible) { menu.onKeyDown(e); } else { _this.triggerOpenChange(true); // need to update current menu's defaultActiveFirst value SubMenu_updateDefaultActiveFirst(store, _this.props.eventKey, true); } return true; } if (keyCode === KeyCode["a" /* default */].LEFT) { var handled; if (visible) { handled = menu.onKeyDown(e); } else { return undefined; } if (!handled) { _this.triggerOpenChange(false); handled = true; } return handled; } if (visible && (keyCode === KeyCode["a" /* default */].UP || keyCode === KeyCode["a" /* default */].DOWN)) { return menu.onKeyDown(e); } return undefined; }; _this.onOpenChange = function (e) { _this.props.onOpenChange(e); }; _this.onPopupVisibleChange = function (visible) { _this.triggerOpenChange(visible, visible ? 'mouseenter' : 'mouseleave'); }; _this.onMouseEnter = function (e) { var _this$props = _this.props, key = _this$props.eventKey, onMouseEnter = _this$props.onMouseEnter, store = _this$props.store; SubMenu_updateDefaultActiveFirst(store, _this.props.eventKey, false); onMouseEnter({ key: key, domEvent: e }); }; _this.onMouseLeave = function (e) { var _this$props2 = _this.props, parentMenu = _this$props2.parentMenu, eventKey = _this$props2.eventKey, onMouseLeave = _this$props2.onMouseLeave; parentMenu.subMenuInstance = Object(assertThisInitialized["a" /* default */])(_this); onMouseLeave({ key: eventKey, domEvent: e }); }; _this.onTitleMouseEnter = function (domEvent) { var _this$props3 = _this.props, key = _this$props3.eventKey, onItemHover = _this$props3.onItemHover, onTitleMouseEnter = _this$props3.onTitleMouseEnter; onItemHover({ key: key, hover: true }); onTitleMouseEnter({ key: key, domEvent: domEvent }); }; _this.onTitleMouseLeave = function (e) { var _this$props4 = _this.props, parentMenu = _this$props4.parentMenu, eventKey = _this$props4.eventKey, onItemHover = _this$props4.onItemHover, onTitleMouseLeave = _this$props4.onTitleMouseLeave; parentMenu.subMenuInstance = Object(assertThisInitialized["a" /* default */])(_this); onItemHover({ key: eventKey, hover: false }); onTitleMouseLeave({ key: eventKey, domEvent: e }); }; _this.onTitleClick = function (e) { var _assertThisInitialize = Object(assertThisInitialized["a" /* default */])(_this), props = _assertThisInitialize.props; props.onTitleClick({ key: props.eventKey, domEvent: e }); if (props.triggerSubMenuAction === 'hover') { return; } _this.triggerOpenChange(!_this.getVisible(), 'click'); SubMenu_updateDefaultActiveFirst(props.store, _this.props.eventKey, false); }; _this.onSubMenuClick = function (info) { // in the case of overflowed submenu // onClick is not copied over if (typeof _this.props.onClick === 'function') { _this.props.onClick(_this.addKeyPath(info)); } }; _this.onSelect = function (info) { _this.props.onSelect(info); }; _this.onDeselect = function (info) { _this.props.onDeselect(info); }; _this.getPrefixCls = function () { return "".concat(_this.props.rootPrefixCls, "-submenu"); }; _this.getActiveClassName = function () { return "".concat(_this.getPrefixCls(), "-active"); }; _this.getDisabledClassName = function () { return "".concat(_this.getPrefixCls(), "-disabled"); }; _this.getSelectedClassName = function () { return "".concat(_this.getPrefixCls(), "-selected"); }; _this.getOpenClassName = function () { return "".concat(_this.props.rootPrefixCls, "-submenu-open"); }; _this.getVisible = function () { return _this.state.isOpen; }; _this.getMode = function () { return _this.state.mode; }; _this.saveMenuInstance = function (c) { // children menu instance _this.menuInstance = c; }; _this.addKeyPath = function (info) { return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, info), {}, { keyPath: (info.keyPath || []).concat(_this.props.eventKey) }); }; _this.triggerOpenChange = function (open, type) { var key = _this.props.eventKey; var openChange = function openChange() { _this.onOpenChange({ key: key, item: Object(assertThisInitialized["a" /* default */])(_this), trigger: type, open: open }); }; if (type === 'mouseenter') { // make sure mouseenter happen after other menu item's mouseleave _this.mouseenterTimeout = setTimeout(function () { openChange(); }, 0); } else { openChange(); } }; _this.isChildrenSelected = function () { var ret = { find: false }; loopMenuItemRecursively(_this.props.children, _this.props.selectedKeys, ret); return ret.find; }; _this.isInlineMode = function () { return _this.getMode() === 'inline'; }; _this.adjustWidth = function () { /* istanbul ignore if */ if (!_this.subMenuTitle || !_this.menuInstance) { return; } var popupMenu = external_window_ReactDOM_["findDOMNode"](_this.menuInstance); if (popupMenu.offsetWidth >= _this.subMenuTitle.offsetWidth) { return; } /* istanbul ignore next */ popupMenu.style.minWidth = "".concat(_this.subMenuTitle.offsetWidth, "px"); }; _this.saveSubMenuTitle = function (subMenuTitle) { _this.subMenuTitle = subMenuTitle; }; _this.getBaseProps = function () { var _assertThisInitialize2 = Object(assertThisInitialized["a" /* default */])(_this), props = _assertThisInitialize2.props; var mergedMode = _this.getMode(); return { mode: mergedMode === 'horizontal' ? 'vertical' : mergedMode, visible: _this.getVisible(), level: props.level + 1, inlineIndent: props.inlineIndent, focusable: false, onClick: _this.onSubMenuClick, onSelect: _this.onSelect, onDeselect: _this.onDeselect, onDestroy: _this.onDestroy, selectedKeys: props.selectedKeys, eventKey: "".concat(props.eventKey, "-menu-"), openKeys: props.openKeys, motion: props.motion, onOpenChange: _this.onOpenChange, subMenuOpenDelay: props.subMenuOpenDelay, parentMenu: Object(assertThisInitialized["a" /* default */])(_this), subMenuCloseDelay: props.subMenuCloseDelay, forceSubMenuRender: props.forceSubMenuRender, triggerSubMenuAction: props.triggerSubMenuAction, builtinPlacements: props.builtinPlacements, defaultActiveFirst: props.store.getState().defaultActiveFirst[getMenuIdFromSubMenuEventKey(props.eventKey)], multiple: props.multiple, prefixCls: props.rootPrefixCls, id: _this.internalMenuId, manualRef: _this.saveMenuInstance, itemIcon: props.itemIcon, expandIcon: props.expandIcon, direction: props.direction }; }; _this.getMotion = function (mode, visible) { var _assertThisInitialize3 = Object(assertThisInitialized["a" /* default */])(_this), haveRendered = _assertThisInitialize3.haveRendered; var _this$props5 = _this.props, motion = _this$props5.motion, rootPrefixCls = _this$props5.rootPrefixCls; // don't show transition on first rendering (no animation for opened menu) // show appear transition if it's not visible (not sure why) // show appear transition if it's not inline mode var mergedMotion = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, motion), {}, { leavedClassName: "".concat(rootPrefixCls, "-hidden"), removeOnLeave: false, motionAppear: haveRendered || !visible || mode !== 'inline' }); return mergedMotion; }; var store = props.store, eventKey = props.eventKey; var _store$getState = store.getState(), defaultActiveFirst = _store$getState.defaultActiveFirst; _this.isRootMenu = false; var value = false; if (defaultActiveFirst) { value = defaultActiveFirst[eventKey]; } SubMenu_updateDefaultActiveFirst(store, eventKey, value); _this.state = { mode: props.mode, isOpen: props.isOpen }; return _this; } Object(createClass["a" /* default */])(SubMenu, [{ key: "componentDidMount", value: function componentDidMount() { this.componentDidUpdate(); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var _this2 = this; var _this$props6 = this.props, mode = _this$props6.mode, parentMenu = _this$props6.parentMenu, manualRef = _this$props6.manualRef, isOpen = _this$props6.isOpen; var updateState = function updateState() { _this2.setState({ mode: mode, isOpen: isOpen }); }; // Delay sync when mode changed in case openKeys change not sync var isOpenChanged = isOpen !== this.state.isOpen; var isModeChanged = mode !== this.state.mode; if (isModeChanged || isOpenChanged) { es_raf["a" /* default */].cancel(this.updateStateRaf); if (isModeChanged) { this.updateStateRaf = Object(es_raf["a" /* default */])(updateState); } else { updateState(); } } // invoke customized ref to expose component to mixin if (manualRef) { manualRef(this); } if (mode !== 'horizontal' || !(parentMenu === null || parentMenu === void 0 ? void 0 : parentMenu.isRootMenu) || !isOpen) { return; } this.minWidthTimeout = setTimeout(function () { return _this2.adjustWidth(); }, 0); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { var _this$props7 = this.props, onDestroy = _this$props7.onDestroy, eventKey = _this$props7.eventKey; if (onDestroy) { onDestroy(eventKey); } /* istanbul ignore if */ if (this.minWidthTimeout) { clearTimeout(this.minWidthTimeout); } /* istanbul ignore if */ if (this.mouseenterTimeout) { clearTimeout(this.mouseenterTimeout); } es_raf["a" /* default */].cancel(this.updateStateRaf); } }, { key: "renderPopupMenu", value: function renderPopupMenu(className, style) { var baseProps = this.getBaseProps(); /** * zombiej: Why SubPopupMenu here? * Seems whatever popup or inline mode both will render SubPopupMenu. * It's controlled by Trigger for popup or not. */ return /*#__PURE__*/external_window_React_["createElement"](es_SubPopupMenu, Object(esm_extends["a" /* default */])({}, baseProps, { id: this.internalMenuId, className: className, style: style }), this.props.children); } }, { key: "renderChildren", value: function renderChildren() { var _this3 = this; var baseProps = this.getBaseProps(); var mode = baseProps.mode, visible = baseProps.visible, forceSubMenuRender = baseProps.forceSubMenuRender, direction = baseProps.direction; // [Legacy] getMotion must be called before `haveRendered` var mergedMotion = this.getMotion(mode, visible); this.haveRendered = true; this.haveOpened = this.haveOpened || visible || forceSubMenuRender; // never rendered not planning to, don't render if (!this.haveOpened) { return /*#__PURE__*/external_window_React_["createElement"]("div", null); } var sharedClassName = classnames_default()("".concat(baseProps.prefixCls, "-sub"), Object(defineProperty["a" /* default */])({}, "".concat(baseProps.prefixCls, "-rtl"), direction === 'rtl')); if (!this.isInlineMode()) { return this.renderPopupMenu(sharedClassName); } return /*#__PURE__*/external_window_React_["createElement"](rc_motion_es, Object(esm_extends["a" /* default */])({ visible: baseProps.visible, forceRender: forceSubMenuRender }, mergedMotion), function (_ref) { var className = _ref.className, style = _ref.style; var mergedClassName = classnames_default()(sharedClassName, className); return _this3.renderPopupMenu(mergedClassName, style); }); } }, { key: "render", value: function render() { var _classNames2, _props$parentMenu, _classNames3; var props = Object(objectSpread2["a" /* default */])({}, this.props); var visible = this.getVisible(); var prefixCls = this.getPrefixCls(); var inline = this.isInlineMode(); var mergedMode = this.getMode(); var className = classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedMode), (_classNames2 = {}, Object(defineProperty["a" /* default */])(_classNames2, props.className, !!props.className), Object(defineProperty["a" /* default */])(_classNames2, this.getOpenClassName(), visible), Object(defineProperty["a" /* default */])(_classNames2, this.getActiveClassName(), props.active || visible && !inline), Object(defineProperty["a" /* default */])(_classNames2, this.getDisabledClassName(), props.disabled), Object(defineProperty["a" /* default */])(_classNames2, this.getSelectedClassName(), this.isChildrenSelected()), _classNames2)); if (!this.internalMenuId) { if (props.eventKey) { this.internalMenuId = "".concat(props.eventKey, "$Menu"); } else { guid += 1; this.internalMenuId = "$__$".concat(guid, "$Menu"); } } var mouseEvents = {}; var titleClickEvents = {}; var titleMouseEvents = {}; if (!props.disabled) { mouseEvents = { onMouseLeave: this.onMouseLeave, onMouseEnter: this.onMouseEnter }; // only works in title, not outer li titleClickEvents = { onClick: this.onTitleClick }; titleMouseEvents = { onMouseEnter: this.onTitleMouseEnter, onMouseLeave: this.onTitleMouseLeave }; } var style = {}; var direction = props.direction; var isRTL = direction === 'rtl'; if (inline) { if (isRTL) { style.paddingRight = props.inlineIndent * props.level; } else { style.paddingLeft = props.inlineIndent * props.level; } } var ariaOwns = {}; // only set aria-owns when menu is open // otherwise it would be an invalid aria-owns value // since corresponding node cannot be found if (this.getVisible()) { ariaOwns = { 'aria-owns': this.internalMenuId }; } // expand custom icon should NOT be displayed in menu with horizontal mode. var icon = null; if (mergedMode !== 'horizontal') { icon = this.props.expandIcon; // ReactNode if (typeof this.props.expandIcon === 'function') { icon = /*#__PURE__*/external_window_React_["createElement"](this.props.expandIcon, Object(objectSpread2["a" /* default */])({}, this.props)); } } var title = /*#__PURE__*/external_window_React_["createElement"]("div", Object(esm_extends["a" /* default */])({ ref: this.saveSubMenuTitle, style: style, className: "".concat(prefixCls, "-title"), role: "button" }, titleMouseEvents, titleClickEvents, { "aria-expanded": visible }, ariaOwns, { "aria-haspopup": "true", title: typeof props.title === 'string' ? props.title : undefined }), props.title, icon || /*#__PURE__*/external_window_React_["createElement"]("i", { className: "".concat(prefixCls, "-arrow") })); var children = this.renderChildren(); var getPopupContainer = ((_props$parentMenu = props.parentMenu) === null || _props$parentMenu === void 0 ? void 0 : _props$parentMenu.isRootMenu) ? props.parentMenu.props.getPopupContainer : function (triggerNode) { return triggerNode.parentNode; }; var popupPlacement = popupPlacementMap[mergedMode]; var popupAlign = props.popupOffset ? { offset: props.popupOffset } : {}; var popupClassName = classnames_default()((_classNames3 = {}, Object(defineProperty["a" /* default */])(_classNames3, props.popupClassName, props.popupClassName && !inline), Object(defineProperty["a" /* default */])(_classNames3, "".concat(prefixCls, "-rtl"), isRTL), _classNames3)); var disabled = props.disabled, triggerSubMenuAction = props.triggerSubMenuAction, subMenuOpenDelay = props.subMenuOpenDelay, forceSubMenuRender = props.forceSubMenuRender, subMenuCloseDelay = props.subMenuCloseDelay, builtinPlacements = props.builtinPlacements; menuAllProps.forEach(function (key) { return delete props[key]; }); // Set onClick to null, to ignore propagated onClick event delete props.onClick; var placement = isRTL ? Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, placementsRtl), builtinPlacements) : Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, placements), builtinPlacements); delete props.direction; // [Legacy] It's a fast fix, // but we should check if we can refactor this to make code more easy to understand var baseProps = this.getBaseProps(); var mergedMotion = inline ? null : this.getMotion(baseProps.mode, baseProps.visible); return /*#__PURE__*/external_window_React_["createElement"]("li", Object(esm_extends["a" /* default */])({}, props, mouseEvents, { className: className, role: "menuitem" }), /*#__PURE__*/external_window_React_["createElement"](rc_trigger_es, { prefixCls: prefixCls, popupClassName: classnames_default()("".concat(prefixCls, "-popup"), popupClassName), getPopupContainer: getPopupContainer, builtinPlacements: placement, popupPlacement: popupPlacement, popupVisible: inline ? false : visible, popupAlign: popupAlign, popup: inline ? null : children, action: disabled || inline ? [] : [triggerSubMenuAction], mouseEnterDelay: subMenuOpenDelay, mouseLeaveDelay: subMenuCloseDelay, onPopupVisibleChange: this.onPopupVisibleChange, forceRender: forceSubMenuRender, popupMotion: mergedMotion }, title), inline ? children : null); } }]); return SubMenu; }(external_window_React_["Component"]); SubMenu_SubMenu.defaultProps = { onMouseEnter: noop, onMouseLeave: noop, onTitleMouseEnter: noop, onTitleMouseLeave: noop, onTitleClick: noop, manualRef: noop, mode: 'vertical', title: '' }; var connected = Object(esm["b" /* connect */])(function (_ref2, _ref3) { var openKeys = _ref2.openKeys, activeKey = _ref2.activeKey, selectedKeys = _ref2.selectedKeys; var eventKey = _ref3.eventKey, subMenuKey = _ref3.subMenuKey; return { isOpen: openKeys.indexOf(eventKey) > -1, active: activeKey[subMenuKey] === eventKey, selectedKeys: selectedKeys }; })(SubMenu_SubMenu); connected.isSubMenu = true; /* harmony default export */ var es_SubMenu = (connected); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/DOMWrap.js var MENUITEM_OVERFLOWED_CLASSNAME = 'menuitem-overflowed'; var FLOAT_PRECISION_ADJUST = 0.5; var DOMWrap_DOMWrap = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(DOMWrap, _React$Component); var _super = Object(createSuper["a" /* default */])(DOMWrap); function DOMWrap() { var _this; Object(classCallCheck["a" /* default */])(this, DOMWrap); _this = _super.apply(this, arguments); _this.resizeObserver = null; _this.mutationObserver = null; // original scroll size of the list _this.originalTotalWidth = 0; // copy of overflowed items _this.overflowedItems = []; // cache item of the original items (so we can track the size and order) _this.menuItemSizes = []; _this.cancelFrameId = null; _this.state = { lastVisibleIndex: undefined }; _this.childRef = /*#__PURE__*/external_window_React_["createRef"](); // get all valid menuItem nodes _this.getMenuItemNodes = function () { var prefixCls = _this.props.prefixCls; var ul = _this.childRef.current; if (!ul) { return []; } // filter out all overflowed indicator placeholder return [].slice.call(ul.children).filter(function (node) { return node.className.split(' ').indexOf("".concat(prefixCls, "-overflowed-submenu")) < 0; }); }; _this.getOverflowedSubMenuItem = function (keyPrefix, overflowedItems, renderPlaceholder) { var _this$props = _this.props, overflowedIndicator = _this$props.overflowedIndicator, level = _this$props.level, mode = _this$props.mode, prefixCls = _this$props.prefixCls, theme = _this$props.theme; if (level !== 1 || mode !== 'horizontal') { return null; } // put all the overflowed item inside a submenu // with a title of overflow indicator ('...') var copy = _this.props.children[0]; var _copy$props = copy.props, throwAway = _copy$props.children, title = _copy$props.title, propStyle = _copy$props.style, rest = Object(objectWithoutProperties["a" /* default */])(_copy$props, ["children", "title", "style"]); var style = Object(objectSpread2["a" /* default */])({}, propStyle); var key = "".concat(keyPrefix, "-overflowed-indicator"); var eventKey = "".concat(keyPrefix, "-overflowed-indicator"); if (overflowedItems.length === 0 && renderPlaceholder !== true) { style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, style), {}, { display: 'none' }); } else if (renderPlaceholder) { style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, style), {}, { visibility: 'hidden', // prevent from taking normal dom space position: 'absolute' }); key = "".concat(key, "-placeholder"); eventKey = "".concat(eventKey, "-placeholder"); } var popupClassName = theme ? "".concat(prefixCls, "-").concat(theme) : ''; var props = {}; menuAllProps.forEach(function (k) { if (rest[k] !== undefined) { props[k] = rest[k]; } }); return /*#__PURE__*/external_window_React_["createElement"](es_SubMenu, Object(esm_extends["a" /* default */])({ title: overflowedIndicator, className: "".concat(prefixCls, "-overflowed-submenu"), popupClassName: popupClassName }, props, { key: key, eventKey: eventKey, disabled: false, style: style }), overflowedItems); }; // memorize rendered menuSize _this.setChildrenWidthAndResize = function () { if (_this.props.mode !== 'horizontal') { return; } var ul = _this.childRef.current; if (!ul) { return; } var ulChildrenNodes = ul.children; if (!ulChildrenNodes || ulChildrenNodes.length === 0) { return; } var lastOverflowedIndicatorPlaceholder = ul.children[ulChildrenNodes.length - 1]; // need last overflowed indicator for calculating length; util_setStyle(lastOverflowedIndicatorPlaceholder, 'display', 'inline-block'); var menuItemNodes = _this.getMenuItemNodes(); // reset display attribute for all hidden elements caused by overflow to calculate updated width // and then reset to original state after width calculation var overflowedItems = menuItemNodes.filter(function (c) { return c.className.split(' ').indexOf(MENUITEM_OVERFLOWED_CLASSNAME) >= 0; }); overflowedItems.forEach(function (c) { util_setStyle(c, 'display', 'inline-block'); }); _this.menuItemSizes = menuItemNodes.map(function (c) { return getWidth(c, true); }); overflowedItems.forEach(function (c) { util_setStyle(c, 'display', 'none'); }); _this.overflowedIndicatorWidth = getWidth(ul.children[ul.children.length - 1], true); _this.originalTotalWidth = _this.menuItemSizes.reduce(function (acc, cur) { return acc + cur; }, 0); _this.handleResize(); // prevent the overflowed indicator from taking space; util_setStyle(lastOverflowedIndicatorPlaceholder, 'display', 'none'); }; _this.handleResize = function () { if (_this.props.mode !== 'horizontal') { return; } var ul = _this.childRef.current; if (!ul) { return; } var width = getWidth(ul); _this.overflowedItems = []; var currentSumWidth = 0; // index for last visible child in horizontal mode var lastVisibleIndex; // float number comparison could be problematic // e.g. 0.1 + 0.2 > 0.3 =====> true // thus using FLOAT_PRECISION_ADJUST as buffer to help the situation if (_this.originalTotalWidth > width + FLOAT_PRECISION_ADJUST) { lastVisibleIndex = -1; _this.menuItemSizes.forEach(function (liWidth) { currentSumWidth += liWidth; if (currentSumWidth + _this.overflowedIndicatorWidth <= width) { lastVisibleIndex += 1; } }); } _this.setState({ lastVisibleIndex: lastVisibleIndex }); }; return _this; } Object(createClass["a" /* default */])(DOMWrap, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; this.setChildrenWidthAndResize(); if (this.props.level === 1 && this.props.mode === 'horizontal') { var menuUl = this.childRef.current; if (!menuUl) { return; } this.resizeObserver = new ResizeObserver_es["default"](function (entries) { entries.forEach(function () { var cancelFrameId = _this2.cancelFrameId; cancelAnimationFrame(cancelFrameId); _this2.cancelFrameId = requestAnimationFrame(_this2.setChildrenWidthAndResize); }); }); [].slice.call(menuUl.children).concat(menuUl).forEach(function (el) { _this2.resizeObserver.observe(el); }); if (typeof MutationObserver !== 'undefined') { this.mutationObserver = new MutationObserver(function () { _this2.resizeObserver.disconnect(); [].slice.call(menuUl.children).concat(menuUl).forEach(function (el) { _this2.resizeObserver.observe(el); }); _this2.setChildrenWidthAndResize(); }); this.mutationObserver.observe(menuUl, { attributes: false, childList: true, subTree: false }); } } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (this.resizeObserver) { this.resizeObserver.disconnect(); } if (this.mutationObserver) { this.mutationObserver.disconnect(); } cancelAnimationFrame(this.cancelFrameId); } }, { key: "renderChildren", value: function renderChildren(children) { var _this3 = this; // need to take care of overflowed items in horizontal mode var lastVisibleIndex = this.state.lastVisibleIndex; return (children || []).reduce(function (acc, childNode, index) { var item = childNode; if (_this3.props.mode === 'horizontal') { var overflowed = _this3.getOverflowedSubMenuItem(childNode.props.eventKey, []); if (lastVisibleIndex !== undefined && _this3.props.className.indexOf("".concat(_this3.props.prefixCls, "-root")) !== -1) { if (index > lastVisibleIndex) { item = /*#__PURE__*/external_window_React_["cloneElement"](childNode, // 这里修改 eventKey 是为了防止隐藏状态下还会触发 openkeys 事件 { style: { display: 'none' }, eventKey: "".concat(childNode.props.eventKey, "-hidden"), /** * Legacy code. Here `className` never used: * https://github.com/react-component/menu/commit/4cd6b49fce9d116726f4ea00dda85325d6f26500#diff-e2fa48f75c2dd2318295cde428556a76R240 */ className: "".concat(MENUITEM_OVERFLOWED_CLASSNAME) }); } if (index === lastVisibleIndex + 1) { _this3.overflowedItems = children.slice(lastVisibleIndex + 1).map(function (c) { return /*#__PURE__*/external_window_React_["cloneElement"](c, // children[index].key will become '.$key' in clone by default, // we have to overwrite with the correct key explicitly { key: c.props.eventKey, mode: 'vertical-left' }); }); overflowed = _this3.getOverflowedSubMenuItem(childNode.props.eventKey, _this3.overflowedItems); } } var ret = [].concat(Object(toConsumableArray["a" /* default */])(acc), [overflowed, item]); if (index === children.length - 1) { // need a placeholder for calculating overflowed indicator width ret.push(_this3.getOverflowedSubMenuItem(childNode.props.eventKey, [], true)); } return ret; } return [].concat(Object(toConsumableArray["a" /* default */])(acc), [item]); }, []); } }, { key: "render", value: function render() { var _this$props2 = this.props, visible = _this$props2.visible, prefixCls = _this$props2.prefixCls, overflowedIndicator = _this$props2.overflowedIndicator, mode = _this$props2.mode, level = _this$props2.level, tag = _this$props2.tag, children = _this$props2.children, theme = _this$props2.theme, rest = Object(objectWithoutProperties["a" /* default */])(_this$props2, ["visible", "prefixCls", "overflowedIndicator", "mode", "level", "tag", "children", "theme"]); var Tag = tag; return /*#__PURE__*/external_window_React_["createElement"](Tag, Object(esm_extends["a" /* default */])({ ref: this.childRef }, rest), this.renderChildren(children)); } }]); return DOMWrap; }(external_window_React_["Component"]); DOMWrap_DOMWrap.defaultProps = { tag: 'div', className: '' }; /* harmony default export */ var es_DOMWrap = (DOMWrap_DOMWrap); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/SubPopupMenu.js function allDisabled(arr) { if (!arr.length) { return true; } return arr.every(function (c) { return !!c.props.disabled; }); } function updateActiveKey(store, menuId, activeKey) { var state = store.getState(); store.setState({ activeKey: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, state.activeKey), {}, Object(defineProperty["a" /* default */])({}, menuId, activeKey)) }); } function getEventKey(props) { // when eventKey not available ,it's menu and return menu id '0-menu-' return props.eventKey || '0-menu-'; } function getActiveKey(props, originalActiveKey) { var activeKey = originalActiveKey; var children = props.children, eventKey = props.eventKey; if (activeKey) { var found; loopMenuItem(children, function (c, i) { if (c && c.props && !c.props.disabled && activeKey === getKeyFromChildrenIndex(c, eventKey, i)) { found = true; } }); if (found) { return activeKey; } } activeKey = null; if (props.defaultActiveFirst) { loopMenuItem(children, function (c, i) { if (!activeKey && c && !c.props.disabled) { activeKey = getKeyFromChildrenIndex(c, eventKey, i); } }); return activeKey; } return activeKey; } function saveRef(c) { if (!c) { return; } /* eslint-disable @typescript-eslint/no-invalid-this */ var index = this.instanceArray.indexOf(c); if (index !== -1) { // update component if it's already inside instanceArray this.instanceArray[index] = c; } else { // add component if it's not in instanceArray yet; this.instanceArray.push(c); } /* eslint-enable @typescript-eslint/no-invalid-this */ } var SubPopupMenu_SubPopupMenu = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(SubPopupMenu, _React$Component); var _super = Object(createSuper["a" /* default */])(SubPopupMenu); function SubPopupMenu(props) { var _this; Object(classCallCheck["a" /* default */])(this, SubPopupMenu); _this = _super.call(this, props); /** * all keyboard events callbacks run from here at first * * note: * This legacy code that `onKeyDown` is called by parent instead of dom self. * which need return code to check if this event is handled */ _this.onKeyDown = function (e, callback) { var keyCode = e.keyCode; var handled; _this.getFlatInstanceArray().forEach(function (obj) { if (obj && obj.props.active && obj.onKeyDown) { handled = obj.onKeyDown(e); } }); if (handled) { return 1; } var activeItem = null; if (keyCode === KeyCode["a" /* default */].UP || keyCode === KeyCode["a" /* default */].DOWN) { activeItem = _this.step(keyCode === KeyCode["a" /* default */].UP ? -1 : 1); } if (activeItem) { e.preventDefault(); updateActiveKey(_this.props.store, getEventKey(_this.props), activeItem.props.eventKey); if (typeof callback === 'function') { callback(activeItem); } return 1; } return undefined; }; _this.onItemHover = function (e) { var key = e.key, hover = e.hover; updateActiveKey(_this.props.store, getEventKey(_this.props), hover ? key : null); }; _this.onDeselect = function (selectInfo) { _this.props.onDeselect(selectInfo); }; _this.onSelect = function (selectInfo) { _this.props.onSelect(selectInfo); }; _this.onClick = function (e) { _this.props.onClick(e); }; _this.onOpenChange = function (e) { _this.props.onOpenChange(e); }; _this.onDestroy = function (key) { /* istanbul ignore next */ _this.props.onDestroy(key); }; _this.getFlatInstanceArray = function () { return _this.instanceArray; }; _this.step = function (direction) { var children = _this.getFlatInstanceArray(); var activeKey = _this.props.store.getState().activeKey[getEventKey(_this.props)]; var len = children.length; if (!len) { return null; } if (direction < 0) { children = children.concat().reverse(); } // find current activeIndex var activeIndex = -1; children.every(function (c, ci) { if (c && c.props.eventKey === activeKey) { activeIndex = ci; return false; } return true; }); if (!_this.props.defaultActiveFirst && activeIndex !== -1 && allDisabled(children.slice(activeIndex, len - 1))) { return undefined; } var start = (activeIndex + 1) % len; var i = start; do { var child = children[i]; if (!child || child.props.disabled) { i = (i + 1) % len; } else { return child; } } while (i !== start); return null; }; _this.renderCommonMenuItem = function (child, i, extraProps) { var state = _this.props.store.getState(); var _assertThisInitialize = Object(assertThisInitialized["a" /* default */])(_this), props = _assertThisInitialize.props; var key = getKeyFromChildrenIndex(child, props.eventKey, i); var childProps = child.props; // https://github.com/ant-design/ant-design/issues/11517#issuecomment-477403055 if (!childProps || typeof child.type === 'string') { return child; } var isActive = key === state.activeKey; var newChildProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({ mode: childProps.mode || props.mode, level: props.level, inlineIndent: props.inlineIndent, renderMenuItem: _this.renderMenuItem, rootPrefixCls: props.prefixCls, index: i, parentMenu: props.parentMenu, // customized ref function, need to be invoked manually in child's componentDidMount manualRef: childProps.disabled ? undefined : Object(createChainedFunction["a" /* default */])(child.ref, saveRef.bind(Object(assertThisInitialized["a" /* default */])(_this))), eventKey: key, active: !childProps.disabled && isActive, multiple: props.multiple, onClick: function onClick(e) { (childProps.onClick || noop)(e); _this.onClick(e); }, onItemHover: _this.onItemHover, motion: props.motion, subMenuOpenDelay: props.subMenuOpenDelay, subMenuCloseDelay: props.subMenuCloseDelay, forceSubMenuRender: props.forceSubMenuRender, onOpenChange: _this.onOpenChange, onDeselect: _this.onDeselect, onSelect: _this.onSelect, builtinPlacements: props.builtinPlacements, itemIcon: childProps.itemIcon || _this.props.itemIcon, expandIcon: childProps.expandIcon || _this.props.expandIcon }, extraProps), {}, { direction: props.direction }); // ref: https://github.com/ant-design/ant-design/issues/13943 if (props.mode === 'inline' || util_isMobileDevice()) { newChildProps.triggerSubMenuAction = 'click'; } return /*#__PURE__*/external_window_React_["cloneElement"](child, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, newChildProps), {}, { key: key || i })); }; _this.renderMenuItem = function (c, i, subMenuKey) { /* istanbul ignore if */ if (!c) { return null; } var state = _this.props.store.getState(); var extraProps = { openKeys: state.openKeys, selectedKeys: state.selectedKeys, triggerSubMenuAction: _this.props.triggerSubMenuAction, subMenuKey: subMenuKey }; return _this.renderCommonMenuItem(c, i, extraProps); }; props.store.setState({ activeKey: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props.store.getState().activeKey), {}, Object(defineProperty["a" /* default */])({}, props.eventKey, getActiveKey(props, props.activeKey))) }); _this.instanceArray = []; return _this; } Object(createClass["a" /* default */])(SubPopupMenu, [{ key: "componentDidMount", value: function componentDidMount() { // invoke customized ref to expose component to mixin if (this.props.manualRef) { this.props.manualRef(this); } } }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(nextProps) { return this.props.visible || nextProps.visible || this.props.className !== nextProps.className || !shallowequal_default()(this.props.style, nextProps.style); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var props = this.props; var originalActiveKey = 'activeKey' in props ? props.activeKey : props.store.getState().activeKey[getEventKey(props)]; var activeKey = getActiveKey(props, originalActiveKey); if (activeKey !== originalActiveKey) { updateActiveKey(props.store, getEventKey(props), activeKey); } else if ('activeKey' in prevProps) { // If prev activeKey is not same as current activeKey, // we should set it. var prevActiveKey = getActiveKey(prevProps, prevProps.activeKey); if (activeKey !== prevActiveKey) { updateActiveKey(props.store, getEventKey(props), activeKey); } } } }, { key: "render", value: function render() { var _this2 = this; var props = Object(esm_extends["a" /* default */])({}, this.props); this.instanceArray = []; var className = classnames_default()(props.prefixCls, props.className, "".concat(props.prefixCls, "-").concat(props.mode)); var domProps = { className: className, // role could be 'select' and by default set to menu role: props.role || 'menu' }; if (props.id) { domProps.id = props.id; } if (props.focusable) { domProps.tabIndex = 0; domProps.onKeyDown = this.onKeyDown; } var prefixCls = props.prefixCls, eventKey = props.eventKey, visible = props.visible, level = props.level, mode = props.mode, overflowedIndicator = props.overflowedIndicator, theme = props.theme; menuAllProps.forEach(function (key) { return delete props[key]; }); // Otherwise, the propagated click event will trigger another onClick delete props.onClick; return /*#__PURE__*/external_window_React_["createElement"](es_DOMWrap, Object(esm_extends["a" /* default */])({}, props, { prefixCls: prefixCls, mode: mode, tag: "ul", level: level, theme: theme, visible: visible, overflowedIndicator: overflowedIndicator }, domProps), Object(toArray["a" /* default */])(props.children).map(function (c, i) { return _this2.renderMenuItem(c, i, eventKey || '0-menu-'); })); } }]); return SubPopupMenu; }(external_window_React_["Component"]); SubPopupMenu_SubPopupMenu.defaultProps = { prefixCls: 'rc-menu', className: '', mode: 'vertical', level: 1, inlineIndent: 24, visible: true, focusable: true, style: {}, manualRef: noop }; var SubPopupMenu_connected = Object(esm["b" /* connect */])()(SubPopupMenu_SubPopupMenu); /* harmony default export */ var es_SubPopupMenu = (SubPopupMenu_connected); // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js var warning = __webpack_require__("Kwbf"); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/utils/legacyUtil.js function legacyUtil_getMotion(_ref, _ref2, menuMode) { var prefixCls = _ref.prefixCls, motion = _ref.motion, _ref$defaultMotions = _ref.defaultMotions, defaultMotions = _ref$defaultMotions === void 0 ? {} : _ref$defaultMotions, openAnimation = _ref.openAnimation, openTransitionName = _ref.openTransitionName; var switchingModeFromInline = _ref2.switchingModeFromInline; if (motion) { return motion; } if (Object(esm_typeof["a" /* default */])(openAnimation) === 'object' && openAnimation) { Object(warning["a" /* default */])(false, 'Object type of `openAnimation` is removed. Please use `motion` instead.'); } else if (typeof openAnimation === 'string') { return { motionName: "".concat(prefixCls, "-open-").concat(openAnimation) }; } if (openTransitionName) { return { motionName: openTransitionName }; } // Default logic var defaultMotion = defaultMotions[menuMode]; if (defaultMotion) { return defaultMotion; } // When mode switch from inline // submenu should hide without animation return switchingModeFromInline ? null : defaultMotions.other; } // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/Menu.js var Menu_Menu = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(Menu, _React$Component); var _super = Object(createSuper["a" /* default */])(Menu); function Menu(props) { var _this; Object(classCallCheck["a" /* default */])(this, Menu); _this = _super.call(this, props); _this.onSelect = function (selectInfo) { var _assertThisInitialize = Object(assertThisInitialized["a" /* default */])(_this), props = _assertThisInitialize.props; if (props.selectable) { // root menu var _this$store$getState = _this.store.getState(), _selectedKeys = _this$store$getState.selectedKeys; var selectedKey = selectInfo.key; if (props.multiple) { _selectedKeys = _selectedKeys.concat([selectedKey]); } else { _selectedKeys = [selectedKey]; } if (!('selectedKeys' in props)) { _this.store.setState({ selectedKeys: _selectedKeys }); } props.onSelect(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, selectInfo), {}, { selectedKeys: _selectedKeys })); } }; _this.onClick = function (e) { var mode = _this.getRealMenuMode(); var _assertThisInitialize2 = Object(assertThisInitialized["a" /* default */])(_this), store = _assertThisInitialize2.store, onOpenChange = _assertThisInitialize2.props.onOpenChange; if (mode !== 'inline' && !('openKeys' in _this.props)) { // closing vertical popup submenu after click it store.setState({ openKeys: [] }); onOpenChange([]); } _this.props.onClick(e); }; // onKeyDown needs to be exposed as a instance method // e.g., in rc-select, we need to navigate menu item while // current active item is rc-select input box rather than the menu itself _this.onKeyDown = function (e, callback) { _this.innerMenu.getWrappedInstance().onKeyDown(e, callback); }; _this.onOpenChange = function (event) { var _assertThisInitialize3 = Object(assertThisInitialized["a" /* default */])(_this), props = _assertThisInitialize3.props; var openKeys = _this.store.getState().openKeys.concat(); var changed = false; var processSingle = function processSingle(e) { var oneChanged = false; if (e.open) { oneChanged = openKeys.indexOf(e.key) === -1; if (oneChanged) { openKeys.push(e.key); } } else { var index = openKeys.indexOf(e.key); oneChanged = index !== -1; if (oneChanged) { openKeys.splice(index, 1); } } changed = changed || oneChanged; }; if (Array.isArray(event)) { // batch change call event.forEach(processSingle); } else { processSingle(event); } if (changed) { if (!('openKeys' in _this.props)) { _this.store.setState({ openKeys: openKeys }); } props.onOpenChange(openKeys); } }; _this.onDeselect = function (selectInfo) { var _assertThisInitialize4 = Object(assertThisInitialized["a" /* default */])(_this), props = _assertThisInitialize4.props; if (props.selectable) { var _selectedKeys2 = _this.store.getState().selectedKeys.concat(); var selectedKey = selectInfo.key; var index = _selectedKeys2.indexOf(selectedKey); if (index !== -1) { _selectedKeys2.splice(index, 1); } if (!('selectedKeys' in props)) { _this.store.setState({ selectedKeys: _selectedKeys2 }); } props.onDeselect(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, selectInfo), {}, { selectedKeys: _selectedKeys2 })); } }; // Restore vertical mode when menu is collapsed responsively when mounted // https://github.com/ant-design/ant-design/issues/13104 // TODO: not a perfect solution, // looking a new way to avoid setting switchingModeFromInline in this situation _this.onMouseEnter = function (e) { _this.restoreModeVerticalFromInline(); var onMouseEnter = _this.props.onMouseEnter; if (onMouseEnter) { onMouseEnter(e); } }; _this.onTransitionEnd = function (e) { // when inlineCollapsed menu width animation finished // https://github.com/ant-design/ant-design/issues/12864 var widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; // Fix SVGElement e.target.className.indexOf is not a function // https://github.com/ant-design/ant-design/issues/15699 var className = e.target.className; // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, // unless during an animation. var classNameValue = Object.prototype.toString.call(className) === '[object SVGAnimatedString]' ? className.animVal : className; // Fix for , // the width transition won't trigger when menu is collapsed // https://github.com/ant-design/ant-design-pro/issues/2783 var iconScaled = e.propertyName === 'font-size' && classNameValue.indexOf('anticon') >= 0; if (widthCollapsed || iconScaled) { _this.restoreModeVerticalFromInline(); } }; _this.setInnerMenu = function (node) { _this.innerMenu = node; }; _this.isRootMenu = true; var selectedKeys = props.defaultSelectedKeys; var openKeys = props.defaultOpenKeys; if ('selectedKeys' in props) { selectedKeys = props.selectedKeys || []; } if ('openKeys' in props) { openKeys = props.openKeys || []; } _this.store = Object(esm["c" /* create */])({ selectedKeys: selectedKeys, openKeys: openKeys, activeKey: { '0-menu-': getActiveKey(props, props.activeKey) } }); _this.state = { switchingModeFromInline: false, prevProps: props, inlineOpenKeys: [], store: _this.store }; return _this; } Object(createClass["a" /* default */])(Menu, [{ key: "componentDidMount", value: function componentDidMount() { this.updateMiniStore(); this.updateMenuDisplay(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props = this.props, siderCollapsed = _this$props.siderCollapsed, inlineCollapsed = _this$props.inlineCollapsed, onOpenChange = _this$props.onOpenChange; if (!prevProps.inlineCollapsed && inlineCollapsed || !prevProps.siderCollapsed && siderCollapsed) { onOpenChange([]); } this.updateMiniStore(); this.updateMenuDisplay(); } }, { key: "updateMenuDisplay", value: function updateMenuDisplay() { var collapsedWidth = this.props.collapsedWidth, store = this.store, prevOpenKeys = this.prevOpenKeys; // https://github.com/ant-design/ant-design/issues/8587 var hideMenu = this.getInlineCollapsed() && (collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px'); if (hideMenu) { this.prevOpenKeys = store.getState().openKeys.concat(); this.store.setState({ openKeys: [] }); } else if (prevOpenKeys) { this.store.setState({ openKeys: prevOpenKeys }); this.prevOpenKeys = null; } } }, { key: "getRealMenuMode", value: function getRealMenuMode() { var mode = this.props.mode; var switchingModeFromInline = this.state.switchingModeFromInline; var inlineCollapsed = this.getInlineCollapsed(); if (switchingModeFromInline && inlineCollapsed) { return 'inline'; } return inlineCollapsed ? 'vertical' : mode; } }, { key: "getInlineCollapsed", value: function getInlineCollapsed() { var _this$props2 = this.props, inlineCollapsed = _this$props2.inlineCollapsed, siderCollapsed = _this$props2.siderCollapsed; if (siderCollapsed !== undefined) { return siderCollapsed; } return inlineCollapsed; } }, { key: "restoreModeVerticalFromInline", value: function restoreModeVerticalFromInline() { var switchingModeFromInline = this.state.switchingModeFromInline; if (switchingModeFromInline) { this.setState({ switchingModeFromInline: false }); } } }, { key: "updateMiniStore", value: function updateMiniStore() { if ('selectedKeys' in this.props) { this.store.setState({ selectedKeys: this.props.selectedKeys || [] }); } if ('openKeys' in this.props) { this.store.setState({ openKeys: this.props.openKeys || [] }); } } }, { key: "render", value: function render() { var props = Object(objectSpread2["a" /* default */])({}, Object(omit["a" /* default */])(this.props, ['collapsedWidth', 'siderCollapsed', 'defaultMotions'])); var mode = this.getRealMenuMode(); props.className += " ".concat(props.prefixCls, "-root"); if (props.direction === 'rtl') { props.className += " ".concat(props.prefixCls, "-rtl"); } props = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props), {}, { mode: mode, onClick: this.onClick, onOpenChange: this.onOpenChange, onDeselect: this.onDeselect, onSelect: this.onSelect, onMouseEnter: this.onMouseEnter, onTransitionEnd: this.onTransitionEnd, parentMenu: this, motion: legacyUtil_getMotion(this.props, this.state, mode) }); delete props.openAnimation; delete props.openTransitionName; return /*#__PURE__*/external_window_React_["createElement"](esm["a" /* Provider */], { store: this.store }, /*#__PURE__*/external_window_React_["createElement"](es_SubPopupMenu, Object(esm_extends["a" /* default */])({}, props, { ref: this.setInnerMenu }), this.props.children)); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(nextProps, prevState) { var prevProps = prevState.prevProps, store = prevState.store; var prevStoreState = store.getState(); var newStoreState = {}; var newState = { prevProps: nextProps }; if (prevProps.mode === 'inline' && nextProps.mode !== 'inline') { newState.switchingModeFromInline = true; } if ('openKeys' in nextProps) { newStoreState.openKeys = nextProps.openKeys || []; } else { // [Legacy] Old code will return after `openKeys` changed. // Not sure the reason, we should keep this logic still. if (nextProps.inlineCollapsed && !prevProps.inlineCollapsed || nextProps.siderCollapsed && !prevProps.siderCollapsed) { newState.switchingModeFromInline = true; newState.inlineOpenKeys = prevStoreState.openKeys; newStoreState.openKeys = []; } if (!nextProps.inlineCollapsed && prevProps.inlineCollapsed || !nextProps.siderCollapsed && prevProps.siderCollapsed) { newStoreState.openKeys = prevState.inlineOpenKeys; newState.inlineOpenKeys = []; } } if (Object.keys(newStoreState).length) { store.setState(newStoreState); } return newState; } }]); return Menu; }(external_window_React_["Component"]); Menu_Menu.defaultProps = { selectable: true, onClick: noop, onSelect: noop, onOpenChange: noop, onDeselect: noop, defaultSelectedKeys: [], defaultOpenKeys: [], subMenuOpenDelay: 0.1, subMenuCloseDelay: 0.1, triggerSubMenuAction: 'hover', prefixCls: 'rc-menu', className: '', mode: 'vertical', style: {}, builtinPlacements: {}, overflowedIndicator: /*#__PURE__*/external_window_React_["createElement"]("span", null, "\xB7\xB7\xB7") }; /* harmony default export */ var es_Menu = (Menu_Menu); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/MenuItem.js var MenuItem_MenuItem = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(MenuItem, _React$Component); var _super = Object(createSuper["a" /* default */])(MenuItem); function MenuItem() { var _this; Object(classCallCheck["a" /* default */])(this, MenuItem); _this = _super.apply(this, arguments); _this.onKeyDown = function (e) { var keyCode = e.keyCode; if (keyCode === KeyCode["a" /* default */].ENTER) { _this.onClick(e); return true; } return undefined; }; _this.onMouseLeave = function (e) { var _this$props = _this.props, eventKey = _this$props.eventKey, onItemHover = _this$props.onItemHover, onMouseLeave = _this$props.onMouseLeave; onItemHover({ key: eventKey, hover: false }); onMouseLeave({ key: eventKey, domEvent: e }); }; _this.onMouseEnter = function (e) { var _this$props2 = _this.props, eventKey = _this$props2.eventKey, onItemHover = _this$props2.onItemHover, onMouseEnter = _this$props2.onMouseEnter; onItemHover({ key: eventKey, hover: true }); onMouseEnter({ key: eventKey, domEvent: e }); }; _this.onClick = function (e) { var _this$props3 = _this.props, eventKey = _this$props3.eventKey, multiple = _this$props3.multiple, onClick = _this$props3.onClick, onSelect = _this$props3.onSelect, onDeselect = _this$props3.onDeselect, isSelected = _this$props3.isSelected; var info = { key: eventKey, keyPath: [eventKey], item: Object(assertThisInitialized["a" /* default */])(_this), domEvent: e }; onClick(info); if (multiple) { if (isSelected) { onDeselect(info); } else { onSelect(info); } } else if (!isSelected) { onSelect(info); } }; _this.saveNode = function (node) { _this.node = node; }; return _this; } Object(createClass["a" /* default */])(MenuItem, [{ key: "componentDidMount", value: function componentDidMount() { // invoke customized ref to expose component to mixin this.callRef(); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { this.callRef(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { var props = this.props; if (props.onDestroy) { props.onDestroy(props.eventKey); } } }, { key: "getPrefixCls", value: function getPrefixCls() { return "".concat(this.props.rootPrefixCls, "-item"); } }, { key: "getActiveClassName", value: function getActiveClassName() { return "".concat(this.getPrefixCls(), "-active"); } }, { key: "getSelectedClassName", value: function getSelectedClassName() { return "".concat(this.getPrefixCls(), "-selected"); } }, { key: "getDisabledClassName", value: function getDisabledClassName() { return "".concat(this.getPrefixCls(), "-disabled"); } }, { key: "callRef", value: function callRef() { if (this.props.manualRef) { this.props.manualRef(this); } } }, { key: "render", value: function render() { var _classNames; var props = Object(objectSpread2["a" /* default */])({}, this.props); var className = classnames_default()(this.getPrefixCls(), props.className, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, this.getActiveClassName(), !props.disabled && props.active), Object(defineProperty["a" /* default */])(_classNames, this.getSelectedClassName(), props.isSelected), Object(defineProperty["a" /* default */])(_classNames, this.getDisabledClassName(), props.disabled), _classNames)); var attrs = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props.attribute), {}, { title: typeof props.title === 'string' ? props.title : undefined, className: className, // set to menuitem by default role: props.role || 'menuitem', 'aria-disabled': props.disabled }); if (props.role === 'option') { // overwrite to option attrs = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, attrs), {}, { role: 'option', 'aria-selected': props.isSelected }); } else if (props.role === null || props.role === 'none') { // sometimes we want to specify role inside
  • element //
  • Link
  • would be a good example // in this case the role on
  • should be "none" to // remove the implied listitem role. // https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html attrs.role = 'none'; } // In case that onClick/onMouseLeave/onMouseEnter is passed down from owner var mouseEvent = { onClick: props.disabled ? null : this.onClick, onMouseLeave: props.disabled ? null : this.onMouseLeave, onMouseEnter: props.disabled ? null : this.onMouseEnter }; var style = Object(objectSpread2["a" /* default */])({}, props.style); if (props.mode === 'inline') { if (props.direction === 'rtl') { style.paddingRight = props.inlineIndent * props.level; } else { style.paddingLeft = props.inlineIndent * props.level; } } menuAllProps.forEach(function (key) { return delete props[key]; }); delete props.direction; var icon = this.props.itemIcon; if (typeof this.props.itemIcon === 'function') { // TODO: This is a bug which should fixed after TS refactor icon = /*#__PURE__*/external_window_React_["createElement"](this.props.itemIcon, this.props); } return /*#__PURE__*/external_window_React_["createElement"]("li", Object(esm_extends["a" /* default */])({}, Object(omit["a" /* default */])(props, ['onClick', 'onMouseEnter', 'onMouseLeave', 'onSelect']), attrs, mouseEvent, { style: style, ref: this.saveNode }), props.children, icon); } }]); return MenuItem; }(external_window_React_["Component"]); MenuItem_MenuItem.isMenuItem = true; MenuItem_MenuItem.defaultProps = { onSelect: noop, onMouseEnter: noop, onMouseLeave: noop, manualRef: noop }; var MenuItem_connected = Object(esm["b" /* connect */])(function (_ref, _ref2) { var activeKey = _ref.activeKey, selectedKeys = _ref.selectedKeys; var eventKey = _ref2.eventKey, subMenuKey = _ref2.subMenuKey; return { active: activeKey[subMenuKey] === eventKey, // selectedKeys should be array in any circumstance // when it is not, we have fallback logic for https://github.com/ant-design/ant-design/issues/29430 isSelected: Array.isArray(selectedKeys) ? selectedKeys.indexOf(eventKey) !== -1 : selectedKeys === eventKey }; })(MenuItem_MenuItem); /* harmony default export */ var es_MenuItem = (MenuItem_connected); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/MenuItemGroup.js var MenuItemGroup_MenuItemGroup = /*#__PURE__*/function (_React$Component) { Object(inherits["a" /* default */])(MenuItemGroup, _React$Component); var _super = Object(createSuper["a" /* default */])(MenuItemGroup); function MenuItemGroup() { var _this; Object(classCallCheck["a" /* default */])(this, MenuItemGroup); _this = _super.apply(this, arguments); _this.renderInnerMenuItem = function (item) { var _this$props = _this.props, renderMenuItem = _this$props.renderMenuItem, index = _this$props.index; return renderMenuItem(item, index, _this.props.subMenuKey); }; return _this; } Object(createClass["a" /* default */])(MenuItemGroup, [{ key: "render", value: function render() { var props = Object(esm_extends["a" /* default */])({}, this.props); var _props$className = props.className, className = _props$className === void 0 ? '' : _props$className, rootPrefixCls = props.rootPrefixCls; var titleClassName = "".concat(rootPrefixCls, "-item-group-title"); var listClassName = "".concat(rootPrefixCls, "-item-group-list"); var title = props.title, children = props.children; menuAllProps.forEach(function (key) { return delete props[key]; }); delete props.direction; return /*#__PURE__*/external_window_React_["createElement"]("li", Object(esm_extends["a" /* default */])({}, props, { onClick: function onClick(e) { return e.stopPropagation(); }, className: "".concat(className, " ").concat(rootPrefixCls, "-item-group") }), /*#__PURE__*/external_window_React_["createElement"]("div", { className: titleClassName, title: typeof title === 'string' ? title : undefined }, title), /*#__PURE__*/external_window_React_["createElement"]("ul", { className: listClassName }, external_window_React_["Children"].map(children, this.renderInnerMenuItem))); } }]); return MenuItemGroup; }(external_window_React_["Component"]); MenuItemGroup_MenuItemGroup.isMenuItemGroup = true; MenuItemGroup_MenuItemGroup.defaultProps = { disabled: true }; /* harmony default export */ var es_MenuItemGroup = (MenuItemGroup_MenuItemGroup); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/Divider.js var Divider_Divider = function Divider(_ref) { var className = _ref.className, rootPrefixCls = _ref.rootPrefixCls, style = _ref.style; return /*#__PURE__*/external_window_React_["createElement"]("li", { className: "".concat(className, " ").concat(rootPrefixCls, "-item-divider"), style: style }); }; Divider_Divider.defaultProps = { // To fix keyboard UX. disabled: true, className: '', style: {} }; /* harmony default export */ var es_Divider = (Divider_Divider); // CONCATENATED MODULE: ./node_modules/rc-tabs/node_modules/rc-menu/es/index.js /* harmony default export */ var rc_menu_es = (es_Menu); // EXTERNAL MODULE: ./node_modules/rc-dropdown/es/index.js + 2 modules var rc_dropdown_es = __webpack_require__("eDIo"); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/AddButton.js function AddButton(_ref, ref) { var prefixCls = _ref.prefixCls, editable = _ref.editable, locale = _ref.locale, style = _ref.style; if (!editable || editable.showAdd === false) { return null; } return external_window_React_["createElement"]("button", { ref: ref, type: "button", className: "".concat(prefixCls, "-nav-add"), style: style, "aria-label": (locale === null || locale === void 0 ? void 0 : locale.addAriaLabel) || 'Add tab', onClick: function onClick(event) { editable.onEdit('add', { event: event }); } }, editable.addIcon || '+'); } /* harmony default export */ var TabNavList_AddButton = (external_window_React_["forwardRef"](AddButton)); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/OperationNode.js function OperationNode(_ref, ref) { var prefixCls = _ref.prefixCls, id = _ref.id, tabs = _ref.tabs, locale = _ref.locale, mobile = _ref.mobile, _ref$moreIcon = _ref.moreIcon, moreIcon = _ref$moreIcon === void 0 ? 'More' : _ref$moreIcon, moreTransitionName = _ref.moreTransitionName, style = _ref.style, className = _ref.className, editable = _ref.editable, tabBarGutter = _ref.tabBarGutter, rtl = _ref.rtl, onTabClick = _ref.onTabClick; // ======================== Dropdown ======================== var _useState = Object(external_window_React_["useState"])(false), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), open = _useState2[0], setOpen = _useState2[1]; var _useState3 = Object(external_window_React_["useState"])(null), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), selectedKey = _useState4[0], setSelectedKey = _useState4[1]; var popupId = "".concat(id, "-more-popup"); var dropdownPrefix = "".concat(prefixCls, "-dropdown"); var selectedItemId = selectedKey !== null ? "".concat(popupId, "-").concat(selectedKey) : null; var dropdownAriaLabel = locale === null || locale === void 0 ? void 0 : locale.dropdownAriaLabel; var menu = external_window_React_["createElement"](rc_menu_es, { onClick: function onClick(_ref2) { var key = _ref2.key, domEvent = _ref2.domEvent; onTabClick(key, domEvent); setOpen(false); }, id: popupId, tabIndex: -1, role: "listbox", "aria-activedescendant": selectedItemId, selectedKeys: [selectedKey], "aria-label": dropdownAriaLabel !== undefined ? dropdownAriaLabel : 'expanded dropdown' }, tabs.map(function (tab) { return external_window_React_["createElement"](es_MenuItem, { key: tab.key, id: "".concat(popupId, "-").concat(tab.key), role: "option", "aria-controls": id && "".concat(id, "-panel-").concat(tab.key), disabled: tab.disabled }, tab.tab); })); function selectOffset(offset) { var enabledTabs = tabs.filter(function (tab) { return !tab.disabled; }); var selectedIndex = enabledTabs.findIndex(function (tab) { return tab.key === selectedKey; }) || 0; var len = enabledTabs.length; for (var i = 0; i < len; i += 1) { selectedIndex = (selectedIndex + offset + len) % len; var tab = enabledTabs[selectedIndex]; if (!tab.disabled) { setSelectedKey(tab.key); return; } } } function onKeyDown(e) { var which = e.which; if (!open) { if ([KeyCode["a" /* default */].DOWN, KeyCode["a" /* default */].SPACE, KeyCode["a" /* default */].ENTER].includes(which)) { setOpen(true); e.preventDefault(); } return; } switch (which) { case KeyCode["a" /* default */].UP: selectOffset(-1); e.preventDefault(); break; case KeyCode["a" /* default */].DOWN: selectOffset(1); e.preventDefault(); break; case KeyCode["a" /* default */].ESC: setOpen(false); break; case KeyCode["a" /* default */].SPACE: case KeyCode["a" /* default */].ENTER: if (selectedKey !== null) onTabClick(selectedKey, e); break; } } // ========================= Effect ========================= Object(external_window_React_["useEffect"])(function () { // We use query element here to avoid React strict warning var ele = document.getElementById(selectedItemId); if (ele && ele.scrollIntoView) { ele.scrollIntoView(false); } }, [selectedKey]); Object(external_window_React_["useEffect"])(function () { if (!open) { setSelectedKey(null); } }, [open]); // ========================= Render ========================= var moreStyle = Object(defineProperty["a" /* default */])({}, rtl ? 'marginLeft' : 'marginRight', tabBarGutter); if (!tabs.length) { moreStyle.visibility = 'hidden'; moreStyle.order = 1; } var overlayClassName = classnames_default()(Object(defineProperty["a" /* default */])({}, "".concat(dropdownPrefix, "-rtl"), rtl)); var moreNode = mobile ? null : external_window_React_["createElement"](rc_dropdown_es["a" /* default */], { prefixCls: dropdownPrefix, overlay: menu, trigger: ['hover'], visible: open, transitionName: moreTransitionName, onVisibleChange: setOpen, overlayClassName: overlayClassName, mouseEnterDelay: 0.1, mouseLeaveDelay: 0.1 }, external_window_React_["createElement"]("button", { type: "button", className: "".concat(prefixCls, "-nav-more"), style: moreStyle, tabIndex: -1, "aria-hidden": "true", "aria-haspopup": "listbox", "aria-controls": popupId, id: "".concat(id, "-more"), "aria-expanded": open, onKeyDown: onKeyDown }, moreIcon)); return external_window_React_["createElement"]("div", { className: classnames_default()("".concat(prefixCls, "-nav-operations"), className), style: style, ref: ref }, moreNode, external_window_React_["createElement"](TabNavList_AddButton, { prefixCls: prefixCls, locale: locale, editable: editable })); } /* harmony default export */ var TabNavList_OperationNode = (external_window_React_["forwardRef"](OperationNode)); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabContext.js /* harmony default export */ var TabContext = (Object(external_window_React_["createContext"])(null)); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useTouchMove.js var MIN_SWIPE_DISTANCE = 0.1; var STOP_SWIPE_DISTANCE = 0.01; var REFRESH_INTERVAL = 20; var SPEED_OFF_MULTIPLE = Math.pow(0.995, REFRESH_INTERVAL); // ========================= Check if is a mobile ========================= function useTouchMove_isMobile() { var agent = navigator.userAgent || navigator.vendor || window.opera; if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent.substr(0, 4))) { return true; } return false; } // ================================= Hook ================================= function useTouchMove(ref, onOffset) { var _useState = Object(external_window_React_["useState"])(), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), touchPosition = _useState2[0], setTouchPosition = _useState2[1]; var _useState3 = Object(external_window_React_["useState"])(0), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), lastTimestamp = _useState4[0], setLastTimestamp = _useState4[1]; var _useState5 = Object(external_window_React_["useState"])(0), _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), lastTimeDiff = _useState6[0], setLastTimeDiff = _useState6[1]; var _useState7 = Object(external_window_React_["useState"])(), _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), lastOffset = _useState8[0], setLastOffset = _useState8[1]; var motionRef = Object(external_window_React_["useRef"])(); // ========================= Events ========================= // >>> Touch events function onTouchStart(e) { var _e$touches$ = e.touches[0], screenX = _e$touches$.screenX, screenY = _e$touches$.screenY; setTouchPosition({ x: screenX, y: screenY }); window.clearInterval(motionRef.current); } function onTouchMove(e) { if (!touchPosition) return; e.preventDefault(); var _e$touches$2 = e.touches[0], screenX = _e$touches$2.screenX, screenY = _e$touches$2.screenY; setTouchPosition({ x: screenX, y: screenY }); var offsetX = screenX - touchPosition.x; var offsetY = screenY - touchPosition.y; onOffset(offsetX, offsetY); var now = Date.now(); setLastTimestamp(now); setLastTimeDiff(now - lastTimestamp); setLastOffset({ x: offsetX, y: offsetY }); } function onTouchEnd() { if (!touchPosition) return; setTouchPosition(null); setLastOffset(null); // Swipe if needed if (lastOffset) { var distanceX = lastOffset.x / lastTimeDiff; var distanceY = lastOffset.y / lastTimeDiff; var absX = Math.abs(distanceX); var absY = Math.abs(distanceY); // Skip swipe if low distance if (Math.max(absX, absY) < MIN_SWIPE_DISTANCE) return; var currentX = distanceX; var currentY = distanceY; motionRef.current = window.setInterval(function () { if (Math.abs(currentX) < STOP_SWIPE_DISTANCE && Math.abs(currentY) < STOP_SWIPE_DISTANCE) { window.clearInterval(motionRef.current); return; } currentX *= SPEED_OFF_MULTIPLE; currentY *= SPEED_OFF_MULTIPLE; onOffset(currentX * REFRESH_INTERVAL, currentY * REFRESH_INTERVAL); }, REFRESH_INTERVAL); } } // >>> Wheel event var lastWheelTimestampRef = Object(external_window_React_["useRef"])(0); var lastWheelPreventRef = Object(external_window_React_["useRef"])(false); var lastWheelDirectionRef = Object(external_window_React_["useRef"])(); function onWheel(e) { var deltaX = e.deltaX, deltaY = e.deltaY; // Convert both to x & y since wheel only happened on PC var mixed = 0; var absX = Math.abs(deltaX); var absY = Math.abs(deltaY); if (absX === absY) { mixed = lastWheelDirectionRef.current === 'x' ? deltaX : deltaY; } else if (absX > absY) { mixed = deltaX; lastWheelDirectionRef.current = 'x'; } else { mixed = deltaY; lastWheelDirectionRef.current = 'y'; } // Optimize mac touch scroll var now = Date.now(); if (now - lastWheelTimestampRef.current > 100) { lastWheelPreventRef.current = false; } if (onOffset(-mixed, -mixed) || lastWheelPreventRef.current) { e.preventDefault(); lastWheelPreventRef.current = true; } lastWheelTimestampRef.current = now; } // ========================= Effect ========================= var touchEventsRef = Object(external_window_React_["useRef"])(null); touchEventsRef.current = { onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, onWheel: onWheel }; external_window_React_["useEffect"](function () { function onProxyTouchStart(e) { touchEventsRef.current.onTouchStart(e); } function onProxyTouchMove(e) { touchEventsRef.current.onTouchMove(e); } function onProxyTouchEnd(e) { touchEventsRef.current.onTouchEnd(e); } function onProxyWheel(e) { touchEventsRef.current.onWheel(e); } document.addEventListener('touchmove', onProxyTouchMove, { passive: false }); document.addEventListener('touchend', onProxyTouchEnd, { passive: false }); // No need to clean up since element removed ref.current.addEventListener('touchstart', onProxyTouchStart, { passive: false }); ref.current.addEventListener('wheel', onProxyWheel); return function () { document.removeEventListener('touchmove', onProxyTouchMove); document.removeEventListener('touchend', onProxyTouchEnd); }; }, []); } // CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useRefs.js function useRefs() { var cacheRefs = Object(external_window_React_["useRef"])(new Map()); function getRef(key) { if (!cacheRefs.current.has(key)) { cacheRefs.current.set(key, external_window_React_["createRef"]()); } return cacheRefs.current.get(key); } function removeRef(key) { cacheRefs.current.delete(key); } return [getRef, removeRef]; } // CONCATENATED MODULE: ./node_modules/rc-tabs/es/hooks/useSyncState.js function useSyncState(defaultState, onChange) { var stateRef = external_window_React_["useRef"](defaultState); var _React$useState = external_window_React_["useState"]({}), _React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2), forceUpdate = _React$useState2[1]; function setState(updater) { var newValue = typeof updater === 'function' ? updater(stateRef.current) : updater; if (newValue !== stateRef.current) { onChange(newValue, stateRef.current); } stateRef.current = newValue; forceUpdate({}); } return [stateRef.current, setState]; } // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabNavList/index.js var TabNavList_ExtraContent = function ExtraContent(_ref) { var position = _ref.position, prefixCls = _ref.prefixCls, extra = _ref.extra; if (!extra) return null; var content; var assertExtra = extra; if (position === 'right') { content = assertExtra.right || !assertExtra.left && assertExtra || null; } if (position === 'left') { content = assertExtra.left || null; } return content ? external_window_React_["createElement"]("div", { className: "".concat(prefixCls, "-extra-content") }, content) : null; }; function TabNavList(props, ref) { var _classNames; var _React$useContext = external_window_React_["useContext"](TabContext), prefixCls = _React$useContext.prefixCls, tabs = _React$useContext.tabs; var className = props.className, style = props.style, id = props.id, animated = props.animated, activeKey = props.activeKey, rtl = props.rtl, extra = props.extra, editable = props.editable, locale = props.locale, tabPosition = props.tabPosition, tabBarGutter = props.tabBarGutter, children = props.children, onTabClick = props.onTabClick, onTabScroll = props.onTabScroll; var tabsWrapperRef = Object(external_window_React_["useRef"])(); var tabListRef = Object(external_window_React_["useRef"])(); var operationsRef = Object(external_window_React_["useRef"])(); var innerAddButtonRef = Object(external_window_React_["useRef"])(); var _useRefs = useRefs(), _useRefs2 = Object(slicedToArray["a" /* default */])(_useRefs, 2), getBtnRef = _useRefs2[0], removeBtnRef = _useRefs2[1]; var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom'; var _useSyncState = useSyncState(0, function (next, prev) { if (tabPositionTopOrBottom && onTabScroll) { onTabScroll({ direction: next > prev ? 'left' : 'right' }); } }), _useSyncState2 = Object(slicedToArray["a" /* default */])(_useSyncState, 2), transformLeft = _useSyncState2[0], setTransformLeft = _useSyncState2[1]; var _useSyncState3 = useSyncState(0, function (next, prev) { if (!tabPositionTopOrBottom && onTabScroll) { onTabScroll({ direction: next > prev ? 'top' : 'bottom' }); } }), _useSyncState4 = Object(slicedToArray["a" /* default */])(_useSyncState3, 2), transformTop = _useSyncState4[0], setTransformTop = _useSyncState4[1]; var _useState = Object(external_window_React_["useState"])(0), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), wrapperScrollWidth = _useState2[0], setWrapperScrollWidth = _useState2[1]; var _useState3 = Object(external_window_React_["useState"])(0), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), wrapperScrollHeight = _useState4[0], setWrapperScrollHeight = _useState4[1]; var _useState5 = Object(external_window_React_["useState"])(0), _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), wrapperContentWidth = _useState6[0], setWrapperContentWidth = _useState6[1]; var _useState7 = Object(external_window_React_["useState"])(0), _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), wrapperContentHeight = _useState8[0], setWrapperContentHeight = _useState8[1]; var _useState9 = Object(external_window_React_["useState"])(null), _useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2), wrapperWidth = _useState10[0], setWrapperWidth = _useState10[1]; var _useState11 = Object(external_window_React_["useState"])(null), _useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2), wrapperHeight = _useState12[0], setWrapperHeight = _useState12[1]; var _useState13 = Object(external_window_React_["useState"])(0), _useState14 = Object(slicedToArray["a" /* default */])(_useState13, 2), addWidth = _useState14[0], setAddWidth = _useState14[1]; var _useState15 = Object(external_window_React_["useState"])(0), _useState16 = Object(slicedToArray["a" /* default */])(_useState15, 2), addHeight = _useState16[0], setAddHeight = _useState16[1]; var _useRafState = useRafState(new Map()), _useRafState2 = Object(slicedToArray["a" /* default */])(_useRafState, 2), tabSizes = _useRafState2[0], setTabSizes = _useRafState2[1]; var tabOffsets = useOffsets(tabs, tabSizes, wrapperScrollWidth); // ========================== Util ========================= var operationsHiddenClassName = "".concat(prefixCls, "-nav-operations-hidden"); var transformMin = 0; var transformMax = 0; if (!tabPositionTopOrBottom) { transformMin = Math.min(0, wrapperHeight - wrapperScrollHeight); transformMax = 0; } else if (rtl) { transformMin = 0; transformMax = Math.max(0, wrapperScrollWidth - wrapperWidth); } else { transformMin = Math.min(0, wrapperWidth - wrapperScrollWidth); transformMax = 0; } function alignInRange(value) { if (value < transformMin) { return [transformMin, false]; } if (value > transformMax) { return [transformMax, false]; } return [value, true]; } // ========================= Mobile ======================== var touchMovingRef = Object(external_window_React_["useRef"])(); var _useState17 = Object(external_window_React_["useState"])(), _useState18 = Object(slicedToArray["a" /* default */])(_useState17, 2), lockAnimation = _useState18[0], setLockAnimation = _useState18[1]; function doLockAnimation() { setLockAnimation(Date.now()); } function clearTouchMoving() { window.clearTimeout(touchMovingRef.current); } useTouchMove(tabsWrapperRef, function (offsetX, offsetY) { var preventDefault = false; function doMove(setState, offset) { setState(function (value) { var _alignInRange = alignInRange(value + offset), _alignInRange2 = Object(slicedToArray["a" /* default */])(_alignInRange, 2), newValue = _alignInRange2[0], needPrevent = _alignInRange2[1]; preventDefault = needPrevent; return newValue; }); } if (tabPositionTopOrBottom) { // Skip scroll if place is enough if (wrapperWidth >= wrapperScrollWidth) { return preventDefault; } doMove(setTransformLeft, offsetX); } else { if (wrapperHeight >= wrapperScrollHeight) { return preventDefault; } doMove(setTransformTop, offsetY); } clearTouchMoving(); doLockAnimation(); return preventDefault; }); Object(external_window_React_["useEffect"])(function () { clearTouchMoving(); if (lockAnimation) { touchMovingRef.current = window.setTimeout(function () { setLockAnimation(0); }, 100); } return clearTouchMoving; }, [lockAnimation]); // ========================= Scroll ======================== function scrollToTab() { var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey; var tabOffset = tabOffsets.get(key); if (!tabOffset) return; if (tabPositionTopOrBottom) { // ============ Align with top & bottom ============ var newTransform = transformLeft; // RTL if (rtl) { if (tabOffset.right < transformLeft) { newTransform = tabOffset.right; } else if (tabOffset.right + tabOffset.width > transformLeft + wrapperWidth) { newTransform = tabOffset.right + tabOffset.width - wrapperWidth; } } // LTR else if (tabOffset.left < -transformLeft) { newTransform = -tabOffset.left; } else if (tabOffset.left + tabOffset.width > -transformLeft + wrapperWidth) { newTransform = -(tabOffset.left + tabOffset.width - wrapperWidth); } setTransformTop(0); setTransformLeft(alignInRange(newTransform)[0]); } else { // ============ Align with left & right ============ var _newTransform = transformTop; if (tabOffset.top < -transformTop) { _newTransform = -tabOffset.top; } else if (tabOffset.top + tabOffset.height > -transformTop + wrapperHeight) { _newTransform = -(tabOffset.top + tabOffset.height - wrapperHeight); } setTransformLeft(0); setTransformTop(alignInRange(_newTransform)[0]); } } // ========================== Tab ========================== // Render tab node & collect tab offset var _useVisibleRange = useVisibleRange(tabOffsets, { width: wrapperWidth, height: wrapperHeight, left: transformLeft, top: transformTop }, { width: wrapperContentWidth, height: wrapperContentHeight }, { width: addWidth, height: addHeight }, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, props), {}, { tabs: tabs })), _useVisibleRange2 = Object(slicedToArray["a" /* default */])(_useVisibleRange, 2), visibleStart = _useVisibleRange2[0], visibleEnd = _useVisibleRange2[1]; var tabNodes = tabs.map(function (tab) { var key = tab.key; return external_window_React_["createElement"](TabNavList_TabNode, { id: id, prefixCls: prefixCls, key: key, rtl: rtl, tab: tab, closable: tab.closable, editable: editable, active: key === activeKey, tabPosition: tabPosition, tabBarGutter: tabBarGutter, renderWrapper: children, removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel, ref: getBtnRef(key), onClick: function onClick(e) { onTabClick(key, e); }, onRemove: function onRemove() { removeBtnRef(key); }, onFocus: function onFocus() { scrollToTab(key); doLockAnimation(); // Focus element will make scrollLeft change which we should reset back if (!rtl) { tabsWrapperRef.current.scrollLeft = 0; } tabsWrapperRef.current.scrollTop = 0; } }); }); var onListHolderResize = useRaf(function () { var _tabsWrapperRef$curre, _tabsWrapperRef$curre2, _innerAddButtonRef$cu, _innerAddButtonRef$cu2, _operationsRef$curren, _operationsRef$curren2, _tabListRef$current, _tabListRef$current2, _operationsRef$curren3; // Update wrapper records var offsetWidth = ((_tabsWrapperRef$curre = tabsWrapperRef.current) === null || _tabsWrapperRef$curre === void 0 ? void 0 : _tabsWrapperRef$curre.offsetWidth) || 0; var offsetHeight = ((_tabsWrapperRef$curre2 = tabsWrapperRef.current) === null || _tabsWrapperRef$curre2 === void 0 ? void 0 : _tabsWrapperRef$curre2.offsetHeight) || 0; var newAddWidth = ((_innerAddButtonRef$cu = innerAddButtonRef.current) === null || _innerAddButtonRef$cu === void 0 ? void 0 : _innerAddButtonRef$cu.offsetWidth) || 0; var newAddHeight = ((_innerAddButtonRef$cu2 = innerAddButtonRef.current) === null || _innerAddButtonRef$cu2 === void 0 ? void 0 : _innerAddButtonRef$cu2.offsetHeight) || 0; var newOperationWidth = ((_operationsRef$curren = operationsRef.current) === null || _operationsRef$curren === void 0 ? void 0 : _operationsRef$curren.offsetWidth) || 0; var newOperationHeight = ((_operationsRef$curren2 = operationsRef.current) === null || _operationsRef$curren2 === void 0 ? void 0 : _operationsRef$curren2.offsetHeight) || 0; setWrapperWidth(offsetWidth); setWrapperHeight(offsetHeight); setAddWidth(newAddWidth); setAddHeight(newAddHeight); var newWrapperScrollWidth = (((_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.offsetWidth) || 0) - newAddWidth; var newWrapperScrollHeight = (((_tabListRef$current2 = tabListRef.current) === null || _tabListRef$current2 === void 0 ? void 0 : _tabListRef$current2.offsetHeight) || 0) - newAddHeight; setWrapperScrollWidth(newWrapperScrollWidth); setWrapperScrollHeight(newWrapperScrollHeight); var isOperationHidden = (_operationsRef$curren3 = operationsRef.current) === null || _operationsRef$curren3 === void 0 ? void 0 : _operationsRef$curren3.className.includes(operationsHiddenClassName); setWrapperContentWidth(newWrapperScrollWidth - (isOperationHidden ? 0 : newOperationWidth)); setWrapperContentHeight(newWrapperScrollHeight - (isOperationHidden ? 0 : newOperationHeight)); // Update buttons records setTabSizes(function () { var newSizes = new Map(); tabs.forEach(function (_ref2) { var key = _ref2.key; var btnNode = getBtnRef(key).current; if (btnNode) { newSizes.set(key, { width: btnNode.offsetWidth, height: btnNode.offsetHeight, left: btnNode.offsetLeft, top: btnNode.offsetTop }); } }); return newSizes; }); }); // ======================== Dropdown ======================= var startHiddenTabs = tabs.slice(0, visibleStart); var endHiddenTabs = tabs.slice(visibleEnd + 1); var hiddenTabs = [].concat(Object(toConsumableArray["a" /* default */])(startHiddenTabs), Object(toConsumableArray["a" /* default */])(endHiddenTabs)); // =================== Link & Operations =================== var _useState19 = Object(external_window_React_["useState"])(), _useState20 = Object(slicedToArray["a" /* default */])(_useState19, 2), inkStyle = _useState20[0], setInkStyle = _useState20[1]; var activeTabOffset = tabOffsets.get(activeKey); // Delay set ink style to avoid remove tab blink var inkBarRafRef = Object(external_window_React_["useRef"])(); function cleanInkBarRaf() { raf_default.a.cancel(inkBarRafRef.current); } Object(external_window_React_["useEffect"])(function () { var newInkStyle = {}; if (activeTabOffset) { if (tabPositionTopOrBottom) { if (rtl) { newInkStyle.right = activeTabOffset.right; } else { newInkStyle.left = activeTabOffset.left; } newInkStyle.width = activeTabOffset.width; } else { newInkStyle.top = activeTabOffset.top; newInkStyle.height = activeTabOffset.height; } } cleanInkBarRaf(); inkBarRafRef.current = raf_default()(function () { setInkStyle(newInkStyle); }); return cleanInkBarRaf; }, [activeTabOffset, tabPositionTopOrBottom, rtl]); // ========================= Effect ======================== Object(external_window_React_["useEffect"])(function () { scrollToTab(); }, [activeKey, activeTabOffset, tabOffsets, tabPositionTopOrBottom]); // Should recalculate when rtl changed Object(external_window_React_["useEffect"])(function () { onListHolderResize(); }, [rtl, tabBarGutter, activeKey, tabs.map(function (tab) { return tab.key; }).join('_')]); // ========================= Render ======================== var hasDropdown = !!hiddenTabs.length; var wrapPrefix = "".concat(prefixCls, "-nav-wrap"); var pingLeft; var pingRight; var pingTop; var pingBottom; if (tabPositionTopOrBottom) { if (rtl) { pingRight = transformLeft > 0; pingLeft = transformLeft + wrapperWidth < wrapperScrollWidth; } else { pingLeft = transformLeft < 0; pingRight = -transformLeft + wrapperWidth < wrapperScrollWidth; } } else { pingTop = transformTop < 0; pingBottom = -transformTop + wrapperHeight < wrapperScrollHeight; } /* eslint-disable jsx-a11y/interactive-supports-focus */ return external_window_React_["createElement"]("div", { ref: ref, role: "tablist", className: classnames_default()("".concat(prefixCls, "-nav"), className), style: style, onKeyDown: function onKeyDown() { // No need animation when use keyboard doLockAnimation(); } }, external_window_React_["createElement"](TabNavList_ExtraContent, { position: "left", extra: extra, prefixCls: prefixCls }), external_window_React_["createElement"](es["a" /* default */], { onResize: onListHolderResize }, external_window_React_["createElement"]("div", { className: classnames_default()(wrapPrefix, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-left"), pingLeft), Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-right"), pingRight), Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-top"), pingTop), Object(defineProperty["a" /* default */])(_classNames, "".concat(wrapPrefix, "-ping-bottom"), pingBottom), _classNames)), ref: tabsWrapperRef }, external_window_React_["createElement"](es["a" /* default */], { onResize: onListHolderResize }, external_window_React_["createElement"]("div", { ref: tabListRef, className: "".concat(prefixCls, "-nav-list"), style: { transform: "translate(".concat(transformLeft, "px, ").concat(transformTop, "px)"), transition: lockAnimation ? 'none' : undefined } }, tabNodes, external_window_React_["createElement"](TabNavList_AddButton, { ref: innerAddButtonRef, prefixCls: prefixCls, locale: locale, editable: editable, style: { visibility: hasDropdown ? 'hidden' : null } }), external_window_React_["createElement"]("div", { className: classnames_default()("".concat(prefixCls, "-ink-bar"), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-ink-bar-animated"), animated.inkBar)), style: inkStyle }))))), external_window_React_["createElement"](TabNavList_OperationNode, Object.assign({}, props, { ref: operationsRef, prefixCls: prefixCls, tabs: hiddenTabs, className: !hasDropdown && operationsHiddenClassName })), external_window_React_["createElement"](TabNavList_ExtraContent, { position: "right", extra: extra, prefixCls: prefixCls })); /* eslint-enable */ } /* harmony default export */ var es_TabNavList = (external_window_React_["forwardRef"](TabNavList)); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabPanelList/index.js function TabPanelList(_ref) { var id = _ref.id, activeKey = _ref.activeKey, animated = _ref.animated, tabPosition = _ref.tabPosition, rtl = _ref.rtl, destroyInactiveTabPane = _ref.destroyInactiveTabPane; var _React$useContext = external_window_React_["useContext"](TabContext), prefixCls = _React$useContext.prefixCls, tabs = _React$useContext.tabs; var tabPaneAnimated = animated.tabPane; var activeIndex = tabs.findIndex(function (tab) { return tab.key === activeKey; }); return external_window_React_["createElement"]("div", { className: classnames_default()("".concat(prefixCls, "-content-holder")) }, external_window_React_["createElement"]("div", { className: classnames_default()("".concat(prefixCls, "-content"), "".concat(prefixCls, "-content-").concat(tabPosition), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-content-animated"), tabPaneAnimated)), style: activeIndex && tabPaneAnimated ? Object(defineProperty["a" /* default */])({}, rtl ? 'marginRight' : 'marginLeft', "-".concat(activeIndex, "00%")) : null }, tabs.map(function (tab) { return external_window_React_["cloneElement"](tab.node, { key: tab.key, prefixCls: prefixCls, tabKey: tab.key, id: id, animated: tabPaneAnimated, active: tab.key === activeKey, destroyInactiveTabPane: destroyInactiveTabPane }); }))); } // CONCATENATED MODULE: ./node_modules/rc-tabs/es/TabPanelList/TabPane.js function TabPane(_ref) { var prefixCls = _ref.prefixCls, forceRender = _ref.forceRender, className = _ref.className, style = _ref.style, id = _ref.id, active = _ref.active, animated = _ref.animated, destroyInactiveTabPane = _ref.destroyInactiveTabPane, tabKey = _ref.tabKey, children = _ref.children; var _React$useState = external_window_React_["useState"](forceRender), _React$useState2 = Object(slicedToArray["a" /* default */])(_React$useState, 2), visited = _React$useState2[0], setVisited = _React$useState2[1]; external_window_React_["useEffect"](function () { if (active) { setVisited(true); } else if (destroyInactiveTabPane) { setVisited(false); } }, [active, destroyInactiveTabPane]); var mergedStyle = {}; if (!active) { if (animated) { mergedStyle.visibility = 'hidden'; mergedStyle.height = 0; mergedStyle.overflowY = 'hidden'; } else { mergedStyle.display = 'none'; } } return external_window_React_["createElement"]("div", { id: id && "".concat(id, "-panel-").concat(tabKey), role: "tabpanel", tabIndex: active ? 0 : -1, "aria-labelledby": id && "".concat(id, "-tab-").concat(tabKey), "aria-hidden": !active, style: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, mergedStyle), style), className: classnames_default()("".concat(prefixCls, "-tabpane"), active && "".concat(prefixCls, "-tabpane-active"), className) }, (active || visited || forceRender) && children); } // CONCATENATED MODULE: ./node_modules/rc-tabs/es/Tabs.js // Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role /** * Should added antd: * - type * * Removed: * - onNextClick * - onPrevClick * - keyboard */ // Used for accessibility var uuid = 0; function parseTabList(children) { return Object(toArray["a" /* default */])(children).map(function (node) { if (external_window_React_["isValidElement"](node)) { var key = node.key !== undefined ? String(node.key) : undefined; return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({ key: key }, node.props), {}, { node: node }); } return null; }).filter(function (tab) { return tab; }); } function Tabs(_ref, ref) { var _classNames; var id = _ref.id, _ref$prefixCls = _ref.prefixCls, prefixCls = _ref$prefixCls === void 0 ? 'rc-tabs' : _ref$prefixCls, className = _ref.className, children = _ref.children, direction = _ref.direction, activeKey = _ref.activeKey, defaultActiveKey = _ref.defaultActiveKey, editable = _ref.editable, animated = _ref.animated, _ref$tabPosition = _ref.tabPosition, tabPosition = _ref$tabPosition === void 0 ? 'top' : _ref$tabPosition, tabBarGutter = _ref.tabBarGutter, tabBarStyle = _ref.tabBarStyle, tabBarExtraContent = _ref.tabBarExtraContent, locale = _ref.locale, moreIcon = _ref.moreIcon, moreTransitionName = _ref.moreTransitionName, destroyInactiveTabPane = _ref.destroyInactiveTabPane, renderTabBar = _ref.renderTabBar, onChange = _ref.onChange, onTabClick = _ref.onTabClick, onTabScroll = _ref.onTabScroll, restProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["id", "prefixCls", "className", "children", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "moreIcon", "moreTransitionName", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll"]); var tabs = parseTabList(children); var rtl = direction === 'rtl'; var mergedAnimated; if (animated === false) { mergedAnimated = { inkBar: false, tabPane: false }; } else { mergedAnimated = Object(objectSpread2["a" /* default */])({ inkBar: true, tabPane: false }, animated !== true ? animated : null); } // ======================== Mobile ======================== var _useState = Object(external_window_React_["useState"])(false), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), mobile = _useState2[0], setMobile = _useState2[1]; Object(external_window_React_["useEffect"])(function () { // Only update on the client side setMobile(useTouchMove_isMobile()); }, []); // ====================== Active Key ====================== var _useMergedState = Object(useMergedState["a" /* default */])(function () { var _tabs$; return (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key; }, { value: activeKey, defaultValue: defaultActiveKey }), _useMergedState2 = Object(slicedToArray["a" /* default */])(_useMergedState, 2), mergedActiveKey = _useMergedState2[0], setMergedActiveKey = _useMergedState2[1]; var _useState3 = Object(external_window_React_["useState"])(function () { return tabs.findIndex(function (tab) { return tab.key === mergedActiveKey; }); }), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), activeIndex = _useState4[0], setActiveIndex = _useState4[1]; // Reset active key if not exist anymore Object(external_window_React_["useEffect"])(function () { var newActiveIndex = tabs.findIndex(function (tab) { return tab.key === mergedActiveKey; }); if (newActiveIndex === -1) { var _tabs$newActiveIndex; newActiveIndex = Math.max(0, Math.min(activeIndex, tabs.length - 1)); setMergedActiveKey((_tabs$newActiveIndex = tabs[newActiveIndex]) === null || _tabs$newActiveIndex === void 0 ? void 0 : _tabs$newActiveIndex.key); } setActiveIndex(newActiveIndex); }, [tabs.map(function (tab) { return tab.key; }).join('_'), mergedActiveKey, activeIndex]); // ===================== Accessibility ==================== var _useMergedState3 = Object(useMergedState["a" /* default */])(null, { value: id }), _useMergedState4 = Object(slicedToArray["a" /* default */])(_useMergedState3, 2), mergedId = _useMergedState4[0], setMergedId = _useMergedState4[1]; var mergedTabPosition = tabPosition; if (mobile && !['left', 'right'].includes(tabPosition)) { mergedTabPosition = 'top'; } // Async generate id to avoid ssr mapping failed Object(external_window_React_["useEffect"])(function () { if (!id) { setMergedId("rc-tabs-".concat( false ? undefined : uuid)); uuid += 1; } }, []); // ======================== Events ======================== function onInternalTabClick(key, e) { onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(key, e); setMergedActiveKey(key); onChange === null || onChange === void 0 ? void 0 : onChange(key); } // ======================== Render ======================== var sharedProps = { id: mergedId, activeKey: mergedActiveKey, animated: mergedAnimated, tabPosition: mergedTabPosition, rtl: rtl, mobile: mobile }; var tabNavBar; var tabNavBarProps = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, sharedProps), {}, { editable: editable, locale: locale, moreIcon: moreIcon, moreTransitionName: moreTransitionName, tabBarGutter: tabBarGutter, onTabClick: onInternalTabClick, onTabScroll: onTabScroll, extra: tabBarExtraContent, style: tabBarStyle, panes: children }); if (renderTabBar) { tabNavBar = renderTabBar(tabNavBarProps, es_TabNavList); } else { tabNavBar = external_window_React_["createElement"](es_TabNavList, Object.assign({}, tabNavBarProps)); } return external_window_React_["createElement"](TabContext.Provider, { value: { tabs: tabs, prefixCls: prefixCls } }, external_window_React_["createElement"]("div", Object.assign({ ref: ref, id: id, className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedTabPosition), (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-mobile"), mobile), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-editable"), editable), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-rtl"), rtl), _classNames), className) }, restProps), tabNavBar, external_window_React_["createElement"](TabPanelList, Object.assign({ destroyInactiveTabPane: destroyInactiveTabPane }, sharedProps, { animated: mergedAnimated })))); } var ForwardTabs = external_window_React_["forwardRef"](Tabs); ForwardTabs.TabPane = TabPane; /* harmony default export */ var es_Tabs = (ForwardTabs); // CONCATENATED MODULE: ./node_modules/rc-tabs/es/index.js /* harmony default export */ var rc_tabs_es = __webpack_exports__["b"] = (es_Tabs); /***/ }), /***/ "lPiR": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha256.js ***! \******************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "Ib8C")); } else {} }(this, function (CryptoJS) { (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Initialization and round constants tables var H = []; var K = []; // Compute constants (function () { function isPrime(n) { var sqrtN = Math.sqrt(n); for (var factor = 2; factor <= sqrtN; factor++) { if (!(n % factor)) { return false; } } return true; } function getFractionalBits(n) { return ((n - (n | 0)) * 0x100000000) | 0; } var n = 2; var nPrime = 0; while (nPrime < 64) { if (isPrime(n)) { if (nPrime < 8) { H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); } K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); nPrime++; } n++; } }()); // Reusable object var W = []; /** * SHA-256 hash algorithm. */ var SHA256 = C_algo.SHA256 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init(H.slice(0)); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; var e = H[4]; var f = H[5]; var g = H[6]; var h = H[7]; // Computation for (var i = 0; i < 64; i++) { if (i < 16) { W[i] = M[offset + i] | 0; } else { var gamma0x = W[i - 15]; var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ ((gamma0x << 14) | (gamma0x >>> 18)) ^ (gamma0x >>> 3); var gamma1x = W[i - 2]; var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ ((gamma1x << 13) | (gamma1x >>> 19)) ^ (gamma1x >>> 10); W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; } var ch = (e & f) ^ (~e & g); var maj = (a & b) ^ (a & c) ^ (b & c); var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); var t1 = h + sigma1 + ch + K[i] + W[i]; var t2 = sigma0 + maj; h = g; g = f; f = e; e = (d + t1) | 0; d = c; c = b; b = a; a = (t1 + t2) | 0; } // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; H[4] = (H[4] + e) | 0; H[5] = (H[5] + f) | 0; H[6] = (H[6] + g) | 0; H[7] = (H[7] + h) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA256('message'); * var hash = CryptoJS.SHA256(wordArray); */ C.SHA256 = Hasher._createHelper(SHA256); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA256(message, key); */ C.HmacSHA256 = Hasher._createHmacHelper(SHA256); }(Math)); return CryptoJS.SHA256; })); /***/ }), /***/ "mxV5": /*!*****************************************************!*\ !*** ./node_modules/ali-oss/dist/aliyun-oss-sdk.js ***! \*****************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var require;var require;// Aliyun OSS SDK for JavaScript v6.10.0 // Copyright Aliyun.com, Inc. or its affiliates. All Rights Reserved. // License at https://github.com/ali-sdk/ali-oss/blob/master/LICENSE (function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) { copy(doneParts).to(internalDoneParts); } partOffs = this._divideParts(fileSize, partSize); numParts = partOffs.length; multipartFinish = false; uploadPartJob = function uploadPartJob(self, partNo) { var _this = this; // eslint-disable-next-line no-async-promise-executor return new _promise2.default(function _callee(resolve, reject) { var pi, data, result, tempErr; return _regenerator2.default.async(function _callee$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.prev = 0; if (self.isCancel()) { _context2.next = 18; break; } pi = partOffs[partNo - 1]; data = { stream: self._createStream(file, pi.start, pi.end), size: pi.end - pi.start }; _context2.next = 6; return _regenerator2.default.awrap(self._uploadPart(name, uploadId, partNo, data)); case 6: result = _context2.sent; if (!(!self.isCancel() && !multipartFinish)) { _context2.next = 15; break; } checkpoint.doneParts.push({ number: partNo, etag: result.res.headers.etag }); if (!options.progress) { _context2.next = 12; break; } _context2.next = 12; return _regenerator2.default.awrap(options.progress(doneParts.length / numParts, checkpoint, result.res)); case 12: resolve({ number: partNo, etag: result.res.headers.etag }); _context2.next = 16; break; case 15: resolve(); case 16: _context2.next = 19; break; case 18: resolve(); case 19: _context2.next = 30; break; case 21: _context2.prev = 21; _context2.t0 = _context2['catch'](0); tempErr = new Error(); tempErr.name = _context2.t0.name; tempErr.message = _context2.t0.message; tempErr.stack = _context2.t0.stack; tempErr.partNum = partNo; copy(_context2.t0).to(tempErr); reject(tempErr); case 30: case 'end': return _context2.stop(); } } }, null, _this, [[0, 21]]); }); }; all = (0, _from2.default)(new Array(numParts), function (x, i) { return i + 1; }); done = internalDoneParts.map(function (p) { return p.number; }); todo = all.filter(function (p) { return done.indexOf(p) < 0; }); defaultParallel = 5; parallel = options.parallel || defaultParallel; // upload in parallel _context3.next = 17; return _regenerator2.default.awrap(this._parallel(todo, parallel, function (value) { return new _promise2.default(function (resolve, reject) { uploadPartJob(that, value).then(function (result) { if (result) { internalDoneParts.push(result); } resolve(); }).catch(function (err) { reject(err); }); }); })); case 17: jobErr = _context3.sent; multipartFinish = true; if (!this.isCancel()) { _context3.next = 22; break; } uploadPartJob = null; throw this._makeCancelEvent(); case 22: if (!(jobErr && jobErr.length > 0)) { _context3.next = 25; break; } jobErr[0].message = 'Failed to upload some parts with error: ' + jobErr[0].toString() + ' part_num: ' + jobErr[0].partNum; throw jobErr[0]; case 25: _context3.next = 27; return _regenerator2.default.awrap(this.completeMultipartUpload(name, uploadId, internalDoneParts, options)); case 27: return _context3.abrupt('return', _context3.sent); case 28: case 'end': return _context3.stop(); } } }, null, this); }; /** * Get file size */ proto._getFileSize = function _getFileSize(file) { return _regenerator2.default.async(function _getFileSize$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: if (!is.buffer(file)) { _context4.next = 4; break; } return _context4.abrupt('return', file.length); case 4: if (!(isBlob(file) || isFile(file))) { _context4.next = 6; break; } return _context4.abrupt('return', file.size); case 6: throw new Error('_getFileSize requires Buffer/File/Blob.'); case 7: case 'end': return _context4.stop(); } } }, null, this); }; /* * Readable stream for Web File */ var _require3 = require('stream'), Readable = _require3.Readable; function WebFileReadStream(file, options) { if (!(this instanceof WebFileReadStream)) { return new WebFileReadStream(file, options); } Readable.call(this, options); this.file = file; this.reader = new FileReader(); this.start = 0; this.finish = false; this.fileBuffer = null; } util.inherits(WebFileReadStream, Readable); WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) { if (this.fileBuffer) { var pushRet = true; while (pushRet && this.fileBuffer && this.start < this.fileBuffer.length) { var start = this.start; var end = start + size; end = end > this.fileBuffer.length ? this.fileBuffer.length : end; this.start = end; pushRet = this.push(this.fileBuffer.slice(start, end)); } } }; WebFileReadStream.prototype._read = function _read(size) { if (this.file && this.start >= this.file.size || this.fileBuffer && this.start >= this.fileBuffer.length || this.finish || this.start === 0 && !this.file) { if (!this.finish) { this.fileBuffer = null; this.finish = true; } this.push(null); return; } var defaultReadSize = 16 * 1024; size = size || defaultReadSize; var that = this; this.reader.onload = function onload(e) { that.fileBuffer = Buffer.from(new Uint8Array(e.target.result)); that.file = null; that.readFileAndPush(size); }; if (this.start === 0) { this.reader.readAsArrayBuffer(this.file); } else { this.readFileAndPush(size); } }; proto._createStream = function _createStream(file, start, end) { if (isBlob(file) || isFile(file)) { return new WebFileReadStream(file.slice(start, end)); } throw new Error('_createStream requires File/Blob.'); }; proto._getPartSize = function _getPartSize(fileSize, partSize) { var maxNumParts = 10 * 1000; var defaultPartSize = 1024 * 1024; if (!partSize) { return defaultPartSize; } return Math.max(Math.ceil(fileSize / maxNumParts), partSize); }; proto._divideParts = function _divideParts(fileSize, partSize) { var numParts = Math.ceil(fileSize / partSize); var partOffs = []; for (var i = 0; i < numParts; i++) { var start = partSize * i; var end = Math.min(start + partSize, fileSize); partOffs.push({ start: start, end: end }); } return partOffs; }; }).call(this,require("buffer").Buffer) },{"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/array/from":52,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"buffer":73,"copy-to":76,"is-type-of":289,"mime":202,"path":205,"stream":230,"util":243}],4:[function(require,module,exports){ 'use strict'; var _promise = require('babel-runtime/core-js/promise'); var _promise2 = _interopRequireDefault(_promise); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // const debug = require('debug')('ali-oss:object'); var utility = require('utility'); var fs = require('fs'); var is = require('is-type-of'); var urlutil = require('url'); var copy = require('copy-to'); var path = require('path'); var mime = require('mime'); var callback = require('../common/callback'); var signHelper = require('../common/signUtils'); var merge = require('merge-descriptors'); var _require = require('../common/utils/isBlob'), isBlob = _require.isBlob; var _require2 = require('../common/utils/isFile'), isFile = _require2.isFile; // var assert = require('assert'); var proto = exports; /** * Object operations */ /** * append an object from String(file path)/Buffer/ReadableStream * @param {String} name the object key * @param {Mixed} file String(file path)/Buffer/ReadableStream * @param {Object} options * @return {Object} */ proto.append = function append(name, file, options) { var result; return _regenerator2.default.async(function append$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = options || {}; if (options.position === undefined) options.position = '0'; options.subres = { append: '', position: options.position }; options.method = 'POST'; _context.next = 6; return _regenerator2.default.awrap(this.put(name, file, options)); case 6: result = _context.sent; result.nextAppendPosition = result.res.headers['x-oss-next-append-position']; return _context.abrupt('return', result); case 9: case 'end': return _context.stop(); } } }, null, this); }; /** * put an object from String(file path)/Buffer/ReadableStream * @param {String} name the object key * @param {Mixed} file String(file path)/Buffer/ReadableStream * @param {Object} options * {Object} options.callback The callback parameter is composed of a JSON string encoded in Base64 * {String} options.callback.url the OSS sends a callback request to this URL * {String} options.callback.host The host header value for initiating callback requests * {String} options.callback.body The value of the request body when a callback is initiated * {String} options.callback.contentType The Content-Type of the callback requests initiatiated * {Object} options.callback.customValue Custom parameters are a map of key-values, e.g: * customValue = { * key1: 'value1', * key2: 'value2' * } * @return {Object} */ proto.put = function put(name, file, options) { var content, stream, _result, method, params, result, ret; return _regenerator2.default.async(function put$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: content = void 0; options = options || {}; name = this._objectName(name); if (!is.buffer(file)) { _context2.next = 7; break; } content = file; _context2.next = 33; break; case 7: if (!(isBlob(file) || isFile(file))) { _context2.next = 32; break; } if (!options.mime) { if (isFile(file)) { options.mime = mime.getType(path.extname(file.name)); } else { options.mime = file.type; } } stream = this._createStream(file, 0, file.size); _context2.next = 12; return _regenerator2.default.awrap(this._getFileSize(file)); case 12: options.contentLength = _context2.sent; _context2.prev = 13; _context2.next = 16; return _regenerator2.default.awrap(this.putStream(name, stream, options)); case 16: _result = _context2.sent; return _context2.abrupt('return', _result); case 20: _context2.prev = 20; _context2.t0 = _context2['catch'](13); if (!(_context2.t0.code === 'RequestTimeTooSkewed')) { _context2.next = 29; break; } this.options.amendTimeSkewed = +new Date(_context2.t0.serverTime) - new Date(); _context2.next = 26; return _regenerator2.default.awrap(this.put(name, file, options)); case 26: return _context2.abrupt('return', _context2.sent); case 29: throw _context2.t0; case 30: _context2.next = 33; break; case 32: throw new TypeError('Must provide Buffer/Blob/File for put.'); case 33: options.headers = options.headers || {}; this._convertMetaToHeaders(options.meta, options.headers); method = options.method || 'PUT'; params = this._objectRequestParams(method, name, options); callback.encodeCallback(params, options); params.mime = options.mime; params.content = content; params.successStatuses = [200]; _context2.next = 43; return _regenerator2.default.awrap(this.request(params)); case 43: result = _context2.sent; ret = { name: name, url: this._objectUrl(name), res: result.res }; if (params.headers && params.headers['x-oss-callback']) { ret.data = JSON.parse(result.data.toString()); } return _context2.abrupt('return', ret); case 47: case 'end': return _context2.stop(); } } }, null, this, [[13, 20]]); }; /** * put an object from ReadableStream. If `options.contentLength` is * not provided, chunked encoding is used. * @param {String} name the object key * @param {Readable} stream the ReadableStream * @param {Object} options * @return {Object} */ proto.putStream = function putStream(name, stream, options) { var method, params, result, ret; return _regenerator2.default.async(function putStream$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: options = options || {}; options.headers = options.headers || {}; name = this._objectName(name); if (options.contentLength) { options.headers['Content-Length'] = options.contentLength; } else { options.headers['Transfer-Encoding'] = 'chunked'; } this._convertMetaToHeaders(options.meta, options.headers); method = options.method || 'PUT'; params = this._objectRequestParams(method, name, options); callback.encodeCallback(params, options); params.mime = options.mime; params.stream = stream; params.successStatuses = [200]; _context3.next = 13; return _regenerator2.default.awrap(this.request(params)); case 13: result = _context3.sent; ret = { name: name, url: this._objectUrl(name), res: result.res }; if (params.headers && params.headers['x-oss-callback']) { ret.data = JSON.parse(result.data.toString()); } return _context3.abrupt('return', ret); case 17: case 'end': return _context3.stop(); } } }, null, this); }; merge(proto, require('../common/object/copyObject')); merge(proto, require('../common/object/getObjectTagging')); merge(proto, require('../common/object/putObjectTagging')); merge(proto, require('../common/object/deleteObjectTagging')); merge(proto, require('../common/image')); merge(proto, require('../common/object/getBucketVersions')); merge(proto, require('../common/object/getACL')); merge(proto, require('../common/object/putACL')); merge(proto, require('../common/object/head')); merge(proto, require('../common/object/delete')); merge(proto, require('../common/object/get')); merge(proto, require('../common/object/putSymlink')); merge(proto, require('../common/object/getSymlink')); merge(proto, require('../common/object/deleteMulti')); merge(proto, require('../common/object/getObjectMeta')); proto.putMeta = function putMeta(name, meta, options) { var copyResult; return _regenerator2.default.async(function putMeta$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.next = 2; return _regenerator2.default.awrap(this.copy(name, name, { meta: meta || {}, timeout: options && options.timeout, ctx: options && options.ctx })); case 2: copyResult = _context4.sent; return _context4.abrupt('return', copyResult); case 4: case 'end': return _context4.stop(); } } }, null, this); }; proto.list = function list(query, options) { var params, result, objects, that, prefixes; return _regenerator2.default.async(function list$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: // prefix, marker, max-keys, delimiter params = this._objectRequestParams('GET', '', options); params.query = query; params.xmlResponse = true; params.successStatuses = [200]; _context5.next = 6; return _regenerator2.default.awrap(this.request(params)); case 6: result = _context5.sent; objects = result.data.Contents; that = this; if (objects) { if (!Array.isArray(objects)) { objects = [objects]; } objects = objects.map(function (obj) { return { name: obj.Key, url: that._objectUrl(obj.Key), lastModified: obj.LastModified, etag: obj.ETag, type: obj.Type, size: Number(obj.Size), storageClass: obj.StorageClass, owner: { id: obj.Owner.ID, displayName: obj.Owner.DisplayName } }; }); } prefixes = result.data.CommonPrefixes || null; if (prefixes) { if (!Array.isArray(prefixes)) { prefixes = [prefixes]; } prefixes = prefixes.map(function (item) { return item.Prefix; }); } return _context5.abrupt('return', { res: result.res, objects: objects, prefixes: prefixes, nextMarker: result.data.NextMarker || null, isTruncated: result.data.IsTruncated === 'true' }); case 13: case 'end': return _context5.stop(); } } }, null, this); }; /** * Restore Object * @param {String} name the object key * @param {Object} options * @returns {{res}} */ proto.restore = function restore(name, options) { var params, result; return _regenerator2.default.async(function restore$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: options = options || {}; options.subres = (0, _assign2.default)({ restore: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } params = this._objectRequestParams('POST', name, options); params.successStatuses = [202]; _context6.next = 7; return _regenerator2.default.awrap(this.request(params)); case 7: result = _context6.sent; return _context6.abrupt('return', { res: result.res }); case 9: case 'end': return _context6.stop(); } } }, null, this); }; proto.signatureUrl = function signatureUrl(name, options) { options = options || {}; name = this._objectName(name); options.method = options.method || 'GET'; var expires = utility.timestamp() + (options.expires || 1800); var params = { bucket: this.options.bucket, object: name }; var resource = this._getResource(params); if (this.options.stsToken) { options['security-token'] = this.options.stsToken; } var signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires); var url = urlutil.parse(this._getReqUrl(params)); url.query = { OSSAccessKeyId: this.options.accessKeyId, Expires: expires, Signature: signRes.Signature }; copy(signRes.subResource).to(url.query); return url.format(); }; /** * Get Object url by name * @param {String} name - object name * @param {String} [baseUrl] - If provide `baseUrl`, * will use `baseUrl` instead the default `endpoint`. * @return {String} object url */ proto.getObjectUrl = function getObjectUrl(name, baseUrl) { if (!baseUrl) { baseUrl = this.options.endpoint.format(); } else if (baseUrl[baseUrl.length - 1] !== '/') { baseUrl += '/'; } return baseUrl + this._escape(this._objectName(name)); }; proto._objectUrl = function _objectUrl(name) { return this._getReqUrl({ bucket: this.options.bucket, object: name }); }; /** * Get Object url by name * @param {String} name - object name * @param {String} [baseUrl] - If provide `baseUrl`, will use `baseUrl` instead the default `endpoint and bucket`. * @return {String} object url include bucket */ proto.generateObjectUrl = function (name, baseUrl) { if (!baseUrl) { baseUrl = this.options.endpoint.format(); var copyUrl = urlutil.parse(baseUrl); var bucket = this.options.bucket; copyUrl.hostname = bucket + '.' + copyUrl.hostname; copyUrl.host = bucket + '.' + copyUrl.host; baseUrl = copyUrl.format(); } else if (baseUrl[baseUrl.length - 1] !== '/') { baseUrl += '/'; } return baseUrl + this._escape(this._objectName(name)); }; /** * generator request params * @return {Object} params * * @api private */ proto._objectRequestParams = function _objectRequestParams(method, name, options) { if (!this.options.bucket) { throw new Error('Please create a bucket first'); } options = options || {}; name = this._objectName(name); var params = { object: name, bucket: this.options.bucket, method: method, subres: options && options.subres, timeout: options && options.timeout, ctx: options && options.ctx }; if (options.headers) { params.headers = {}; copy(options.headers).to(params.headers); } return params; }; proto._objectName = function _objectName(name) { return name.replace(/^\/+/, ''); }; proto._convertMetaToHeaders = function _convertMetaToHeaders(meta, headers) { if (!meta) { return; } (0, _keys2.default)(meta).forEach(function (k) { headers['x-oss-meta-' + k] = meta[k]; }); }; proto._deleteFileSafe = function _deleteFileSafe(filepath) { var _this = this; return new _promise2.default(function (resolve) { fs.exists(filepath, function (exists) { if (!exists) { resolve(); } else { fs.unlink(filepath, function (err) { if (err) { _this.debug('unlink %j error: %s', filepath, err, 'error'); } resolve(); }); } }); }); }; },{"../common/callback":14,"../common/image":16,"../common/object/copyObject":19,"../common/object/delete":20,"../common/object/deleteMulti":21,"../common/object/deleteObjectTagging":22,"../common/object/get":23,"../common/object/getACL":24,"../common/object/getBucketVersions":25,"../common/object/getObjectMeta":26,"../common/object/getObjectTagging":27,"../common/object/getSymlink":28,"../common/object/head":29,"../common/object/putACL":30,"../common/object/putObjectTagging":31,"../common/object/putSymlink":32,"../common/signUtils":34,"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"copy-to":76,"fs":71,"is-type-of":289,"merge-descriptors":200,"mime":202,"path":205,"url":238,"utility":290}],5:[function(require,module,exports){ "use strict"; exports.version = "6.10.0"; },{}],6:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var proto = exports; proto.deleteBucketLifecycle = function deleteBucketLifecycle(name, options) { var params, result; return _regenerator2.default.async(function deleteBucketLifecycle$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); params = this._bucketRequestParams('DELETE', name, 'lifecycle', options); params.successStatuses = [204]; _context.next = 5; return _regenerator2.default.awrap(this.request(params)); case 5: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 7: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var proto = exports; proto.deleteBucketWebsite = function deleteBucketWebsite(name, options) { var params, result; return _regenerator2.default.async(function deleteBucketWebsite$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); params = this._bucketRequestParams('DELETE', name, 'website', options); params.successStatuses = [204]; _context.next = 5; return _regenerator2.default.awrap(this.request(params)); case 5: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 7: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/isArray'), isArray = _require2.isArray; var _require3 = require('../utils/formatObjKey'), formatObjKey = _require3.formatObjKey; var proto = exports; proto.getBucketLifecycle = function getBucketLifecycle(name, options) { var params, result, rules; return _regenerator2.default.async(function getBucketLifecycle$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); params = this._bucketRequestParams('GET', name, 'lifecycle', options); params.successStatuses = [200]; params.xmlResponse = true; _context.next = 6; return _regenerator2.default.awrap(this.request(params)); case 6: result = _context.sent; rules = result.data.Rule || null; if (rules) { if (!isArray(rules)) { rules = [rules]; } rules = rules.map(function (_) { if (_.ID) { _.id = _.ID; delete _.ID; } if (_.Tag && !isArray(_.Tag)) { _.Tag = [_.Tag]; } return formatObjKey(_, 'firstLowerCase'); }); } return _context.abrupt('return', { rules: rules, res: result.res }); case 10: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var proto = exports; /** * getBucketVersioning * @param {String} bucketName - bucket name */ proto.getBucketVersioning = function getBucketVersioning(bucketName, options) { var params, result, versionStatus; return _regenerator2.default.async(function getBucketVersioning$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(bucketName); params = this._bucketRequestParams('GET', bucketName, 'versioning', options); params.xmlResponse = true; params.successStatuses = [200]; _context.next = 6; return _regenerator2.default.awrap(this.request(params)); case 6: result = _context.sent; versionStatus = result.data.Status; return _context.abrupt('return', { status: result.status, versionStatus: versionStatus, res: result.res }); case 9: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/isObject'), isObject = _require2.isObject; var proto = exports; proto.getBucketWebsite = function getBucketWebsite(name, options) { var params, result, routingRules; return _regenerator2.default.async(function getBucketWebsite$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); params = this._bucketRequestParams('GET', name, 'website', options); params.successStatuses = [200]; params.xmlResponse = true; _context.next = 6; return _regenerator2.default.awrap(this.request(params)); case 6: result = _context.sent; routingRules = []; if (result.data.RoutingRules && result.data.RoutingRules.RoutingRule) { if (isObject(result.data.RoutingRules.RoutingRule)) { routingRules = [result.data.RoutingRules.RoutingRule]; } else { routingRules = result.data.RoutingRules.RoutingRule; } } return _context.abrupt('return', { index: result.data.IndexDocument && result.data.IndexDocument.Suffix || '', supportSubDir: result.data.IndexDocument && result.data.IndexDocument.SupportSubDir || 'false', type: result.data.IndexDocument && result.data.IndexDocument.Type, routingRules: routingRules, error: result.data.ErrorDocument && result.data.ErrorDocument.Key || null, res: result.res }); case 10: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable no-use-before-define */ var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/isArray'), isArray = _require2.isArray; var _require3 = require('../utils/deepCopy'), deepCopy = _require3.deepCopy; var _require4 = require('../utils/isObject'), isObject = _require4.isObject; var _require5 = require('../utils/obj2xml'), obj2xml = _require5.obj2xml; var _require6 = require('../utils/checkObjectTag'), checkObjectTag = _require6.checkObjectTag; var _require7 = require('../utils/getStrBytesCount'), getStrBytesCount = _require7.getStrBytesCount; var proto = exports; proto.putBucketLifecycle = function putBucketLifecycle(name, rules, options) { var params, Rule, paramXMLObj, paramXML, result; return _regenerator2.default.async(function putBucketLifecycle$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); if (isArray(rules)) { _context.next = 3; break; } throw new Error('rules must be Array'); case 3: params = this._bucketRequestParams('PUT', name, 'lifecycle', options); Rule = []; paramXMLObj = { LifecycleConfiguration: { Rule: Rule } }; rules.forEach(function (_) { defaultDaysAndDate2Expiration(_); // todo delete, 兼容旧版本 checkRule(_); if (_.id) { _.ID = _.id; delete _.id; } Rule.push(_); }); paramXML = obj2xml(paramXMLObj, { headers: true, firstUpperCase: true }); params.content = paramXML; params.mime = 'xml'; params.successStatuses = [200]; _context.next = 13; return _regenerator2.default.awrap(this.request(params)); case 13: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 15: case 'end': return _context.stop(); } } }, null, this); }; // todo delete, 兼容旧版本 function defaultDaysAndDate2Expiration(obj) { if (obj.days) { obj.expiration = { days: obj.days }; } if (obj.date) { obj.expiration = { createdBeforeDate: obj.date }; } } function checkDaysAndDate(obj, key) { var days = obj.days, createdBeforeDate = obj.createdBeforeDate; if (!days && !createdBeforeDate) { throw new Error(key + ' must includes days or createdBeforeDate'); } else if (days && !/^[1-9][0-9]*$/.test(days)) { throw new Error('days must be a positive integer'); } else if (createdBeforeDate && !/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(createdBeforeDate)) { throw new Error('createdBeforeDate must be date and conform to iso8601 format'); } } function handleCheckTag(tag) { if (!isArray(tag) && !isObject(tag)) { throw new Error('tag must be Object or Array'); } tag = isObject(tag) ? [tag] : tag; var tagObj = {}; var tagClone = deepCopy(tag); tagClone.forEach(function (v) { tagObj[v.key] = v.value; }); checkObjectTag(tagObj); } function checkRule(rule) { if (rule.id && getStrBytesCount(rule.id) > 255) throw new Error('ID is composed of 255 bytes at most'); if (rule.prefix === '' || rule.prefix === undefined) throw new Error('Rule must includes prefix'); if (!['Enabled', 'Disabled'].includes(rule.status)) throw new Error('Status must be Enabled or Disabled'); if (rule.transition) { if (!['IA', 'Archive'].includes(rule.transition.storageClass)) throw new Error('StorageClass must be IA or Archive'); checkDaysAndDate(rule.transition, 'Transition'); } if (rule.expiration) { if (!rule.expiration.expiredObjectDeleteMarker) { checkDaysAndDate(rule.expiration, 'Expiration'); } else if (rule.expiration.days || rule.expiration.createdBeforeDate) { throw new Error('expiredObjectDeleteMarker cannot be used with days or createdBeforeDate'); } } if (rule.abortMultipartUpload) { checkDaysAndDate(rule.abortMultipartUpload, 'AbortMultipartUpload'); } if (!rule.expiration && !rule.abortMultipartUpload && !rule.transition && !rule.noncurrentVersionTransition) { throw new Error('Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition'); } if (rule.tag) { if (rule.abortMultipartUpload) { throw new Error('Tag cannot be used with abortMultipartUpload'); } handleCheckTag(rule.tag); } } },{"../utils/checkBucketName":35,"../utils/checkObjectTag":36,"../utils/deepCopy":39,"../utils/getStrBytesCount":41,"../utils/isArray":42,"../utils/isObject":46,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],12:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/obj2xml'), obj2xml = _require2.obj2xml; var proto = exports; /** * putBucketVersioning * @param {String} name - bucket name * @param {String} status * @param {Object} options */ proto.putBucketVersioning = function putBucketVersioning(name, status) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var params, paramXMLObj, result; return _regenerator2.default.async(function putBucketVersioning$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); if (['Enabled', 'Suspended'].includes(status)) { _context.next = 3; break; } throw new Error('status must be Enabled or Suspended'); case 3: params = this._bucketRequestParams('PUT', name, 'versioning', options); paramXMLObj = { VersioningConfiguration: { Status: status } }; params.mime = 'xml'; params.content = obj2xml(paramXMLObj, { headers: true }); _context.next = 9; return _regenerator2.default.awrap(this.request(params)); case 9: result = _context.sent; return _context.abrupt('return', { res: result.res, status: result.status }); case 11: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/obj2xml'), obj2xml = _require2.obj2xml; var _require3 = require('../utils/isArray'), isArray = _require3.isArray; var proto = exports; proto.putBucketWebsite = function putBucketWebsite(name) { var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var options = arguments[2]; var params, IndexDocument, WebsiteConfiguration, website, result; return _regenerator2.default.async(function putBucketWebsite$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _checkBucketName(name); params = this._bucketRequestParams('PUT', name, 'website', options); IndexDocument = { Suffix: config.index || 'index.html' }; WebsiteConfiguration = { IndexDocument: IndexDocument }; website = { WebsiteConfiguration: WebsiteConfiguration }; if (config.supportSubDir) { IndexDocument.SupportSubDir = config.supportSubDir; } if (config.type) { IndexDocument.Type = config.type; } if (config.error) { WebsiteConfiguration.ErrorDocument = { Key: config.error }; } if (!(config.routingRules !== undefined)) { _context.next = 12; break; } if (isArray(config.routingRules)) { _context.next = 11; break; } throw new Error('RoutingRules must be Array'); case 11: WebsiteConfiguration.RoutingRules = { RoutingRule: config.routingRules }; case 12: website = obj2xml(website); params.content = website; params.mime = 'xml'; params.successStatuses = [200]; _context.next = 18; return _regenerator2.default.awrap(this.request(params)); case 18: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 20: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(require,module,exports){ (function (Buffer){ 'use strict'; var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _stringify = require('babel-runtime/core-js/json/stringify'); var _stringify2 = _interopRequireDefault(_stringify); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.encodeCallback = function encodeCallback(reqParams, options) { reqParams.headers = reqParams.headers || {}; if (!Object.prototype.hasOwnProperty.call(reqParams.headers, 'x-oss-callback')) { if (options.callback) { var json = { callbackUrl: encodeURI(options.callback.url), callbackBody: options.callback.body }; if (options.callback.host) { json.callbackHost = options.callback.host; } if (options.callback.contentType) { json.callbackBodyType = options.callback.contentType; } var callback = Buffer.from((0, _stringify2.default)(json)).toString('base64'); reqParams.headers['x-oss-callback'] = callback; if (options.callback.customValue) { var callbackVar = {}; (0, _keys2.default)(options.callback.customValue).forEach(function (key) { callbackVar['x:' + key] = options.callback.customValue[key]; }); reqParams.headers['x-oss-callback-var'] = Buffer.from((0, _stringify2.default)(callbackVar)).toString('base64'); } } } }; }).call(this,require("buffer").Buffer) },{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,"buffer":73}],15:[function(require,module,exports){ 'use strict'; var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ms = require('humanize-ms'); var urlutil = require('url'); var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; function setEndpoint(endpoint, secure) { var url = urlutil.parse(endpoint); if (!url.protocol) { url = urlutil.parse('http' + (secure ? 's' : '') + '://' + endpoint); } if (url.protocol !== 'http:' && url.protocol !== 'https:') { throw new Error('Endpoint protocol must be http or https.'); } return url; } function setRegion(region, internal, secure) { var protocol = secure ? 'https://' : 'http://'; var suffix = internal ? '-internal.aliyuncs.com' : '.aliyuncs.com'; var prefix = 'vpc100-oss-cn-'; // aliyun VPC region: https://help.aliyun.com/knowledge_detail/38740.html if (region.substr(0, prefix.length) === prefix) { suffix = '.aliyuncs.com'; } return urlutil.parse(protocol + region + suffix); } module.exports = function (options) { if (!options || !options.accessKeyId || !options.accessKeySecret) { throw new Error('require accessKeyId, accessKeySecret'); } if (options.bucket) { _checkBucketName(options.bucket); } var opts = (0, _assign2.default)({ region: 'oss-cn-hangzhou', internal: false, secure: false, timeout: 60000, bucket: null, endpoint: null, cname: false, isRequestPay: false, sldEnable: false }, options); opts.accessKeyId = opts.accessKeyId.trim(); opts.accessKeySecret = opts.accessKeySecret.trim(); if (opts.timeout) { opts.timeout = ms(opts.timeout); } if (opts.endpoint) { opts.endpoint = setEndpoint(opts.endpoint, opts.secure); } else if (opts.region) { opts.endpoint = setRegion(opts.region, opts.internal, opts.secure); } else { throw new Error('require options.endpoint or options.region'); } opts.inited = true; return opts; }; },{"../utils/checkBucketName":35,"babel-runtime/core-js/object/assign":54,"humanize-ms":194,"url":238}],16:[function(require,module,exports){ 'use strict'; var merge = require('merge-descriptors'); var proto = exports; merge(proto, require('./processObjectSave')); },{"./processObjectSave":17,"merge-descriptors":200}],17:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable no-use-before-define */ var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var querystring = require('querystring'); var _require2 = require('js-base64'), str2Base64 = _require2.Base64.encode; var proto = exports; proto.processObjectSave = function processObjectSave(sourceObject, targetObject, process, targetBucket) { var params, bucketParam, content, result; return _regenerator2.default.async(function processObjectSave$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: checkArgs(sourceObject, 'sourceObject'); checkArgs(targetObject, 'targetObject'); checkArgs(process, 'process'); targetObject = this._objectName(targetObject); if (targetBucket) { _checkBucketName(targetBucket); } params = this._objectRequestParams('POST', sourceObject, { subres: 'x-oss-process' }); bucketParam = targetBucket ? ',b_' + str2Base64(targetBucket) : ''; targetObject = str2Base64(targetObject); content = { 'x-oss-process': process + '|sys/saveas,o_' + targetObject + bucketParam }; params.content = querystring.stringify(content); _context.next = 12; return _regenerator2.default.awrap(this.request(params)); case 12: result = _context.sent; return _context.abrupt('return', { res: result.res, status: result.res.status }); case 14: case 'end': return _context.stop(); } } }, null, this); }; function checkArgs(name, key) { if (!name) { throw new Error(key + ' is required'); } if (typeof name !== 'string') { throw new Error(key + ' must be String'); } } },{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,"querystring":212}],18:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var copy = require('copy-to'); var callback = require('./callback'); var _require = require('./utils/deepCopy'), deepCopy = _require.deepCopy; var proto = exports; /** * List the on-going multipart uploads * https://help.aliyun.com/document_detail/31997.html * @param {Object} options * @return {Array} the multipart uploads */ proto.listUploads = function listUploads(query, options) { var opt, params, result, uploads; return _regenerator2.default.async(function listUploads$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = options || {}; opt = {}; copy(options).to(opt); opt.subres = 'uploads'; params = this._objectRequestParams('GET', '', opt); params.query = query; params.xmlResponse = true; params.successStatuses = [200]; _context.next = 10; return _regenerator2.default.awrap(this.request(params)); case 10: result = _context.sent; uploads = result.data.Upload || []; if (!Array.isArray(uploads)) { uploads = [uploads]; } uploads = uploads.map(function (up) { return { name: up.Key, uploadId: up.UploadId, initiated: up.Initiated }; }); return _context.abrupt('return', { res: result.res, uploads: uploads, bucket: result.data.Bucket, nextKeyMarker: result.data.NextKeyMarker, nextUploadIdMarker: result.data.NextUploadIdMarker, isTruncated: result.data.IsTruncated === 'true' }); case 15: case 'end': return _context.stop(); } } }, null, this); }; /** * List the done uploadPart parts * @param {String} name object name * @param {String} uploadId multipart upload id * @param {Object} query * {Number} query.max-parts The maximum part number in the response of the OSS. Default value: 1000 * {Number} query.part-number-marker Starting position of a specific list. * {String} query.encoding-type Specify the encoding of the returned content and the encoding type. * @param {Object} options * @return {Object} result */ proto.listParts = function listParts(name, uploadId, query, options) { var opt, params, result; return _regenerator2.default.async(function listParts$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: options = options || {}; opt = {}; copy(options).to(opt); opt.subres = { uploadId: uploadId }; params = this._objectRequestParams('GET', name, opt); params.query = query; params.xmlResponse = true; params.successStatuses = [200]; _context2.next = 10; return _regenerator2.default.awrap(this.request(params)); case 10: result = _context2.sent; return _context2.abrupt('return', { res: result.res, uploadId: result.data.UploadId, bucket: result.data.Bucket, name: result.data.Key, partNumberMarker: result.data.PartNumberMarker, nextPartNumberMarker: result.data.NextPartNumberMarker, maxParts: result.data.MaxParts, isTruncated: result.data.IsTruncated, parts: result.data.Part || [] }); case 12: case 'end': return _context2.stop(); } } }, null, this); }; /** * Abort a multipart upload transaction * @param {String} name the object name * @param {String} uploadId the upload id * @param {Object} options */ proto.abortMultipartUpload = function abortMultipartUpload(name, uploadId, options) { var opt, params, result; return _regenerator2.default.async(function abortMultipartUpload$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: this._stop(); options = options || {}; opt = {}; copy(options).to(opt); opt.subres = { uploadId: uploadId }; params = this._objectRequestParams('DELETE', name, opt); params.successStatuses = [204]; _context3.next = 9; return _regenerator2.default.awrap(this.request(params)); case 9: result = _context3.sent; return _context3.abrupt('return', { res: result.res }); case 11: case 'end': return _context3.stop(); } } }, null, this); }; /** * Initiate a multipart upload transaction * @param {String} name the object name * @param {Object} options * @return {String} upload id */ proto.initMultipartUpload = function initMultipartUpload(name, options) { var opt, params, result; return _regenerator2.default.async(function initMultipartUpload$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: options = options || {}; opt = {}; copy(options).to(opt); opt.headers = opt.headers || {}; this._convertMetaToHeaders(options.meta, opt.headers); opt.subres = 'uploads'; params = this._objectRequestParams('POST', name, opt); params.mime = options.mime; params.xmlResponse = true; params.successStatuses = [200]; _context4.next = 12; return _regenerator2.default.awrap(this.request(params)); case 12: result = _context4.sent; return _context4.abrupt('return', { res: result.res, bucket: result.data.Bucket, name: result.data.Key, uploadId: result.data.UploadId }); case 14: case 'end': return _context4.stop(); } } }, null, this); }; /** * Upload a part in a multipart upload transaction * @param {String} name the object name * @param {String} uploadId the upload id * @param {Integer} partNo the part number * @param {File} file upload File, whole File * @param {Integer} start part start bytes e.g: 102400 * @param {Integer} end part end bytes e.g: 204800 * @param {Object} options */ proto.uploadPart = function uploadPart(name, uploadId, partNo, file, start, end, options) { var data; return _regenerator2.default.async(function uploadPart$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: data = { stream: this._createStream(file, start, end), size: end - start }; _context5.next = 3; return _regenerator2.default.awrap(this._uploadPart(name, uploadId, partNo, data, options)); case 3: return _context5.abrupt('return', _context5.sent); case 4: case 'end': return _context5.stop(); } } }, null, this); }; /** * Complete a multipart upload transaction * @param {String} name the object name * @param {String} uploadId the upload id * @param {Array} parts the uploaded parts, each in the structure: * {Integer} number partNo * {String} etag part etag uploadPartCopy result.res.header.etag * @param {Object} options * {Object} options.callback The callback parameter is composed of a JSON string encoded in Base64 * {String} options.callback.url the OSS sends a callback request to this URL * {String} options.callback.host The host header value for initiating callback requests * {String} options.callback.body The value of the request body when a callback is initiated * {String} options.callback.contentType The Content-Type of the callback requests initiatiated * {Object} options.callback.customValue Custom parameters are a map of key-values, e.g: * customValue = { * key1: 'value1', * key2: 'value2' * } */ proto.completeMultipartUpload = function completeMultipartUpload(name, uploadId, parts, options) { var completeParts, xml, i, p, opt, params, result, ret; return _regenerator2.default.async(function completeMultipartUpload$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: completeParts = parts.concat().sort(function (a, b) { return a.number - b.number; }).filter(function (item, index, arr) { return !index || item.number !== arr[index - 1].number; }); xml = '\n\n'; for (i = 0; i < completeParts.length; i++) { p = completeParts[i]; xml += '\n'; xml += '' + p.number + '\n'; xml += '' + p.etag + '\n'; xml += '\n'; } xml += ''; options = options || {}; opt = {}; opt = deepCopy(options); if (opt.headers) delete opt.headers['x-oss-server-side-encryption']; opt.subres = { uploadId: uploadId }; params = this._objectRequestParams('POST', name, opt); callback.encodeCallback(params, opt); params.mime = 'xml'; params.content = xml; if (!(params.headers && params.headers['x-oss-callback'])) { params.xmlResponse = true; } params.successStatuses = [200]; _context6.next = 17; return _regenerator2.default.awrap(this.request(params)); case 17: result = _context6.sent; ret = { res: result.res, bucket: params.bucket, name: name, etag: result.res.headers.etag }; if (params.headers && params.headers['x-oss-callback']) { ret.data = JSON.parse(result.data.toString()); } return _context6.abrupt('return', ret); case 21: case 'end': return _context6.stop(); } } }, null, this); }; /** * Upload a part in a multipart upload transaction * @param {String} name the object name * @param {String} uploadId the upload id * @param {Integer} partNo the part number * @param {Object} data the body data * @param {Object} options */ proto._uploadPart = function _uploadPart(name, uploadId, partNo, data, options) { var opt, params, result; return _regenerator2.default.async(function _uploadPart$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: options = options || {}; opt = {}; copy(options).to(opt); opt.headers = { 'Content-Length': data.size }; opt.subres = { partNumber: partNo, uploadId: uploadId }; params = this._objectRequestParams('PUT', name, opt); params.mime = opt.mime; params.stream = data.stream; params.successStatuses = [200]; _context7.next = 11; return _regenerator2.default.awrap(this.request(params)); case 11: result = _context7.sent; if (result.res.headers.etag) { _context7.next = 14; break; } throw new Error('Please set the etag of expose-headers in OSS \n https://help.aliyun.com/document_detail/32069.html'); case 14: data.stream = null; params.stream = null; return _context7.abrupt('return', { name: name, etag: result.res.headers.etag, res: result.res }); case 17: case 'end': return _context7.stop(); } } }, null, this); }; },{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _typeof2 = require('babel-runtime/helpers/typeof'); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/checkBucketName'), _checkBucketName = _require.checkBucketName; var proto = exports; proto.copy = function copy(name, sourceName, bucketName, options) { var params, result, data; return _regenerator2.default.async(function copy$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if ((typeof bucketName === 'undefined' ? 'undefined' : (0, _typeof3.default)(bucketName)) === 'object') { options = bucketName; // 兼容旧版本,旧版本第三个参数为options } options = options || {}; options.headers = options.headers || {}; (0, _keys2.default)(options.headers).forEach(function (key) { options.headers['x-oss-copy-source-' + key.toLowerCase()] = options.headers[key]; }); if (options.meta) { options.headers['x-oss-metadata-directive'] = 'REPLACE'; } this._convertMetaToHeaders(options.meta, options.headers); sourceName = this._getSourceName(sourceName, bucketName); if (options.versionId) { sourceName = sourceName + '?versionId=' + options.versionId; } options.headers['x-oss-copy-source'] = sourceName; params = this._objectRequestParams('PUT', name, options); params.xmlResponse = true; params.successStatuses = [200, 304]; _context.next = 14; return _regenerator2.default.awrap(this.request(params)); case 14: result = _context.sent; data = result.data; if (data) { data = { etag: data.ETag, lastModified: data.LastModified }; } return _context.abrupt('return', { data: data, res: result.res }); case 18: case 'end': return _context.stop(); } } }, null, this); }; // todo delete proto._getSourceName = function _getSourceName(sourceName, bucketName) { if (typeof bucketName === 'string') { sourceName = this._objectName(sourceName); } else if (sourceName[0] !== '/') { bucketName = this.options.bucket; } else { bucketName = sourceName.replace(/\/(.+?)(\/.*)/, '$1'); sourceName = sourceName.replace(/(\/.+?\/)(.*)/, '$2'); } _checkBucketName(bucketName); sourceName = encodeURI(sourceName); sourceName = '/' + bucketName + '/' + sourceName; return sourceName; }; },{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /** * delete * @param {String} name - object name * @param {Object} options * @param {{res}} */ proto.delete = function _delete(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result; return _regenerator2.default.async(function _delete$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options.subres = (0, _assign2.default)({}, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } params = this._objectRequestParams('DELETE', name, options); params.successStatuses = [204]; _context.next = 6; return _regenerator2.default.awrap(this.request(params)); case 6: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 8: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable object-curly-newline */ var utility = require('utility'); var _require = require('../utils/obj2xml'), obj2xml = _require.obj2xml; var proto = exports; proto.deleteMulti = function deleteMulti(names) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var objects, i, object, _names$i, key, versionId, paramXMLObj, paramXML, params, result, r, deleted; return _regenerator2.default.async(function deleteMulti$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: objects = []; if (!(!names || !names.length)) { _context.next = 3; break; } throw new Error('names is required'); case 3: for (i = 0; i < names.length; i++) { object = {}; if (typeof names[i] === 'string') { object.Key = utility.escape(this._objectName(names[i])); } else { _names$i = names[i], key = _names$i.key, versionId = _names$i.versionId; object.Key = utility.escape(this._objectName(key)); object.VersionId = versionId; } objects.push(object); } paramXMLObj = { Delete: { Quiet: !!options.quiet, Object: objects } }; paramXML = obj2xml(paramXMLObj, { headers: true }); options.subres = (0, _assign2.default)({ delete: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } params = this._objectRequestParams('POST', '', options); params.mime = 'xml'; params.content = paramXML; params.xmlResponse = true; params.successStatuses = [200]; _context.next = 15; return _regenerator2.default.awrap(this.request(params)); case 15: result = _context.sent; r = result.data; deleted = r && r.Deleted || null; if (deleted) { if (!Array.isArray(deleted)) { deleted = [deleted]; } } return _context.abrupt('return', { res: result.res, deleted: deleted || [] }); case 20: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,"utility":290}],22:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /** * deleteObjectTagging * @param {String} name - object name * @param {Object} options */ proto.deleteObjectTagging = function deleteObjectTagging(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result; return _regenerator2.default.async(function deleteObjectTagging$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options.subres = (0, _assign2.default)({ tagging: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } name = this._objectName(name); params = this._objectRequestParams('DELETE', name, options); params.successStatuses = [204]; _context.next = 7; return _regenerator2.default.awrap(this.request(params)); case 7: result = _context.sent; return _context.abrupt('return', { status: result.status, res: result.res }); case 9: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var fs = require('fs'); var is = require('is-type-of'); var proto = exports; /** * get * @param {String} name - object name * @param {String | Stream} file * @param {Object} options * @param {{res}} */ proto.get = function get(name, file) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var writeStream, needDestroy, result, params; return _regenerator2.default.async(function get$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: writeStream = null; needDestroy = false; if (is.writableStream(file)) { writeStream = file; } else if (is.string(file)) { writeStream = fs.createWriteStream(file); needDestroy = true; } else { // get(name, options) options = file; } options = options || {}; options.subres = (0, _assign2.default)({}, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } if (options.process) { options.subres['x-oss-process'] = options.process; } result = void 0; _context.prev = 8; params = this._objectRequestParams('GET', name, options); params.writeStream = writeStream; params.successStatuses = [200, 206, 304]; _context.next = 14; return _regenerator2.default.awrap(this.request(params)); case 14: result = _context.sent; if (needDestroy) { writeStream.destroy(); } _context.next = 25; break; case 18: _context.prev = 18; _context.t0 = _context['catch'](8); if (!needDestroy) { _context.next = 24; break; } writeStream.destroy(); // should delete the exists file before throw error _context.next = 24; return _regenerator2.default.awrap(this._deleteFileSafe(file)); case 24: throw _context.t0; case 25: return _context.abrupt('return', { res: result.res, content: result.data }); case 26: case 'end': return _context.stop(); } } }, null, this, [[8, 18]]); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,"fs":71,"is-type-of":289}],24:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /* * Get object's ACL * @param {String} name the object key * @param {Object} options * @return {Object} */ proto.getACL = function getACL(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result; return _regenerator2.default.async(function getACL$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options.subres = (0, _assign2.default)({ acl: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } name = this._objectName(name); params = this._objectRequestParams('GET', name, options); params.successStatuses = [200]; params.xmlResponse = true; _context.next = 8; return _regenerator2.default.awrap(this.request(params)); case 8: result = _context.sent; return _context.abrupt('return', { acl: result.data.AccessControlList.Grant, owner: { id: result.data.Owner.ID, displayName: result.data.Owner.DisplayName }, res: result.res }); case 10: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(require,module,exports){ 'use strict'; var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable no-use-before-define */ var proto = exports; var _require = require('../utils/isObject'), isObject = _require.isObject; var _require2 = require('../utils/isArray'), isArray = _require2.isArray; proto.getBucketVersions = getBucketVersions; proto.listObjectVersions = getBucketVersions; function getBucketVersions() { var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result, objects, deleteMarker, that, prefixes; return _regenerator2.default.async(function getBucketVersions$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!(query.versionIdMarker && query.keyMarker === undefined)) { _context.next = 2; break; } throw new Error('A version-id marker cannot be specified without a key marker'); case 2: options.subres = (0, _assign2.default)({ versions: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } params = this._objectRequestParams('GET', '', options); params.xmlResponse = true; params.successStatuses = [200]; params.query = formatQuery(query); _context.next = 10; return _regenerator2.default.awrap(this.request(params)); case 10: result = _context.sent; objects = result.data.Version || []; deleteMarker = result.data.DeleteMarker || []; that = this; if (objects) { if (!Array.isArray(objects)) { objects = [objects]; } objects = objects.map(function (obj) { return { name: obj.Key, url: that._objectUrl(obj.Key), lastModified: obj.LastModified, isLatest: obj.IsLatest === 'true', versionId: obj.VersionId, etag: obj.ETag, type: obj.Type, size: Number(obj.Size), storageClass: obj.StorageClass, owner: { id: obj.Owner.ID, displayName: obj.Owner.DisplayName } }; }); } if (deleteMarker) { if (!isArray(deleteMarker)) { deleteMarker = [deleteMarker]; } deleteMarker = deleteMarker.map(function (obj) { return { name: obj.Key, lastModified: obj.LastModified, versionId: obj.VersionId, owner: { id: obj.Owner.ID, displayName: obj.Owner.DisplayName } }; }); } prefixes = result.data.CommonPrefixes || null; if (prefixes) { if (!isArray(prefixes)) { prefixes = [prefixes]; } prefixes = prefixes.map(function (item) { return item.Prefix; }); } return _context.abrupt('return', { res: result.res, objects: objects, deleteMarker: deleteMarker, prefixes: prefixes, nextMarker: result.data.NextMarker || null, NextVersionIdMarker: result.data.NextVersionIdMarker || null, isTruncated: result.data.IsTruncated === 'true' }); case 19: case 'end': return _context.stop(); } } }, null, this); } function camel2Line(name) { return name.replace(/([A-Z])/g, '-$1').toLowerCase(); } function formatQuery() { var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var obj = {}; if (isObject(query)) { (0, _keys2.default)(query).forEach(function (key) { obj[camel2Line(key)] = query[key]; }); } return obj; } },{"../utils/isArray":42,"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],26:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /** * getObjectMeta * @param {String} name - object name * @param {Object} options * @param {{res}} */ proto.getObjectMeta = function getObjectMeta(name, options) { var params, result; return _regenerator2.default.async(function getObjectMeta$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = options || {}; name = this._objectName(name); options.subres = (0, _assign2.default)({ objectMeta: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } params = this._objectRequestParams('HEAD', name, options); params.successStatuses = [200]; _context.next = 8; return _regenerator2.default.awrap(this.request(params)); case 8: result = _context.sent; return _context.abrupt('return', { status: result.status, res: result.res }); case 10: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; var _require = require('../utils/isObject'), isObject = _require.isObject; /** * getObjectTagging * @param {String} name - object name * @param {Object} options * @return {Object} */ proto.getObjectTagging = function getObjectTagging(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result, Tagging, Tag, tag; return _regenerator2.default.async(function getObjectTagging$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options.subres = (0, _assign2.default)({ tagging: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } name = this._objectName(name); params = this._objectRequestParams('GET', name, options); params.successStatuses = [200]; _context.next = 7; return _regenerator2.default.awrap(this.request(params)); case 7: result = _context.sent; _context.next = 10; return _regenerator2.default.awrap(this.parseXML(result.data)); case 10: Tagging = _context.sent; Tag = Tagging.TagSet.Tag; Tag = Tag && isObject(Tag) ? [Tag] : Tag || []; tag = {}; Tag.forEach(function (item) { tag[item.Key] = item.Value; }); return _context.abrupt('return', { status: result.status, res: result.res, tag: tag }); case 16: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /** * getSymlink * @param {String} name - object name * @param {Object} options * @param {{res}} */ proto.getSymlink = function getSymlink(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result, target; return _regenerator2.default.async(function getSymlink$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options.subres = (0, _assign2.default)({ symlink: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } name = this._objectName(name); params = this._objectRequestParams('GET', name, options); params.successStatuses = [200]; _context.next = 7; return _regenerator2.default.awrap(this.request(params)); case 7: result = _context.sent; target = result.res.headers['x-oss-symlink-target']; return _context.abrupt('return', { targetName: decodeURIComponent(target), res: result.res }); case 10: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /** * head * @param {String} name - object name * @param {Object} options * @param {{res}} */ proto.head = function head(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var params, result, data; return _regenerator2.default.async(function head$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options.subres = (0, _assign2.default)({}, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } params = this._objectRequestParams('HEAD', name, options); params.successStatuses = [200, 304]; _context.next = 6; return _regenerator2.default.awrap(this.request(params)); case 6: result = _context.sent; data = { meta: null, res: result.res, status: result.status }; if (result.status === 200) { (0, _keys2.default)(result.headers).forEach(function (k) { if (k.indexOf('x-oss-meta-') === 0) { if (!data.meta) { data.meta = {}; } data.meta[k.substring(11)] = result.headers[k]; } }); } return _context.abrupt('return', data); case 10: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /* * Set object's ACL * @param {String} name the object key * @param {String} acl the object ACL * @param {Object} options */ proto.putACL = function putACL(name, acl, options) { var params, result; return _regenerator2.default.async(function putACL$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = options || {}; options.subres = (0, _assign2.default)({ acl: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } options.headers = options.headers || {}; options.headers['x-oss-object-acl'] = acl; name = this._objectName(name); params = this._objectRequestParams('PUT', name, options); params.successStatuses = [200]; _context.next = 10; return _regenerator2.default.awrap(this.request(params)); case 10: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 12: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _require = require('../utils/obj2xml'), obj2xml = _require.obj2xml; var _require2 = require('../utils/checkObjectTag'), checkObjectTag = _require2.checkObjectTag; var proto = exports; /** * putObjectTagging * @param {String} name - object name * @param {Object} tag - object tag, eg: `{a: "1", b: "2"}` * @param {Object} options */ proto.putObjectTagging = function putObjectTagging(name, tag) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var params, paramXMLObj, result; return _regenerator2.default.async(function putObjectTagging$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: checkObjectTag(tag); options.subres = (0, _assign2.default)({ tagging: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } name = this._objectName(name); params = this._objectRequestParams('PUT', name, options); params.successStatuses = [200]; tag = (0, _keys2.default)(tag).map(function (key) { return { Key: key, Value: tag[key] }; }); paramXMLObj = { Tagging: { TagSet: { Tag: tag } } }; params.mime = 'xml'; params.content = obj2xml(paramXMLObj); _context.next = 12; return _regenerator2.default.awrap(this.request(params)); case 12: result = _context.sent; return _context.abrupt('return', { res: result.res, status: result.status }); case 14: case 'end': return _context.stop(); } } }, null, this); }; },{"../utils/checkObjectTag":36,"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],32:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; /** * putSymlink * @param {String} name - object name * @param {String} targetName - target name * @param {Object} options * @param {{res}} */ proto.putSymlink = function putSymlink(name, targetName, options) { var params, result; return _regenerator2.default.async(function putSymlink$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = options || {}; options.headers = options.headers || {}; targetName = this._escape(this._objectName(targetName)); this._convertMetaToHeaders(options.meta, options.headers); options.headers['x-oss-symlink-target'] = targetName; options.subres = (0, _assign2.default)({ symlink: '' }, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; } if (options.storageClass) { options.headers['x-oss-storage-class'] = options.storageClass; } name = this._objectName(name); params = this._objectRequestParams('PUT', name, options); params.successStatuses = [200]; _context.next = 13; return _regenerator2.default.awrap(this.request(params)); case 13: result = _context.sent; return _context.abrupt('return', { res: result.res }); case 15: case 'end': return _context.stop(); } } }, null, this); }; },{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(require,module,exports){ 'use strict'; var _regenerator = require('babel-runtime/regenerator'); var _regenerator2 = _interopRequireDefault(_regenerator); var _promise = require('babel-runtime/core-js/promise'); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var proto = exports; proto._parallelNode = function _parallelNode(todo, parallel, fn, sourceData) { var that, jobErr, jobs, tempBatch, remainder, batch, taskIndex, i; return _regenerator2.default.async(function _parallelNode$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: that = this; // upload in parallel jobErr = []; jobs = []; tempBatch = todo.length / parallel; remainder = todo.length % parallel; batch = remainder === 0 ? tempBatch : (todo.length - remainder) / parallel + 1; taskIndex = 1; i = 0; case 8: if (!(i < todo.length)) { _context.next = 26; break; } if (!that.isCancel()) { _context.next = 11; break; } return _context.abrupt('break', 26); case 11: if (sourceData) { jobs.push(fn(that, todo[i], sourceData)); } else { jobs.push(fn(that, todo[i])); } if (!(jobs.length === parallel || taskIndex === batch && i === todo.length - 1)) { _context.next = 23; break; } _context.prev = 13; taskIndex += 1; /* eslint no-await-in-loop: [0] */ _context.next = 17; return _regenerator2.default.awrap(_promise2.default.all(jobs)); case 17: _context.next = 22; break; case 19: _context.prev = 19; _context.t0 = _context['catch'](13); jobErr.push(_context.t0); case 22: jobs = []; case 23: i++; _context.next = 8; break; case 26: return _context.abrupt('return', jobErr); case 27: case 'end': return _context.stop(); } } }, null, this, [[13, 19]]); }; proto._parallel = function _parallel(todo, parallel, jobPromise) { var that = this; return new _promise2.default(function (resolve) { var _jobErr = []; if (parallel <= 0 || !todo) { resolve(_jobErr); return; } function onlyOnce(fn) { return function () { if (fn === null) throw new Error('Callback was already called.'); var callFn = fn; fn = null; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callFn.apply(this, args); }; } function createArrayIterator(coll) { var i = -1; var len = coll.length; return function next() { return ++i < len && !that.isCancel() ? { value: coll[i], key: i } : null; }; } var nextElem = createArrayIterator(todo); var done = false; var running = 0; var looping = false; function iterateeCallback(err, value) { running -= 1; if (err) { done = true; _jobErr.push(err); resolve(_jobErr); } else if (value === {} || done && running <= 0) { done = true; resolve(_jobErr); } else if (!looping) { /* eslint no-use-before-define: [0] */ if (that.isCancel()) { resolve(_jobErr); } else { replenish(); } } } function iteratee(value, callback) { jobPromise(value).then(function (result) { callback(null, result); }).catch(function (err) { callback(err); }); } function replenish() { looping = true; while (running < parallel && !done && !that.isCancel()) { var elem = nextElem(); if (elem === null || _jobErr.length > 0) { done = true; if (running <= 0) { resolve(_jobErr); } return; } running += 1; iteratee(elem.value, onlyOnce(iterateeCallback)); } looping = false; } replenish(); }); }; /** * cancel operation, now can use with multipartUpload * @param {Object} abort * {String} anort.name object key * {String} anort.uploadId upload id * {String} anort.options timeout */ proto.cancel = function cancel(abort) { this.options.cancelFlag = true; if (abort) { this.abortMultipartUpload(abort.name, abort.uploadId, abort.options); } }; proto.isCancel = function isCancel() { return this.options.cancelFlag; }; proto.resetCancelFlag = function resetCancelFlag() { this.options.cancelFlag = false; }; proto._stop = function _stop() { this.options.cancelFlag = true; }; // cancel is not error , so create an object proto._makeCancelEvent = function _makeCancelEvent() { var cancelEvent = { status: 0, name: 'cancel' }; return cancelEvent; }; },{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(require,module,exports){ (function (Buffer){ 'use strict'; var _stringify = require('babel-runtime/core-js/json/stringify'); var _stringify2 = _interopRequireDefault(_stringify); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var crypto = require('./../../shims/crypto/crypto.js'); var is = require('is-type-of'); /** * * @param {String} resourcePath * @param {Object} parameters * @return */ exports.buildCanonicalizedResource = function buildCanonicalizedResource(resourcePath, parameters) { var canonicalizedResource = '' + resourcePath; var separatorString = '?'; if (is.string(parameters) && parameters.trim() !== '') { canonicalizedResource += separatorString + parameters; } else if (is.array(parameters)) { parameters.sort(); canonicalizedResource += separatorString + parameters.join('&'); } else if (parameters) { var compareFunc = function compareFunc(entry1, entry2) { if (entry1[0] > entry2[0]) { return 1; } else if (entry1[0] < entry2[0]) { return -1; } return 0; }; var processFunc = function processFunc(key) { canonicalizedResource += separatorString + key; if (parameters[key]) { canonicalizedResource += '=' + parameters[key]; } separatorString = '&'; }; (0, _keys2.default)(parameters).sort(compareFunc).forEach(processFunc); } return canonicalizedResource; }; /** * @param {String} method * @param {String} resourcePath * @param {Object} request * @param {String} expires * @return {String} canonicalString */ exports.buildCanonicalString = function canonicalString(method, resourcePath, request, expires) { request = request || {}; var headers = request.headers || {}; var OSS_PREFIX = 'x-oss-'; var ossHeaders = []; var headersToSign = {}; var signContent = [method.toUpperCase(), headers['Content-Md5'] || '', headers['Content-Type'] || headers['Content-Type'.toLowerCase()], expires || headers['x-oss-date']]; (0, _keys2.default)(headers).forEach(function (key) { var lowerKey = key.toLowerCase(); if (lowerKey.indexOf(OSS_PREFIX) === 0) { headersToSign[lowerKey] = String(headers[key]).trim(); } }); (0, _keys2.default)(headersToSign).sort().forEach(function (key) { ossHeaders.push(key + ':' + headersToSign[key]); }); signContent = signContent.concat(ossHeaders); signContent.push(this.buildCanonicalizedResource(resourcePath, request.parameters)); return signContent.join('\n'); }; /** * @param {String} accessKeySecret * @param {String} canonicalString */ exports.computeSignature = function computeSignature(accessKeySecret, canonicalString) { var signature = crypto.createHmac('sha1', accessKeySecret); return signature.update(Buffer.from(canonicalString, 'utf8')).digest('base64'); }; /** * @param {String} accessKeyId * @param {String} accessKeySecret * @param {String} canonicalString */ exports.authorization = function authorization(accessKeyId, accessKeySecret, canonicalString) { return 'OSS ' + accessKeyId + ':' + this.computeSignature(accessKeySecret, canonicalString); }; /** * * @param {String} accessKeySecret * @param {Object} options * @param {String} resource * @param {Number} expires */ exports._signatureForURL = function _signatureForURL(accessKeySecret) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var resource = arguments[2]; var expires = arguments[3]; var headers = {}; var _options$subResource = options.subResource, subResource = _options$subResource === undefined ? {} : _options$subResource; if (options.process) { var processKeyword = 'x-oss-process'; subResource[processKeyword] = options.process; } if (options.trafficLimit) { var trafficLimitKey = 'x-oss-traffic-limit'; subResource[trafficLimitKey] = options.trafficLimit; } if (options.response) { (0, _keys2.default)(options.response).forEach(function (k) { var key = 'response-' + k.toLowerCase(); subResource[key] = options.response[k]; }); } (0, _keys2.default)(options).forEach(function (key) { var lowerKey = key.toLowerCase(); var value = options[key]; if (lowerKey.indexOf('x-oss-') === 0) { headers[lowerKey] = value; } else if (lowerKey.indexOf('content-md5') === 0) { headers[key] = value; } else if (lowerKey.indexOf('content-type') === 0) { headers[key] = value; } }); if (Object.prototype.hasOwnProperty.call(options, 'security-token')) { subResource['security-token'] = options['security-token']; } if (Object.prototype.hasOwnProperty.call(options, 'callback')) { var json = { callbackUrl: encodeURI(options.callback.url), callbackBody: options.callback.body }; if (options.callback.host) { json.callbackHost = options.callback.host; } if (options.callback.contentType) { json.callbackBodyType = options.callback.contentType; } subResource.callback = Buffer.from((0, _stringify2.default)(json)).toString('base64'); if (options.callback.customValue) { var callbackVar = {}; (0, _keys2.default)(options.callback.customValue).forEach(function (key) { callbackVar['x:' + key] = options.callback.customValue[key]; }); subResource['callback-var'] = Buffer.from((0, _stringify2.default)(callbackVar)).toString('base64'); } } var canonicalString = this.buildCanonicalString(options.method, resource, { headers: headers, parameters: subResource }, expires.toString()); return { Signature: this.computeSignature(accessKeySecret, canonicalString), subResource: subResource }; }; }).call(this,require("buffer").Buffer) },{"./../../shims/crypto/crypto.js":284,"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,"buffer":73,"is-type-of":289}],35:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkBucketName = void 0; exports.checkBucketName = function (name, createBucket) { var bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/; if (!bucketRegex.test(name)) { throw new Error('The bucket must be conform to the specifications'); } }; },{}],36:[function(require,module,exports){ "use strict"; var _entries = require("babel-runtime/core-js/object/entries"); var _entries2 = _interopRequireDefault(_entries); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: true }); exports.checkObjectTag = void 0; var _require = require('./checkValid'), checkValid = _require.checkValid; var _require2 = require('./isObject'), isObject = _require2.isObject; var commonRules = [{ validator: function validator(value) { if (typeof value !== 'string') { throw new Error('the key and value of the tag must be String'); } } }, { pattern: /^[a-zA-Z0-9 +-=._:/]+$/, msg: 'tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)' }]; var rules = { key: [].concat(commonRules, [{ pattern: /^.{1,128}$/, msg: 'tag key can be a maximum of 128 bytes in length' }]), value: [].concat(commonRules, [{ pattern: /^.{0,256}$/, msg: 'tag value can be a maximum of 256 bytes in length' }]) }; function checkObjectTag(tag) { if (!isObject(tag)) { throw new Error('tag must be Object'); } var entries = (0, _entries2.default)(tag); if (entries.length > 10) { throw new Error('maximum of 10 tags for a object'); } var rulesIndexKey = ['key', 'value']; entries.forEach(function (keyValue) { keyValue.forEach(function (item, index) { checkValid(item, rules[rulesIndexKey[index]]); }); }); } exports.checkObjectTag = checkObjectTag; },{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkValid = void 0; function checkValid(_value, _rules) { _rules.forEach(function (rule) { if (rule.validator) { rule.validator(_value); } else if (rule.pattern && !rule.pattern.test(_value)) { throw new Error(rule.msg); } }); } exports.checkValid = checkValid; },{}],38:[function(require,module,exports){ (function (Buffer){ "use strict"; var _assign = require("babel-runtime/core-js/object/assign"); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: true }); exports.createRequest = void 0; var crypto = require('./../../../shims/crypto/crypto.js'); var debug = require('debug')('ali-oss'); var mime = require('mime'); var dateFormat = require('dateformat'); var copy = require('copy-to'); var path = require('path'); function getHeader(headers, name) { return headers[name] || headers[name.toLowerCase()]; } function delHeader(headers, name) { delete headers[name]; delete headers[name.toLowerCase()]; } function createRequest(params) { var date = new Date(); if (this.options.amendTimeSkewed) { date = +new Date() + this.options.amendTimeSkewed; } var headers = { 'x-oss-date': dateFormat(date, 'UTC:ddd, dd mmm yyyy HH:MM:ss \'GMT\''), 'x-oss-user-agent': this.userAgent }; if (this.userAgent.includes('nodejs')) { headers['User-Agent'] = this.userAgent; } if (this.options.isRequestPay) { (0, _assign2.default)(headers, { 'x-oss-request-payer': 'requester' }); } if (this.options.stsToken) { headers['x-oss-security-token'] = this.options.stsToken; } copy(params.headers).to(headers); if (!getHeader(headers, 'Content-Type')) { if (params.mime && params.mime.indexOf('/') > 0) { headers['Content-Type'] = params.mime; } else { headers['Content-Type'] = mime.getType(params.mime || path.extname(params.object || '')); } } if (!getHeader(headers, 'Content-Type')) { delHeader(headers, 'Content-Type'); } if (params.content) { headers['Content-Md5'] = crypto.createHash('md5').update(Buffer.from(params.content, 'utf8')).digest('base64'); if (!headers['Content-Length']) { headers['Content-Length'] = params.content.length; } } var authResource = this._getResource(params); headers.authorization = this.authorization(params.method, authResource, params.subres, headers); var url = this._getReqUrl(params); debug('request %s %s, with headers %j, !!stream: %s', params.method, url, headers, !!params.stream); var timeout = params.timeout || this.options.timeout; var reqParams = { method: params.method, content: params.content, stream: params.stream, headers: headers, timeout: timeout, writeStream: params.writeStream, customResponse: params.customResponse, ctx: params.ctx || this.ctx }; if (this.agent) { reqParams.agent = this.agent; } if (this.httpsAgent) { reqParams.httpsAgent = this.httpsAgent; } return { url: url, params: reqParams }; } exports.createRequest = createRequest; }).call(this,require("buffer").Buffer) },{"./../../../shims/crypto/crypto.js":284,"babel-runtime/core-js/object/assign":54,"buffer":73,"copy-to":76,"dateformat":190,"debug":288,"mime":202,"path":205}],39:[function(require,module,exports){ "use strict"; var _keys = require("babel-runtime/core-js/object/keys"); var _keys2 = _interopRequireDefault(_keys); var _typeof2 = require("babel-runtime/helpers/typeof"); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: true }); exports.deepCopy = void 0; exports.deepCopy = function (obj) { if (obj === null || (typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) !== 'object') { return obj; } var copy = Array.isArray(obj) ? [] : {}; (0, _keys2.default)(obj).forEach(function (key) { copy[key] = exports.deepCopy(obj[key]); }); return copy; }; },{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(require,module,exports){ "use strict"; var _keys = require("babel-runtime/core-js/object/keys"); var _keys2 = _interopRequireDefault(_keys); var _typeof2 = require("babel-runtime/helpers/typeof"); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: true }); exports.formatObjKey = void 0; function formatObjKey(obj, type) { if (obj === null || (typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) !== 'object') { return obj; } var o = void 0; if (Array.isArray(obj)) { o = []; for (var i = 0; i < obj.length; i++) { o.push(formatObjKey(obj[i], type)); } } else { o = {}; (0, _keys2.default)(obj).forEach(function (key) { o[handelFormat(key, type)] = formatObjKey(obj[key], type); }); } return o; } exports.formatObjKey = formatObjKey; function handelFormat(key, type) { if (type === 'firstUpperCase') { key = key.replace(/^./, function (_) { return _.toUpperCase(); }); } else if (type === 'firstLowerCase') { key = key.replace(/^./, function (_) { return _.toLowerCase(); }); } return key; } },{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStrBytesCount = void 0; function getStrBytesCount(str) { var bytesCount = 0; for (var i = 0; i < str.length; i++) { var c = str.charAt(i); if (/^[\u00-\uff]$/.test(c)) { bytesCount += 1; } else { bytesCount += 2; } } return bytesCount; } exports.getStrBytesCount = getStrBytesCount; },{}],42:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isArray = void 0; exports.isArray = function (obj) { return Object.prototype.toString.call(obj) === '[object Array]'; }; },{}],43:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isBlob = void 0; function isBlob(blob) { return typeof Blob !== 'undefined' && blob instanceof Blob; } exports.isBlob = isBlob; },{}],44:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFile = void 0; exports.isFile = function (obj) { return typeof File !== 'undefined' && obj instanceof File; }; },{}],45:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isIP = void 0; // it provide commont methods for node and browser , we will add more solutions later in this file /** * Judge isIP include ipv4 or ipv6 * @param {String} options * @return {Array} the multipart uploads */ exports.isIP = function (host) { var ipv4Regex = /^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/; var ipv6Regex = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; return ipv4Regex.test(host) || ipv6Regex.test(host); }; },{}],46:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isObject = void 0; exports.isObject = function (obj) { return Object.prototype.toString.call(obj) === '[object Object]'; }; },{}],47:[function(require,module,exports){ "use strict"; var _keys = require("babel-runtime/core-js/object/keys"); var _keys2 = _interopRequireDefault(_keys); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: true }); exports.obj2xml = void 0; var formatObjKey_1 = require("./formatObjKey"); function type(params) { return Object.prototype.toString.call(params).replace(/(.*? |])/g, '').toLowerCase(); } function obj2xml(obj, options) { var s = ''; if (options && options.headers) { s = '\n'; } if (options && options.firstUpperCase) { obj = formatObjKey_1.formatObjKey(obj, 'firstUpperCase'); } if (type(obj) === 'object') { (0, _keys2.default)(obj).forEach(function (key) { if (type(obj[key]) === 'string' || type(obj[key]) === 'number') { s += "<" + key + ">" + obj[key] + ""; } else if (type(obj[key]) === 'object') { s += "<" + key + ">" + obj2xml(obj[key]) + ""; } else if (type(obj[key]) === 'array') { s += obj[key].map(function (keyChild) { return "<" + key + ">" + obj2xml(keyChild) + ""; }).join(''); } else { s += "<" + key + ">" + obj[key].toString() + ""; } }); } else { s += obj.toString(); } return s; } exports.obj2xml = obj2xml; },{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(require,module,exports){ module.exports = noop; module.exports.HttpsAgent = noop; // Noop function for browser since native api's don't use agents. function noop () {} },{}],49:[function(require,module,exports){ module.exports = require('./register')().Promise },{"./register":51}],50:[function(require,module,exports){ "use strict" // global key for user preferred registration var REGISTRATION_KEY = '@@any-promise/REGISTRATION', // Prior registration (preferred or detected) registered = null /** * Registers the given implementation. An implementation must * be registered prior to any call to `require("any-promise")`, * typically on application load. * * If called with no arguments, will return registration in * following priority: * * For Node.js: * * 1. Previous registration * 2. global.Promise if node.js version >= 0.12 * 3. Auto detected promise based on first sucessful require of * known promise libraries. Note this is a last resort, as the * loaded library is non-deterministic. node.js >= 0.12 will * always use global.Promise over this priority list. * 4. Throws error. * * For Browser: * * 1. Previous registration * 2. window.Promise * 3. Throws error. * * Options: * * Promise: Desired Promise constructor * global: Boolean - Should the registration be cached in a global variable to * allow cross dependency/bundle registration? (default true) */ module.exports = function(root, loadImplementation){ return function register(implementation, opts){ implementation = implementation || null opts = opts || {} // global registration unless explicitly {global: false} in options (default true) var registerGlobal = opts.global !== false; // load any previous global registration if(registered === null && registerGlobal){ registered = root[REGISTRATION_KEY] || null } if(registered !== null && implementation !== null && registered.implementation !== implementation){ // Throw error if attempting to redefine implementation throw new Error('any-promise already defined as "'+registered.implementation+ '". You can only register an implementation before the first '+ ' call to require("any-promise") and an implementation cannot be changed') } if(registered === null){ // use provided implementation if(implementation !== null && typeof opts.Promise !== 'undefined'){ registered = { Promise: opts.Promise, implementation: implementation } } else { // require implementation if implementation is specified but not provided registered = loadImplementation(implementation) } if(registerGlobal){ // register preference globally in case multiple installations root[REGISTRATION_KEY] = registered } } return registered } } },{}],51:[function(require,module,exports){ "use strict"; module.exports = require('./loader')(window, loadImplementation) /** * Browser specific loadImplementation. Always uses `window.Promise` * * To register a custom implementation, must register with `Promise` option. */ function loadImplementation(){ if(typeof window.Promise === 'undefined'){ throw new Error("any-promise browser requires a polyfill or explicit registration"+ " e.g: require('any-promise/register/bluebird')") } return { Promise: window.Promise, implementation: 'window.Promise' } } },{"./loader":50}],52:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/array/from"), __esModule: true }; },{"core-js/library/fn/array/from":77}],53:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/json/stringify"), __esModule: true }; },{"core-js/library/fn/json/stringify":78}],54:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/assign"), __esModule: true }; },{"core-js/library/fn/object/assign":79}],55:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/create"), __esModule: true }; },{"core-js/library/fn/object/create":80}],56:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/define-property"), __esModule: true }; },{"core-js/library/fn/object/define-property":81}],57:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/entries"), __esModule: true }; },{"core-js/library/fn/object/entries":82}],58:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/get-own-property-names"), __esModule: true }; },{"core-js/library/fn/object/get-own-property-names":83}],59:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/get-prototype-of"), __esModule: true }; },{"core-js/library/fn/object/get-prototype-of":84}],60:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/object/keys"), __esModule: true }; },{"core-js/library/fn/object/keys":85}],61:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/promise"), __esModule: true }; },{"core-js/library/fn/promise":86}],62:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/set-immediate"), __esModule: true }; },{"core-js/library/fn/set-immediate":87}],63:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/string/from-code-point"), __esModule: true }; },{"core-js/library/fn/string/from-code-point":88}],64:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/symbol"), __esModule: true }; },{"core-js/library/fn/symbol":90}],65:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/symbol/has-instance"), __esModule: true }; },{"core-js/library/fn/symbol/has-instance":89}],66:[function(require,module,exports){ module.exports = { "default": require("core-js/library/fn/symbol/iterator"), __esModule: true }; },{"core-js/library/fn/symbol/iterator":91}],67:[function(require,module,exports){ "use strict"; exports.__esModule = true; var _iterator = require("../core-js/symbol/iterator"); var _iterator2 = _interopRequireDefault(_iterator); var _symbol = require("../core-js/symbol"); var _symbol2 = _interopRequireDefault(_symbol); var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof(obj); } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); }; },{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(require,module,exports){ module.exports = require("regenerator-runtime"); },{"regenerator-runtime":226}],69:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 function getLens (b64) { var len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('=') if (validLen === -1) validLen = len var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { var tmp var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen var i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk( uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) )) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } },{}],70:[function(require,module,exports){ /*! * Bowser - a browser detector * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2015 */ !function (root, name, definition) { if (typeof module != 'undefined' && module.exports) module.exports = definition() else if (typeof define == 'function' && define.amd) define(name, definition) else root[name] = definition() }(this, 'bowser', function () { /** * See useragents.js for examples of navigator.userAgent */ var t = true function detect(ua) { function getFirstMatch(regex) { var match = ua.match(regex); return (match && match.length > 1 && match[1]) || ''; } function getSecondMatch(regex) { var match = ua.match(regex); return (match && match.length > 1 && match[2]) || ''; } var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() , likeAndroid = /like android/i.test(ua) , android = !likeAndroid && /android/i.test(ua) , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) , chromeos = /CrOS/.test(ua) , silk = /silk/i.test(ua) , sailfish = /sailfish/i.test(ua) , tizen = /tizen/i.test(ua) , webos = /(web|hpw)(o|0)s/i.test(ua) , windowsphone = /windows phone/i.test(ua) , samsungBrowser = /SamsungBrowser/i.test(ua) , windows = !windowsphone && /windows/i.test(ua) , mac = !iosdevice && !silk && /macintosh/i.test(ua) , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) , edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i) , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) , tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua) , mobile = !tablet && /[^-]mobi/i.test(ua) , xbox = /xbox/i.test(ua) , result if (/opera/i.test(ua)) { // an old Opera result = { name: 'Opera' , opera: t , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) } } else if (/opr\/|opios/i.test(ua)) { // a new Opera result = { name: 'Opera' , opera: t , version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier } } else if (/SamsungBrowser/i.test(ua)) { result = { name: 'Samsung Internet for Android' , samsungBrowser: t , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) } } else if (/Whale/i.test(ua)) { result = { name: 'NAVER Whale browser' , whale: t , version: getFirstMatch(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/MZBrowser/i.test(ua)) { result = { name: 'MZ Browser' , mzbrowser: t , version: getFirstMatch(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/coast/i.test(ua)) { result = { name: 'Opera Coast' , coast: t , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) } } else if (/focus/i.test(ua)) { result = { name: 'Focus' , focus: t , version: getFirstMatch(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/yabrowser/i.test(ua)) { result = { name: 'Yandex Browser' , yandexbrowser: t , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) } } else if (/ucbrowser/i.test(ua)) { result = { name: 'UC Browser' , ucbrowser: t , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/mxios/i.test(ua)) { result = { name: 'Maxthon' , maxthon: t , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/epiphany/i.test(ua)) { result = { name: 'Epiphany' , epiphany: t , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/puffin/i.test(ua)) { result = { name: 'Puffin' , puffin: t , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) } } else if (/sleipnir/i.test(ua)) { result = { name: 'Sleipnir' , sleipnir: t , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/k-meleon/i.test(ua)) { result = { name: 'K-Meleon' , kMeleon: t , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) } } else if (windowsphone) { result = { name: 'Windows Phone' , osname: 'Windows Phone' , windowsphone: t } if (edgeVersion) { result.msedge = t result.version = edgeVersion } else { result.msie = t result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) } } else if (/msie|trident/i.test(ua)) { result = { name: 'Internet Explorer' , msie: t , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) } } else if (chromeos) { result = { name: 'Chrome' , osname: 'Chrome OS' , chromeos: t , chromeBook: t , chrome: t , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) } } else if (/edg([ea]|ios)/i.test(ua)) { result = { name: 'Microsoft Edge' , msedge: t , version: edgeVersion } } else if (/vivaldi/i.test(ua)) { result = { name: 'Vivaldi' , vivaldi: t , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier } } else if (sailfish) { result = { name: 'Sailfish' , osname: 'Sailfish OS' , sailfish: t , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) } } else if (/seamonkey\//i.test(ua)) { result = { name: 'SeaMonkey' , seamonkey: t , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) } } else if (/firefox|iceweasel|fxios/i.test(ua)) { result = { name: 'Firefox' , firefox: t , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) } if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { result.firefoxos = t result.osname = 'Firefox OS' } } else if (silk) { result = { name: 'Amazon Silk' , silk: t , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) } } else if (/phantom/i.test(ua)) { result = { name: 'PhantomJS' , phantom: t , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) } } else if (/slimerjs/i.test(ua)) { result = { name: 'SlimerJS' , slimer: t , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) } } else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { result = { name: 'BlackBerry' , osname: 'BlackBerry OS' , blackberry: t , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) } } else if (webos) { result = { name: 'WebOS' , osname: 'WebOS' , webos: t , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) }; /touchpad\//i.test(ua) && (result.touchpad = t) } else if (/bada/i.test(ua)) { result = { name: 'Bada' , osname: 'Bada' , bada: t , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) }; } else if (tizen) { result = { name: 'Tizen' , osname: 'Tizen' , tizen: t , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier }; } else if (/qupzilla/i.test(ua)) { result = { name: 'QupZilla' , qupzilla: t , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier } } else if (/chromium/i.test(ua)) { result = { name: 'Chromium' , chromium: t , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier } } else if (/chrome|crios|crmo/i.test(ua)) { result = { name: 'Chrome' , chrome: t , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) } } else if (android) { result = { name: 'Android' , version: versionIdentifier } } else if (/safari|applewebkit/i.test(ua)) { result = { name: 'Safari' , safari: t } if (versionIdentifier) { result.version = versionIdentifier } } else if (iosdevice) { result = { name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' } // WTF: version is not part of user agent in web apps if (versionIdentifier) { result.version = versionIdentifier } } else if(/googlebot/i.test(ua)) { result = { name: 'Googlebot' , googlebot: t , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier } } else { result = { name: getFirstMatch(/^(.*)\/(.*) /), version: getSecondMatch(/^(.*)\/(.*) /) }; } // set webkit or gecko flag for browsers based on these engines if (!result.msedge && /(apple)?webkit/i.test(ua)) { if (/(apple)?webkit\/537\.36/i.test(ua)) { result.name = result.name || "Blink" result.blink = t } else { result.name = result.name || "Webkit" result.webkit = t } if (!result.version && versionIdentifier) { result.version = versionIdentifier } } else if (!result.opera && /gecko\//i.test(ua)) { result.name = result.name || "Gecko" result.gecko = t result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) } // set OS flags for platforms that have multiple browsers if (!result.windowsphone && (android || result.silk)) { result.android = t result.osname = 'Android' } else if (!result.windowsphone && iosdevice) { result[iosdevice] = t result.ios = t result.osname = 'iOS' } else if (mac) { result.mac = t result.osname = 'macOS' } else if (xbox) { result.xbox = t result.osname = 'Xbox' } else if (windows) { result.windows = t result.osname = 'Windows' } else if (linux) { result.linux = t result.osname = 'Linux' } function getWindowsVersion (s) { switch (s) { case 'NT': return 'NT' case 'XP': return 'XP' case 'NT 5.0': return '2000' case 'NT 5.1': return 'XP' case 'NT 5.2': return '2003' case 'NT 6.0': return 'Vista' case 'NT 6.1': return '7' case 'NT 6.2': return '8' case 'NT 6.3': return '8.1' case 'NT 10.0': return '10' default: return undefined } } // OS version extraction var osVersion = ''; if (result.windows) { osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i)) } else if (result.windowsphone) { osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); } else if (result.mac) { osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i); osVersion = osVersion.replace(/[_\s]/g, '.'); } else if (iosdevice) { osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); osVersion = osVersion.replace(/[_\s]/g, '.'); } else if (android) { osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); } else if (result.webos) { osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); } else if (result.blackberry) { osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); } else if (result.bada) { osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); } else if (result.tizen) { osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); } if (osVersion) { result.osversion = osVersion; } // device type extraction var osMajorVersion = !result.windows && osVersion.split('.')[0]; if ( tablet || nexusTablet || iosdevice == 'ipad' || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) || result.silk ) { result.tablet = t } else if ( mobile || iosdevice == 'iphone' || iosdevice == 'ipod' || android || nexusMobile || result.blackberry || result.webos || result.bada ) { result.mobile = t } // Graded Browser Support // http://developer.yahoo.com/yui/articles/gbs if (result.msedge || (result.msie && result.version >= 10) || (result.yandexbrowser && result.version >= 15) || (result.vivaldi && result.version >= 1.0) || (result.chrome && result.version >= 20) || (result.samsungBrowser && result.version >= 4) || (result.whale && compareVersions([result.version, '1.0']) === 1) || (result.mzbrowser && compareVersions([result.version, '6.0']) === 1) || (result.focus && compareVersions([result.version, '1.0']) === 1) || (result.firefox && result.version >= 20.0) || (result.safari && result.version >= 6) || (result.opera && result.version >= 10.0) || (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || (result.blackberry && result.version >= 10.1) || (result.chromium && result.version >= 20) ) { result.a = t; } else if ((result.msie && result.version < 10) || (result.chrome && result.version < 20) || (result.firefox && result.version < 20.0) || (result.safari && result.version < 6) || (result.opera && result.version < 10.0) || (result.ios && result.osversion && result.osversion.split(".")[0] < 6) || (result.chromium && result.version < 20) ) { result.c = t } else result.x = t return result } var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '') bowser.test = function (browserList) { for (var i = 0; i < browserList.length; ++i) { var browserItem = browserList[i]; if (typeof browserItem=== 'string') { if (browserItem in bowser) { return true; } } } return false; } /** * Get version precisions count * * @example * getVersionPrecision("1.10.3") // 3 * * @param {string} version * @return {number} */ function getVersionPrecision(version) { return version.split(".").length; } /** * Array::map polyfill * * @param {Array} arr * @param {Function} iterator * @return {Array} */ function map(arr, iterator) { var result = [], i; if (Array.prototype.map) { return Array.prototype.map.call(arr, iterator); } for (i = 0; i < arr.length; i++) { result.push(iterator(arr[i])); } return result; } /** * Calculate browser version weight * * @example * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 * * @param {Array} versions versions to compare * @return {Number} comparison result */ function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); var chunks = map(versions, function (version) { var delta = precision - getVersionPrecision(version); // 2) "9" -> "9.0" (for precision = 2) version = version + new Array(delta + 1).join(".0"); // 3) "9.0" -> ["000000000"", "000000009"] return map(version.split("."), function (chunk) { return new Array(20 - chunk.length).join("0") + chunk; }).reverse(); }); // iterate in reverse order by reversed chunks array while (--precision >= 0) { // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) if (chunks[0][precision] > chunks[1][precision]) { return 1; } else if (chunks[0][precision] === chunks[1][precision]) { if (precision === 0) { // all version chunks are same return 0; } } else { return -1; } } } /** * Check if browser is unsupported * * @example * bowser.isUnsupportedBrowser({ * msie: "10", * firefox: "23", * chrome: "29", * safari: "5.1", * opera: "16", * phantom: "534" * }); * * @param {Object} minVersions map of minimal version to browser * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map * @param {String} [ua] user agent string * @return {Boolean} */ function isUnsupportedBrowser(minVersions, strictMode, ua) { var _bowser = bowser; // make strictMode param optional with ua param usage if (typeof strictMode === 'string') { ua = strictMode; strictMode = void(0); } if (strictMode === void(0)) { strictMode = false; } if (ua) { _bowser = detect(ua); } var version = "" + _bowser.version; for (var browser in minVersions) { if (minVersions.hasOwnProperty(browser)) { if (_bowser[browser]) { if (typeof minVersions[browser] !== 'string') { throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); } // browser version and min supported version. return compareVersions([version, minVersions[browser]]) < 0; } } } return strictMode; // not found } /** * Check if browser is supported * * @param {Object} minVersions map of minimal version to browser * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map * @param {String} [ua] user agent string * @return {Boolean} */ function check(minVersions, strictMode, ua) { return !isUnsupportedBrowser(minVersions, strictMode, ua); } bowser.isUnsupportedBrowser = isUnsupportedBrowser; bowser.compareVersions = compareVersions; bowser.check = check; /* * Set our detect method to the main bowser object so we can * reuse it to test other user agents. * This is needed to implement future tests. */ bowser._detect = detect; /* * Set our detect public method to the main bowser object * This is needed to implement bowser in server side */ bowser.detect = detect; return bowser }); },{}],71:[function(require,module,exports){ },{}],72:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var Buffer = require('buffer').Buffer; var isBufferEncoding = Buffer.isEncoding || function(encoding) { switch (encoding && encoding.toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; default: return false; } } function assertEncoding(encoding) { if (encoding && !isBufferEncoding(encoding)) { throw new Error('Unknown encoding: ' + encoding); } } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. CESU-8 is handled as part of the UTF-8 encoding. // // @TODO Handling all encodings inside a single object makes it very difficult // to reason about this code, so it should be split up in the future. // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code // points as used by CESU-8. var StringDecoder = exports.StringDecoder = function(encoding) { this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); assertEncoding(encoding); switch (this.encoding) { case 'utf8': // CESU-8 represents each of Surrogate Pair by 3-bytes this.surrogateSize = 3; break; case 'ucs2': case 'utf16le': // UTF-16 represents each of Surrogate Pair by 2-bytes this.surrogateSize = 2; this.detectIncompleteChar = utf16DetectIncompleteChar; break; case 'base64': // Base-64 stores 3 bytes in 4 chars, and pads the remainder. this.surrogateSize = 3; this.detectIncompleteChar = base64DetectIncompleteChar; break; default: this.write = passThroughWrite; return; } // Enough space to store all bytes of a single character. UTF-8 needs 4 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). this.charBuffer = new Buffer(6); // Number of bytes received for the current incomplete multi-byte character. this.charReceived = 0; // Number of bytes expected for the current incomplete multi-byte character. this.charLength = 0; }; // write decodes the given buffer and returns it as JS string that is // guaranteed to not contain any partial multi-byte characters. Any partial // character found at the end of the buffer is buffered up, and will be // returned when calling write again with the remaining bytes. // // Note: Converting a Buffer containing an orphan surrogate to a String // currently works, but converting a String to a Buffer (via `new Buffer`, or // Buffer#write) will replace incomplete surrogates with the unicode // replacement character. See https://codereview.chromium.org/121173009/ . StringDecoder.prototype.write = function(buffer) { var charStr = ''; // if our last write ended with an incomplete multibyte character while (this.charLength) { // determine how many remaining bytes this buffer has to offer for this char var available = (buffer.length >= this.charLength - this.charReceived) ? this.charLength - this.charReceived : buffer.length; // add the new bytes to the char buffer buffer.copy(this.charBuffer, this.charReceived, 0, available); this.charReceived += available; if (this.charReceived < this.charLength) { // still not enough chars in this buffer? wait for more ... return ''; } // remove bytes belonging to the current character from the buffer buffer = buffer.slice(available, buffer.length); // get the character that was split charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character var charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { this.charLength += this.surrogateSize; charStr = ''; continue; } this.charReceived = this.charLength = 0; // if there are no more bytes in this buffer, just emit our char if (buffer.length === 0) { return charStr; } break; } // determine and set charLength / charReceived this.detectIncompleteChar(buffer); var end = buffer.length; if (this.charLength) { // buffer the incomplete character bytes we got buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); end -= this.charReceived; } charStr += buffer.toString(this.encoding, 0, end); var end = charStr.length - 1; var charCode = charStr.charCodeAt(end); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character if (charCode >= 0xD800 && charCode <= 0xDBFF) { var size = this.surrogateSize; this.charLength += size; this.charReceived += size; this.charBuffer.copy(this.charBuffer, size, 0, size); buffer.copy(this.charBuffer, 0, 0, size); return charStr.substring(0, end); } // or just emit the charStr return charStr; }; // detectIncompleteChar determines if there is an incomplete UTF-8 character at // the end of the given buffer. If so, it sets this.charLength to the byte // length that character, and sets this.charReceived to the number of bytes // that are available for this character. StringDecoder.prototype.detectIncompleteChar = function(buffer) { // determine how many bytes we have to check at the end of this buffer var i = (buffer.length >= 3) ? 3 : buffer.length; // Figure out if one of the last i bytes of our buffer announces an // incomplete char. for (; i > 0; i--) { var c = buffer[buffer.length - i]; // See http://en.wikipedia.org/wiki/UTF-8#Description // 110XXXXX if (i == 1 && c >> 5 == 0x06) { this.charLength = 2; break; } // 1110XXXX if (i <= 2 && c >> 4 == 0x0E) { this.charLength = 3; break; } // 11110XXX if (i <= 3 && c >> 3 == 0x1E) { this.charLength = 4; break; } } this.charReceived = i; }; StringDecoder.prototype.end = function(buffer) { var res = ''; if (buffer && buffer.length) res = this.write(buffer); if (this.charReceived) { var cr = this.charReceived; var buf = this.charBuffer; var enc = this.encoding; res += buf.slice(0, cr).toString(enc); } return res; }; function passThroughWrite(buffer) { return buffer.toString(this.encoding); } function utf16DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 2; this.charLength = this.charReceived ? 2 : 0; } function base64DetectIncompleteChar(buffer) { this.charReceived = buffer.length % 3; this.charLength = this.charReceived ? 3 : 0; } },{"buffer":73}],73:[function(require,module,exports){ (function (global,Buffer){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ 'use strict' var base64 = require('base64-js') var ieee754 = require('ieee754') var isArray = require('isarray') exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Use Object implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * Due to various browser bugs, sometimes the Object implementation will be used even * when the browser supports typed arrays. * * Note: * * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * incorrect length in some situations. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they * get the Object implementation, which is slower but behaves correctly. */ Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport() /* * Export kMaxLength after typed array support is determined. */ exports.kMaxLength = kMaxLength() function typedArraySupport () { try { var arr = new Uint8Array(1) arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} return arr.foo() === 42 && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } } function kMaxLength () { return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff } function createBuffer (that, length) { if (kMaxLength() < length) { throw new RangeError('Invalid typed array length') } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = new Uint8Array(length) that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class if (that === null) { that = new Buffer(length) } that.length = length } return that } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length) } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error( 'If encoding is specified then the first argument must be a string' ) } return allocUnsafe(this, arg) } return from(this, arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation // TODO: Legacy, not needed anymore. Remove in next major version. Buffer._augment = function (arr) { arr.__proto__ = Buffer.prototype return arr } function from (that, value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number') } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { return fromArrayBuffer(that, value, encodingOrOffset, length) } if (typeof value === 'string') { return fromString(that, value, encodingOrOffset) } return fromObject(that, value) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(null, value, encodingOrOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { Buffer.prototype.__proto__ = Uint8Array.prototype Buffer.__proto__ = Uint8Array if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) { // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 Object.defineProperty(Buffer, Symbol.species, { value: null, configurable: true }) } } function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } else if (size < 0) { throw new RangeError('"size" argument must not be negative') } } function alloc (that, size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(that, size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpretted as a start offset. return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill) } return createBuffer(that, size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(null, size, fill, encoding) } function allocUnsafe (that, size) { assertSize(size) that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < size; ++i) { that[i] = 0 } } return that } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(null, size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(null, size) } function fromString (that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding') } var length = byteLength(string, encoding) | 0 that = createBuffer(that, length) var actual = that.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') that = that.slice(0, actual) } return that } function fromArrayLike (that, array) { var length = array.length < 0 ? 0 : checked(array.length) | 0 that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that } function fromArrayBuffer (that, array, byteOffset, length) { array.byteLength // this throws if `array` is not a valid ArrayBuffer if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('\'offset\' is out of bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('\'length\' is out of bounds') } if (byteOffset === undefined && length === undefined) { array = new Uint8Array(array) } else if (length === undefined) { array = new Uint8Array(array, byteOffset) } else { array = new Uint8Array(array, byteOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = array that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class that = fromArrayLike(that, array) } return that } function fromObject (that, obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 that = createBuffer(that, len) if (that.length === 0) { return that } obj.copy(that, 0, 0, len) return that } if (obj) { if ((typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer) || 'length' in obj) { if (typeof obj.length !== 'number' || isnan(obj.length)) { return createBuffer(that, 0) } return fromArrayLike(that, obj) } if (obj.type === 'Buffer' && isArray(obj.data)) { return fromArrayLike(that, obj.data) } } throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } function checked (length) { // Note: cannot use `length < kMaxLength()` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return !!(b != null && b._isBuffer) } Buffer.compare = function compare (a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('Arguments must be Buffers') } if (a === b) return 0 var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } var i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } buf.copy(buffer, pos) pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { string = '' + string } var len = string.length if (len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) return utf8ToBytes(string).length // assume utf8 encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect // Buffer instances. Buffer.prototype._isBuffer = true function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { var len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { var len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { var len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { var length = this.length | 0 if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') if (this.length > max) str += ' ... ' } return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (!Buffer.isBuffer(target)) { throw new TypeError('Argument must be a Buffer') } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var y = end - start var len = Math.min(x, y) var thisCopy = this.slice(thisStart, thisEnd) var targetCopy = target.slice(start, end) for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (isNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } var i if (dir) { var foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { var found = true for (var j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } // must be an even number of digits var strLen = string.length if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16) if (isNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function latin1Write (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset | 0 if (isFinite(length)) { length = length | 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } // legacy write(string, encoding, offset, length) - remove in v0.13 } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' var loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': return asciiWrite(this, string, offset, length) case 'latin1': case 'binary': return latin1Write(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = '' var i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; ++i) { out += toHex(buf[i]) } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } Buffer.prototype.slice = function slice (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start var newBuf if (Buffer.TYPED_ARRAY_SUPPORT) { newBuf = this.subarray(start, end) newBuf.__proto__ = Buffer.prototype } else { var sliceLen = end - start newBuf = new Buffer(sliceLen, undefined) for (var i = 0; i < sliceLen; ++i) { newBuf[i] = this[i + start] } } return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } var val = this[offset + --byteLength] var mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var i = byteLength var mul = 1 var val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) this[offset] = (value & 0xff) return offset + 1 } function objectWriteUInt16 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> (littleEndian ? i : 1 - i) * 8 } } Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } function objectWriteUInt32 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff } } Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = 0 var mul = 1 var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = byteLength - 1 var mul = 1 var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } var len = end - start var i if (this === target && start < targetStart && targetStart < end) { // descending copy from end for (i = len - 1; i >= 0; --i) { target[i + targetStart] = this[i + start] } } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { // ascending copy from start for (i = 0; i < len; ++i) { target[i + targetStart] = this[i + start] } } else { Uint8Array.prototype.set.call( target, this.subarray(start, start + len), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (val.length === 1) { var code = val.charCodeAt(0) if (code < 256) { val = code } } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } } else if (typeof val === 'number') { val = val & 255 } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 var i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()) var len = bytes.length for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g function base64clean (str) { // Node strips out invalid characters like \n and \t from the string, base64-js does not str = stringtrim(str).replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function stringtrim (str) { if (str.trim) return str.trim() return str.replace(/^\s+|\s+$/g, '') } function toHex (n) { if (n < 16) return '0' + n.toString(16) return n.toString(16) } function utf8ToBytes (string, units) { units = units || Infinity var codePoint var length = string.length var leadSurrogate = null var bytes = [] for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; ++i) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } function isnan (val) { return val !== val // eslint-disable-line no-self-compare } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) },{"base64-js":69,"buffer":73,"ieee754":195,"isarray":198}],74:[function(require,module,exports){ module.exports = { "100": "Continue", "101": "Switching Protocols", "102": "Processing", "200": "OK", "201": "Created", "202": "Accepted", "203": "Non-Authoritative Information", "204": "No Content", "205": "Reset Content", "206": "Partial Content", "207": "Multi-Status", "208": "Already Reported", "226": "IM Used", "300": "Multiple Choices", "301": "Moved Permanently", "302": "Found", "303": "See Other", "304": "Not Modified", "305": "Use Proxy", "307": "Temporary Redirect", "308": "Permanent Redirect", "400": "Bad Request", "401": "Unauthorized", "402": "Payment Required", "403": "Forbidden", "404": "Not Found", "405": "Method Not Allowed", "406": "Not Acceptable", "407": "Proxy Authentication Required", "408": "Request Timeout", "409": "Conflict", "410": "Gone", "411": "Length Required", "412": "Precondition Failed", "413": "Payload Too Large", "414": "URI Too Long", "415": "Unsupported Media Type", "416": "Range Not Satisfiable", "417": "Expectation Failed", "418": "I'm a teapot", "421": "Misdirected Request", "422": "Unprocessable Entity", "423": "Locked", "424": "Failed Dependency", "425": "Unordered Collection", "426": "Upgrade Required", "428": "Precondition Required", "429": "Too Many Requests", "431": "Request Header Fields Too Large", "451": "Unavailable For Legal Reasons", "500": "Internal Server Error", "501": "Not Implemented", "502": "Bad Gateway", "503": "Service Unavailable", "504": "Gateway Timeout", "505": "HTTP Version Not Supported", "506": "Variant Also Negotiates", "507": "Insufficient Storage", "508": "Loop Detected", "509": "Bandwidth Limit Exceeded", "510": "Not Extended", "511": "Network Authentication Required" } },{}],75:[function(require,module,exports){ module.exports={ "O_RDONLY": 0, "O_WRONLY": 1, "O_RDWR": 2, "S_IFMT": 61440, "S_IFREG": 32768, "S_IFDIR": 16384, "S_IFCHR": 8192, "S_IFBLK": 24576, "S_IFIFO": 4096, "S_IFLNK": 40960, "S_IFSOCK": 49152, "O_CREAT": 512, "O_EXCL": 2048, "O_NOCTTY": 131072, "O_TRUNC": 1024, "O_APPEND": 8, "O_DIRECTORY": 1048576, "O_NOFOLLOW": 256, "O_SYNC": 128, "O_SYMLINK": 2097152, "O_NONBLOCK": 4, "S_IRWXU": 448, "S_IRUSR": 256, "S_IWUSR": 128, "S_IXUSR": 64, "S_IRWXG": 56, "S_IRGRP": 32, "S_IWGRP": 16, "S_IXGRP": 8, "S_IRWXO": 7, "S_IROTH": 4, "S_IWOTH": 2, "S_IXOTH": 1, "E2BIG": 7, "EACCES": 13, "EADDRINUSE": 48, "EADDRNOTAVAIL": 49, "EAFNOSUPPORT": 47, "EAGAIN": 35, "EALREADY": 37, "EBADF": 9, "EBADMSG": 94, "EBUSY": 16, "ECANCELED": 89, "ECHILD": 10, "ECONNABORTED": 53, "ECONNREFUSED": 61, "ECONNRESET": 54, "EDEADLK": 11, "EDESTADDRREQ": 39, "EDOM": 33, "EDQUOT": 69, "EEXIST": 17, "EFAULT": 14, "EFBIG": 27, "EHOSTUNREACH": 65, "EIDRM": 90, "EILSEQ": 92, "EINPROGRESS": 36, "EINTR": 4, "EINVAL": 22, "EIO": 5, "EISCONN": 56, "EISDIR": 21, "ELOOP": 62, "EMFILE": 24, "EMLINK": 31, "EMSGSIZE": 40, "EMULTIHOP": 95, "ENAMETOOLONG": 63, "ENETDOWN": 50, "ENETRESET": 52, "ENETUNREACH": 51, "ENFILE": 23, "ENOBUFS": 55, "ENODATA": 96, "ENODEV": 19, "ENOENT": 2, "ENOEXEC": 8, "ENOLCK": 77, "ENOLINK": 97, "ENOMEM": 12, "ENOMSG": 91, "ENOPROTOOPT": 42, "ENOSPC": 28, "ENOSR": 98, "ENOSTR": 99, "ENOSYS": 78, "ENOTCONN": 57, "ENOTDIR": 20, "ENOTEMPTY": 66, "ENOTSOCK": 38, "ENOTSUP": 45, "ENOTTY": 25, "ENXIO": 6, "EOPNOTSUPP": 102, "EOVERFLOW": 84, "EPERM": 1, "EPIPE": 32, "EPROTO": 100, "EPROTONOSUPPORT": 43, "EPROTOTYPE": 41, "ERANGE": 34, "EROFS": 30, "ESPIPE": 29, "ESRCH": 3, "ESTALE": 70, "ETIME": 101, "ETIMEDOUT": 60, "ETXTBSY": 26, "EWOULDBLOCK": 35, "EXDEV": 18, "SIGHUP": 1, "SIGINT": 2, "SIGQUIT": 3, "SIGILL": 4, "SIGTRAP": 5, "SIGABRT": 6, "SIGIOT": 6, "SIGBUS": 10, "SIGFPE": 8, "SIGKILL": 9, "SIGUSR1": 30, "SIGSEGV": 11, "SIGUSR2": 31, "SIGPIPE": 13, "SIGALRM": 14, "SIGTERM": 15, "SIGCHLD": 20, "SIGCONT": 19, "SIGSTOP": 17, "SIGTSTP": 18, "SIGTTIN": 21, "SIGTTOU": 22, "SIGURG": 16, "SIGXCPU": 24, "SIGXFSZ": 25, "SIGVTALRM": 26, "SIGPROF": 27, "SIGWINCH": 28, "SIGIO": 23, "SIGSYS": 12, "SSL_OP_ALL": 2147486719, "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION": 262144, "SSL_OP_CIPHER_SERVER_PREFERENCE": 4194304, "SSL_OP_CISCO_ANYCONNECT": 32768, "SSL_OP_COOKIE_EXCHANGE": 8192, "SSL_OP_CRYPTOPRO_TLSEXT_BUG": 2147483648, "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS": 2048, "SSL_OP_EPHEMERAL_RSA": 0, "SSL_OP_LEGACY_SERVER_CONNECT": 4, "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER": 32, "SSL_OP_MICROSOFT_SESS_ID_BUG": 1, "SSL_OP_MSIE_SSLV2_RSA_PADDING": 0, "SSL_OP_NETSCAPE_CA_DN_BUG": 536870912, "SSL_OP_NETSCAPE_CHALLENGE_BUG": 2, "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG": 1073741824, "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG": 8, "SSL_OP_NO_COMPRESSION": 131072, "SSL_OP_NO_QUERY_MTU": 4096, "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION": 65536, "SSL_OP_NO_SSLv2": 16777216, "SSL_OP_NO_SSLv3": 33554432, "SSL_OP_NO_TICKET": 16384, "SSL_OP_NO_TLSv1": 67108864, "SSL_OP_NO_TLSv1_1": 268435456, "SSL_OP_NO_TLSv1_2": 134217728, "SSL_OP_PKCS1_CHECK_1": 0, "SSL_OP_PKCS1_CHECK_2": 0, "SSL_OP_SINGLE_DH_USE": 1048576, "SSL_OP_SINGLE_ECDH_USE": 524288, "SSL_OP_SSLEAY_080_CLIENT_DH_BUG": 128, "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG": 0, "SSL_OP_TLS_BLOCK_PADDING_BUG": 512, "SSL_OP_TLS_D5_BUG": 256, "SSL_OP_TLS_ROLLBACK_BUG": 8388608, "ENGINE_METHOD_DSA": 2, "ENGINE_METHOD_DH": 4, "ENGINE_METHOD_RAND": 8, "ENGINE_METHOD_ECDH": 16, "ENGINE_METHOD_ECDSA": 32, "ENGINE_METHOD_CIPHERS": 64, "ENGINE_METHOD_DIGESTS": 128, "ENGINE_METHOD_STORE": 256, "ENGINE_METHOD_PKEY_METHS": 512, "ENGINE_METHOD_PKEY_ASN1_METHS": 1024, "ENGINE_METHOD_ALL": 65535, "ENGINE_METHOD_NONE": 0, "DH_CHECK_P_NOT_SAFE_PRIME": 2, "DH_CHECK_P_NOT_PRIME": 1, "DH_UNABLE_TO_CHECK_GENERATOR": 4, "DH_NOT_SUITABLE_GENERATOR": 8, "NPN_ENABLED": 1, "RSA_PKCS1_PADDING": 1, "RSA_SSLV23_PADDING": 2, "RSA_NO_PADDING": 3, "RSA_PKCS1_OAEP_PADDING": 4, "RSA_X931_PADDING": 5, "RSA_PKCS1_PSS_PADDING": 6, "POINT_CONVERSION_COMPRESSED": 2, "POINT_CONVERSION_UNCOMPRESSED": 4, "POINT_CONVERSION_HYBRID": 6, "F_OK": 0, "R_OK": 4, "W_OK": 2, "X_OK": 1, "UV_UDP_REUSEADDR": 4 } },{}],76:[function(require,module,exports){ /*! * copy-to - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */ 'use strict'; /** * slice() reference. */ var slice = Array.prototype.slice; /** * Expose copy * * ``` * copy({foo: 'nar', hello: 'copy'}).to({hello: 'world'}); * copy({foo: 'nar', hello: 'copy'}).toCover({hello: 'world'}); * ``` * * @param {Object} src * @return {Copy} */ module.exports = Copy; /** * Copy * @param {Object} src * @param {Boolean} withAccess */ function Copy(src, withAccess) { if (!(this instanceof Copy)) return new Copy(src, withAccess); this.src = src; this._withAccess = withAccess; } /** * copy properties include getter and setter * @param {[type]} val [description] * @return {[type]} [description] */ Copy.prototype.withAccess = function (w) { this._withAccess = w !== false; return this; }; /** * pick keys in src * * @api: public */ Copy.prototype.pick = function(keys) { if (!Array.isArray(keys)) { keys = slice.call(arguments); } if (keys.length) { this.keys = keys; } return this; }; /** * copy src to target, * do not cover any property target has * @param {Object} to * * @api: public */ Copy.prototype.to = function(to) { to = to || {}; if (!this.src) return to; var keys = this.keys || Object.keys(this.src); if (!this._withAccess) { for (var i = 0; i < keys.length; i++) { key = keys[i]; if (to[key] !== undefined) continue; to[key] = this.src[key]; } return to; } for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!notDefined(to, key)) continue; var getter = this.src.__lookupGetter__(key); var setter = this.src.__lookupSetter__(key); if (getter) to.__defineGetter__(key, getter); if (setter) to.__defineSetter__(key, setter); if (!getter && !setter) { to[key] = this.src[key]; } } return to; }; /** * copy src to target, * override any property target has * @param {Object} to * * @api: public */ Copy.prototype.toCover = function(to) { var keys = this.keys || Object.keys(this.src); for (var i = 0; i < keys.length; i++) { var key = keys[i]; delete to[key]; var getter = this.src.__lookupGetter__(key); var setter = this.src.__lookupSetter__(key); if (getter) to.__defineGetter__(key, getter); if (setter) to.__defineSetter__(key, setter); if (!getter && !setter) { to[key] = this.src[key]; } } }; Copy.prototype.override = Copy.prototype.toCover; /** * append another object to src * @param {Obj} obj * @return {Copy} */ Copy.prototype.and = function (obj) { var src = {}; this.to(src); this.src = obj; this.to(src); this.src = src; return this; }; /** * check obj[key] if not defiend * @param {Object} obj * @param {String} key * @return {Boolean} */ function notDefined(obj, key) { return obj[key] === undefined && obj.__lookupGetter__(key) === undefined && obj.__lookupSetter__(key) === undefined; } },{}],77:[function(require,module,exports){ require('../../modules/es6.string.iterator'); require('../../modules/es6.array.from'); module.exports = require('../../modules/_core').Array.from; },{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(require,module,exports){ var core = require('../../modules/_core'); var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify }); module.exports = function stringify(it) { // eslint-disable-line no-unused-vars return $JSON.stringify.apply($JSON, arguments); }; },{"../../modules/_core":99}],79:[function(require,module,exports){ require('../../modules/es6.object.assign'); module.exports = require('../../modules/_core').Object.assign; },{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(require,module,exports){ require('../../modules/es6.object.create'); var $Object = require('../../modules/_core').Object; module.exports = function create(P, D) { return $Object.create(P, D); }; },{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(require,module,exports){ require('../../modules/es6.object.define-property'); var $Object = require('../../modules/_core').Object; module.exports = function defineProperty(it, key, desc) { return $Object.defineProperty(it, key, desc); }; },{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(require,module,exports){ require('../../modules/es7.object.entries'); module.exports = require('../../modules/_core').Object.entries; },{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(require,module,exports){ require('../../modules/es6.object.get-own-property-names'); var $Object = require('../../modules/_core').Object; module.exports = function getOwnPropertyNames(it) { return $Object.getOwnPropertyNames(it); }; },{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(require,module,exports){ require('../../modules/es6.object.get-prototype-of'); module.exports = require('../../modules/_core').Object.getPrototypeOf; },{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(require,module,exports){ require('../../modules/es6.object.keys'); module.exports = require('../../modules/_core').Object.keys; },{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(require,module,exports){ require('../modules/es6.object.to-string'); require('../modules/es6.string.iterator'); require('../modules/web.dom.iterable'); require('../modules/es6.promise'); require('../modules/es7.promise.finally'); require('../modules/es7.promise.try'); module.exports = require('../modules/_core').Promise; },{"../modules/_core":99,"../modules/es6.object.to-string":177,"../modules/es6.promise":178,"../modules/es6.string.iterator":180,"../modules/es7.promise.finally":183,"../modules/es7.promise.try":184,"../modules/web.dom.iterable":187}],87:[function(require,module,exports){ require('../modules/web.immediate'); module.exports = require('../modules/_core').setImmediate; },{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(require,module,exports){ require('../../modules/es6.string.from-code-point'); module.exports = require('../../modules/_core').String.fromCodePoint; },{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(require,module,exports){ require('../../modules/es6.function.has-instance'); module.exports = require('../../modules/_wks-ext').f('hasInstance'); },{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(require,module,exports){ require('../../modules/es6.symbol'); require('../../modules/es6.object.to-string'); require('../../modules/es7.symbol.async-iterator'); require('../../modules/es7.symbol.observable'); module.exports = require('../../modules/_core').Symbol; },{"../../modules/_core":99,"../../modules/es6.object.to-string":177,"../../modules/es6.symbol":181,"../../modules/es7.symbol.async-iterator":185,"../../modules/es7.symbol.observable":186}],91:[function(require,module,exports){ require('../../modules/es6.string.iterator'); require('../../modules/web.dom.iterable'); module.exports = require('../../modules/_wks-ext').f('iterator'); },{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(require,module,exports){ module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; },{}],93:[function(require,module,exports){ module.exports = function () { /* empty */ }; },{}],94:[function(require,module,exports){ module.exports = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; },{}],95:[function(require,module,exports){ var isObject = require('./_is-object'); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; },{"./_is-object":119}],96:[function(require,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = require('./_to-iobject'); var toLength = require('./_to-length'); var toAbsoluteIndex = require('./_to-absolute-index'); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; },{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(require,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = require('./_cof'); var TAG = require('./_wks')('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; module.exports = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; },{"./_cof":98,"./_wks":166}],98:[function(require,module,exports){ var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; },{}],99:[function(require,module,exports){ var core = module.exports = { version: '2.6.11' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef },{}],100:[function(require,module,exports){ 'use strict'; var $defineProperty = require('./_object-dp'); var createDesc = require('./_property-desc'); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; },{"./_object-dp":132,"./_property-desc":146}],101:[function(require,module,exports){ // optional / simple context binding var aFunction = require('./_a-function'); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; },{"./_a-function":92}],102:[function(require,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; },{}],103:[function(require,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !require('./_fails')(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); },{"./_fails":108}],104:[function(require,module,exports){ var isObject = require('./_is-object'); var document = require('./_global').document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; },{"./_global":110,"./_is-object":119}],105:[function(require,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); },{}],106:[function(require,module,exports){ // all enumerable object keys, includes symbols var getKeys = require('./_object-keys'); var gOPS = require('./_object-gops'); var pIE = require('./_object-pie'); module.exports = function (it) { var result = getKeys(it); var getSymbols = gOPS.f; if (getSymbols) { var symbols = getSymbols(it); var isEnum = pIE.f; var i = 0; var key; while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); } return result; }; },{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(require,module,exports){ var global = require('./_global'); var core = require('./_core'); var ctx = require('./_ctx'); var hide = require('./_hide'); var has = require('./_has'); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var IS_WRAP = type & $export.W; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE]; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; if (own && has(exports, key)) continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function (C) { var F = function (a, b, c) { if (this instanceof C) { switch (arguments.length) { case 0: return new C(); case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if (IS_PROTO) { (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); } } }; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; },{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(require,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; },{}],109:[function(require,module,exports){ var ctx = require('./_ctx'); var call = require('./_iter-call'); var isArrayIter = require('./_is-array-iter'); var anObject = require('./_an-object'); var toLength = require('./_to-length'); var getIterFn = require('./core.get-iterator-method'); var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); var f = ctx(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; },{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(require,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef },{}],111:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; },{}],112:[function(require,module,exports){ var dP = require('./_object-dp'); var createDesc = require('./_property-desc'); module.exports = require('./_descriptors') ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(require,module,exports){ var document = require('./_global').document; module.exports = document && document.documentElement; },{"./_global":110}],114:[function(require,module,exports){ module.exports = !require('./_descriptors') && !require('./_fails')(function () { return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7; }); },{"./_descriptors":103,"./_dom-create":104,"./_fails":108}],115:[function(require,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function (fn, args, that) { var un = that === undefined; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; },{}],116:[function(require,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = require('./_cof'); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; },{"./_cof":98}],117:[function(require,module,exports){ // check on default Array iterator var Iterators = require('./_iterators'); var ITERATOR = require('./_wks')('iterator'); var ArrayProto = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; },{"./_iterators":125,"./_wks":166}],118:[function(require,module,exports){ // 7.2.2 IsArray(argument) var cof = require('./_cof'); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; },{"./_cof":98}],119:[function(require,module,exports){ module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],120:[function(require,module,exports){ // call something on iterator step with safe closing on error var anObject = require('./_an-object'); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) anObject(ret.call(iterator)); throw e; } }; },{"./_an-object":95}],121:[function(require,module,exports){ 'use strict'; var create = require('./_object-create'); var descriptor = require('./_property-desc'); var setToStringTag = require('./_set-to-string-tag'); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; },{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library'); var $export = require('./_export'); var redefine = require('./_redefine'); var hide = require('./_hide'); var Iterators = require('./_iterators'); var $iterCreate = require('./_iter-create'); var setToStringTag = require('./_set-to-string-tag'); var getPrototypeOf = require('./_object-gpo'); var ITERATOR = require('./_wks')('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; },{"./_export":107,"./_hide":112,"./_iter-create":121,"./_iterators":125,"./_library":126,"./_object-gpo":138,"./_redefine":148,"./_set-to-string-tag":150,"./_wks":166}],123:[function(require,module,exports){ var ITERATOR = require('./_wks')('iterator'); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter['return'] = function () { SAFE_CLOSING = true; }; // eslint-disable-next-line no-throw-literal Array.from(riter, function () { throw 2; }); } catch (e) { /* empty */ } module.exports = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; },{"./_wks":166}],124:[function(require,module,exports){ module.exports = function (done, value) { return { value: value, done: !!done }; }; },{}],125:[function(require,module,exports){ module.exports = {}; },{}],126:[function(require,module,exports){ module.exports = true; },{}],127:[function(require,module,exports){ var META = require('./_uid')('meta'); var isObject = require('./_is-object'); var has = require('./_has'); var setDesc = require('./_object-dp').f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; var FREEZE = !require('./_fails')(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { setDesc(it, META, { value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function (it, create) { if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; },{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(require,module,exports){ var global = require('./_global'); var macrotask = require('./_task').set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process = global.process; var Promise = global.Promise; var isNode = require('./_cof')(process) == 'process'; module.exports = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode && (parent = process.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = undefined; throw e; } } last = undefined; if (parent) parent.enter(); }; // Node.js if (isNode) { notify = function () { process.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer && !(global.navigator && global.navigator.standalone)) { var toggle = true; var node = document.createTextNode(''); new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (Promise && Promise.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 var promise = Promise.resolve(undefined); notify = function () { promise.then(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global, flush); }; } return function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; },{"./_cof":98,"./_global":110,"./_task":155}],129:[function(require,module,exports){ 'use strict'; // 25.4.1.5 NewPromiseCapability(C) var aFunction = require('./_a-function'); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; },{"./_a-function":92}],130:[function(require,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var DESCRIPTORS = require('./_descriptors'); var getKeys = require('./_object-keys'); var gOPS = require('./_object-gops'); var pIE = require('./_object-pie'); var toObject = require('./_to-object'); var IObject = require('./_iobject'); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || require('./_fails')(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var S = Symbol(); var K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = gOPS.f; var isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]); var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; } } return T; } : $assign; },{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(require,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = require('./_an-object'); var dPs = require('./_object-dps'); var enumBugKeys = require('./_enum-bug-keys'); var IE_PROTO = require('./_shared-key')('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = require('./_dom-create')('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; require('./_html').appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; },{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(require,module,exports){ var anObject = require('./_an-object'); var IE8_DOM_DEFINE = require('./_ie8-dom-define'); var toPrimitive = require('./_to-primitive'); var dP = Object.defineProperty; exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(require,module,exports){ var dP = require('./_object-dp'); var anObject = require('./_an-object'); var getKeys = require('./_object-keys'); module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; },{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(require,module,exports){ var pIE = require('./_object-pie'); var createDesc = require('./_property-desc'); var toIObject = require('./_to-iobject'); var toPrimitive = require('./_to-primitive'); var has = require('./_has'); var IE8_DOM_DEFINE = require('./_ie8-dom-define'); var gOPD = Object.getOwnPropertyDescriptor; exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) { O = toIObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return gOPD(O, P); } catch (e) { /* empty */ } if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); }; },{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(require,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = require('./_to-iobject'); var gOPN = require('./_object-gopn').f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return gOPN(it); } catch (e) { return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; },{"./_object-gopn":136,"./_to-iobject":158}],136:[function(require,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = require('./_object-keys-internal'); var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); }; },{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],138:[function(require,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = require('./_has'); var toObject = require('./_to-object'); var IE_PROTO = require('./_shared-key')('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; },{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(require,module,exports){ var has = require('./_has'); var toIObject = require('./_to-iobject'); var arrayIndexOf = require('./_array-includes')(false); var IE_PROTO = require('./_shared-key')('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; },{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(require,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = require('./_object-keys-internal'); var enumBugKeys = require('./_enum-bug-keys'); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; },{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(require,module,exports){ exports.f = {}.propertyIsEnumerable; },{}],142:[function(require,module,exports){ // most Object methods by ES6 should accept primitives var $export = require('./_export'); var core = require('./_core'); var fails = require('./_fails'); module.exports = function (KEY, exec) { var fn = (core.Object || {})[KEY] || Object[KEY]; var exp = {}; exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); }; },{"./_core":99,"./_export":107,"./_fails":108}],143:[function(require,module,exports){ var DESCRIPTORS = require('./_descriptors'); var getKeys = require('./_object-keys'); var toIObject = require('./_to-iobject'); var isEnum = require('./_object-pie').f; module.exports = function (isEntries) { return function (it) { var O = toIObject(it); var keys = getKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS || isEnum.call(O, key)) { result.push(isEntries ? [key, O[key]] : O[key]); } } return result; }; }; },{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(require,module,exports){ module.exports = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; },{}],145:[function(require,module,exports){ var anObject = require('./_an-object'); var isObject = require('./_is-object'); var newPromiseCapability = require('./_new-promise-capability'); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; },{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(require,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],147:[function(require,module,exports){ var hide = require('./_hide'); module.exports = function (target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key]; else hide(target, key, src[key]); } return target; }; },{"./_hide":112}],148:[function(require,module,exports){ module.exports = require('./_hide'); },{"./_hide":112}],149:[function(require,module,exports){ 'use strict'; var global = require('./_global'); var core = require('./_core'); var dP = require('./_object-dp'); var DESCRIPTORS = require('./_descriptors'); var SPECIES = require('./_wks')('species'); module.exports = function (KEY) { var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function () { return this; } }); }; },{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(require,module,exports){ var def = require('./_object-dp').f; var has = require('./_has'); var TAG = require('./_wks')('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; },{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(require,module,exports){ var shared = require('./_shared')('keys'); var uid = require('./_uid'); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; },{"./_shared":152,"./_uid":162}],152:[function(require,module,exports){ var core = require('./_core'); var global = require('./_global'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: require('./_library') ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); },{"./_core":99,"./_global":110,"./_library":126}],153:[function(require,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = require('./_an-object'); var aFunction = require('./_a-function'); var SPECIES = require('./_wks')('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; },{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(require,module,exports){ var toInteger = require('./_to-integer'); var defined = require('./_defined'); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; },{"./_defined":102,"./_to-integer":157}],155:[function(require,module,exports){ var ctx = require('./_ctx'); var invoke = require('./_invoke'); var html = require('./_html'); var cel = require('./_dom-create'); var global = require('./_global'); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func invoke(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (require('./_cof')(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(ctx(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { defer = function (id) { global.postMessage(id + '', '*'); }; global.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in cel('script')) { defer = function (id) { html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; },{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(require,module,exports){ var toInteger = require('./_to-integer'); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; },{"./_to-integer":157}],157:[function(require,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; },{}],158:[function(require,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject'); var defined = require('./_defined'); module.exports = function (it) { return IObject(defined(it)); }; },{"./_defined":102,"./_iobject":116}],159:[function(require,module,exports){ // 7.1.15 ToLength var toInteger = require('./_to-integer'); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; },{"./_to-integer":157}],160:[function(require,module,exports){ // 7.1.13 ToObject(argument) var defined = require('./_defined'); module.exports = function (it) { return Object(defined(it)); }; },{"./_defined":102}],161:[function(require,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; },{"./_is-object":119}],162:[function(require,module,exports){ var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; },{}],163:[function(require,module,exports){ var global = require('./_global'); var navigator = global.navigator; module.exports = navigator && navigator.userAgent || ''; },{"./_global":110}],164:[function(require,module,exports){ var global = require('./_global'); var core = require('./_core'); var LIBRARY = require('./_library'); var wksExt = require('./_wks-ext'); var defineProperty = require('./_object-dp').f; module.exports = function (name) { var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); }; },{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(require,module,exports){ exports.f = require('./_wks'); },{"./_wks":166}],166:[function(require,module,exports){ var store = require('./_shared')('wks'); var uid = require('./_uid'); var Symbol = require('./_global').Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; },{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(require,module,exports){ var classof = require('./_classof'); var ITERATOR = require('./_wks')('iterator'); var Iterators = require('./_iterators'); module.exports = require('./_core').getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; },{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(require,module,exports){ 'use strict'; var ctx = require('./_ctx'); var $export = require('./_export'); var toObject = require('./_to-object'); var call = require('./_iter-call'); var isArrayIter = require('./_is-array-iter'); var toLength = require('./_to-length'); var createProperty = require('./_create-property'); var getIterFn = require('./core.get-iterator-method'); $export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iterFn = getIterFn(O); var length, result, step, iterator; if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = toLength(O.length); for (result = new C(length); length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); },{"./_create-property":100,"./_ctx":101,"./_export":107,"./_is-array-iter":117,"./_iter-call":120,"./_iter-detect":123,"./_to-length":159,"./_to-object":160,"./core.get-iterator-method":167}],169:[function(require,module,exports){ 'use strict'; var addToUnscopables = require('./_add-to-unscopables'); var step = require('./_iter-step'); var Iterators = require('./_iterators'); var toIObject = require('./_to-iobject'); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(require,module,exports){ 'use strict'; var isObject = require('./_is-object'); var getPrototypeOf = require('./_object-gpo'); var HAS_INSTANCE = require('./_wks')('hasInstance'); var FunctionProto = Function.prototype; // 19.2.3.6 Function.prototype[@@hasInstance](V) if (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) { if (typeof this != 'function' || !isObject(O)) return false; if (!isObject(this.prototype)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf(O)) if (this.prototype === O) return true; return false; } }); },{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(require,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = require('./_export'); $export($export.S + $export.F, 'Object', { assign: require('./_object-assign') }); },{"./_export":107,"./_object-assign":130}],172:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', { create: require('./_object-create') }); },{"./_export":107,"./_object-create":131}],173:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f }); },{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(require,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) require('./_object-sap')('getOwnPropertyNames', function () { return require('./_object-gopn-ext').f; }); },{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(require,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = require('./_to-object'); var $getPrototypeOf = require('./_object-gpo'); require('./_object-sap')('getPrototypeOf', function () { return function getPrototypeOf(it) { return $getPrototypeOf(toObject(it)); }; }); },{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(require,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = require('./_to-object'); var $keys = require('./_object-keys'); require('./_object-sap')('keys', function () { return function keys(it) { return $keys(toObject(it)); }; }); },{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(require,module,exports){ arguments[4][71][0].apply(exports,arguments) },{"dup":71}],178:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library'); var global = require('./_global'); var ctx = require('./_ctx'); var classof = require('./_classof'); var $export = require('./_export'); var isObject = require('./_is-object'); var aFunction = require('./_a-function'); var anInstance = require('./_an-instance'); var forOf = require('./_for-of'); var speciesConstructor = require('./_species-constructor'); var task = require('./_task').set; var microtask = require('./_microtask')(); var newPromiseCapabilityModule = require('./_new-promise-capability'); var perform = require('./_perform'); var userAgent = require('./_user-agent'); var promiseResolve = require('./_promise-resolve'); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; var versions = process && process.versions; var v8 = versions && versions.v8 || ''; var $Promise = global[PROMISE]; var isNode = classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(global, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = perform(function () { if (isNode) { process.emit('unhandledRejection', value, promise); } else if (handler = global.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(global, function () { var handler; if (isNode) { process.emit('rejectionHandled', promise); } else if (handler = global.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = require('./_redefine-all')($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); require('./_set-to-string-tag')($Promise, PROMISE); require('./_set-species')(PROMISE); Wrapper = require('./_core')[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); },{"./_a-function":92,"./_an-instance":94,"./_classof":97,"./_core":99,"./_ctx":101,"./_export":107,"./_for-of":109,"./_global":110,"./_is-object":119,"./_iter-detect":123,"./_library":126,"./_microtask":128,"./_new-promise-capability":129,"./_perform":144,"./_promise-resolve":145,"./_redefine-all":147,"./_set-species":149,"./_set-to-string-tag":150,"./_species-constructor":153,"./_task":155,"./_user-agent":163,"./_wks":166}],179:[function(require,module,exports){ var $export = require('./_export'); var toAbsoluteIndex = require('./_to-absolute-index'); var fromCharCode = String.fromCharCode; var $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars var res = []; var aLen = arguments.length; var i = 0; var code; while (aLen > i) { code = +arguments[i++]; if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } }); },{"./_export":107,"./_to-absolute-index":156}],180:[function(require,module,exports){ 'use strict'; var $at = require('./_string-at')(true); // 21.1.3.27 String.prototype[@@iterator]() require('./_iter-define')(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); },{"./_iter-define":122,"./_string-at":154}],181:[function(require,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = require('./_global'); var has = require('./_has'); var DESCRIPTORS = require('./_descriptors'); var $export = require('./_export'); var redefine = require('./_redefine'); var META = require('./_meta').KEY; var $fails = require('./_fails'); var shared = require('./_shared'); var setToStringTag = require('./_set-to-string-tag'); var uid = require('./_uid'); var wks = require('./_wks'); var wksExt = require('./_wks-ext'); var wksDefine = require('./_wks-define'); var enumKeys = require('./_enum-keys'); var isArray = require('./_is-array'); var anObject = require('./_an-object'); var isObject = require('./_is-object'); var toObject = require('./_to-object'); var toIObject = require('./_to-iobject'); var toPrimitive = require('./_to-primitive'); var createDesc = require('./_property-desc'); var _create = require('./_object-create'); var gOPNExt = require('./_object-gopn-ext'); var $GOPD = require('./_object-gopd'); var $GOPS = require('./_object-gops'); var $DP = require('./_object-dp'); var $keys = require('./_object-keys'); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; var $Symbol = global.Symbol; var $JSON = global.JSON; var _stringify = $JSON && $JSON.stringify; var PROTOTYPE = 'prototype'; var HIDDEN = wks('_hidden'); var TO_PRIMITIVE = wks('toPrimitive'); var isEnum = {}.propertyIsEnumerable; var SymbolRegistry = shared('symbol-registry'); var AllSymbols = shared('symbols'); var OPSymbols = shared('op-symbols'); var ObjectProto = Object[PROTOTYPE]; var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function () { return _create(dP({}, 'a', { get: function () { return dP(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (it, key, D) { var protoDesc = gOPD(ObjectProto, key); if (protoDesc) delete ObjectProto[key]; dP(it, key, D); if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); } : dP; var wrap = function (tag) { var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D) { if (it === ObjectProto) $defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if (has(AllSymbols, key)) { if (!D.enumerable) { if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; D = _create(D, { enumerable: createDesc(0, false) }); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P) { anObject(it); var keys = enumKeys(P = toIObject(P)); var i = 0; var l = keys.length; var key; while (l > i) $defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P) { return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key) { var E = isEnum.call(this, key = toPrimitive(key, true)); if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { it = toIObject(it); key = toPrimitive(key, true); if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; var D = gOPD(it, key); if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it) { var names = gOPN(toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { var IS_OP = it === ObjectProto; var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if (!USE_NATIVE) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function (value) { if (this === ObjectProto) $set.call(OPSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; require('./_object-pie').f = $propertyIsEnumerable; $GOPS.f = $getOwnPropertySymbols; if (DESCRIPTORS && !require('./_library')) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function (name) { return wrap(wks(name)); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); for (var es6Symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function (key) { return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { getOwnPropertySymbols: function getOwnPropertySymbols(it) { return $GOPS.f(toObject(it)); } }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it) { var args = [it]; var i = 1; var replacer, $replacer; while (arguments.length > i) args.push(arguments[i++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); },{"./_an-object":95,"./_descriptors":103,"./_enum-keys":106,"./_export":107,"./_fails":108,"./_global":110,"./_has":111,"./_hide":112,"./_is-array":118,"./_is-object":119,"./_library":126,"./_meta":127,"./_object-create":131,"./_object-dp":132,"./_object-gopd":134,"./_object-gopn":136,"./_object-gopn-ext":135,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_property-desc":146,"./_redefine":148,"./_set-to-string-tag":150,"./_shared":152,"./_to-iobject":158,"./_to-object":160,"./_to-primitive":161,"./_uid":162,"./_wks":166,"./_wks-define":164,"./_wks-ext":165}],182:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export'); var $entries = require('./_object-to-array')(true); $export($export.S, 'Object', { entries: function entries(it) { return $entries(it); } }); },{"./_export":107,"./_object-to-array":143}],183:[function(require,module,exports){ // https://github.com/tc39/proposal-promise-finally 'use strict'; var $export = require('./_export'); var core = require('./_core'); var global = require('./_global'); var speciesConstructor = require('./_species-constructor'); var promiseResolve = require('./_promise-resolve'); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); },{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-promise-try var $export = require('./_export'); var newPromiseCapability = require('./_new-promise-capability'); var perform = require('./_perform'); $export($export.S, 'Promise', { 'try': function (callbackfn) { var promiseCapability = newPromiseCapability.f(this); var result = perform(callbackfn); (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); return promiseCapability.promise; } }); },{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(require,module,exports){ require('./_wks-define')('asyncIterator'); },{"./_wks-define":164}],186:[function(require,module,exports){ require('./_wks-define')('observable'); },{"./_wks-define":164}],187:[function(require,module,exports){ require('./es6.array.iterator'); var global = require('./_global'); var hide = require('./_hide'); var Iterators = require('./_iterators'); var TO_STRING_TAG = require('./_wks')('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } },{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(require,module,exports){ var $export = require('./_export'); var $task = require('./_task'); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); },{"./_export":107,"./_task":155}],189:[function(require,module,exports){ (function (Buffer){ 'use strict'; var _typeof2 = require('babel-runtime/helpers/typeof'); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return (typeof arg === 'undefined' ? 'undefined' : (0, _typeof3.default)(arg)) === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return (typeof arg === 'undefined' ? 'undefined' : (0, _typeof3.default)(arg)) === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return objectToString(e) === '[object Error]' || e instanceof Error; } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || (typeof arg === 'undefined' ? 'undefined' : (0, _typeof3.default)(arg)) === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) },{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(require,module,exports){ 'use strict'; var _typeof2 = require('babel-runtime/helpers/typeof'); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* * Date Format 1.2.3 * (c) 2007-2009 Steven Levithan * MIT license * * Includes enhancements by Scott Trenda * and Kris Kowal * * Accepts a date, a mask, or a date and a mask. * Returns a formatted version of the given date. * The date defaults to the current date/time. * The mask defaults to dateFormat.masks.default. */ (function (global) { 'use strict'; var dateFormat = function () { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g; var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g; var timezoneClip = /[^-+\dA-Z]/g; // Regexes and supporting functions are cached through closure return function (date, mask, utc, gmt) { // You can't provide utc if you skip other args (use the 'UTC:' mask prefix) if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) { mask = date; date = undefined; } date = date || new Date(); if (!(date instanceof Date)) { date = new Date(date); } if (isNaN(date)) { throw TypeError('Invalid date'); } mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']); // Allow setting the utc/gmt argument via the mask var maskSlice = mask.slice(0, 4); if (maskSlice === 'UTC:' || maskSlice === 'GMT:') { mask = mask.slice(4); utc = true; if (maskSlice === 'GMT:') { gmt = true; } } var _ = utc ? 'getUTC' : 'get'; var d = date[_ + 'Date'](); var D = date[_ + 'Day'](); var m = date[_ + 'Month'](); var y = date[_ + 'FullYear'](); var H = date[_ + 'Hours'](); var M = date[_ + 'Minutes'](); var s = date[_ + 'Seconds'](); var L = date[_ + 'Milliseconds'](); var o = utc ? 0 : date.getTimezoneOffset(); var W = getWeek(date); var N = getDayOfWeek(date); var flags = { d: d, dd: pad(d), ddd: dateFormat.i18n.dayNames[D], dddd: dateFormat.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dateFormat.i18n.monthNames[m], mmmm: dateFormat.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(Math.round(L / 10)), t: H < 12 ? 'a' : 'p', tt: H < 12 ? 'am' : 'pm', T: H < 12 ? 'A' : 'P', TT: H < 12 ? 'AM' : 'PM', Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''), o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], W: W, N: N }; return mask.replace(token, function (match) { if (match in flags) { return flags[match]; } return match.slice(1, match.length - 1); }); }; }(); dateFormat.masks = { 'default': 'ddd mmm dd yyyy HH:MM:ss', 'shortDate': 'm/d/yy', 'mediumDate': 'mmm d, yyyy', 'longDate': 'mmmm d, yyyy', 'fullDate': 'dddd, mmmm d, yyyy', 'shortTime': 'h:MM TT', 'mediumTime': 'h:MM:ss TT', 'longTime': 'h:MM:ss TT Z', 'isoDate': 'yyyy-mm-dd', 'isoTime': 'HH:MM:ss', 'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso', 'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'', 'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z' }; // Internationalization strings dateFormat.i18n = { dayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }; function pad(val, len) { val = String(val); len = len || 2; while (val.length < len) { val = '0' + val; } return val; } /** * Get the ISO 8601 week number * Based on comments from * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html * * @param {Object} `date` * @return {Number} */ function getWeek(date) { // Remove time components of date var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); // Change date to Thursday same week targetThursday.setDate(targetThursday.getDate() - (targetThursday.getDay() + 6) % 7 + 3); // Take January 4th as it is always in week 1 (see ISO 8601) var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); // Change date to Thursday same week firstThursday.setDate(firstThursday.getDate() - (firstThursday.getDay() + 6) % 7 + 3); // Check if daylight-saving-time-switch occurred and correct for it var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset(); targetThursday.setHours(targetThursday.getHours() - ds); // Number of weeks between target Thursday and first Thursday var weekDiff = (targetThursday - firstThursday) / (86400000 * 7); return 1 + Math.floor(weekDiff); } /** * Get ISO-8601 numeric representation of the day of the week * 1 (for Monday) through 7 (for Sunday) * * @param {Object} `date` * @return {Number} */ function getDayOfWeek(date) { var dow = date.getDay(); if (dow === 0) { dow = 7; } return dow; } /** * kind-of shortcut * @param {*} val * @return {String} */ function kindOf(val) { if (val === null) { return 'null'; } if (val === undefined) { return 'undefined'; } if ((typeof val === 'undefined' ? 'undefined' : (0, _typeof3.default)(val)) !== 'object') { return typeof val === 'undefined' ? 'undefined' : (0, _typeof3.default)(val); } if (Array.isArray(val)) { return 'array'; } return {}.toString.call(val).slice(8, -1).toLowerCase(); }; if (typeof define === 'function' && define.amd) { define(function () { return dateFormat; }); } else if ((typeof exports === 'undefined' ? 'undefined' : (0, _typeof3.default)(exports)) === 'object') { module.exports = dateFormat; } else { global.dateFormat = dateFormat; } })(undefined); },{"babel-runtime/helpers/typeof":67}],191:[function(require,module,exports){ /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */ 'use strict'; /** * Module variables. * @private */ var matchHtmlRegExp = /["'&<>]/; /** * Module exports. * @public */ module.exports = escapeHtml; /** * Escape special characters in the given string of html. * * @param {string} string The string to escape for inserting into HTML * @return {string} * @public */ function escapeHtml(string) { var str = '' + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ''; var index = 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: // " escape = '"'; break; case 38: // & escape = '&'; break; case 39: // ' escape = '''; break; case 60: // < escape = '<'; break; case 62: // > escape = '>'; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; } },{}],192:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } },{}],193:[function(require,module,exports){ var http = require('http'); var https = module.exports; for (var key in http) { if (http.hasOwnProperty(key)) https[key] = http[key]; }; https.request = function (params, cb) { if (!params) params = {}; params.scheme = 'https'; params.protocol = 'https:'; return http.request.call(this, params, cb); } },{"http":231}],194:[function(require,module,exports){ /*! * humanize-ms - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */ 'use strict'; /** * Module dependencies. */ var util = require('util'); var ms = require('ms'); module.exports = function (t) { if (typeof t === 'number') return t; var r = ms(t); if (r === undefined) { var err = new Error(util.format('humanize-ms(%j) result undefined', t)); console.warn(err.stack); } return r; }; },{"ms":204,"util":243}],195:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 var i = isLE ? (nBytes - 1) : 0 var d = isLE ? -1 : 1 var s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var i = isLE ? 0 : (nBytes - 1) var d = isLE ? 1 : -1 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } },{}],196:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } },{}],197:[function(require,module,exports){ /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ // The _isBuffer check is for Safari 5-7 support, because it's missing // Object.prototype.constructor. Remove this eventually module.exports = function (obj) { return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) } function isBuffer (obj) { return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } // For Node v0.10 support. Remove this eventually. function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } },{}],198:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; },{}],199:[function(require,module,exports){ (function (global){ /* * base64.js * * Licensed under the BSD 3-Clause License. * http://opensource.org/licenses/BSD-3-Clause * * References: * http://en.wikipedia.org/wiki/Base64 */ ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(global) : typeof define === 'function' && define.amd ? define(factory) : factory(global) }(( typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this ), function(global) { 'use strict'; // existing version for noConflict() global = global || {}; var _Base64 = global.Base64; var version = "2.5.2"; // if node.js and NOT React Native, we use Buffer var buffer; if (typeof module !== 'undefined' && module.exports) { try { buffer = eval("require('buffer').Buffer"); } catch (err) { buffer = undefined; } } // constants var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var b64tab = function(bin) { var t = {}; for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i; return t; }(b64chars); var fromCharCode = String.fromCharCode; // encoder stuff var cb_utob = function(c) { if (c.length < 2) { var cc = c.charCodeAt(0); return cc < 0x80 ? c : cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f))) : (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) + fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) + fromCharCode(0x80 | ( cc & 0x3f))); } else { var cc = 0x10000 + (c.charCodeAt(0) - 0xD800) * 0x400 + (c.charCodeAt(1) - 0xDC00); return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07)) + fromCharCode(0x80 | ((cc >>> 12) & 0x3f)) + fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) + fromCharCode(0x80 | ( cc & 0x3f))); } }; var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; var utob = function(u) { return u.replace(re_utob, cb_utob); }; var cb_encode = function(ccc) { var padlen = [0, 2, 1][ccc.length % 3], ord = ccc.charCodeAt(0) << 16 | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)), chars = [ b64chars.charAt( ord >>> 18), b64chars.charAt((ord >>> 12) & 63), padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63), padlen >= 1 ? '=' : b64chars.charAt(ord & 63) ]; return chars.join(''); }; var btoa = global.btoa ? function(b) { return global.btoa(b); } : function(b) { return b.replace(/[\s\S]{1,3}/g, cb_encode); }; var _encode = function(u) { var isUint8Array = Object.prototype.toString.call(u) === '[object Uint8Array]'; return isUint8Array ? u.toString('base64') : btoa(utob(String(u))); } var encode = function(u, urisafe) { return !urisafe ? _encode(u) : _encode(String(u)).replace(/[+\/]/g, function(m0) { return m0 == '+' ? '-' : '_'; }).replace(/=/g, ''); }; var encodeURI = function(u) { return encode(u, true) }; // decoder stuff var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g; var cb_btou = function(cccc) { switch(cccc.length) { case 4: var cp = ((0x07 & cccc.charCodeAt(0)) << 18) | ((0x3f & cccc.charCodeAt(1)) << 12) | ((0x3f & cccc.charCodeAt(2)) << 6) | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000; return (fromCharCode((offset >>> 10) + 0xD800) + fromCharCode((offset & 0x3FF) + 0xDC00)); case 3: return fromCharCode( ((0x0f & cccc.charCodeAt(0)) << 12) | ((0x3f & cccc.charCodeAt(1)) << 6) | (0x3f & cccc.charCodeAt(2)) ); default: return fromCharCode( ((0x1f & cccc.charCodeAt(0)) << 6) | (0x3f & cccc.charCodeAt(1)) ); } }; var btou = function(b) { return b.replace(re_btou, cb_btou); }; var cb_decode = function(cccc) { var len = cccc.length, padlen = len % 4, n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0) | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0) | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0) | (len > 3 ? b64tab[cccc.charAt(3)] : 0), chars = [ fromCharCode( n >>> 16), fromCharCode((n >>> 8) & 0xff), fromCharCode( n & 0xff) ]; chars.length -= [0, 0, 2, 1][padlen]; return chars.join(''); }; var _atob = global.atob ? function(a) { return global.atob(a); } : function(a){ return a.replace(/\S{1,4}/g, cb_decode); }; var atob = function(a) { return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g, '')); }; var _decode = buffer ? buffer.from && Uint8Array && buffer.from !== Uint8Array.from ? function(a) { return (a.constructor === buffer.constructor ? a : buffer.from(a, 'base64')).toString(); } : function(a) { return (a.constructor === buffer.constructor ? a : new buffer(a, 'base64')).toString(); } : function(a) { return btou(_atob(a)) }; var decode = function(a){ return _decode( String(a).replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' }) .replace(/[^A-Za-z0-9\+\/]/g, '') ); }; var noConflict = function() { var Base64 = global.Base64; global.Base64 = _Base64; return Base64; }; // export Base64 global.Base64 = { VERSION: version, atob: atob, btoa: btoa, fromBase64: decode, toBase64: encode, utob: utob, encode: encode, encodeURI: encodeURI, btou: btou, decode: decode, noConflict: noConflict, __buffer__: buffer }; // if ES5 is available, make Base64.extendString() available if (typeof Object.defineProperty === 'function') { var noEnum = function(v){ return {value:v,enumerable:false,writable:true,configurable:true}; }; global.Base64.extendString = function () { Object.defineProperty( String.prototype, 'fromBase64', noEnum(function () { return decode(this) })); Object.defineProperty( String.prototype, 'toBase64', noEnum(function (urisafe) { return encode(this, urisafe) })); Object.defineProperty( String.prototype, 'toBase64URI', noEnum(function () { return encode(this, true) })); }; } // // export Base64 to the namespace // if (global['Meteor']) { // Meteor.js Base64 = global.Base64; } // module.exports and AMD are mutually exclusive. // module.exports has precedence. if (typeof module !== 'undefined' && module.exports) { module.exports.Base64 = global.Base64; } else if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], function(){ return global.Base64 }); } // that's it! return {Base64: global.Base64} })); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],200:[function(require,module,exports){ /*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. * @public */ module.exports = merge /** * Module variables. * @private */ var hasOwnProperty = Object.prototype.hasOwnProperty /** * Merge the property descriptors of `src` into `dest` * * @param {object} dest Object to add descriptors to * @param {object} src Object to clone descriptors from * @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties * @returns {object} Reference to dest * @public */ function merge(dest, src, redefine) { if (!dest) { throw new TypeError('argument dest is required') } if (!src) { throw new TypeError('argument src is required') } if (redefine === undefined) { // Default to true redefine = true } Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) { if (!redefine && hasOwnProperty.call(dest, name)) { // Skip desriptor return } // Copy descriptor var descriptor = Object.getOwnPropertyDescriptor(src, name) Object.defineProperty(dest, name, descriptor) }) return dest } },{}],201:[function(require,module,exports){ 'use strict'; /** * @param typeMap [Object] Map of MIME type -> Array[extensions] * @param ... */ function Mime() { this._types = Object.create(null); this._extensions = Object.create(null); for (var i = 0; i < arguments.length; i++) { this.define(arguments[i]); } this.define = this.define.bind(this); this.getType = this.getType.bind(this); this.getExtension = this.getExtension.bind(this); } /** * Define mimetype -> extension mappings. Each key is a mime-type that maps * to an array of extensions associated with the type. The first extension is * used as the default extension for the type. * * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); * * If a type declares an extension that has already been defined, an error will * be thrown. To suppress this error and force the extension to be associated * with the new type, pass `force`=true. Alternatively, you may prefix the * extension with "*" to map the type to extension, without mapping the * extension to the type. * * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']}); * * * @param map (Object) type definitions * @param force (Boolean) if true, force overriding of existing definitions */ Mime.prototype.define = function(typeMap, force) { for (var type in typeMap) { var extensions = typeMap[type].map(function(t) {return t.toLowerCase()}); type = type.toLowerCase(); for (var i = 0; i < extensions.length; i++) { var ext = extensions[i]; // '*' prefix = not the preferred type for this extension. So fixup the // extension, and skip it. if (ext[0] == '*') { continue; } if (!force && (ext in this._types)) { throw new Error( 'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".' ); } this._types[ext] = type; } // Use first extension as default if (force || !this._extensions[type]) { var ext = extensions[0]; this._extensions[type] = (ext[0] != '*') ? ext : ext.substr(1) } } }; /** * Lookup a mime type based on extension */ Mime.prototype.getType = function(path) { path = String(path); var last = path.replace(/^.*[/\\]/, '').toLowerCase(); var ext = last.replace(/^.*\./, '').toLowerCase(); var hasPath = last.length < path.length; var hasDot = ext.length < last.length - 1; return (hasDot || !hasPath) && this._types[ext] || null; }; /** * Return file extension associated with a mime type */ Mime.prototype.getExtension = function(type) { type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; return type && this._extensions[type.toLowerCase()] || null; }; module.exports = Mime; },{}],202:[function(require,module,exports){ 'use strict'; var Mime = require('./Mime'); module.exports = new Mime(require('./types/standard')); },{"./Mime":201,"./types/standard":203}],203:[function(require,module,exports){ module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["*xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/urc-ressheet+xml":["rsheet"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; },{}],204:[function(require,module,exports){ /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } },{}],205:[function(require,module,exports){ (function (process){ // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, // backported and transplited with Babel, with backwards-compat fixes // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // resolves . and .. elements in a path array with directory names there // must be no slashes, empty elements, or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // path.resolve([from ...], to) // posix version exports.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { return !!p; }), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version exports.normalize = function(path) { var isAbsolute = exports.isAbsolute(path), trailingSlash = substr(path, -1) === '/'; // Normalize the path path = normalizeArray(filter(path.split('/'), function(p) { return !!p; }), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version exports.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version exports.join = function() { var paths = Array.prototype.slice.call(arguments, 0); return exports.normalize(filter(paths, function(p, index) { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } return p; }).join('/')); }; // path.relative(from, to) // posix version exports.relative = function(from, to) { from = exports.resolve(from).substr(1); to = exports.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') break; } var end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== '') break; } if (start > end) return []; return arr.slice(start, end - start + 1); } var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; exports.sep = '/'; exports.delimiter = ':'; exports.dirname = function (path) { if (typeof path !== 'string') path = path + ''; if (path.length === 0) return '.'; var code = path.charCodeAt(0); var hasRoot = code === 47 /*/*/; var end = -1; var matchedSlash = true; for (var i = path.length - 1; i >= 1; --i) { code = path.charCodeAt(i); if (code === 47 /*/*/) { if (!matchedSlash) { end = i; break; } } else { // We saw the first non-path separator matchedSlash = false; } } if (end === -1) return hasRoot ? '/' : '.'; if (hasRoot && end === 1) { // return '//'; // Backwards-compat fix: return '/'; } return path.slice(0, end); }; function basename(path) { if (typeof path !== 'string') path = path + ''; var start = 0; var end = -1; var matchedSlash = true; var i; for (i = path.length - 1; i >= 0; --i) { if (path.charCodeAt(i) === 47 /*/*/) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else if (end === -1) { // We saw the first non-path separator, mark this as the end of our // path component matchedSlash = false; end = i + 1; } } if (end === -1) return ''; return path.slice(start, end); } // Uses a mixed approach for backwards-compatibility, as ext behavior changed // in new Node.js versions, so only basename() above is backported here exports.basename = function (path, ext) { var f = basename(path); if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; exports.extname = function (path) { if (typeof path !== 'string') path = path + ''; var startDot = -1; var startPart = 0; var end = -1; var matchedSlash = true; // Track the state of characters (if any) we see before our first dot and // after any path separator we find var preDotState = 0; for (var i = path.length - 1; i >= 0; --i) { var code = path.charCodeAt(i); if (code === 47 /*/*/) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === 46 /*.*/) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) startDot = i; else if (preDotState !== 1) preDotState = 1; } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { return ''; } return path.slice(startDot, end); }; function filter (xs, f) { if (xs.filter) return xs.filter(f); var res = []; for (var i = 0; i < xs.length; i++) { if (f(xs[i], i, xs)) res.push(xs[i]); } return res; } // String.prototype.substr - negative index don't work in IE8 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { return str.substr(start, len) } : function (str, start, len) { if (start < 0) start = str.length + start; return str.substr(start, len); } ; }).call(this,require('_process')) },{"_process":208}],206:[function(require,module,exports){ (function (global){ /*! * Platform.js * Copyright 2014-2018 Benjamin Tan * Copyright 2011-2013 John-David Dalton * Available under MIT license */ ;(function() { 'use strict'; /** Used to determine if values are of the language type `Object`. */ var objectTypes = { 'function': true, 'object': true }; /** Used as a reference to the global object. */ var root = (objectTypes[typeof window] && window) || this; /** Backup possible global object. */ var oldRoot = root; /** Detect free variable `exports`. */ var freeExports = objectTypes[typeof exports] && exports; /** Detect free variable `module`. */ var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */ var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { root = freeGlobal; } /** * Used as the maximum length of an array-like object. * See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) * for more details. */ var maxSafeInteger = Math.pow(2, 53) - 1; /** Regular expression to detect Opera. */ var reOpera = /\bOpera/; /** Possible global object. */ var thisBinding = this; /** Used for native method references. */ var objectProto = Object.prototype; /** Used to check for own properties of an object. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to resolve the internal `[[Class]]` of values. */ var toString = objectProto.toString; /*--------------------------------------------------------------------------*/ /** * Capitalizes a string value. * * @private * @param {string} string The string to capitalize. * @returns {string} The capitalized string. */ function capitalize(string) { string = String(string); return string.charAt(0).toUpperCase() + string.slice(1); } /** * A utility function to clean up the OS name. * * @private * @param {string} os The OS name to clean up. * @param {string} [pattern] A `RegExp` pattern matching the OS name. * @param {string} [label] A label for the OS. */ function cleanupOS(os, pattern, label) { // Platform tokens are defined at: // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx var data = { '10.0': '10', '6.4': '10 Technical Preview', '6.3': '8.1', '6.2': '8', '6.1': 'Server 2008 R2 / 7', '6.0': 'Server 2008 / Vista', '5.2': 'Server 2003 / XP 64-bit', '5.1': 'XP', '5.01': '2000 SP1', '5.0': '2000', '4.0': 'NT', '4.90': 'ME' }; // Detect Windows version from platform tokens. if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && (data = data[/[\d.]+$/.exec(os)])) { os = 'Windows ' + data; } // Correct character case and cleanup string. os = String(os); if (pattern && label) { os = os.replace(RegExp(pattern, 'i'), label); } os = format( os.replace(/ ce$/i, ' CE') .replace(/\bhpw/i, 'web') .replace(/\bMacintosh\b/, 'Mac OS') .replace(/_PowerPC\b/i, ' OS') .replace(/\b(OS X) [^ \d]+/i, '$1') .replace(/\bMac (OS X)\b/, '$1') .replace(/\/(\d)/, ' $1') .replace(/_/g, '.') .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '') .replace(/\bx86\.64\b/gi, 'x86_64') .replace(/\b(Windows Phone) OS\b/, '$1') .replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1') .split(' on ')[0] ); return os; } /** * An iteration utility for arrays and objects. * * @private * @param {Array|Object} object The object to iterate over. * @param {Function} callback The function called per iteration. */ function each(object, callback) { var index = -1, length = object ? object.length : 0; if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { while (++index < length) { callback(object[index], index, object); } } else { forOwn(object, callback); } } /** * Trim and conditionally capitalize string values. * * @private * @param {string} string The string to format. * @returns {string} The formatted string. */ function format(string) { string = trim(string); return /^(?:webOS|i(?:OS|P))/.test(string) ? string : capitalize(string); } /** * Iterates over an object's own properties, executing the `callback` for each. * * @private * @param {Object} object The object to iterate over. * @param {Function} callback The function executed per own property. */ function forOwn(object, callback) { for (var key in object) { if (hasOwnProperty.call(object, key)) { callback(object[key], key, object); } } } /** * Gets the internal `[[Class]]` of a value. * * @private * @param {*} value The value. * @returns {string} The `[[Class]]`. */ function getClassOf(value) { return value == null ? capitalize(value) : toString.call(value).slice(8, -1); } /** * Host objects can return type values that are different from their actual * data type. The objects we are concerned with usually return non-primitive * types of "object", "function", or "unknown". * * @private * @param {*} object The owner of the property. * @param {string} property The property to check. * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`. */ function isHostType(object, property) { var type = object != null ? typeof object[property] : 'number'; return !/^(?:boolean|number|string|undefined)$/.test(type) && (type == 'object' ? !!object[property] : true); } /** * Prepares a string for use in a `RegExp` by making hyphens and spaces optional. * * @private * @param {string} string The string to qualify. * @returns {string} The qualified string. */ function qualify(string) { return String(string).replace(/([ -])(?!$)/g, '$1?'); } /** * A bare-bones `Array#reduce` like utility function. * * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function called per iteration. * @returns {*} The accumulated result. */ function reduce(array, callback) { var accumulator = null; each(array, function(value, index) { accumulator = callback(accumulator, value, index, array); }); return accumulator; } /** * Removes leading and trailing whitespace from a string. * * @private * @param {string} string The string to trim. * @returns {string} The trimmed string. */ function trim(string) { return String(string).replace(/^ +| +$/g, ''); } /*--------------------------------------------------------------------------*/ /** * Creates a new platform object. * * @memberOf platform * @param {Object|string} [ua=navigator.userAgent] The user agent string or * context object. * @returns {Object} A platform object. */ function parse(ua) { /** The environment context object. */ var context = root; /** Used to flag when a custom context is provided. */ var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String'; // Juggle arguments. if (isCustomContext) { context = ua; ua = null; } /** Browser navigator object. */ var nav = context.navigator || {}; /** Browser user agent string. */ var userAgent = nav.userAgent || ''; ua || (ua = userAgent); /** Used to flag when `thisBinding` is the [ModuleScope]. */ var isModuleScope = isCustomContext || thisBinding == oldRoot; /** Used to detect if browser is like Chrome. */ var likeChrome = isCustomContext ? !!nav.likeChrome : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString()); /** Internal `[[Class]]` value shortcuts. */ var objectClass = 'Object', airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject', enviroClass = isCustomContext ? objectClass : 'Environment', javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java), phantomClass = isCustomContext ? objectClass : 'RuntimeObject'; /** Detect Java environments. */ var java = /\bJava/.test(javaClass) && context.java; /** Detect Rhino. */ var rhino = java && getClassOf(context.environment) == enviroClass; /** A character to represent alpha. */ var alpha = java ? 'a' : '\u03b1'; /** A character to represent beta. */ var beta = java ? 'b' : '\u03b2'; /** Browser document object. */ var doc = context.document || {}; /** * Detect Opera browser (Presto-based). * http://www.howtocreate.co.uk/operaStuff/operaObject.html * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini */ var opera = context.operamini || context.opera; /** Opera `[[Class]]`. */ var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera)) ? operaClass : (opera = null); /*------------------------------------------------------------------------*/ /** Temporary variable used over the script's lifetime. */ var data; /** The CPU architecture. */ var arch = ua; /** Platform description array. */ var description = []; /** Platform alpha/beta indicator. */ var prerelease = null; /** A flag to indicate that environment features should be used to resolve the platform. */ var useFeatures = ua == userAgent; /** The browser/environment version. */ var version = useFeatures && opera && typeof opera.version == 'function' && opera.version(); /** A flag to indicate if the OS ends with "/ Version" */ var isSpecialCasedOS; /* Detectable layout engines (order is important). */ var layout = getLayout([ { 'label': 'EdgeHTML', 'pattern': 'Edge' }, 'Trident', { 'label': 'WebKit', 'pattern': 'AppleWebKit' }, 'iCab', 'Presto', 'NetFront', 'Tasman', 'KHTML', 'Gecko' ]); /* Detectable browser names (order is important). */ var name = getName([ 'Adobe AIR', 'Arora', 'Avant Browser', 'Breach', 'Camino', 'Electron', 'Epiphany', 'Fennec', 'Flock', 'Galeon', 'GreenBrowser', 'iCab', 'Iceweasel', 'K-Meleon', 'Konqueror', 'Lunascape', 'Maxthon', { 'label': 'Microsoft Edge', 'pattern': 'Edge' }, 'Midori', 'Nook Browser', 'PaleMoon', 'PhantomJS', 'Raven', 'Rekonq', 'RockMelt', { 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' }, 'SeaMonkey', { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, 'Sleipnir', 'SlimBrowser', { 'label': 'SRWare Iron', 'pattern': 'Iron' }, 'Sunrise', 'Swiftfox', 'Waterfox', 'WebPositive', 'Opera Mini', { 'label': 'Opera Mini', 'pattern': 'OPiOS' }, 'Opera', { 'label': 'Opera', 'pattern': 'OPR' }, 'Chrome', { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' }, { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' }, { 'label': 'Firefox for iOS', 'pattern': 'FxiOS' }, { 'label': 'IE', 'pattern': 'IEMobile' }, { 'label': 'IE', 'pattern': 'MSIE' }, 'Safari' ]); /* Detectable products (order is important). */ var product = getProduct([ { 'label': 'BlackBerry', 'pattern': 'BB10' }, 'BlackBerry', { 'label': 'Galaxy S', 'pattern': 'GT-I9000' }, { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' }, { 'label': 'Galaxy S3', 'pattern': 'GT-I9300' }, { 'label': 'Galaxy S4', 'pattern': 'GT-I9500' }, { 'label': 'Galaxy S5', 'pattern': 'SM-G900' }, { 'label': 'Galaxy S6', 'pattern': 'SM-G920' }, { 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' }, { 'label': 'Galaxy S7', 'pattern': 'SM-G930' }, { 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' }, 'Google TV', 'Lumia', 'iPad', 'iPod', 'iPhone', 'Kindle', { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, 'Nexus', 'Nook', 'PlayBook', 'PlayStation Vita', 'PlayStation', 'TouchPad', 'Transformer', { 'label': 'Wii U', 'pattern': 'WiiU' }, 'Wii', 'Xbox One', { 'label': 'Xbox 360', 'pattern': 'Xbox' }, 'Xoom' ]); /* Detectable manufacturers. */ var manufacturer = getManufacturer({ 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 }, 'Archos': {}, 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 }, 'Asus': { 'Transformer': 1 }, 'Barnes & Noble': { 'Nook': 1 }, 'BlackBerry': { 'PlayBook': 1 }, 'Google': { 'Google TV': 1, 'Nexus': 1 }, 'HP': { 'TouchPad': 1 }, 'HTC': {}, 'LG': {}, 'Microsoft': { 'Xbox': 1, 'Xbox One': 1 }, 'Motorola': { 'Xoom': 1 }, 'Nintendo': { 'Wii U': 1, 'Wii': 1 }, 'Nokia': { 'Lumia': 1 }, 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 }, 'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 } }); /* Detectable operating systems (order is important). */ var os = getOS([ 'Windows Phone', 'Android', 'CentOS', { 'label': 'Chrome OS', 'pattern': 'CrOS' }, 'Debian', 'Fedora', 'FreeBSD', 'Gentoo', 'Haiku', 'Kubuntu', 'Linux Mint', 'OpenBSD', 'Red Hat', 'SuSE', 'Ubuntu', 'Xubuntu', 'Cygwin', 'Symbian OS', 'hpwOS', 'webOS ', 'webOS', 'Tablet OS', 'Tizen', 'Linux', 'Mac OS X', 'Macintosh', 'Mac', 'Windows 98;', 'Windows ' ]); /*------------------------------------------------------------------------*/ /** * Picks the layout engine from an array of guesses. * * @private * @param {Array} guesses An array of guesses. * @returns {null|string} The detected layout engine. */ function getLayout(guesses) { return reduce(guesses, function(result, guess) { return result || RegExp('\\b' + ( guess.pattern || qualify(guess) ) + '\\b', 'i').exec(ua) && (guess.label || guess); }); } /** * Picks the manufacturer from an array of guesses. * * @private * @param {Array} guesses An object of guesses. * @returns {null|string} The detected manufacturer. */ function getManufacturer(guesses) { return reduce(guesses, function(result, value, key) { // Lookup the manufacturer by product or scan the UA for the manufacturer. return result || ( value[product] || value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua) ) && key; }); } /** * Picks the browser name from an array of guesses. * * @private * @param {Array} guesses An array of guesses. * @returns {null|string} The detected browser name. */ function getName(guesses) { return reduce(guesses, function(result, guess) { return result || RegExp('\\b' + ( guess.pattern || qualify(guess) ) + '\\b', 'i').exec(ua) && (guess.label || guess); }); } /** * Picks the OS name from an array of guesses. * * @private * @param {Array} guesses An array of guesses. * @returns {null|string} The detected OS name. */ function getOS(guesses) { return reduce(guesses, function(result, guess) { var pattern = guess.pattern || qualify(guess); if (!result && (result = RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua) )) { result = cleanupOS(result, pattern, guess.label || guess); } return result; }); } /** * Picks the product name from an array of guesses. * * @private * @param {Array} guesses An array of guesses. * @returns {null|string} The detected product name. */ function getProduct(guesses) { return reduce(guesses, function(result, guess) { var pattern = guess.pattern || qualify(guess); if (!result && (result = RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) || RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua) )) { // Split by forward slash and append product version if needed. if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) { result[0] += ' ' + result[1]; } // Correct character case and cleanup string. guess = guess.label || guess; result = format(result[0] .replace(RegExp(pattern, 'i'), guess) .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ') .replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2')); } return result; }); } /** * Resolves the version using an array of UA patterns. * * @private * @param {Array} patterns An array of UA patterns. * @returns {null|string} The detected version. */ function getVersion(patterns) { return reduce(patterns, function(result, pattern) { return result || (RegExp(pattern + '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null; }); } /** * Returns `platform.description` when the platform object is coerced to a string. * * @name toString * @memberOf platform * @returns {string} Returns `platform.description` if available, else an empty string. */ function toStringPlatform() { return this.description || ''; } /*------------------------------------------------------------------------*/ // Convert layout to an array so we can add extra details. layout && (layout = [layout]); // Detect product names that contain their manufacturer's name. if (manufacturer && !product) { product = getProduct([manufacturer]); } // Clean up Google TV. if ((data = /\bGoogle TV\b/.exec(product))) { product = data[0]; } // Detect simulators. if (/\bSimulator\b/i.test(ua)) { product = (product ? product + ' ' : '') + 'Simulator'; } // Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS. if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) { description.push('running in Turbo/Uncompressed mode'); } // Detect IE Mobile 11. if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) { data = parse(ua.replace(/like iPhone OS/, '')); manufacturer = data.manufacturer; product = data.product; } // Detect iOS. else if (/^iP/.test(product)) { name || (name = 'Safari'); os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) ? ' ' + data[1].replace(/_/g, '.') : ''); } // Detect Kubuntu. else if (name == 'Konqueror' && !/buntu/i.test(os)) { os = 'Kubuntu'; } // Detect Android browsers. else if ((manufacturer && manufacturer != 'Google' && ((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) || (/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) { name = 'Android Browser'; os = /\bAndroid\b/.test(os) ? os : 'Android'; } // Detect Silk desktop/accelerated modes. else if (name == 'Silk') { if (!/\bMobi/i.test(ua)) { os = 'Android'; description.unshift('desktop mode'); } if (/Accelerated *= *true/i.test(ua)) { description.unshift('accelerated'); } } // Detect PaleMoon identifying as Firefox. else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) { description.push('identifying as Firefox ' + data[1]); } // Detect Firefox OS and products running Firefox. else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) { os || (os = 'Firefox OS'); product || (product = data[1]); } // Detect false positives for Firefox/Safari. else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) { // Escape the `/` for Firefox 1. if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) { // Clear name of false positives. name = null; } // Reassign a generic name. if ((data = product || manufacturer || os) && (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) { name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser'; } } // Add Chrome version to description for Electron. else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) { description.push('Chromium ' + data); } // Detect non-Opera (Presto-based) versions (order is important). if (!version) { version = getVersion([ '(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))', 'Version', qualify(name), '(?:Firefox|Minefield|NetFront)' ]); } // Detect stubborn layout engines. if ((data = layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' || /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') || /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' || !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') || layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront' )) { layout = [data]; } // Detect Windows Phone 7 desktop mode. if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) { name += ' Mobile'; os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x'); description.unshift('desktop mode'); } // Detect Windows Phone 8.x desktop mode. else if (/\bWPDesktop\b/i.test(ua)) { name = 'IE Mobile'; os = 'Windows Phone 8.x'; description.unshift('desktop mode'); version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]); } // Detect IE 11 identifying as other browsers. else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) { if (name) { description.push('identifying as ' + name + (version ? ' ' + version : '')); } name = 'IE'; version = data[1]; } // Leverage environment features. if (useFeatures) { // Detect server-side environments. // Rhino has a global function while others have a global object. if (isHostType(context, 'global')) { if (java) { data = java.lang.System; arch = data.getProperty('os.arch'); os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version'); } if (rhino) { try { version = context.require('ringo/engine').version.join('.'); name = 'RingoJS'; } catch(e) { if ((data = context.system) && data.global.system == context.system) { name = 'Narwhal'; os || (os = data[0].os || null); } } if (!name) { name = 'Rhino'; } } else if ( typeof context.process == 'object' && !context.process.browser && (data = context.process) ) { if (typeof data.versions == 'object') { if (typeof data.versions.electron == 'string') { description.push('Node ' + data.versions.node); name = 'Electron'; version = data.versions.electron; } else if (typeof data.versions.nw == 'string') { description.push('Chromium ' + version, 'Node ' + data.versions.node); name = 'NW.js'; version = data.versions.nw; } } if (!name) { name = 'Node.js'; arch = data.arch; os = data.platform; version = /[\d.]+/.exec(data.version); version = version ? version[0] : null; } } } // Detect Adobe AIR. else if (getClassOf((data = context.runtime)) == airRuntimeClass) { name = 'Adobe AIR'; os = data.flash.system.Capabilities.os; } // Detect PhantomJS. else if (getClassOf((data = context.phantom)) == phantomClass) { name = 'PhantomJS'; version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch); } // Detect IE compatibility modes. else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) { // We're in compatibility mode when the Trident version + 4 doesn't // equal the document mode. version = [version, doc.documentMode]; if ((data = +data[1] + 4) != version[1]) { description.push('IE ' + version[1] + ' mode'); layout && (layout[1] = ''); version[1] = data; } version = name == 'IE' ? String(version[1].toFixed(1)) : version[0]; } // Detect IE 11 masking as other browsers. else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) { description.push('masking as ' + name + ' ' + version); name = 'IE'; version = '11.0'; layout = ['Trident']; os = 'Windows'; } os = os && format(os); } // Detect prerelease phases. if (version && (data = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || /\bMinefield\b/i.test(ua) && 'a' )) { prerelease = /b/i.test(data) ? 'beta' : 'alpha'; version = version.replace(RegExp(data + '\\+?$'), '') + (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || ''); } // Detect Firefox Mobile. if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS)\b/.test(os)) { name = 'Firefox Mobile'; } // Obscure Maxthon's unreliable version. else if (name == 'Maxthon' && version) { version = version.replace(/\.[\d.]+/, '.x'); } // Detect Xbox 360 and Xbox One. else if (/\bXbox\b/i.test(product)) { if (product == 'Xbox 360') { os = null; } if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) { description.unshift('mobile mode'); } } // Add mobile postfix. else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && (os == 'Windows CE' || /Mobi/i.test(ua))) { name += ' Mobile'; } // Detect IE platform preview. else if (name == 'IE' && useFeatures) { try { if (context.external === null) { description.unshift('platform preview'); } } catch(e) { description.unshift('embedded'); } } // Detect BlackBerry OS version. // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || version )) { data = [data, /BB10/.test(ua)]; os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0]; version = null; } // Detect Opera identifying/masking itself as another browser. // http://www.opera.com/support/kb/view/843/ else if (this != forOwn && product != 'Wii' && ( (useFeatures && opera) || (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) || (name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) || (name == 'IE' && ( (os && !/^Win/.test(os) && version > 5.5) || /\bWindows XP\b/.test(os) && version > 8 || version == 8 && !/\bTrident\b/.test(ua) )) ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) { // When "identifying", the UA contains both Opera and the other browser's name. data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : ''); if (reOpera.test(name)) { if (/\bIE\b/.test(data) && os == 'Mac OS') { os = null; } data = 'identify' + data; } // When "masking", the UA contains only the other browser's name. else { data = 'mask' + data; if (operaClass) { name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2')); } else { name = 'Opera'; } if (/\bIE\b/.test(data)) { os = null; } if (!useFeatures) { version = null; } } layout = ['Presto']; description.push(data); } // Detect WebKit Nightly and approximate Chrome/Safari versions. if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { // Correct build number for numeric comparison. // (e.g. "532.5" becomes "532.05") data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data]; // Nightly builds are postfixed with a "+". if (name == 'Safari' && data[1].slice(-1) == '+') { name = 'WebKit Nightly'; prerelease = 'alpha'; version = data[1].slice(0, -1); } // Clear incorrect browser versions. else if (version == data[1] || version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { version = null; } // Use the full Chrome version when available. data[1] = (/\bChrome\/([\d.]+)/i.exec(ua) || 0)[1]; // Detect Blink layout engine. if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') { layout = ['Blink']; } // Detect JavaScriptCore. // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi if (!useFeatures || (!likeChrome && !data[1])) { layout && (layout[1] = 'like Safari'); data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : '8'); } else { layout && (layout[1] = 'like Chrome'); data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28'); } // Add the postfix of ".x" or "+" for approximate versions. layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+')); // Obscure version for some Safari 1-2 releases. if (name == 'Safari' && (!version || parseInt(version) > 45)) { version = data; } } // Detect Opera desktop modes. if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) { name += ' '; description.unshift('desktop mode'); if (data == 'zvav') { name += 'Mini'; version = null; } else { name += 'Mobile'; } os = os.replace(RegExp(' *' + data + '$'), ''); } // Detect Chrome desktop mode. else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) { description.unshift('desktop mode'); name = 'Chrome Mobile'; version = null; if (/\bOS X\b/.test(os)) { manufacturer = 'Apple'; os = 'iOS 4.3+'; } else { os = null; } } // Strip incorrect OS versions. if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 && ua.indexOf('/' + data + '-') > -1) { os = trim(os.replace(data, '')); } // Add layout engine. if (layout && !/\b(?:Avant|Nook)\b/.test(name) && ( /Browser|Lunascape|Maxthon/.test(name) || name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(name) && layout[1])) { // Don't add layout details to description if they are falsey. (data = layout[layout.length - 1]) && description.push(data); } // Combine contextual information. if (description.length) { description = ['(' + description.join('; ') + ')']; } // Append manufacturer to description. if (manufacturer && product && product.indexOf(manufacturer) < 0) { description.push('on ' + manufacturer); } // Append product to description. if (product) { description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product); } // Parse the OS into an object. if (os) { data = / ([\d.+]+)$/.exec(os); isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/'; os = { 'architecture': 32, 'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os, 'version': data ? data[1] : null, 'toString': function() { var version = this.version; return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : ''); } }; } // Add browser/OS architecture. if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) { if (os) { os.architecture = 64; os.family = os.family.replace(RegExp(' *' + data), ''); } if ( name && (/\bWOW64\b/i.test(ua) || (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) ) { description.unshift('32-bit'); } } // Chrome 39 and above on OS X is always 64-bit. else if ( os && /^OS X/.test(os.family) && name == 'Chrome' && parseFloat(version) >= 39 ) { os.architecture = 64; } ua || (ua = null); /*------------------------------------------------------------------------*/ /** * The platform object. * * @name platform * @type Object */ var platform = {}; /** * The platform description. * * @memberOf platform * @type string|null */ platform.description = ua; /** * The name of the browser's layout engine. * * The list of common layout engines include: * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit" * * @memberOf platform * @type string|null */ platform.layout = layout && layout[0]; /** * The name of the product's manufacturer. * * The list of manufacturers include: * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry", * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo", * "Nokia", "Samsung" and "Sony" * * @memberOf platform * @type string|null */ platform.manufacturer = manufacturer; /** * The name of the browser/environment. * * The list of common browser names include: * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE", * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk", * "Opera Mini" and "Opera" * * Mobile versions of some browsers have "Mobile" appended to their name: * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile" * * @memberOf platform * @type string|null */ platform.name = name; /** * The alpha/beta release indicator. * * @memberOf platform * @type string|null */ platform.prerelease = prerelease; /** * The name of the product hosting the browser. * * The list of common products include: * * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle", * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer" * * @memberOf platform * @type string|null */ platform.product = product; /** * The browser's user agent string. * * @memberOf platform * @type string|null */ platform.ua = ua; /** * The browser/environment version. * * @memberOf platform * @type string|null */ platform.version = name && version; /** * The name of the operating system. * * @memberOf platform * @type Object */ platform.os = os || { /** * The CPU architecture the OS is built for. * * @memberOf platform.os * @type number|null */ 'architecture': null, /** * The family of the OS. * * Common values include: * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista", * "Windows XP", "OS X", "Ubuntu", "Debian", "Fedora", "Red Hat", "SuSE", * "Android", "iOS" and "Windows Phone" * * @memberOf platform.os * @type string|null */ 'family': null, /** * The version of the OS. * * @memberOf platform.os * @type string|null */ 'version': null, /** * Returns the OS string. * * @memberOf platform.os * @returns {string} The OS string. */ 'toString': function() { return 'null'; } }; platform.parse = parse; platform.toString = toStringPlatform; if (platform.version) { description.unshift(version); } if (platform.name) { description.unshift(name); } if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) { description.push(product ? '(' + os + ')' : 'on ' + os); } if (description.length) { platform.description = description.join(' '); } return platform; } /*--------------------------------------------------------------------------*/ // Export platform. var platform = parse(); // Some AMD build optimizers, like r.js, check for condition patterns like the following: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { // Expose platform on the global object to prevent errors when platform is // loaded by a script tag in the presence of an AMD loader. // See http://requirejs.org/docs/errors.html#mismatch for more details. root.platform = platform; // Define as an anonymous module so platform can be aliased through path mapping. define(function() { return platform; }); } // Check for `exports` after `define` in case a build optimizer adds an `exports` object. else if (freeExports && freeModule) { // Export for CommonJS support. forOwn(platform, function(value, key) { freeExports[key] = value; }); } else { // Export to the global object. root.platform = platform; } }.call(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],207:[function(require,module,exports){ (function (process){ 'use strict'; if (typeof process === 'undefined' || !process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = { nextTick: nextTick }; } else { module.exports = process } function nextTick(fn, arg1, arg2, arg3) { if (typeof fn !== 'function') { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args, i; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick(function afterTickOne() { fn.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn.call(null, arg1, arg2, arg3); }); default: args = new Array(len - 1); i = 0; while (i < args.length) { args[i++] = arguments[i]; } return process.nextTick(function afterTick() { fn.apply(null, args); }); } } }).call(this,require('_process')) },{"_process":208}],208:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; },{}],209:[function(require,module,exports){ (function (global){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { /** Detect free variables */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; var freeModule = typeof module == 'object' && module && !module.nodeType && module; var freeGlobal = typeof global == 'object' && global; if ( freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal ) { root = freeGlobal; } /** * The `punycode` object. * @name punycode * @type Object */ var punycode, /** Highest positive signed 32-bit float value */ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, // 0x80 delimiter = '-', // '\x2D' /** Regular expressions */ regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators /** Error messages */ errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*--------------------------------------------------------------------------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define('punycode', function() { return punycode; }); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],210:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: https://github.com/joyent/node/issues/1707 function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; // maxKeys <= 0 means that we should not limit keys count if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; },{}],211:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var stringifyPrimitive = function(v) { switch (typeof v) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function(obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (typeof obj === 'object') { return map(objectKeys(obj), function(k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function(v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map (xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; },{}],212:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); },{"./decode":210,"./encode":211}],213:[function(require,module,exports){ module.exports = require('./lib/_stream_duplex.js'); },{"./lib/_stream_duplex.js":214}],214:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. 'use strict'; /**/ var _create = require('babel-runtime/core-js/object/create'); var _create2 = _interopRequireDefault(_create); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var pna = require('process-nextick-args'); /**/ /**/ var objectKeys = _keys2.default || function (obj) { var keys = []; for (var key in obj) { keys.push(key); }return keys; }; /**/ module.exports = Duplex; /**/ var util = (0, _create2.default)(require('core-util-is')); util.inherits = require('inherits'); /**/ var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); util.inherits(Duplex, Readable); { // avoid scope creep, the keys array can then be collected var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // the no-half-open enforcer function onend() { // if we allow half-open state, or if the writable side ended, // then we're ok. if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. pna.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } }); Duplex.prototype._destroy = function (err, cb) { this.push(null); this.end(); pna.nextTick(cb, err); }; },{"./_stream_readable":216,"./_stream_writable":218,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60,"core-util-is":189,"inherits":196,"process-nextick-args":207}],215:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; var _create = require('babel-runtime/core-js/object/create'); var _create2 = _interopRequireDefault(_create); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = PassThrough; var Transform = require('./_stream_transform'); /**/ var util = (0, _create2.default)(require('core-util-is')); util.inherits = require('inherits'); /**/ util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; },{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,"inherits":196}],216:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; /**/ var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _create = require('babel-runtime/core-js/object/create'); var _create2 = _interopRequireDefault(_create); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var pna = require('process-nextick-args'); /**/ module.exports = Readable; /**/ var isArray = require('isarray'); /**/ /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = require('events').EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ /**/ var Buffer = require('safe-buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ /**/ var util = (0, _create2.default)(require('core-util-is')); util.inherits = require('inherits'); /**/ /**/ var debugUtil = require('util'); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /**/ var BufferList = require('./internal/streams/BufferList'); var destroyImpl = require('./internal/streams/destroy'); var StringDecoder; util.inherits(Readable, Stream); var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; var readableHwm = options.readableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { this.push(null); cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && (0, _getPrototypeOf2.default)(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); } else if (state.ended) { stream.emit('error', new Error('stream.push() after EOF')); } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; } } return needMoreData(state); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { stream.emit('data', chunk); stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, // such as the repl. Also, if the push() triggered a // readable event, and the user called read(largeNumber) such that // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; // Don't raise the hwm > 8MB var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; } else { state.length -= n; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; // emit 'readable' now to make sure it gets picked up. emitReadable(stream); } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } } function emitReadable_(stream) { debug('emit readable'); stream.emit('readable'); flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break;else len = state.length; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { this.emit('error', new Error('_read() is not implemented')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } // If the user pushes more data while we're writing to dest then we'll end up // in ondata again. However, we only want to increase awaitDrain once because // dest will only emit one 'drain' event for the multiple writes. // => Introduce a guard on increasing awaitDrain. var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); increasedAwaitDrain = false; var ret = dest.write(chunk); if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; increasedAwaitDrain = true; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, unpipeInfo); }return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if (ev === 'data') { // Start flowing on next tick if stream isn't explicitly paused if (this._readableState.flowing !== false) this.resume(); } else if (ev === 'readable') { var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.emittedReadable = false; if (!state.reading) { pna.nextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; pna.nextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug('resume read 0'); stream.read(0); } state.resumeScheduled = false; state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function (method) { return function () { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); // exposed for testing purposes only. Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = fromListPartial(n, state.buffer, state.decoder); } return ret; } // Extracts only enough buffered data to satisfy the amount requested. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { // slice is the same for buffers and strings ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { // first chunk is a perfect match ret = list.shift(); } else { // result spans more than one buffer ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } return ret; } // Copies a specified amount of characters from the list of buffered data // chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = str.slice(nb); } break; } ++c; } list.length -= c; return ret; } // Copies a specified amount of bytes from the list of buffered data chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBuffer(n, list) { var ret = Buffer.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = buf.slice(nb); } break; } ++c; } list.length -= c; return ret; } function endReadable(stream) { var state = stream._readableState; // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; pna.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./_stream_duplex":214,"./internal/streams/BufferList":219,"./internal/streams/destroy":220,"./internal/streams/stream":221,"_process":208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/get-prototype-of":59,"core-util-is":189,"events":192,"inherits":196,"isarray":198,"process-nextick-args":207,"safe-buffer":228,"string_decoder/":235,"util":71}],217:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. 'use strict'; var _create = require('babel-runtime/core-js/object/create'); var _create2 = _interopRequireDefault(_create); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = Transform; var Duplex = require('./_stream_duplex'); /**/ var util = (0, _create2.default)(require('core-util-is')); util.inherits = require('inherits'); /**/ util.inherits(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) { return this.emit('error', new Error('write callback called multiple times')); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function') { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { throw new Error('_transform() is not implemented'); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); _this2.emit('close'); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); return stream.push(null); } },{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,"inherits":196}],218:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; /**/ var _defineProperty = require('babel-runtime/core-js/object/define-property'); var _defineProperty2 = _interopRequireDefault(_defineProperty); var _hasInstance = require('babel-runtime/core-js/symbol/has-instance'); var _hasInstance2 = _interopRequireDefault(_hasInstance); var _symbol = require('babel-runtime/core-js/symbol'); var _symbol2 = _interopRequireDefault(_symbol); var _create = require('babel-runtime/core-js/object/create'); var _create2 = _interopRequireDefault(_create); var _setImmediate2 = require('babel-runtime/core-js/set-immediate'); var _setImmediate3 = _interopRequireDefault(_setImmediate2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var pna = require('process-nextick-args'); /**/ module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? _setImmediate3.default : pna.nextTick; /**/ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var util = (0, _create2.default)(require('core-util-is')); util.inherits = require('inherits'); /**/ /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ /**/ var Buffer = require('safe-buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var destroyImpl = require('./internal/streams/destroy'); util.inherits(Writable, Stream); function nop() {} function WritableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() var hwm = options.highWaterMark; var writableHwm = options.writableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof _symbol2.default === 'function' && _hasInstance2.default && typeof Function.prototype[_hasInstance2.default] === 'function') { realHasInstance = Function.prototype[_hasInstance2.default]; (0, _defineProperty2.default)(Writable, _hasInstance2.default, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { return new Writable(options); } this._writableState = new WritableState(options, this); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe, not readable')); }; function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); pna.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { stream.emit('error', er); pna.nextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack pna.nextTick(cb, er); // this can emit finish, and it will always happen // after error pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; stream.emit('error', er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { /**/ asyncWrite(afterWrite, stream, state, finished, cb); /**/ } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('_write() is not implemented')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending && !state.finished) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { stream.emit('error', err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function') { state.pendingcb++; state.finalCalled = true; pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } if (state.corkedRequestsFree) { state.corkedRequestsFree.next = corkReq; } else { state.corkedRequestsFree = corkReq; } } Object.defineProperty(Writable.prototype, 'destroyed', { get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { this.end(); cb(err); }; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./_stream_duplex":214,"./internal/streams/destroy":220,"./internal/streams/stream":221,"_process":208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/set-immediate":62,"babel-runtime/core-js/symbol":64,"babel-runtime/core-js/symbol/has-instance":65,"core-util-is":189,"inherits":196,"process-nextick-args":207,"safe-buffer":228,"util-deprecate":240}],219:[function(require,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer = require('safe-buffer').Buffer; var util = require('util'); function copyBuffer(src, target, offset) { src.copy(target, offset); } module.exports = function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } BufferList.prototype.push = function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; }; BufferList.prototype.unshift = function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; }; BufferList.prototype.shift = function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; }; BufferList.prototype.clear = function clear() { this.head = this.tail = null; this.length = 0; }; BufferList.prototype.join = function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; }return ret; }; BufferList.prototype.concat = function concat(n) { if (this.length === 0) return Buffer.alloc(0); if (this.length === 1) return this.head.data; var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; }; return BufferList; }(); if (util && util.inspect && util.inspect.custom) { module.exports.prototype[util.inspect.custom] = function () { var obj = util.inspect({ length: this.length }); return this.constructor.name + ' ' + obj; }; } },{"safe-buffer":228,"util":71}],220:[function(require,module,exports){ 'use strict'; /**/ var pna = require('process-nextick-args'); /**/ // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { pna.nextTick(emitErrorNT, this, err); } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { pna.nextTick(emitErrorNT, _this, err); if (_this._writableState) { _this._writableState.errorEmitted = true; } } else if (cb) { cb(err); } }); return this; } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy }; },{"process-nextick-args":207}],221:[function(require,module,exports){ 'use strict'; module.exports = require('events').EventEmitter; },{"events":192}],222:[function(require,module,exports){ module.exports = require('./readable').PassThrough },{"./readable":223}],223:[function(require,module,exports){ exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); },{"./lib/_stream_duplex.js":214,"./lib/_stream_passthrough.js":215,"./lib/_stream_readable.js":216,"./lib/_stream_transform.js":217,"./lib/_stream_writable.js":218}],224:[function(require,module,exports){ module.exports = require('./readable').Transform },{"./readable":223}],225:[function(require,module,exports){ module.exports = require('./lib/_stream_writable.js'); },{"./lib/_stream_writable.js":218}],226:[function(require,module,exports){ /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // This method of obtaining a reference to the global object needs to be // kept identical to the way it is obtained in runtime.js var g = (function() { return this })() || Function("return this")(); // Use `getOwnPropertyNames` because not all browsers support calling // `hasOwnProperty` on the global `self` object in a worker. See #183. var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; // Save the old regeneratorRuntime in case it needs to be restored later. var oldRuntime = hadRuntime && g.regeneratorRuntime; // Force reevalutation of runtime.js. g.regeneratorRuntime = undefined; module.exports = require("./runtime"); if (hadRuntime) { // Restore the original runtime. g.regeneratorRuntime = oldRuntime; } else { // Remove the global property added by runtime.js. try { delete g.regeneratorRuntime; } catch(e) { g.regeneratorRuntime = undefined; } } },{"./runtime":227}],227:[function(require,module,exports){ /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !(function(global) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; var inModule = typeof module === "object"; var runtime = global.regeneratorRuntime; if (runtime) { if (inModule) { // If regeneratorRuntime is defined globally and we're in a module, // make the exports object identical to regeneratorRuntime. module.exports = runtime; } // Don't bother evaluating the rest of this file if the runtime was // already defined globally. return; } // Define the runtime globally (as expected by generated code) as either // module.exports (if we're in a module) or a new, empty object. runtime = global.regeneratorRuntime = inModule ? module.exports : {}; function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } runtime.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { prototype[method] = function(arg) { return this._invoke(method, arg); }; }); } runtime.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; runtime.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; if (!(toStringTagSymbol in genFun)) { genFun[toStringTagSymbol] = "GeneratorFunction"; } } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. runtime.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return Promise.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return Promise.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. If the Promise is rejected, however, the // result for this iteration will be rejected with the same // reason. Note that rejections of yielded Promises are not // thrown back into the generator function, as is the case // when an awaited Promise is rejected. This difference in // behavior between yield and await is important, because it // allows the consumer to decide what to do with the yielded // rejection (swallow it and continue, manually .throw it back // into the generator, abandon iteration, whatever). With // await, by contrast, there is no opportunity to examine the // rejection reason outside the generator function, so the // only option is to throw it from the await expression, and // let the generator function handle the exception. result.value = unwrapped; resolve(result); }, reject); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new Promise(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; runtime.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. runtime.async = function(innerFn, outerFn, self, tryLocsList) { var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList) ); return runtime.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { if (delegate.iterator.return) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } runtime.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } runtime.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; })( // In sloppy mode, unbound `this` refers to the global object, fallback to // Function constructor if we're in global strict mode. That is sadly a form // of indirect eval which violates Content Security Policy. (function() { return this })() || Function("return this")() ); },{}],228:[function(require,module,exports){ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } },{"buffer":73}],229:[function(require,module,exports){ (function (Buffer){ 'use strict'; var _fromCodePoint = require('babel-runtime/core-js/string/from-code-point'); var _fromCodePoint2 = _interopRequireDefault(_fromCodePoint); var _stringify = require('babel-runtime/core-js/json/stringify'); var _stringify2 = _interopRequireDefault(_stringify); var _typeof2 = require('babel-runtime/helpers/typeof'); var _typeof3 = _interopRequireDefault(_typeof2); var _defineProperty = require('babel-runtime/core-js/object/define-property'); var _defineProperty2 = _interopRequireDefault(_defineProperty); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _create = require('babel-runtime/core-js/object/create'); var _create2 = _interopRequireDefault(_create); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } ;(function (sax) { // wrapper for non-node envs sax.parser = function (strict, opt) { return new SAXParser(strict, opt); }; sax.SAXParser = SAXParser; sax.SAXStream = SAXStream; sax.createStream = createStream; // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), // since that's the earliest that a buffer overrun could occur. This way, checks are // as rare as required, but as often as necessary to ensure never crossing this bound. // Furthermore, buffers are only tested at most once per write(), so passing a very // large string into write() might have undesirable effects, but this is manageable by // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme // edge case, result in creating at most one complete copy of the string passed in. // Set to Infinity to have unlimited buffers. sax.MAX_BUFFER_LENGTH = 64 * 1024; var buffers = ['comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', 'procInstName', 'procInstBody', 'entity', 'attribName', 'attribValue', 'cdata', 'script']; sax.EVENTS = ['text', 'processinginstruction', 'sgmldeclaration', 'doctype', 'comment', 'opentagstart', 'attribute', 'opentag', 'closetag', 'opencdata', 'cdata', 'closecdata', 'error', 'end', 'ready', 'script', 'opennamespace', 'closenamespace']; function SAXParser(strict, opt) { if (!(this instanceof SAXParser)) { return new SAXParser(strict, opt); } var parser = this; clearBuffers(parser); parser.q = parser.c = ''; parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH; parser.opt = opt || {}; parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags; parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'; parser.tags = []; parser.closed = parser.closedRoot = parser.sawRoot = false; parser.tag = parser.error = null; parser.strict = !!strict; parser.noscript = !!(strict || parser.opt.noscript); parser.state = S.BEGIN; parser.strictEntities = parser.opt.strictEntities; parser.ENTITIES = parser.strictEntities ? (0, _create2.default)(sax.XML_ENTITIES) : (0, _create2.default)(sax.ENTITIES); parser.attribList = []; // namespaces form a prototype chain. // it always points at the current tag, // which protos to its parent tag. if (parser.opt.xmlns) { parser.ns = (0, _create2.default)(rootNS); } // mostly just for error reporting parser.trackPosition = parser.opt.position !== false; if (parser.trackPosition) { parser.position = parser.line = parser.column = 0; } emit(parser, 'onready'); } if (!_create2.default) { Object.create = function (o) { function F() {} F.prototype = o; var newf = new F(); return newf; }; } if (!_keys2.default) { Object.keys = function (o) { var a = []; for (var i in o) { if (o.hasOwnProperty(i)) a.push(i); }return a; }; } function checkBufferLength(parser) { var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10); var maxActual = 0; for (var i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length; if (len > maxAllowed) { // Text/cdata nodes can get big, and since they're buffered, // we can get here under normal conditions. // Avoid issues by emitting the text node now, // so at least it won't get any bigger. switch (buffers[i]) { case 'textNode': closeText(parser); break; case 'cdata': emitNode(parser, 'oncdata', parser.cdata); parser.cdata = ''; break; case 'script': emitNode(parser, 'onscript', parser.script); parser.script = ''; break; default: error(parser, 'Max buffer length exceeded: ' + buffers[i]); } } maxActual = Math.max(maxActual, len); } // schedule the next check for the earliest possible buffer overrun. var m = sax.MAX_BUFFER_LENGTH - maxActual; parser.bufferCheckPosition = m + parser.position; } function clearBuffers(parser) { for (var i = 0, l = buffers.length; i < l; i++) { parser[buffers[i]] = ''; } } function flushBuffers(parser) { closeText(parser); if (parser.cdata !== '') { emitNode(parser, 'oncdata', parser.cdata); parser.cdata = ''; } if (parser.script !== '') { emitNode(parser, 'onscript', parser.script); parser.script = ''; } } SAXParser.prototype = { end: function end() { _end(this); }, write: write, resume: function resume() { this.error = null;return this; }, close: function close() { return this.write(null); }, flush: function flush() { flushBuffers(this); } }; var Stream; try { Stream = require('stream').Stream; } catch (ex) { Stream = function Stream() {}; } var streamWraps = sax.EVENTS.filter(function (ev) { return ev !== 'error' && ev !== 'end'; }); function createStream(strict, opt) { return new SAXStream(strict, opt); } function SAXStream(strict, opt) { if (!(this instanceof SAXStream)) { return new SAXStream(strict, opt); } Stream.apply(this); this._parser = new SAXParser(strict, opt); this.writable = true; this.readable = true; var me = this; this._parser.onend = function () { me.emit('end'); }; this._parser.onerror = function (er) { me.emit('error', er); // if didn't throw, then means error was handled. // go ahead and clear error, so we can write again. me._parser.error = null; }; this._decoder = null; streamWraps.forEach(function (ev) { (0, _defineProperty2.default)(me, 'on' + ev, { get: function get() { return me._parser['on' + ev]; }, set: function set(h) { if (!h) { me.removeAllListeners(ev); me._parser['on' + ev] = h; return h; } me.on(ev, h); }, enumerable: true, configurable: false }); }); } SAXStream.prototype = (0, _create2.default)(Stream.prototype, { constructor: { value: SAXStream } }); SAXStream.prototype.write = function (data) { if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = require('string_decoder').StringDecoder; this._decoder = new SD('utf8'); } data = this._decoder.write(data); } this._parser.write(data.toString()); this.emit('data', data); return true; }; SAXStream.prototype.end = function (chunk) { if (chunk && chunk.length) { this.write(chunk); } this._parser.end(); return true; }; SAXStream.prototype.on = function (ev, handler) { var me = this; if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { me._parser['on' + ev] = function () { var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments); args.splice(0, 0, ev); me.emit.apply(me, args); }; } return Stream.prototype.on.call(me, ev, handler); }; // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits. var CDATA = '[CDATA['; var DOCTYPE = 'DOCTYPE'; var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'; var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'; var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE // http://www.w3.org/TR/REC-xml/#NT-NameStartChar // This implementation works on strings, a single character at a time // as such, it cannot ever support astral-plane characters (10000-EFFFF) // without a significant breaking change to either this parser, or the // JavaScript language. Implementation of an emoji-capable xml parser // is left as an exercise for the reader. };var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; function isWhitespace(c) { return c === ' ' || c === '\n' || c === '\r' || c === '\t'; } function isQuote(c) { return c === '"' || c === '\''; } function isAttribEnd(c) { return c === '>' || isWhitespace(c); } function isMatch(regex, c) { return regex.test(c); } function notMatch(regex, c) { return !isMatch(regex, c); } var S = 0; sax.STATE = { BEGIN: S++, // leading byte order mark or whitespace BEGIN_WHITESPACE: S++, // leading whitespace TEXT: S++, // general stuff TEXT_ENTITY: S++, // & and such. OPEN_WAKA: S++, // < SGML_DECL: S++, // SCRIPT: S++, //