diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..319299684 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +quote_type = single + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore index 88d21b51c..e75f6190b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,19 +1,17 @@ -node_modules/ +build/ coverage/ -.tmp/ -.git/ -lib/browser/version.js +dist/ +es/ +lib/ +node_modules/ +**/*.min.js +**/*-min.js +**/*.bundle.js +example/ +test/ +browser-build.js shims/ -example/node_modules/ -example/public/ -example/public/index.js -test/.tmp/ -test/browser/.tmp -test/browser/build -test/benchmark/ -test/fixtures/ task/ -browser-build.js -es -cjs -lib/ +karma.conf.js +publish-check.js +publish.js diff --git a/.eslintrc.js b/.eslintrc.js index 5ae3fabb2..85eecf08f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,37 +1,20 @@ -/* eslint max-len: [0] */ module.exports = { - extends: ['airbnb', 'eslint-config-ali/typescript'], - parserOptions: { - ecmaFeatures: { - experimentalObjectRestSpread: true, - }, - }, - env: { - browser: true, - node: true, - es6: true, - mocha: true, - jasmine: true, - jest: true, - }, + extends: ['eslint-config-ali/typescript/node', 'prettier', 'prettier/@typescript-eslint'], rules: { - indent: ['error', 2], - // override default options - 'no-underscore-dangle': [0], - 'no-plusplus': [0], - 'no-return-await':[0], + '@typescript-eslint/no-require-imports': [0], + 'node/prefer-global/buffer': [0], + 'import/newline-after-import': [0], 'no-param-reassign': [0], - 'max-len': ['warn', 120, 2, { - ignoreUrls: true, - ignoreComments: false, - ignoreRegExpLiterals: true, - ignoreStrings: true, - ignoreTemplateLiterals: true, - }], - 'no-buffer-constructor': [2], - 'comma-dangle': [0], - 'import/prefer-default-export': [0], - 'implicit-arrow-linebreak': [0], - '@typescript-eslint/no-unused-vars': [0], - } + 'require-atomic-updates': [0], + '@typescript-eslint/consistent-type-definitions': [0], + '@typescript-eslint/restrict-plus-operands': [0], + '@typescript-eslint/explicit-member-accessibility': [0], + '@typescript-eslint/no-this-alias': [0], + 'node/prefer-promises/fs': [0], + 'no-console': [0], + '@typescript-eslint/no-inferrable-types': [0], + 'no-await-in-loop': [0], + 'no-throw-literal': [0], + '@typescript-eslint/member-ordering': [0], + }, }; diff --git a/.husky/pre-commit b/.husky/pre-commit index 57757f4ed..05f52abb4 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,3 +2,4 @@ . "$(dirname "$0")/_/husky.sh" npm run lint-staged +npm run f2elint-scan diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 796853bf4..000000000 --- a/.prettierrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "semi": true, - "singleQuote": true, - "tabWidth": 2, - "useTabs": false, - "printWidth": 120, - "bracketSpacing": true, - "arrowParens": "avoid", - "trailingComma": "none" -} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..9353f639c --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'always', +}; diff --git a/commitlint.config.js b/commitlint.config.js index 422b19445..52f3b754b 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,3 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; +module.exports = { + extends: ['ali'], +}; diff --git a/dist/aliyun-oss-sdk.js b/dist/aliyun-oss-sdk.js index 063482777..130b0bc10 100644 --- a/dist/aliyun-oss-sdk.js +++ b/dist/aliyun-oss-sdk.js @@ -2,19 +2,21 @@ // 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(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.OSS = f()}})(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 c(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 2 && _args[2] !== undefined ? _args[2] : {}; + + if (this.options.multipartRunning) { + console.warn('multipartUpload is already executing, if you need to call more than one multipartUpload at the same time, please create more instances'); + } + this.resetCancelFlag(); if (!(options.checkpoint && options.checkpoint.uploadId)) { - _context.next = 6; + _context.next = 7; break; } - _context.next = 5; + _context.next = 6; return resumeMultipart_1.resumeMultipart.call(this, options.checkpoint, options); - case 5: + case 6: return _context.abrupt("return", _context.sent); - case 6: + case 7: minPartSize = 100 * 1024; if (!options.mime) { @@ -283,33 +308,33 @@ function _multipartUpload() { options.headers = options.headers || {}; convertMetaToHeaders_1.convertMetaToHeaders(options.meta, options.headers); - _context.next = 12; + _context.next = 13; return getFileSize_1.getFileSize(file); - case 12: + case 13: fileSize = _context.sent; if (!(fileSize < minPartSize)) { - _context.next = 24; + _context.next = 25; break; } options.contentLength = fileSize; - _context.next = 17; + _context.next = 18; return put_1.put.call(this, name, file, options); - case 17: + case 18: result = _context.sent; if (!(options && options.progress)) { - _context.next = 21; + _context.next = 22; break; } - _context.next = 21; + _context.next = 22; return options.progress(1); - case 21: + case 22: ret = { res: result.res, bucket: this.options.bucket, @@ -323,27 +348,27 @@ function _multipartUpload() { return _context.abrupt("return", ret); - case 24: + case 25: if (!(options.partSize && !(parseInt(options.partSize.toString(), 10) === options.partSize))) { - _context.next = 26; + _context.next = 27; break; } throw new Error('partSize must be int number'); - case 26: + case 27: if (!(options.partSize && options.partSize < minPartSize)) { - _context.next = 28; + _context.next = 29; break; } throw new Error("partSize must not be smaller than ".concat(minPartSize)); - case 28: - _context.next = 30; + case 29: + _context.next = 31; return initMultipartUpload_1.initMultipartUpload.call(this, name, options); - case 30: + case 31: initResult = _context.sent; uploadId = initResult.uploadId; partSize = getPartSize_1.getPartSize(fileSize, options.partSize); @@ -357,21 +382,21 @@ function _multipartUpload() { }; if (!(options && options.progress)) { - _context.next = 37; + _context.next = 38; break; } - _context.next = 37; + _context.next = 38; return options.progress(0, checkpoint, initResult.res); - case 37: - _context.next = 39; + case 38: + _context.next = 40; return resumeMultipart_1.resumeMultipart.call(this, checkpoint, options); - case 39: + case 40: return _context.abrupt("return", _context.sent); - case 40: + case 41: case "end": return _context.stop(); } @@ -383,7 +408,7 @@ function _multipartUpload() { exports.multipartUpload = multipartUpload; -},{"../../common/multipart/initMultipartUpload":80,"../../common/multipart/resumeMultipart":84,"../../common/utils/convertMetaToHeaders":124,"../../common/utils/getPartSize":136,"../../common/utils/isBlob":143,"../../common/utils/isBuffer":144,"../../common/utils/isFile":145,"../object/put":7,"../utils/getFileSize":9,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"mime":411,"path":414,"regenerator-runtime/runtime":434}],6:[function(require,module,exports){ +},{"../../common/multipart/initMultipartUpload":81,"../../common/multipart/resumeMultipart":85,"../../common/utils/convertMetaToHeaders":126,"../../common/utils/getPartSize":138,"../../common/utils/isBlob":145,"../../common/utils/isBuffer":146,"../../common/utils/isFile":148,"../object/put":7,"../utils/getFileSize":9,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404,"mime":464,"path":467}],6:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -404,15 +429,13 @@ exports.default = { var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.function.name"); - -require("core-js/modules/es.object.to-string"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.function.name.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.to-string.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.regexp.to-string.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -488,20 +511,21 @@ function _put() { switch (_context.prev = _context.next) { case 0: options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; name = objectName_1.objectName(name); if (!isBuffer_1.isBuffer(file)) { - _context.next = 6; + _context.next = 7; break; } content = file; - _context.next = 34; + _context.next = 35; break; - case 6: + case 7: if (!(isBlob_1.isBlob(file) || isFile_1.isFile(file))) { - _context.next = 33; + _context.next = 34; break; } @@ -513,51 +537,51 @@ function _put() { } } - _context.next = 10; + _context.next = 11; return this._createStream(file, 0, file.size); - case 10: + case 11: stream = _context.sent; - _context.next = 13; + _context.next = 14; return getFileSize_1.getFileSize(file); - case 13: + case 14: options.contentLength = _context.sent; - _context.prev = 14; - _context.next = 17; + _context.prev = 15; + _context.next = 18; return putStream_1.putStream.call(this, name, stream, options); - case 17: + case 18: _result = _context.sent; return _context.abrupt("return", _result); - case 21: - _context.prev = 21; - _context.t0 = _context["catch"](14); + case 22: + _context.prev = 22; + _context.t0 = _context["catch"](15); if (!(_context.t0.code === 'RequestTimeTooSkewed')) { - _context.next = 30; + _context.next = 31; break; } this.options.amendTimeSkewed = +new Date(_context.t0.serverTime) - new Date().valueOf(); - _context.next = 27; + _context.next = 28; return put.call(this, name, file, options); - case 27: + case 28: return _context.abrupt("return", _context.sent); - case 30: + case 31: throw _context.t0; - case 31: - _context.next = 34; + case 32: + _context.next = 35; break; - case 33: + case 34: throw new TypeError('Must provide Buffer/Blob/File for put.'); - case 34: + case 35: options.headers = options.headers || {}; convertMetaToHeaders_1.convertMetaToHeaders(options.meta, options.headers); method = options.method || 'PUT'; @@ -566,10 +590,10 @@ function _put() { params.mime = options.mime; params.content = content; params.successStatuses = [200]; - _context.next = 44; + _context.next = 45; return this.request(params); - case 44: + case 45: result = _context.sent; ret = { name: name, @@ -583,30 +607,28 @@ function _put() { return _context.abrupt("return", ret); - case 48: + case 49: case "end": return _context.stop(); } } - }, _callee, this, [[14, 21]]); + }, _callee, this, [[15, 22]]); })); return _put.apply(this, arguments); } exports.put = put; -},{"../../common/utils/convertMetaToHeaders":124,"../../common/utils/encodeCallback":129,"../../common/utils/isBlob":143,"../../common/utils/isBuffer":144,"../../common/utils/isFile":145,"../../common/utils/objectName":150,"../../common/utils/objectUrl":151,"../utils/getFileSize":9,"./putStream":8,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"mime":411,"path":414,"regenerator-runtime/runtime":434}],8:[function(require,module,exports){ +},{"../../common/utils/convertMetaToHeaders":126,"../../common/utils/encodeCallback":131,"../../common/utils/isBlob":145,"../../common/utils/isBuffer":146,"../../common/utils/isFile":148,"../../common/utils/objectName":155,"../../common/utils/objectUrl":156,"../utils/getFileSize":9,"./putStream":8,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404,"mime":464,"path":467}],8:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.to-string"); - -require("core-js/modules/es.regexp.to-string"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.to-string.js"); + +require("core-js/modules/es.regexp.to-string.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -663,6 +685,7 @@ function _putStream() { params = this._objectRequestParams(method, name, options); encodeCallback_1.encodeCallback(params, options); params.mime = options.mime; + params.disabledMD5 = options.disabledMD5; if (stream.pipe) { params.stream = stream; @@ -671,10 +694,10 @@ function _putStream() { } params.successStatuses = [200]; - _context.next = 13; + _context.next = 14; return this.request(params); - case 13: + case 14: result = _context.sent; ret = { name: name, @@ -688,7 +711,7 @@ function _putStream() { return _context.abrupt("return", ret); - case 17: + case 18: case "end": return _context.stop(); } @@ -700,15 +723,13 @@ function _putStream() { exports.putStream = putStream; -},{"../../common/utils/convertMetaToHeaders":124,"../../common/utils/encodeCallback":129,"../../common/utils/objectName":150,"../../common/utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"regenerator-runtime/runtime":434}],9:[function(require,module,exports){ +},{"../../common/utils/convertMetaToHeaders":126,"../../common/utils/encodeCallback":131,"../../common/utils/objectName":155,"../../common/utils/objectUrl":156,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404}],9:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -762,7 +783,7 @@ function _getFileSize() { exports.getFileSize = getFileSize; -},{"../../common/utils/isBlob":143,"../../common/utils/isBuffer":144,"../../common/utils/isFile":145,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],10:[function(require,module,exports){ +},{"../../common/utils/isBlob":145,"../../common/utils/isBuffer":146,"../../common/utils/isFile":148,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],10:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -778,8 +799,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -828,15 +847,13 @@ function _abortBucketWorm() { exports.abortBucketWorm = abortBucketWorm; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],12:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],12:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -887,15 +904,13 @@ function _completeBucketWorm() { exports.completeBucketWorm = completeBucketWorm; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],13:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],13:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -956,15 +971,13 @@ function _deleteBucket() { exports.deleteBucket = deleteBucket; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],14:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],14:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1013,15 +1026,13 @@ function _deleteBucketCORS() { exports.deleteBucketCORS = deleteBucketCORS; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],15:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],15:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1077,16 +1088,14 @@ function _deleteBucketEncryption() { exports.deleteBucketEncryption = deleteBucketEncryption; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],16:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],16:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -1149,15 +1158,13 @@ function _deleteBucketInventory() { exports.deleteBucketInventory = deleteBucketInventory; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],17:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],17:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1206,15 +1213,13 @@ function _deleteBucketLifecycle() { exports.deleteBucketLifecycle = deleteBucketLifecycle; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],18:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],18:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1263,15 +1268,13 @@ function _deleteBucketLogging() { exports.deleteBucketLogging = deleteBucketLogging; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],19:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],19:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1327,15 +1330,13 @@ function _deleteBucketPolicy() { exports.deleteBucketPolicy = deleteBucketPolicy; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],20:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],20:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1379,15 +1380,13 @@ function _deleteBucketReferer() { exports.deleteBucketReferer = deleteBucketReferer; -},{"../utils/checkBucketName":120,"./putBucketReferer":51,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],21:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"./putBucketReferer":52,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],21:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1443,15 +1442,13 @@ function _deleteBucketTags() { exports.deleteBucketTags = deleteBucketTags; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],22:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],22:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1500,15 +1497,13 @@ function _deleteBucketWebsite() { exports.deleteBucketWebsite = deleteBucketWebsite; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],23:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],23:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1573,15 +1568,13 @@ function _extendBucketWorm() { exports.extendBucketWorm = extendBucketWorm; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],24:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],24:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1636,22 +1629,20 @@ function _getBucketACL() { exports.getBucketACL = getBucketACL; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],25:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],25:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.for-each"); - -require("core-js/modules/es.array.slice"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.keys.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.slice.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -1721,15 +1712,13 @@ function _getBucketCORS() { exports.getBucketCORS = getBucketCORS; -},{"../utils/checkBucketName":120,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.slice":344,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],26:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/isArray":144,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],26:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1788,15 +1777,13 @@ function _getBucketEncryption() { exports.getBucketEncryption = getBucketEncryption; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],27:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],27:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -1848,16 +1835,14 @@ function _getBucketInfo() { exports.getBucketInfo = getBucketInfo; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],28:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],28:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -1924,16 +1909,14 @@ function _getBucketInventory() { exports.getBucketInventory = getBucketInventory; -},{"../utils/checkBucketName":120,"../utils/formatInventoryConfig":132,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],29:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/formatInventoryConfig":134,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],29:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.map.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -2011,15 +1994,13 @@ function _getBucketLifecycle() { exports.getBucketLifecycle = getBucketLifecycle; -},{"../utils/checkBucketName":120,"../utils/formatObjKey":133,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"regenerator-runtime/runtime":434}],30:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/formatObjKey":135,"../utils/isArray":144,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382}],30:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2071,15 +2052,13 @@ function _getBucketLocation() { exports.getBucketLocation = getBucketLocation; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],31:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],31:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2133,18 +2112,16 @@ function _getBucketLogging() { exports.getBucketLogging = getBucketLogging; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],32:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],32:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.to-string"); - -require("core-js/modules/es.regexp.to-string"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.to-string.js"); + +require("core-js/modules/es.regexp.to-string.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -2209,15 +2186,13 @@ function _getBucketPolicy() { exports.getBucketPolicy = getBucketPolicy; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"regenerator-runtime/runtime":434}],33:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404}],33:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2280,15 +2255,13 @@ function _getBucketReferer() { exports.getBucketReferer = getBucketReferer; -},{"../utils/checkBucketName":120,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],34:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/isArray":144,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],34:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2346,14 +2319,70 @@ function _getBucketRequestPayment() { exports.getBucketRequestPayment = getBucketRequestPayment; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],35:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],35:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getBucketStat = void 0; + +var checkBucketName_1 = require("../utils/checkBucketName"); + +function getBucketStat(_x) { + return _getBucketStat.apply(this, arguments); +} + +function _getBucketStat() { + _getBucketStat = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + name = name || this.options.bucket; + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'stat', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 8; + return this.request(params); + + case 8: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + stat: result.data + }); + + case 10: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + return _getBucketStat.apply(this, arguments); +} + +exports.getBucketStat = getBucketStat; + +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],36:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); + +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -2417,15 +2446,13 @@ function _getBucketTags() { exports.getBucketTags = getBucketTags; -},{"../utils/checkBucketName":120,"../utils/formatTag":135,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],36:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/formatTag":137,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],37:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2484,15 +2511,13 @@ function _getBucketVersioning() { exports.getBucketVersioning = getBucketVersioning; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],37:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],38:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2560,16 +2585,14 @@ function _getBucketWebsite() { exports.getBucketWebsite = getBucketWebsite; -},{"../utils/checkBucketName":120,"../utils/isObject":147,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],38:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/isObject":151,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],39:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -2629,7 +2652,7 @@ function _getBucketWorm() { exports.getBucketWorm = getBucketWorm; -},{"../utils/checkBucketName":120,"../utils/dataFix":125,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],39:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/dataFix":127,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],40:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -2724,6 +2747,8 @@ var putBucketVersioning_1 = require("./putBucketVersioning"); var putBucketWebsite_1 = require("./putBucketWebsite"); +var getBucketStat_1 = require("./getBucketStat"); + exports.default = { abortBucketWorm: abortBucketWorm_1.abortBucketWorm, completeBucketWorm: completeBucketWorm_1.completeBucketWorm, @@ -2768,18 +2793,17 @@ exports.default = { putBucketRequestPayment: putBucketRequestPayment_1.putBucketRequestPayment, putBucketTags: putBucketTags_1.putBucketTags, putBucketVersioning: putBucketVersioning_1.putBucketVersioning, - putBucketWebsite: putBucketWebsite_1.putBucketWebsite + putBucketWebsite: putBucketWebsite_1.putBucketWebsite, + getBucketStat: getBucketStat_1.getBucketStat }; -},{"./abortBucketWorm":11,"./completeBucketWorm":12,"./deleteBucket":13,"./deleteBucketCORS":14,"./deleteBucketEncryption":15,"./deleteBucketInventory":16,"./deleteBucketLifecycle":17,"./deleteBucketLogging":18,"./deleteBucketPolicy":19,"./deleteBucketReferer":20,"./deleteBucketTags":21,"./deleteBucketWebsite":22,"./extendBucketWorm":23,"./getBucketACL":24,"./getBucketCORS":25,"./getBucketEncryption":26,"./getBucketInfo":27,"./getBucketInventory":28,"./getBucketLifecycle":29,"./getBucketLocation":30,"./getBucketLogging":31,"./getBucketPolicy":32,"./getBucketReferer":33,"./getBucketRequestPayment":34,"./getBucketTags":35,"./getBucketVersioning":36,"./getBucketWebsite":37,"./getBucketWorm":38,"./initiateBucketWorm":40,"./listBucketInventory":41,"./listBuckets":42,"./putBucket":43,"./putBucketACL":44,"./putBucketCORS":45,"./putBucketEncryption":46,"./putBucketInventory":47,"./putBucketLifecycle":48,"./putBucketLogging":49,"./putBucketPolicy":50,"./putBucketReferer":51,"./putBucketRequestPayment":52,"./putBucketTags":53,"./putBucketVersioning":54,"./putBucketWebsite":55}],40:[function(require,module,exports){ +},{"./abortBucketWorm":11,"./completeBucketWorm":12,"./deleteBucket":13,"./deleteBucketCORS":14,"./deleteBucketEncryption":15,"./deleteBucketInventory":16,"./deleteBucketLifecycle":17,"./deleteBucketLogging":18,"./deleteBucketPolicy":19,"./deleteBucketReferer":20,"./deleteBucketTags":21,"./deleteBucketWebsite":22,"./extendBucketWorm":23,"./getBucketACL":24,"./getBucketCORS":25,"./getBucketEncryption":26,"./getBucketInfo":27,"./getBucketInventory":28,"./getBucketLifecycle":29,"./getBucketLocation":30,"./getBucketLogging":31,"./getBucketPolicy":32,"./getBucketReferer":33,"./getBucketRequestPayment":34,"./getBucketStat":35,"./getBucketTags":36,"./getBucketVersioning":37,"./getBucketWebsite":38,"./getBucketWorm":39,"./initiateBucketWorm":41,"./listBucketInventory":42,"./listBuckets":43,"./putBucket":44,"./putBucketACL":45,"./putBucketCORS":46,"./putBucketEncryption":47,"./putBucketInventory":48,"./putBucketLifecycle":49,"./putBucketLogging":50,"./putBucketPolicy":51,"./putBucketReferer":52,"./putBucketRequestPayment":53,"./putBucketTags":54,"./putBucketVersioning":55,"./putBucketWebsite":56}],41:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -2842,16 +2866,14 @@ function _initiateBucketWorm() { exports.initiateBucketWorm = initiateBucketWorm; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],41:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],42:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -2927,18 +2949,16 @@ function _listBucketInventory() { exports.listBucketInventory = listBucketInventory; -},{"../utils/checkBucketName":120,"../utils/formatInventoryConfig":132,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],42:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/formatInventoryConfig":134,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],43:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); + +require("core-js/modules/es.array.map.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -3016,6 +3036,7 @@ function _listBuckets() { name: item.Name, region: item.Location, creationDate: item.CreationDate, + storageClass: item.StorageClass, StorageClass: item.StorageClass, tag: formatTag_1.formatTag(item) }; @@ -3052,15 +3073,13 @@ function _listBuckets() { exports.listBuckets = listBuckets; -},{"../utils/formatTag":135,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],43:[function(require,module,exports){ +},{"../utils/formatTag":137,"../utils/isArray":144,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.assign.js":389}],44:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -3141,15 +3160,13 @@ function _putBucket() { exports.putBucket = putBucket; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],44:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],45:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -3202,20 +3219,18 @@ function _putBucketACL() { exports.putBucketACL = putBucketACL; -},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],45:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],46:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.for-each"); - -require("core-js/modules/es.array.map"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.to-string.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/web.dom-collections.for-each.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.map.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -3308,15 +3323,13 @@ function _putBucketCORS() { exports.putBucketCORS = putBucketCORS; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.map":343,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],46:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],47:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -3387,18 +3400,16 @@ function _putBucketEncryption() { exports.putBucketEncryption = putBucketEncryption; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],47:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],48:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); + +require("core-js/modules/es.array.concat.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -3505,20 +3516,20 @@ function _putBucketInventory() { exports.putBucketInventory = putBucketInventory; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],48:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.object.assign.js":389}],49:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.for-each"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.array.includes"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.to-string.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/web.dom-collections.for-each.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.includes.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -3693,15 +3704,13 @@ function checkRule(rule) { } } -},{"../utils/checkBucketName":120,"../utils/checkObjectTag":122,"../utils/deepCopy":126,"../utils/getStrBytesCount":140,"../utils/isArray":142,"../utils/isObject":147,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],49:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/checkObjectTag":124,"../utils/deepCopy":128,"../utils/getStrBytesCount":142,"../utils/isArray":144,"../utils/isObject":151,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/web.dom-collections.for-each.js":443}],50:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -3767,15 +3776,13 @@ function _putBucketLogging() { exports.putBucketLogging = putBucketLogging; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],50:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],51:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -3846,15 +3853,13 @@ function _putBucketPolicy() { exports.putBucketPolicy = putBucketPolicy; -},{"../utils/checkBucketName":120,"../utils/isObject":147,"../utils/policy2Str":153,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],51:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/isObject":151,"../utils/policy2Str":159,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],52:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -3916,17 +3921,13 @@ function _putBucketReferer() { exports.putBucketReferer = putBucketReferer; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],52:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],53:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.index-of"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -4008,18 +4009,16 @@ function _putBucketRequestPayment() { exports.putBucketRequestPayment = putBucketRequestPayment; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.index-of":339,"regenerator-runtime/runtime":434}],53:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],54:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - -require("core-js/modules/es.object.keys"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.map.js"); + +require("core-js/modules/es.object.keys.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -4098,16 +4097,14 @@ function _putBucketTags() { exports.putBucketTags = putBucketTags; -},{"../utils/checkBucketName":120,"../utils/checkBucketTag":121,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.object.keys":351,"regenerator-runtime/runtime":434}],54:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/checkBucketTag":122,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.keys.js":392}],55:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.includes"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.includes.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -4185,15 +4182,13 @@ function _putBucketVersioning() { exports.putBucketVersioning = putBucketVersioning; -},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.includes":338,"regenerator-runtime/runtime":434}],55:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.includes.js":379}],56:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -4298,7 +4293,7 @@ function _putBucketWebsite() { exports.putBucketWebsite = putBucketWebsite; -},{"../utils/checkBucketName":120,"../utils/isArray":142,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],56:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/isArray":144,"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],57:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4318,12 +4313,12 @@ function _bucketRequestParams(method, bucket, subres, options) { exports._bucketRequestParams = _bucketRequestParams; -},{}],57:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -4337,19 +4332,17 @@ function _checkUserAgent(ua) { exports._checkUserAgent = _checkUserAgent; -},{"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],58:[function(require,module,exports){ -(function (Buffer){ +},{"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408}],59:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.array.includes"); +require("core-js/modules/es.array.includes.js"); -require("core-js/modules/es.array.index-of"); +require("core-js/modules/es.string.includes.js"); -require("core-js/modules/es.object.assign"); +require("core-js/modules/es.object.assign.js"); -require("core-js/modules/es.string.includes"); +require("core-js/modules/es.array.concat.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -4386,6 +4379,8 @@ var isIP_1 = require("../utils/isIP"); var initOptions_1 = require("./initOptions"); +var isDingTalk_1 = require("../utils/isDingTalk"); + var _debug = debug_1.default('ali-oss'); function getHeader(headers, name) { @@ -4405,10 +4400,13 @@ function _createRequest(params) { } var headers = { - 'x-oss-date': dateformat_1.default(date, 'UTC:ddd, dd mmm yyyy HH:MM:ss \'GMT\''), - 'x-oss-user-agent': this.userAgent + 'x-oss-date': dateformat_1.default(date, "UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'") }; + if (typeof window !== 'undefined') { + headers['x-oss-user-agent'] = this.userAgent; + } + if (this.userAgent.includes('nodejs')) { headers['User-Agent'] = this.userAgent; } @@ -4427,7 +4425,9 @@ function _createRequest(params) { if (!getHeader(headers, 'Content-Type')) { if (params.mime && params.mime.indexOf('/') > 0) { - headers['Content-Type'] = params.mime; + headers['Content-Type'] = params.mime; // dingtalk webkit + } else if (isDingTalk_1.isDingTalk(params)) { + headers['Content-Type'] = 'application/octet-stream'; } else { headers['Content-Type'] = mime_1.default.getType(params.mime || path_1.default.extname(params.object || '')); } @@ -4438,8 +4438,12 @@ function _createRequest(params) { } if (params.content) { - if (!headers['Content-Md5']) { - headers['Content-Md5'] = crypto_1.default.createHash('md5').update(Buffer.from(params.content, 'utf8')).digest('base64'); + if (!params.disabledMD5) { + if (!headers['Content-MD5']) { + headers['Content-MD5'] = crypto_1.default.createHash('md5').update(Buffer.from(params.content, 'utf8')).digest('base64'); + } else { + headers['Content-MD5'] = params.headers['Content-MD5']; + } } if (!headers['Content-Length']) { @@ -4500,19 +4504,19 @@ function _createRequest(params) { exports._createRequest = _createRequest; -}).call(this,require("buffer").Buffer) -},{"../utils/authorization":118,"../utils/encoder":130,"../utils/getReqUrl":137,"../utils/getResource":138,"../utils/isIP":146,"./../../../shims/crypto/crypto.js":444,"./initOptions":66,"buffer":196,"copy-to":199,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.includes":338,"core-js/modules/es.array.index-of":339,"core-js/modules/es.object.assign":349,"core-js/modules/es.string.includes":357,"dateformat":393,"debug":448,"mime":411,"path":414}],59:[function(require,module,exports){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"../utils/authorization":119,"../utils/encoder":132,"../utils/getReqUrl":139,"../utils/getResource":140,"../utils/isDingTalk":147,"../utils/isIP":150,"./../../../shims/crypto/crypto.js":501,"./initOptions":67,"buffer":183,"copy-to":185,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.object.assign.js":389,"core-js/modules/es.string.includes.js":405,"dateformat":446,"debug":505,"mime":464,"path":467}],60:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -4594,17 +4598,17 @@ function _getReqUrl(params) { exports._getReqUrl = _getReqUrl; -},{"../utils/checkValid":123,"../utils/escapeName":131,"../utils/isIP":146,"copy-to":199,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391,"is-type-of":449,"merge-descriptors":409,"url":452}],60:[function(require,module,exports){ -(function (process){ +},{"../utils/checkValid":125,"../utils/escapeName":133,"../utils/isIP":150,"copy-to":185,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408,"core-js/modules/web.dom-collections.for-each.js":443,"is-type-of":506,"merge-descriptors":462,"url":509}],61:[function(require,module,exports){ +(function (process){(function (){ "use strict"; -require("core-js/modules/es.symbol"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.symbol.description"); +require("core-js/modules/es.symbol.js"); -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.symbol.description.js"); -require("core-js/modules/es.array.slice"); +require("core-js/modules/es.array.slice.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -4637,8 +4641,8 @@ function _getUserAgent() { exports._getUserAgent = _getUserAgent; -}).call(this,require('_process')) -},{"../../browser/version":10,"./_checkUserAgent":57,"_process":451,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.slice":344,"core-js/modules/es.symbol":366,"core-js/modules/es.symbol.description":365,"platform":450}],61:[function(require,module,exports){ +}).call(this)}).call(this,require('_process')) +},{"../../browser/version":10,"./_checkUserAgent":58,"_process":508,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.symbol.description.js":414,"core-js/modules/es.symbol.js":417,"platform":507}],62:[function(require,module,exports){ "use strict"; var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -4660,7 +4664,7 @@ function _objectRequestParams(method, name) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var bucket = this.options.bucket; - if (!bucket) { + if (!bucket && !this.options.cname) { throw new Error('Please create a bucket first'); } @@ -4684,7 +4688,7 @@ function _objectRequestParams(method, name) { exports._objectRequestParams = _objectRequestParams; -},{"../utils/objectName":150,"copy-to":199}],62:[function(require,module,exports){ +},{"../utils/objectName":155,"copy-to":185}],63:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4694,18 +4698,19 @@ exports._stop = void 0; function _stop() { this.options.cancelFlag = true; + this.options.multipartRunning = false; } exports._stop = _stop; -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.function.name"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.function.name.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -4749,7 +4754,7 @@ function cancel(abort) { exports.cancel = cancel; -},{"../multipart/abortMultipartUpload":76,"../utils/isArray":142,"core-js/modules/es.array.for-each":336,"core-js/modules/es.function.name":347,"core-js/modules/web.dom-collections.for-each":391}],64:[function(require,module,exports){ +},{"../multipart/abortMultipartUpload":77,"../utils/isArray":144,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],65:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4763,7 +4768,7 @@ function getBucket() { exports.getBucket = getBucket; -},{}],65:[function(require,module,exports){ +},{}],66:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4822,14 +4827,14 @@ exports.default = { signature: signature_1.signature }; -},{"./_bucketRequestParams":56,"./_checkUserAgent":57,"./_createRequest":58,"./_getReqUrl":59,"./_getUserAgent":60,"./_objectRequestParams":61,"./_stop":62,"./cancel":63,"./getBucket":64,"./isCancel":67,"./request":68,"./requestError":69,"./resetCancelFlag":70,"./setBucket":71,"./setSLDEnabled":72,"./signature":73}],66:[function(require,module,exports){ +},{"./_bucketRequestParams":57,"./_checkUserAgent":58,"./_createRequest":59,"./_getReqUrl":60,"./_getUserAgent":61,"./_objectRequestParams":62,"./_stop":63,"./cancel":64,"./getBucket":65,"./isCancel":68,"./request":69,"./requestError":70,"./resetCancelFlag":71,"./setBucket":72,"./setSLDEnabled":73,"./signature":74}],67:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.object.assign"); +require("core-js/modules/es.object.assign.js"); -require("core-js/modules/es.string.trim"); +require("core-js/modules/es.string.trim.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -4895,6 +4900,10 @@ function initOptions(options) { throw new Error('require accessKeyId, accessKeySecret'); } + if (options.stsToken && !options.refreshSTSToken && !options.refreshSTSTokenInterval) { + console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh stsToken、accessKeyId、accessKeySecret automatically when sts info expires"); + } + if (options.bucket) { checkBucketName_1.checkBucketName(options.bucket); } @@ -4912,9 +4921,12 @@ function initOptions(options) { useFetch: false, headerEncoding: 'utf-8', amendTimeSkewed: 0, + refreshSTSTokenInterval: 60000 * 5, refreshSTSToken: null, enableProxy: false, - proxy: null + proxy: null, + disabledMD5: false, + multipartRunning: false }, options); opts.accessKeyId = opts.accessKeyId.trim(); opts.accessKeySecret = opts.accessKeySecret.trim(); @@ -4937,7 +4949,7 @@ function initOptions(options) { exports.initOptions = initOptions; -},{"../utils/checkBucketName":120,"../utils/checkValid":123,"core-js/modules/es.array.concat":332,"core-js/modules/es.object.assign":349,"core-js/modules/es.string.trim":364,"humanize-ms":397,"url":452}],67:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/checkValid":125,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.object.assign.js":389,"core-js/modules/es.string.trim.js":412,"humanize-ms":450,"url":509}],68:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4951,28 +4963,20 @@ function isCancel() { exports.isCancel = isCancel; -},{}],68:[function(require,module,exports){ +},{}],69:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.includes"); - -require("core-js/modules/es.array.index-of"); - -require("core-js/modules/es.function.name"); - -require("core-js/modules/es.regexp.exec"); - -require("core-js/modules/es.string.includes"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.string.split"); +require("core-js/modules/es.array.includes.js"); -require("core-js/modules/es.string.starts-with"); +require("core-js/modules/es.string.includes.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.string.starts-with.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.function.name.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -4995,6 +4999,8 @@ var retry_1 = require("../utils/retry"); var setSTSToken_1 = require("../utils/setSTSToken"); +var isFunction_1 = require("../utils/isFunction"); + var debug = debug_1.default('ali-oss'); /** * request oss server @@ -5026,6 +5032,19 @@ function _request2() { while (1) { switch (_context.prev = _context.next) { case 0: + if (!(this.options.stsToken && isFunction_1.isFunction(this.options.refreshSTSToken))) { + _context.next = 3; + break; + } + + _context.next = 3; + return setSTSToken_1.setSTSToken.call(this); + + case 3: + if (this.options.disabledMD5) { + params.disabledMD5 = true; + } + reqParams = this._createRequest(params); isNode = this._getUserAgent().includes('nodejs'); @@ -5034,122 +5053,122 @@ function _request2() { } useStream = !!params.stream; - _context.prev = 4; - _context.next = 7; + _context.prev = 8; + _context.next = 11; return this.urllib.request(reqParams.url, reqParams.params); - case 7: + case 11: result = _context.sent; debug('response %s %s, got %s, headers: %j', params.method, reqParams.url, result.status, result.headers); - _context.next = 14; + _context.next = 18; break; - case 11: - _context.prev = 11; - _context.t0 = _context["catch"](4); + case 15: + _context.prev = 15; + _context.t0 = _context["catch"](8); reqErr = _context.t0; - case 14: + case 18: if (!(result && params.successStatuses && params.successStatuses.indexOf(result.status) === -1)) { - _context.next = 26; + _context.next = 30; break; } - _context.next = 17; + _context.next = 21; return this.requestError(result); - case 17: + case 21: err = _context.sent; if (!(err.code === 'RequestTimeTooSkewed' && !useStream && !isNode)) { - _context.next = 23; + _context.next = 27; break; } this.options.amendTimeSkewed = +new Date(err.serverTime) - new Date().valueOf(); - _context.next = 22; + _context.next = 26; return this.request(params); - case 22: + case 26: return _context.abrupt("return", _context.sent); - case 23: + case 27: err.params = params; - _context.next = 30; + _context.next = 34; break; - case 26: + case 30: if (!reqErr) { - _context.next = 30; + _context.next = 34; break; } - _context.next = 29; + _context.next = 33; return this.requestError(reqErr); - case 29: + case 33: err = _context.sent; - case 30: + case 34: if (!err) { - _context.next = 42; + _context.next = 46; break; } if (!(this.sendToWormhole && params.customResponse && result && result.res)) { - _context.next = 34; + _context.next = 38; break; } - _context.next = 34; + _context.next = 38; return this.sendToWormhole(result.res); - case 34: + case 38: if (!(err.status === 403 && err.code === 'InvalidAccessKeyId' && this.options.accessKeyId.startsWith('STS.') && typeof this.options.refreshSTSToken === 'function')) { - _context.next = 40; + _context.next = 44; break; } if (!(!this._setOptions || Date.now() - this._setOptions > 10000)) { - _context.next = 40; + _context.next = 44; break; } this._setOptions = Date.now(); - _context.next = 39; + _context.next = 43; return setSTSToken_1.setSTSToken.call(this); - case 39: + case 43: return _context.abrupt("return", this.request(params)); - case 40: + case 44: if (err.name === 'ResponseTimeoutError') { err.message = "".concat(err.message.split(',')[0], ", please increase the timeout or use multipartDownload."); } throw err; - case 42: + case 46: if (!params.xmlResponse) { - _context.next = 46; + _context.next = 50; break; } - _context.next = 45; + _context.next = 49; return parseXML_1.parseXML(result.data); - case 45: + case 49: result.data = _context.sent; - case 46: + case 50: return _context.abrupt("return", result); - case 47: + case 51: case "end": return _context.stop(); } } - }, _callee, this, [[4, 11]]); + }, _callee, this, [[8, 15]]); })); return _request2.apply(this, arguments); } @@ -5217,16 +5236,14 @@ function _request3() { exports.request = request; -},{"../utils/parseXML":152,"../utils/retry":154,"../utils/setSTSToken":155,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.includes":338,"core-js/modules/es.array.index-of":339,"core-js/modules/es.function.name":347,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.includes":357,"core-js/modules/es.string.split":362,"core-js/modules/es.string.starts-with":363,"debug":448,"regenerator-runtime/runtime":434}],69:[function(require,module,exports){ +},{"../utils/isFunction":149,"../utils/parseXML":158,"../utils/retry":160,"../utils/setSTSToken":161,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.function.name.js":386,"core-js/modules/es.string.includes.js":405,"core-js/modules/es.string.starts-with.js":411,"debug":505}],70:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.function.name"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.function.name.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -5369,7 +5386,7 @@ function _requestError() { exports.requestError = requestError; -},{"../utils/parseXML":152,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.function.name":347,"debug":448,"regenerator-runtime/runtime":434}],70:[function(require,module,exports){ +},{"../utils/parseXML":158,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.function.name.js":386,"debug":505}],71:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5378,12 +5395,13 @@ Object.defineProperty(exports, "__esModule", { exports.resetCancelFlag = void 0; function resetCancelFlag() { + this.options.multipartRunning = true; this.options.cancelFlag = false; } exports.resetCancelFlag = resetCancelFlag; -},{}],71:[function(require,module,exports){ +},{}],72:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5401,7 +5419,7 @@ function setBucket(name) { exports.setBucket = setBucket; -},{"../utils/checkBucketName":120}],72:[function(require,module,exports){ +},{"../utils/checkBucketName":121}],73:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5416,7 +5434,7 @@ function setSLDEnabled(enable) { exports.setSLDEnabled = setSLDEnabled; -},{}],73:[function(require,module,exports){ +},{}],74:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5438,7 +5456,7 @@ function signature(stringToSign) { exports.signature = signature; -},{"../utils/signUtils":156}],74:[function(require,module,exports){ +},{"../utils/signUtils":162}],75:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5451,16 +5469,14 @@ exports.default = { processObjectSave: processObjectSave_1.processObjectSave }; -},{"./processObjectSave":75}],75:[function(require,module,exports){ +},{"./processObjectSave":76}],76:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.concat.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -5544,15 +5560,13 @@ function checkArgs(name, key) { } } -},{"../utils/checkBucketName":120,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"js-base64":408,"querystring":420,"regenerator-runtime/runtime":434}],76:[function(require,module,exports){ +},{"../utils/checkBucketName":121,"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.concat.js":374,"js-base64":461,"querystring":473}],77:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -5624,26 +5638,24 @@ function _abortMultipartUpload() { exports.abortMultipartUpload = abortMultipartUpload; -},{"../client/_stop":62,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],77:[function(require,module,exports){ +},{"../client/_stop":63,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185}],78:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.array.filter"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.array.map"); +require("core-js/modules/es.array.filter.js"); -require("core-js/modules/es.array.sort"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.array.sort.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.array.concat.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.map.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.regexp.to-string.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -5652,11 +5664,15 @@ Object.defineProperty(exports, "__esModule", { }); exports.completeMultipartUpload = void 0; -var deepCopy_1 = require("../utils/deepCopy"); - var encodeCallback_1 = require("../utils/encodeCallback"); var obj2xml_1 = require("../utils/obj2xml"); + +var deepCopy_1 = require("../utils/deepCopy"); + +var isBuffer_1 = require("../utils/isBuffer"); + +var omit_1 = require("../utils/omit"); /** * Complete a multipart upload transaction * @param {String} name the object name @@ -5712,7 +5728,11 @@ function _completeMultipartUpload() { }) } }; - opt = deepCopy_1.deepCopy(options); + opt = deepCopy_1.deepCopyWith(options, function (_) { + if (isBuffer_1.isBuffer(_)) return null; + return undefined; + }); + opt.headers = omit_1.omit(opt.headers, ['x-oss-server-side-encryption', 'x-oss-storage-class']); if (opt.headers) delete opt.headers['x-oss-server-side-encryption']; opt.subres = { uploadId: uploadId @@ -5729,11 +5749,12 @@ function _completeMultipartUpload() { } params.successStatuses = [200]; - _context.next = 14; + _context.next = 15; return this.request(params); - case 14: + case 15: result = _context.sent; + this.options.multipartRunning = false; ret = { res: result.res, bucket: params.bucket, @@ -5747,7 +5768,7 @@ function _completeMultipartUpload() { return _context.abrupt("return", ret); - case 18: + case 20: case "end": return _context.stop(); } @@ -5759,15 +5780,13 @@ function _completeMultipartUpload() { exports.completeMultipartUpload = completeMultipartUpload; -},{"../utils/deepCopy":126,"../utils/encodeCallback":129,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.map":343,"core-js/modules/es.array.sort":345,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"regenerator-runtime/runtime":434}],78:[function(require,module,exports){ +},{"../utils/deepCopy":128,"../utils/encodeCallback":131,"../utils/isBuffer":146,"../utils/obj2xml":154,"../utils/omit":157,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.filter.js":376,"core-js/modules/es.array.map.js":382,"core-js/modules/es.array.sort.js":384,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404}],79:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -5812,6 +5831,7 @@ function _handleUploadPart() { switch (_context.prev = _context.next) { case 0: options = _args.length > 4 && _args[4] !== undefined ? _args[4] : {}; + options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; opt = {}; copy_to_1.default(options, false).to(opt); opt.headers = opt.headers || {}; @@ -5830,21 +5850,22 @@ function _handleUploadPart() { params.content = data.stream; } + params.disabledMD5 = opt.disabledMD5; params.successStatuses = [200]; - _context.next = 13; + _context.next = 15; return this.request(params); - case 13: + case 15: result = _context.sent; if (result.res.headers.etag) { - _context.next = 16; + _context.next = 18; break; } throw new Error('Please set the etag of expose-headers in OSS \n https://help.aliyun.com/document_detail/32069.html'); - case 16: + case 18: data.stream = null; params.stream = null; return _context.abrupt("return", { @@ -5853,7 +5874,7 @@ function _handleUploadPart() { res: result.res }); - case 19: + case 21: case "end": return _context.stop(); } @@ -5865,7 +5886,7 @@ function _handleUploadPart() { exports.handleUploadPart = handleUploadPart; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],79:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185}],80:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5905,15 +5926,13 @@ exports.default = { uploadPartCopy: uploadPartCopy_1.uploadPartCopy }; -},{"./abortMultipartUpload":76,"./completeMultipartUpload":77,"./handleUploadPart":78,"./initMultipartUpload":80,"./listParts":81,"./listUploads":82,"./multipartUploadCopy":83,"./resumeMultipart":84,"./uploadPart":85,"./uploadPartCopy":86}],80:[function(require,module,exports){ +},{"./abortMultipartUpload":77,"./completeMultipartUpload":78,"./handleUploadPart":79,"./initMultipartUpload":81,"./listParts":82,"./listUploads":83,"./multipartUploadCopy":84,"./resumeMultipart":85,"./uploadPart":86,"./uploadPartCopy":87}],81:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -5980,15 +5999,13 @@ function _initMultipartUpload() { exports.initMultipartUpload = initMultipartUpload; -},{"../utils/convertMetaToHeaders":124,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],81:[function(require,module,exports){ +},{"../utils/convertMetaToHeaders":126,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185}],82:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -6072,16 +6089,14 @@ function _listParts() { exports.listParts = listParts; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],82:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185}],83:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.map.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -6170,35 +6185,31 @@ function _listUploads() { exports.listUploads = listUploads; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"core-js/modules/es.array.map":343,"regenerator-runtime/runtime":434}],83:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185,"core-js/modules/es.array.map.js":382}],84:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.function.name.js"); -require("core-js/modules/es.array.filter"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.from"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.array.index-of"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.array.map"); +require("core-js/modules/es.array.from.js"); -require("core-js/modules/es.function.name"); +require("core-js/modules/es.string.iterator.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.array.map.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.array.filter.js"); -require("core-js/modules/es.regexp.to-string"); - -require("core-js/modules/es.string.iterator"); +require("core-js/modules/es.regexp.to-string.js"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -6584,38 +6595,34 @@ function _divideMultipartCopyParts(fileSize, partSize, startOffset) { exports._divideMultipartCopyParts = _divideMultipartCopyParts; -},{"../utils/_getObjectMeta":113,"../utils/_makeAbortEvent":114,"../utils/_makeCancelEvent":115,"../utils/_parallel":116,"../utils/getPartSize":136,"./completeMultipartUpload":77,"./initMultipartUpload":80,"./uploadPartCopy":86,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.from":337,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.map":343,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.iterator":358,"debug":448,"regenerator-runtime/runtime":434}],84:[function(require,module,exports){ +},{"../utils/_getObjectMeta":114,"../utils/_makeAbortEvent":115,"../utils/_makeCancelEvent":116,"../utils/_parallel":117,"../utils/getPartSize":138,"./completeMultipartUpload":78,"./initMultipartUpload":81,"./uploadPartCopy":87,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.filter.js":376,"core-js/modules/es.array.from.js":378,"core-js/modules/es.array.map.js":382,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/es.string.iterator.js":406,"debug":505}],85:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.array.filter"); - -require("core-js/modules/es.array.find"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.array.from"); +require("core-js/modules/es.function.name.js"); -require("core-js/modules/es.array.index-of"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.map"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.array.splice"); +require("core-js/modules/es.array.find.js"); -require("core-js/modules/es.function.name"); +require("core-js/modules/es.array.splice.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.array.from.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.string.iterator.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.array.map.js"); -require("core-js/modules/es.string.iterator"); +require("core-js/modules/es.array.filter.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.concat.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.regexp.to-string.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -6888,7 +6895,13 @@ function _resumeMultipart() { case 24: _context2.next = 26; - return _parallel_1._parallel.call(this, todo, parallel, uploadPartJob); + return _parallel_1._parallel.call(this, todo, parallel, function (value) { + return new Promise(function (resolve, reject) { + uploadPartJob(value).then(function () { + resolve(); + }).catch(reject); + }); + }); case 26: jobErr = _context2.sent; @@ -6941,15 +6954,13 @@ function _resumeMultipart() { exports.resumeMultipart = resumeMultipart; -},{"../../common/utils/divideParts":128,"../utils/_makeAbortEvent":114,"../utils/_makeCancelEvent":115,"../utils/_parallel":116,"./completeMultipartUpload":77,"./handleUploadPart":78,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.find":335,"core-js/modules/es.array.from":337,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.map":343,"core-js/modules/es.array.splice":346,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.iterator":358,"regenerator-runtime/runtime":434}],85:[function(require,module,exports){ +},{"../../common/utils/divideParts":130,"../utils/_makeAbortEvent":115,"../utils/_makeCancelEvent":116,"../utils/_parallel":117,"./completeMultipartUpload":78,"./handleUploadPart":79,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.filter.js":376,"core-js/modules/es.array.find.js":377,"core-js/modules/es.array.from.js":378,"core-js/modules/es.array.map.js":382,"core-js/modules/es.array.splice.js":385,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/es.string.iterator.js":406}],86:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -7012,16 +7023,14 @@ function _uploadPart() { exports.uploadPart = uploadPart; -},{"./handleUploadPart":78,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],86:[function(require,module,exports){ +},{"./handleUploadPart":79,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],87:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.concat.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7106,15 +7115,13 @@ function _uploadPartCopy() { exports.uploadPartCopy = uploadPartCopy; -},{"../utils/deepCopy":126,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"regenerator-runtime/runtime":434}],87:[function(require,module,exports){ +},{"../utils/deepCopy":128,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.concat.js":374}],88:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -7182,13 +7189,13 @@ function _append() { exports.append = append; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],88:[function(require,module,exports){ -(function (Buffer){ +},{"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],89:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.regexp.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -7234,30 +7241,28 @@ function calculatePostSignature(policy) { exports.calculatePostSignature = calculatePostSignature; -}).call(this,require("buffer").Buffer) -},{"../utils/isObject":147,"../utils/policy2Str":153,"../utils/signUtils":156,"buffer":196,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],89:[function(require,module,exports){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"../utils/isObject":151,"../utils/policy2Str":159,"../utils/signUtils":162,"buffer":183,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404}],90:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.array.find"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.array.includes"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.array.find.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.array.includes.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.concat.js"); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -7340,16 +7345,14 @@ function _copy() { exports.copy = copy; -},{"../utils/convertMetaToHeaders":124,"../utils/getSourceName":139,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.find":335,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],90:[function(require,module,exports){ +},{"../utils/convertMetaToHeaders":126,"../utils/getSourceName":141,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"@babel/runtime/regenerator":178,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.find.js":377,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],91:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7408,16 +7411,14 @@ function _deleteObject() { exports.deleteObject = deleteObject; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],91:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],92:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7542,16 +7543,14 @@ function _deleteMulti() { exports.deleteMulti = deleteMulti; -},{"../utils/obj2xml":149,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434,"utility":454}],92:[function(require,module,exports){ +},{"../utils/obj2xml":154,"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389,"utility":511}],93:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7616,10 +7615,10 @@ function _deleteObjectTagging() { exports.deleteObjectTagging = deleteObjectTagging; -},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],93:[function(require,module,exports){ +},{"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],94:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -7662,16 +7661,15 @@ function generateObjectUrl(name, baseUrl) { exports.generateObjectUrl = generateObjectUrl; -},{"../utils/escapeName":131,"../utils/objectName":150,"core-js/modules/es.array.concat":332,"url":452}],94:[function(require,module,exports){ +},{"../utils/escapeName":133,"../utils/objectName":155,"core-js/modules/es.array.concat.js":374,"url":509}],95:[function(require,module,exports){ +(function (process){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7711,6 +7709,9 @@ function _get() { var options, writeStream, needDestroy, + isBrowserEnv, + responseCacheControl, + defaultSubresOptions, result, params, _args = arguments; @@ -7731,7 +7732,12 @@ function _get() { options = file; } - options.subres = Object.assign({}, options.subres); + isBrowserEnv = process && process.browser; + responseCacheControl = options.responseCacheControl === null ? '' : 'no-cache'; + defaultSubresOptions = isBrowserEnv && responseCacheControl ? { + 'response-cache-control': responseCacheControl + } : {}; + options.subres = Object.assign(defaultSubresOptions, options.subres); if (options.versionId) { options.subres.versionId = options.versionId; @@ -7741,68 +7747,67 @@ function _get() { options.subres['x-oss-process'] = options.process; } - _context.prev = 7; + _context.prev = 10; params = this._objectRequestParams('GET', name, options); params.writeStream = writeStream; params.successStatuses = [200, 206, 304]; - _context.next = 13; + _context.next = 16; return this.request(params); - case 13: + case 16: result = _context.sent; if (needDestroy) { writeStream.destroy(); } - _context.next = 24; + _context.next = 27; break; - case 17: - _context.prev = 17; - _context.t0 = _context["catch"](7); + case 20: + _context.prev = 20; + _context.t0 = _context["catch"](10); if (!needDestroy) { - _context.next = 23; + _context.next = 26; break; } writeStream.destroy(); // should delete the exists file before throw error - _context.next = 23; + _context.next = 26; return deleteFileSafe_1.deleteFileSafe(file); - case 23: + case 26: throw _context.t0; - case 24: + case 27: return _context.abrupt("return", { res: result.res, content: result.data }); - case 25: + case 28: case "end": return _context.stop(); } } - }, _callee, this, [[7, 17]]); + }, _callee, this, [[10, 20]]); })); return _get.apply(this, arguments); } exports.get = get; -},{"../utils/deleteFileSafe":127,"../utils/isObject":147,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"fs":176,"is-type-of":449,"regenerator-runtime/runtime":434}],95:[function(require,module,exports){ +}).call(this)}).call(this,require('_process')) +},{"../utils/deleteFileSafe":129,"../utils/isObject":151,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"_process":508,"core-js/modules/es.object.assign.js":389,"fs":182,"is-type-of":506}],96:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7873,16 +7878,14 @@ function _getACL() { exports.getACL = getACL; -},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],96:[function(require,module,exports){ +},{"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],97:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -7948,20 +7951,18 @@ function _getAsyncFetch() { exports.getAsyncFetch = getAsyncFetch; -},{"../utils/formatObjKey":133,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],97:[function(require,module,exports){ +},{"../utils/formatObjKey":135,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],98:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - -require("core-js/modules/es.number.constructor"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.object.assign"); +require("core-js/modules/es.object.assign.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.map.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.number.constructor.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8109,16 +8110,14 @@ function _getBucketVersions() { exports.getBucketVersions = getBucketVersions; -},{"../utils/formatQuery":134,"../utils/isArray":142,"../utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.number.constructor":348,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],98:[function(require,module,exports){ +},{"../utils/formatQuery":136,"../utils/isArray":144,"../utils/objectUrl":156,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.number.constructor.js":388,"core-js/modules/es.object.assign.js":389}],99:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8184,16 +8183,14 @@ function _getObjectMeta() { exports.getObjectMeta = getObjectMeta; -},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],99:[function(require,module,exports){ +},{"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],100:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8270,7 +8267,7 @@ function _getObjectTagging() { exports.getObjectTagging = getObjectTagging; -},{"../utils/formatTag":135,"../utils/objectName":150,"../utils/parseXML":152,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],100:[function(require,module,exports){ +},{"../utils/formatTag":137,"../utils/objectName":155,"../utils/parseXML":158,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],101:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -8301,16 +8298,14 @@ function getObjectUrl(name, baseUrl) { exports.getObjectUrl = getObjectUrl; -},{"../utils/escapeName":131,"../utils/objectName":150}],101:[function(require,module,exports){ +},{"../utils/escapeName":133,"../utils/objectName":155}],102:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8378,24 +8373,20 @@ function _getSymlink() { exports.getSymlink = getSymlink; -},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],102:[function(require,module,exports){ +},{"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],103:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.for-each"); - -require("core-js/modules/es.array.index-of"); - -require("core-js/modules/es.object.assign"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.object.assign.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.to-string.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/web.dom-collections.for-each.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.keys.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8403,6 +8394,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.head = void 0; + +var checkEnv_1 = require("../utils/checkEnv"); /** * head * @param {String} name - object name @@ -8410,6 +8403,7 @@ exports.head = void 0; * @param {{res}} */ + function head(_x) { return _head.apply(this, arguments); } @@ -8426,6 +8420,7 @@ function _head() { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + checkEnv_1.checkEnv('Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta'); options.subres = Object.assign({}, options.subres); if (options.versionId) { @@ -8434,10 +8429,10 @@ function _head() { params = this._objectRequestParams('HEAD', name, options); params.successStatuses = [200, 304]; - _context.next = 7; + _context.next = 8; return this.request(params); - case 7: + case 8: result = _context.sent; data = { meta: null, @@ -8459,7 +8454,7 @@ function _head() { return _context.abrupt("return", data); - case 11: + case 12: case "end": return _context.stop(); } @@ -8471,7 +8466,7 @@ function _head() { exports.head = head; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.index-of":339,"core-js/modules/es.object.assign":349,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],103:[function(require,module,exports){ +},{"../utils/checkEnv":123,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],104:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -8560,18 +8555,16 @@ exports.default = { signatureUrl: signatureUrl_1.signatureUrl }; -},{"./append":87,"./calculatePostSignature":88,"./copy":89,"./delete":90,"./deleteMulti":91,"./deleteObjectTagging":92,"./generateObjectUrl":93,"./get":94,"./getACL":95,"./getAsyncFetch":96,"./getBucketVersions":97,"./getObjectMeta":98,"./getObjectTagging":99,"./getObjectUrl":100,"./getSymlink":101,"./head":102,"./list":104,"./listV2":105,"./postAsyncFetch":106,"./putACL":107,"./putMeta":108,"./putObjectTagging":109,"./putSymlink":110,"./restore":111,"./signatureUrl":112}],104:[function(require,module,exports){ +},{"./append":88,"./calculatePostSignature":89,"./copy":90,"./delete":91,"./deleteMulti":92,"./deleteObjectTagging":93,"./generateObjectUrl":94,"./get":95,"./getACL":96,"./getAsyncFetch":97,"./getBucketVersions":98,"./getObjectMeta":99,"./getObjectTagging":100,"./getObjectUrl":101,"./getSymlink":102,"./head":103,"./list":105,"./listV2":106,"./postAsyncFetch":107,"./putACL":108,"./putMeta":109,"./putObjectTagging":110,"./putSymlink":111,"./restore":112,"./signatureUrl":113}],105:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - -require("core-js/modules/es.number.constructor"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.array.map.js"); + +require("core-js/modules/es.number.constructor.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8613,7 +8606,7 @@ function _list() { case 8: result = _context.sent; - objects = result.data.Contents; + objects = result.data.Contents || []; if (objects) { if (!Array.isArray(objects)) { @@ -8669,20 +8662,18 @@ function _list() { exports.list = list; -},{"../utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.number.constructor":348,"regenerator-runtime/runtime":434}],105:[function(require,module,exports){ +},{"../utils/objectUrl":156,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.number.constructor.js":388}],106:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - -require("core-js/modules/es.number.constructor"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.object.assign"); +require("core-js/modules/es.object.assign.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.map.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.number.constructor.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8702,6 +8693,7 @@ function _listV() { var _this = this; var options, + continuation_token, params, result, objects, @@ -8712,18 +8704,27 @@ function _listV() { switch (_context.prev = _context.next) { case 0: options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + continuation_token = query['continuation-token']; + delete query['continuation-token']; + + if (continuation_token) { + options.subres = Object.assign({ + 'continuation-token': continuation_token + }, options.subres); + } + params = this._objectRequestParams('GET', '', options); params.query = Object.assign({ 'list-type': 2 }, query); params.xmlResponse = true; params.successStatuses = [200]; - _context.next = 7; + _context.next = 10; return this.request(params); - case 7: + case 10: result = _context.sent; - objects = result.data.Contents; + objects = result.data.Contents || []; if (objects) { if (!Array.isArray(objects)) { @@ -8764,12 +8765,12 @@ function _listV() { objects: objects, prefixes: prefixes, isTruncated: result.data.IsTruncated === 'true', - keyCount: result.data.KeyCount, + keyCount: +result.data.KeyCount, continuationToken: result.data.ContinuationToken || null, nextContinuationToken: result.data.NextContinuationToken || null }); - case 13: + case 16: case "end": return _context.stop(); } @@ -8781,16 +8782,14 @@ function _listV() { exports.listV2 = listV2; -},{"../utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.number.constructor":348,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],106:[function(require,module,exports){ +},{"../utils/objectUrl":156,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.number.constructor.js":388,"core-js/modules/es.object.assign.js":389}],107:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8887,16 +8886,14 @@ function _postAsyncFetch() { exports.postAsyncFetch = postAsyncFetch; -},{"../utils/obj2xml":149,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],107:[function(require,module,exports){ +},{"../utils/obj2xml":154,"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],108:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -8963,15 +8960,13 @@ function _putACL() { exports.putACL = putACL; -},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],108:[function(require,module,exports){ +},{"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],109:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -9018,20 +9013,18 @@ function _putMeta() { exports.putMeta = putMeta; -},{"./copy":89,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],109:[function(require,module,exports){ +},{"./copy":90,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],110:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.map"); - -require("core-js/modules/es.object.assign"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.object.assign.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.map.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.keys.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -9118,16 +9111,14 @@ function _putObjectTagging() { exports.putObjectTagging = putObjectTagging; -},{"../utils/checkObjectTag":122,"../utils/obj2xml":149,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.object.assign":349,"core-js/modules/es.object.keys":351,"regenerator-runtime/runtime":434}],110:[function(require,module,exports){ +},{"../utils/checkObjectTag":124,"../utils/obj2xml":154,"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.assign.js":389,"core-js/modules/es.object.keys.js":392}],111:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -9205,16 +9196,14 @@ function _putSymlink() { exports.putSymlink = putSymlink; -},{"../utils/convertMetaToHeaders":124,"../utils/escapeName":131,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],111:[function(require,module,exports){ +},{"../utils/convertMetaToHeaders":126,"../utils/escapeName":133,"../utils/objectName":155,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],112:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.object.assign"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -9222,28 +9211,33 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.restore = void 0; + +var obj2xml_1 = require("../utils/obj2xml"); /** * Restore Object * @param {String} name the object key - * @param {Object} options + * @param {Object} options {type : Archive or ColdArchive} * @returns {{res}} */ -function restore(_x) { + +function restore(_x, _x2) { return _restore.apply(this, arguments); } function _restore() { - _restore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { - var options, - params, - result, - _args = arguments; + _restore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, paramsXMLObj, result; return _regenerator.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: - options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options = options || {}; + + if (!options.type) { + options.type = 'Archive'; + } + options.subres = Object.assign({ restore: '' }, options.subres); @@ -9253,17 +9247,33 @@ function _restore() { } params = this._objectRequestParams('POST', name, options); + + if (options.type === 'ColdArchive') { + paramsXMLObj = { + RestoreRequest: { + Days: options.Days ? options.Days : 2, + JobParameters: { + Tier: options.JobParameters ? options.JobParameters : 'Standard' + } + } + }; + params.content = obj2xml_1.obj2xml(paramsXMLObj, { + headers: true + }); + params.mime = 'xml'; + } + params.successStatuses = [202]; - _context.next = 7; + _context.next = 9; return this.request(params); - case 7: + case 9: result = _context.sent; return _context.abrupt("return", { res: result.res }); - case 9: + case 11: case "end": return _context.stop(); } @@ -9275,9 +9285,15 @@ function _restore() { exports.restore = restore; -},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],112:[function(require,module,exports){ +},{"../utils/obj2xml":154,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.object.assign.js":389}],113:[function(require,module,exports){ "use strict"; +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); + +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); + +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); + var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { "default": mod @@ -9303,44 +9319,79 @@ var signUtils_1 = require("../../common/utils/signUtils"); var getReqUrl_1 = require("../../common/utils/getReqUrl"); -function signatureUrl(name) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - name = objectName_1.objectName(name); - options.method = options.method || 'GET'; - var expires = utility_1.default.timestamp() + (options.expires || 1800); - var params = { - bucket: this.options.bucket, - object: name - }; - var resource = getResource_1.getResource(params, this.options.headerEncoding); +var setSTSToken_1 = require("../../common/utils/setSTSToken"); - if (this.options.stsToken) { - options['security-token'] = this.options.stsToken; - } +var isFunction_1 = require("../../common/utils/isFunction"); - var signRes = signUtils_1._signatureForURL(this.options.accessKeySecret, options, resource, expires); +function signatureUrl(_x) { + return _signatureUrl.apply(this, arguments); +} - var url = url_1.default.parse(getReqUrl_1.getReqUrl(params, this.options)); - url.query = { - OSSAccessKeyId: this.options.accessKeyId, - Expires: expires, - Signature: signRes.Signature - }; - copy_to_1.default(signRes.subResource).to(url.query); - return url.format(); +function _signatureUrl() { + _signatureUrl = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + expires, + params, + resource, + signRes, + url, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + name = objectName_1.objectName(name); + options.method = options.method || 'GET'; + expires = utility_1.default.timestamp() + (options.expires || 1800); + params = { + bucket: this.options.bucket, + object: name + }; + resource = getResource_1.getResource(params, this.options.headerEncoding); + + if (!(this.options.stsToken && isFunction_1.isFunction(this.options.refreshSTSToken))) { + _context.next = 9; + break; + } + + _context.next = 9; + return setSTSToken_1.setSTSToken.call(this); + + case 9: + if (this.options.stsToken) { + options['security-token'] = this.options.stsToken; + } + + signRes = signUtils_1._signatureForURL(this.options.accessKeySecret, options, resource, expires); + url = url_1.default.parse(getReqUrl_1.getReqUrl(params, this.options)); + url.query = { + OSSAccessKeyId: this.options.accessKeyId, + Expires: expires, + Signature: signRes.Signature + }; + copy_to_1.default(signRes.subResource).to(url.query); + return _context.abrupt("return", url.format()); + + case 15: + case "end": + return _context.stop(); + } + } + }, _callee, this); + })); + return _signatureUrl.apply(this, arguments); } exports.signatureUrl = signatureUrl; -},{"../../common/utils/getReqUrl":137,"../../common/utils/getResource":138,"../../common/utils/objectName":150,"../../common/utils/signUtils":156,"copy-to":199,"url":452,"utility":454}],113:[function(require,module,exports){ +},{"../../common/utils/getReqUrl":139,"../../common/utils/getResource":140,"../../common/utils/isFunction":149,"../../common/utils/objectName":155,"../../common/utils/setSTSToken":161,"../../common/utils/signUtils":162,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"copy-to":185,"url":509,"utility":511}],114:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("regenerator-runtime/runtime"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); Object.defineProperty(exports, "__esModule", { @@ -9401,7 +9452,7 @@ function _getObjectMeta2() { exports._getObjectMeta = _getObjectMeta; -},{"../object/head":102,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],114:[function(require,module,exports){ +},{"../object/head":103,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178}],115:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -9420,7 +9471,7 @@ function _makeAbortEvent() { exports._makeAbortEvent = _makeAbortEvent; -},{}],115:[function(require,module,exports){ +},{}],116:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -9438,14 +9489,14 @@ function _makeCancelEvent() { exports._makeCancelEvent = _makeCancelEvent; -},{}],116:[function(require,module,exports){ +},{}],117:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.map"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.array.map.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9474,7 +9525,7 @@ function _parallel(todo, num, fn, sourceData) { var item = queue.pop(); doing.push(item); - item().then(function (_res) { + item().then(function () { continueFn(queue); }).catch(function (_err) { queue.length = 0; @@ -9490,14 +9541,10 @@ function _parallel(todo, num, fn, sourceData) { exports._parallel = _parallel; -},{"core-js/modules/es.array.map":343,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353}],117:[function(require,module,exports){ +},{"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397}],118:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.function.name"); - -require("core-js/modules/es.regexp.exec"); - -require("core-js/modules/es.string.split"); +require("core-js/modules/es.function.name.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -9524,10 +9571,10 @@ function _unSupportBrowserTip() { exports._unSupportBrowserTip = _unSupportBrowserTip; -},{"core-js/modules/es.function.name":347,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.split":362,"platform":450}],118:[function(require,module,exports){ +},{"core-js/modules/es.function.name.js":386,"platform":507}],119:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9546,14 +9593,10 @@ function authorization(method, resource, subres, headers, config, headerEncoding exports.authorization = authorization; -},{"./signUtils":156,"core-js/modules/es.array.concat":332}],119:[function(require,module,exports){ +},{"./signUtils":162,"core-js/modules/es.array.concat.js":374}],120:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.function.name"); - -require("core-js/modules/es.regexp.exec"); - -require("core-js/modules/es.string.split"); +require("core-js/modules/es.function.name.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -9582,9 +9625,11 @@ function checkBrowserAndVersion(name, version) { exports.checkBrowserAndVersion = checkBrowserAndVersion; -},{"bowser":175,"core-js/modules/es.function.name":347,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.split":362}],120:[function(require,module,exports){ +},{"bowser":181,"core-js/modules/es.function.name.js":386}],121:[function(require,module,exports){ "use strict"; +require("core-js/modules/es.regexp.exec.js"); + Object.defineProperty(exports, "__esModule", { value: true }); @@ -9599,16 +9644,16 @@ exports.checkBucketName = function (name) { } }; -},{}],121:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":403}],122:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.entries.js"); -require("core-js/modules/es.object.entries"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9659,16 +9704,34 @@ exports.checkBucketTag = function (tag) { }); }; -},{"./checkValid":123,"./isObject":147,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.entries":350,"core-js/modules/web.dom-collections.for-each":391}],122:[function(require,module,exports){ +},{"./checkValid":125,"./isObject":151,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.object.entries.js":390,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],123:[function(require,module,exports){ +(function (process){(function (){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkEnv = void 0; + +function checkEnv(msg) { + if (process.browser) { + console.warn(msg); + } +} + +exports.checkEnv = checkEnv; + +}).call(this)}).call(this,require('_process')) +},{"_process":508}],124:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.entries.js"); -require("core-js/modules/es.object.entries"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9721,12 +9784,14 @@ function checkObjectTag(tag) { exports.checkObjectTag = checkObjectTag; -},{"./checkValid":123,"./isObject":147,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.entries":350,"core-js/modules/web.dom-collections.for-each":391}],123:[function(require,module,exports){ +},{"./checkValid":125,"./isObject":151,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.object.entries.js":390,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],125:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); + +require("core-js/modules/es.regexp.exec.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9774,14 +9839,14 @@ function checkValidRegion(value) { exports.checkValidRegion = checkValidRegion; -},{"core-js/modules/es.array.for-each":336,"core-js/modules/web.dom-collections.for-each":391}],124:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/web.dom-collections.for-each.js":443}],126:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.keys.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9797,22 +9862,22 @@ function convertMetaToHeaders(meta, headers) { exports.convertMetaToHeaders = convertMetaToHeaders; -},{"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391}],125:[function(require,module,exports){ +},{"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],127:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.includes"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.object.entries"); +require("core-js/modules/es.object.entries.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.array.includes.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.keys.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -9896,29 +9961,37 @@ function fixLowerFirst(o, lowerFirst) { } } -},{"./isObject":147,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/es.object.entries":350,"core-js/modules/es.object.keys":351,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],126:[function(require,module,exports){ +},{"./isObject":151,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.object.entries.js":390,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408,"core-js/modules/web.dom-collections.for-each.js":443}],128:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.array.slice.js"); + +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.keys.js"); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); Object.defineProperty(exports, "__esModule", { value: true }); -exports.deepCopy = void 0; +exports.deepCopyWith = exports.deepCopy = void 0; + +var isBuffer_1 = require("./isBuffer"); exports.deepCopy = function (obj) { if (obj === null || (0, _typeof2.default)(obj) !== 'object') { return obj; } + if (isBuffer_1.isBuffer(obj)) { + return obj.slice(); + } + var copy = Array.isArray(obj) ? [] : {}; Object.keys(obj).forEach(function (key) { copy[key] = exports.deepCopy(obj[key]); @@ -9926,12 +9999,39 @@ exports.deepCopy = function (obj) { return copy; }; -},{"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391}],127:[function(require,module,exports){ +exports.deepCopyWith = function (obj, customizer) { + function deepCopyWithHelper(value, innerKey, innerObject) { + var result = customizer(value, innerKey, innerObject); + if (result !== undefined) return result; + + if (value === null || (0, _typeof2.default)(value) !== 'object') { + return value; + } + + if (isBuffer_1.isBuffer(value)) { + return value.slice(); + } + + var copy = Array.isArray(value) ? [] : {}; + Object.keys(value).forEach(function (k) { + copy[k] = deepCopyWithHelper(value[k], k, value); + }); + return copy; + } + + if (customizer) { + return deepCopyWithHelper(obj, '', null); + } else { + return exports.deepCopy(obj); + } +}; + +},{"./isBuffer":146,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],129:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -9970,7 +10070,7 @@ function deleteFileSafe(filepath) { exports.deleteFileSafe = deleteFileSafe; -},{"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"debug":448,"fs":176}],128:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397,"debug":505,"fs":182}],130:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -9996,19 +10096,17 @@ function divideParts(fileSize, partSize) { exports.divideParts = divideParts; -},{}],129:[function(require,module,exports){ -(function (Buffer){ +},{}],131:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; -require("core-js/modules/es.array.for-each"); - -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.regexp.to-string.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.keys.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10049,14 +10147,14 @@ function encodeCallback(reqParams, options) { exports.encodeCallback = encodeCallback; -}).call(this,require("buffer").Buffer) -},{"buffer":196,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"core-js/modules/web.dom-collections.for-each":391}],130:[function(require,module,exports){ -(function (Buffer){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"buffer":183,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/web.dom-collections.for-each.js":443}],132:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.regexp.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10071,13 +10169,13 @@ function encoder(str) { exports.encoder = encoder; -}).call(this,require("buffer").Buffer) -},{"buffer":196,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],131:[function(require,module,exports){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"buffer":183,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404}],133:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -10106,14 +10204,14 @@ function escapeName(name) { exports.escapeName = escapeName; -},{"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"utility":454}],132:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408,"utility":511}],134:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.map"); +require("core-js/modules/es.array.map.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10174,24 +10272,24 @@ function formatFn(_) { return _; } -},{"../utils/dataFix":125,"../utils/formatObjKey":133,"../utils/isArray":142,"../utils/isObject":147,"core-js/modules/es.array.map":343,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],133:[function(require,module,exports){ +},{"../utils/dataFix":127,"../utils/formatObjKey":135,"../utils/isArray":144,"../utils/isObject":151,"core-js/modules/es.array.map.js":382,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408}],135:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.includes"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.array.includes.js"); -require("core-js/modules/es.string.includes"); +require("core-js/modules/es.string.includes.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.string.replace.js"); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); @@ -10243,18 +10341,18 @@ function handelFormat(key, type, options) { return key; } -},{"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/es.object.keys":351,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.includes":357,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],134:[function(require,module,exports){ +},{"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.includes.js":405,"core-js/modules/es.string.replace.js":408,"core-js/modules/web.dom-collections.for-each.js":443}],136:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.object.keys.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10282,12 +10380,12 @@ function formatQuery() { exports.formatQuery = formatQuery; -},{"./isObject":147,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],135:[function(require,module,exports){ +},{"./isObject":151,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408,"core-js/modules/web.dom-collections.for-each.js":443}],137:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10315,7 +10413,7 @@ function formatTag(obj) { exports.formatTag = formatTag; -},{"./isObject":147,"core-js/modules/es.array.for-each":336,"core-js/modules/web.dom-collections.for-each":391}],136:[function(require,module,exports){ +},{"./isObject":151,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],138:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10339,18 +10437,18 @@ function getPartSize(fileSize, partSize) { exports.getPartSize = getPartSize; -},{}],137:[function(require,module,exports){ +},{}],139:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -10430,7 +10528,7 @@ function getReqUrl(params, options) { exports.getReqUrl = getReqUrl; -},{"./checkValid":123,"./escapeName":131,"./isIP":146,"copy-to":199,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391,"is-type-of":449,"merge-descriptors":409,"url":452}],138:[function(require,module,exports){ +},{"./checkValid":125,"./escapeName":133,"./isIP":150,"copy-to":185,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408,"core-js/modules/web.dom-collections.for-each.js":443,"is-type-of":506,"merge-descriptors":462,"url":509}],140:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10449,14 +10547,14 @@ function getResource(params, headerEncoding) { exports.getResource = getResource; -},{"./encoder":130}],139:[function(require,module,exports){ +},{"./encoder":132}],141:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.array.concat.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10478,16 +10576,18 @@ function getSourceName(sourceName, bucketName, configBucket) { } checkBucketName_1.checkBucketName(bucketName, false); - sourceName = encodeURI(sourceName); + sourceName = encodeURIComponent(sourceName); sourceName = "/".concat(bucketName, "/").concat(sourceName); return sourceName; } exports.getSourceName = getSourceName; -},{"./checkBucketName":120,"./objectName":150,"core-js/modules/es.array.concat":332,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],140:[function(require,module,exports){ +},{"./checkBucketName":121,"./objectName":155,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408}],142:[function(require,module,exports){ "use strict"; +require("core-js/modules/es.regexp.exec.js"); + Object.defineProperty(exports, "__esModule", { value: true }); @@ -10511,7 +10611,7 @@ function getStrBytesCount(str) { exports.getStrBytesCount = getStrBytesCount; -},{}],141:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":403}],143:[function(require,module,exports){ "use strict"; var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -10631,12 +10731,10 @@ exports.default = { WebFileReadStream: webFileReadStream_1.WebFileReadStream }; -},{"./_getObjectMeta":113,"./authorization":118,"./checkBrowserAndVersion":119,"./checkBucketName":120,"./checkBucketTag":121,"./checkObjectTag":122,"./checkValid":123,"./convertMetaToHeaders":124,"./deepCopy":126,"./deleteFileSafe":127,"./divideParts":128,"./encodeCallback":129,"./escapeName":131,"./formatObjKey":133,"./formatQuery":134,"./formatTag":135,"./getPartSize":136,"./getReqUrl":137,"./getResource":138,"./getSourceName":139,"./getStrBytesCount":140,"./isArray":142,"./isBlob":143,"./isFile":145,"./isIP":146,"./isObject":147,"./mergeDefault":148,"./obj2xml":149,"./objectName":150,"./objectUrl":151,"./parseXML":152,"./policy2Str":153,"./signUtils":156,"./webFileReadStream":157}],142:[function(require,module,exports){ +},{"./_getObjectMeta":114,"./authorization":119,"./checkBrowserAndVersion":120,"./checkBucketName":121,"./checkBucketTag":122,"./checkObjectTag":124,"./checkValid":125,"./convertMetaToHeaders":126,"./deepCopy":128,"./deleteFileSafe":129,"./divideParts":130,"./encodeCallback":131,"./escapeName":133,"./formatObjKey":135,"./formatQuery":136,"./formatTag":137,"./getPartSize":138,"./getReqUrl":139,"./getResource":140,"./getSourceName":141,"./getStrBytesCount":142,"./isArray":144,"./isBlob":145,"./isFile":148,"./isIP":150,"./isObject":151,"./mergeDefault":153,"./obj2xml":154,"./objectName":155,"./objectUrl":156,"./parseXML":158,"./policy2Str":159,"./signUtils":162,"./webFileReadStream":163}],144:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.object.to-string"); - -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.object.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10647,7 +10745,7 @@ exports.isArray = function (obj) { return Object.prototype.toString.call(obj) === '[object Array]'; }; -},{"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],143:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":393}],145:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10661,8 +10759,8 @@ function isBlob(blob) { exports.isBlob = isBlob; -},{}],144:[function(require,module,exports){ -(function (Buffer){ +},{}],146:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10676,22 +10774,70 @@ function isBuffer(obj) { exports.isBuffer = isBuffer; -}).call(this,{"isBuffer":require("../../../node_modules/is-buffer/index.js")}) -},{"../../../node_modules/is-buffer/index.js":406}],145:[function(require,module,exports){ +}).call(this)}).call(this,{"isBuffer":require("../../../node_modules/is-buffer/index.js")}) +},{"../../../node_modules/is-buffer/index.js":459}],147:[function(require,module,exports){ +(function (process){(function (){ "use strict"; +require("core-js/modules/es.array.includes.js"); + +require("core-js/modules/es.string.includes.js"); + +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; + Object.defineProperty(exports, "__esModule", { value: true }); -exports.isFile = void 0; +exports.isDingTalk = void 0; -exports.isFile = function (obj) { - return typeof File !== 'undefined' && obj instanceof File; +var mime_1 = __importDefault(require("mime")); + +var path_1 = __importDefault(require("path")); + +function isDingTalk(params) { + if (process.browser && !mime_1.default.getType(params.mime || path_1.default.extname(params.object || '')) && window.navigator.userAgent.toLowerCase().includes('aliapp(dingtalk')) { + return true; + } + + return false; +} + +exports.isDingTalk = isDingTalk; + +}).call(this)}).call(this,require('_process')) +},{"_process":508,"core-js/modules/es.array.includes.js":379,"core-js/modules/es.string.includes.js":405,"mime":464,"path":467}],148:[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; }; -},{}],146:[function(require,module,exports){ +},{}],149:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isFunction = void 0; + +exports.isFunction = function (v) { + return typeof v === 'function'; +}; + +},{}],150:[function(require,module,exports){ "use strict"; +require("core-js/modules/es.regexp.exec.js"); + Object.defineProperty(exports, "__esModule", { value: true }); @@ -10709,12 +10855,10 @@ exports.isIP = function (host) { return ipv4Regex.test(host) || ipv6Regex.test(host); }; -},{}],147:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":403}],151:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.object.to-string"); - -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.object.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10725,7 +10869,37 @@ exports.isObject = function (obj) { return Object.prototype.toString.call(obj) === '[object Object]'; }; -},{"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],148:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":393}],152:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); + +require("core-js/modules/web.dom-collections.for-each.js"); + +require("core-js/modules/es.object.keys.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lowercaseKeyHeader = void 0; + +var isObject_1 = require("./isObject"); + +function lowercaseKeyHeader(headers) { + var lowercaseHeader = {}; + + if (isObject_1.isObject(headers)) { + Object.keys(headers).forEach(function (key) { + lowercaseHeader[key.toLowerCase()] = headers[key]; + }); + } + + return lowercaseHeader; +} + +exports.lowercaseKeyHeader = lowercaseKeyHeader; + +},{"./isObject":151,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443}],153:[function(require,module,exports){ "use strict"; var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -10747,28 +10921,26 @@ function mergeDefault(source, mod) { exports.mergeDefault = mergeDefault; -},{"merge-descriptors":409}],149:[function(require,module,exports){ +},{"merge-descriptors":462}],154:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.array.join"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.array.map"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.array.join.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.array.map.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.regexp.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10818,12 +10990,12 @@ function obj2xml(obj, options) { exports.obj2xml = obj2xml; -},{"./formatObjKey":133,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.join":341,"core-js/modules/es.array.map":343,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],150:[function(require,module,exports){ +},{"./formatObjKey":135,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.join.js":381,"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/es.string.replace.js":408,"core-js/modules/web.dom-collections.for-each.js":443}],155:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10836,7 +11008,7 @@ function objectName(name) { exports.objectName = objectName; -},{"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],151:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.replace.js":408}],156:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10856,7 +11028,67 @@ function objectUrl(name, options) { exports.objectUrl = objectUrl; -},{"./getReqUrl":137}],152:[function(require,module,exports){ +},{"./getReqUrl":139}],157:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.slice.js"); + +require("core-js/modules/es.object.to-string.js"); + +require("core-js/modules/es.function.name.js"); + +require("core-js/modules/es.array.from.js"); + +require("core-js/modules/es.string.iterator.js"); + +require("core-js/modules/es.regexp.exec.js"); + +require("core-js/modules/es.symbol.js"); + +require("core-js/modules/es.symbol.description.js"); + +require("core-js/modules/es.symbol.iterator.js"); + +require("core-js/modules/es.array.iterator.js"); + +require("core-js/modules/web.dom-collections.iterator.js"); + +require("core-js/modules/es.object.assign.js"); + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.omit = void 0; + +function omit(originalObject, keysToOmit) { + var cloneObject = Object.assign({}, originalObject); + + var _iterator = _createForOfIteratorHelper(keysToOmit), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var path = _step.value; + delete cloneObject[path]; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + return cloneObject; +} + +exports.omit = omit; + +},{"core-js/modules/es.array.from.js":378,"core-js/modules/es.array.iterator.js":380,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.assign.js":389,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.iterator.js":406,"core-js/modules/es.symbol.description.js":414,"core-js/modules/es.symbol.iterator.js":416,"core-js/modules/es.symbol.js":417,"core-js/modules/web.dom-collections.iterator.js":444}],158:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10872,7 +11104,7 @@ Object.defineProperty(exports, "parseXML", { } }); -},{"./xml2js":158}],153:[function(require,module,exports){ +},{"./xml2js":164}],159:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -10900,12 +11132,12 @@ function policy2Str(policy) { exports.policy2Str = policy2Str; -},{}],154:[function(require,module,exports){ +},{}],160:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -10950,22 +11182,20 @@ function retry(func, retryMax) { exports.retry = retry; -},{"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353}],155:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397}],161:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.find"); - -require("core-js/modules/es.array.for-each"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); -require("core-js/modules/es.object.assign"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.object.to-string.js"); -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.find.js"); -require("regenerator-runtime/runtime"); +require("core-js/modules/es.object.assign.js"); var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); @@ -10982,16 +11212,29 @@ function setSTSToken() { function _setSTSToken() { _setSTSToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { - var credentials; + var now, credentials; return _regenerator.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!this.options) this.options = {}; - _context.next = 3; + now = new Date(); + + if (!this.stsTokenFreshTime) { + _context.next = 14; + break; + } + + if (!(+now - this.stsTokenFreshTime >= this.options.refreshSTSTokenInterval)) { + _context.next = 12; + break; + } + + this.stsTokenFreshTime = now; + _context.next = 7; return this.options.refreshSTSToken(); - case 3: + case 7: credentials = _context.sent; credentials = formatObjKey_1.formatObjKey(credentials, 'firstLowerCase'); @@ -11002,7 +11245,17 @@ function _setSTSToken() { checkCredentials(credentials); Object.assign(this.options, credentials); - case 8: + case 12: + _context.next = 15; + break; + + case 14: + this.stsTokenFreshTime = now; + + case 15: + return _context.abrupt("return", null); + + case 16: case "end": return _context.stop(); } @@ -11026,29 +11279,25 @@ function checkCredentials(obj) { }); } -},{"./formatObjKey":133,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.find":335,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.assign":349,"core-js/modules/es.object.keys":351,"regenerator-runtime/runtime":434}],156:[function(require,module,exports){ -(function (Buffer){ +},{"./formatObjKey":135,"@babel/runtime/helpers/asyncToGenerator":167,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/regenerator":178,"core-js/modules/es.array.find.js":377,"core-js/modules/es.object.assign.js":389,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393}],162:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.array.for-each"); +require("core-js/modules/es.string.trim.js"); -require("core-js/modules/es.array.index-of"); +require("core-js/modules/es.array.sort.js"); -require("core-js/modules/es.array.join"); +require("core-js/modules/es.array.join.js"); -require("core-js/modules/es.array.sort"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.string.trim"); - -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.regexp.to-string.js"); var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { @@ -11064,6 +11313,8 @@ exports._signatureForURL = exports.computeSignature = exports.buildCanonicalStri var crypto_1 = __importDefault(require('./../../../shims/crypto/crypto.js')); var is_type_of_1 = __importDefault(require("is-type-of")); + +var lowercaseKeyHeader_1 = require("./lowercaseKeyHeader"); /** * * @param {String} resourcePath @@ -11095,7 +11346,7 @@ function buildCanonicalizedResource(resourcePath, parameters) { var processFunc = function processFunc(key) { canonicalizedResource += separatorString + key; - if (parameters[key]) { + if (parameters[key] || parameters[key] === 0) { canonicalizedResource += "=".concat(parameters[key]); } @@ -11119,11 +11370,11 @@ exports.buildCanonicalizedResource = buildCanonicalizedResource; function buildCanonicalString(method, resourcePath, request, expires) { request = request || {}; - var headers = request.headers || {}; + var headers = lowercaseKeyHeader_1.lowercaseKeyHeader(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']]; + var signContent = [method.toUpperCase(), headers['content-md5'] || '', headers['content-type'], expires || headers['x-oss-date']]; Object.keys(headers).forEach(function (key) { var lowerKey = key.toLowerCase(); @@ -11246,68 +11497,70 @@ exports.default = { _signatureForURL: _signatureForURL }; -}).call(this,require("buffer").Buffer) -},{"./../../../shims/crypto/crypto.js":444,"buffer":196,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.join":341,"core-js/modules/es.array.sort":345,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.trim":364,"core-js/modules/web.dom-collections.for-each":391,"is-type-of":449}],157:[function(require,module,exports){ -(function (Buffer){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"./../../../shims/crypto/crypto.js":501,"./lowercaseKeyHeader":152,"buffer":183,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.join.js":381,"core-js/modules/es.array.sort.js":384,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/es.string.trim.js":412,"core-js/modules/web.dom-collections.for-each.js":443,"is-type-of":506}],163:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; +require("core-js/modules/es.reflect.construct.js"); + var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.iterator"); +require("core-js/modules/es.array.slice.js"); -require("core-js/modules/es.array.slice"); +require("core-js/modules/es.array.iterator.js"); -require("core-js/modules/es.array-buffer.slice"); +require("core-js/modules/es.array-buffer.slice.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.typed-array.uint8-array"); +require("core-js/modules/es.typed-array.uint8-array.js"); -require("core-js/modules/es.typed-array.copy-within"); +require("core-js/modules/es.typed-array.copy-within.js"); -require("core-js/modules/es.typed-array.every"); +require("core-js/modules/es.typed-array.every.js"); -require("core-js/modules/es.typed-array.fill"); +require("core-js/modules/es.typed-array.fill.js"); -require("core-js/modules/es.typed-array.filter"); +require("core-js/modules/es.typed-array.filter.js"); -require("core-js/modules/es.typed-array.find"); +require("core-js/modules/es.typed-array.find.js"); -require("core-js/modules/es.typed-array.find-index"); +require("core-js/modules/es.typed-array.find-index.js"); -require("core-js/modules/es.typed-array.for-each"); +require("core-js/modules/es.typed-array.for-each.js"); -require("core-js/modules/es.typed-array.includes"); +require("core-js/modules/es.typed-array.includes.js"); -require("core-js/modules/es.typed-array.index-of"); +require("core-js/modules/es.typed-array.index-of.js"); -require("core-js/modules/es.typed-array.iterator"); +require("core-js/modules/es.typed-array.iterator.js"); -require("core-js/modules/es.typed-array.join"); +require("core-js/modules/es.typed-array.join.js"); -require("core-js/modules/es.typed-array.last-index-of"); +require("core-js/modules/es.typed-array.last-index-of.js"); -require("core-js/modules/es.typed-array.map"); +require("core-js/modules/es.typed-array.map.js"); -require("core-js/modules/es.typed-array.reduce"); +require("core-js/modules/es.typed-array.reduce.js"); -require("core-js/modules/es.typed-array.reduce-right"); +require("core-js/modules/es.typed-array.reduce-right.js"); -require("core-js/modules/es.typed-array.reverse"); +require("core-js/modules/es.typed-array.reverse.js"); -require("core-js/modules/es.typed-array.set"); +require("core-js/modules/es.typed-array.set.js"); -require("core-js/modules/es.typed-array.slice"); +require("core-js/modules/es.typed-array.slice.js"); -require("core-js/modules/es.typed-array.some"); +require("core-js/modules/es.typed-array.some.js"); -require("core-js/modules/es.typed-array.sort"); +require("core-js/modules/es.typed-array.sort.js"); -require("core-js/modules/es.typed-array.subarray"); +require("core-js/modules/es.typed-array.subarray.js"); -require("core-js/modules/es.typed-array.to-locale-string"); +require("core-js/modules/es.typed-array.to-locale-string.js"); -require("core-js/modules/es.typed-array.to-string"); +require("core-js/modules/es.typed-array.to-string.js"); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); @@ -11323,7 +11576,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.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; } } +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } Object.defineProperty(exports, "__esModule", { value: true @@ -11408,49 +11661,45 @@ var WebFileReadStream = /*#__PURE__*/function (_stream_1$Readable) { exports.WebFileReadStream = WebFileReadStream; -}).call(this,require("buffer").Buffer) -},{"@babel/runtime/helpers/assertThisInitialized":160,"@babel/runtime/helpers/classCallCheck":162,"@babel/runtime/helpers/createClass":163,"@babel/runtime/helpers/getPrototypeOf":165,"@babel/runtime/helpers/inherits":166,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/possibleConstructorReturn":168,"buffer":196,"core-js/modules/es.array-buffer.slice":331,"core-js/modules/es.array.iterator":340,"core-js/modules/es.array.slice":344,"core-js/modules/es.object.to-string":352,"core-js/modules/es.typed-array.copy-within":367,"core-js/modules/es.typed-array.every":368,"core-js/modules/es.typed-array.fill":369,"core-js/modules/es.typed-array.filter":370,"core-js/modules/es.typed-array.find":372,"core-js/modules/es.typed-array.find-index":371,"core-js/modules/es.typed-array.for-each":373,"core-js/modules/es.typed-array.includes":374,"core-js/modules/es.typed-array.index-of":375,"core-js/modules/es.typed-array.iterator":376,"core-js/modules/es.typed-array.join":377,"core-js/modules/es.typed-array.last-index-of":378,"core-js/modules/es.typed-array.map":379,"core-js/modules/es.typed-array.reduce":381,"core-js/modules/es.typed-array.reduce-right":380,"core-js/modules/es.typed-array.reverse":382,"core-js/modules/es.typed-array.set":383,"core-js/modules/es.typed-array.slice":384,"core-js/modules/es.typed-array.some":385,"core-js/modules/es.typed-array.sort":386,"core-js/modules/es.typed-array.subarray":387,"core-js/modules/es.typed-array.to-locale-string":388,"core-js/modules/es.typed-array.to-string":389,"core-js/modules/es.typed-array.uint8-array":390,"stream":436}],158:[function(require,module,exports){ +}).call(this)}).call(this,require("buffer").Buffer) +},{"@babel/runtime/helpers/assertThisInitialized":166,"@babel/runtime/helpers/classCallCheck":168,"@babel/runtime/helpers/createClass":169,"@babel/runtime/helpers/getPrototypeOf":171,"@babel/runtime/helpers/inherits":172,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/possibleConstructorReturn":174,"buffer":183,"core-js/modules/es.array-buffer.slice.js":373,"core-js/modules/es.array.iterator.js":380,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.reflect.construct.js":401,"core-js/modules/es.typed-array.copy-within.js":419,"core-js/modules/es.typed-array.every.js":420,"core-js/modules/es.typed-array.fill.js":421,"core-js/modules/es.typed-array.filter.js":422,"core-js/modules/es.typed-array.find-index.js":423,"core-js/modules/es.typed-array.find.js":424,"core-js/modules/es.typed-array.for-each.js":425,"core-js/modules/es.typed-array.includes.js":426,"core-js/modules/es.typed-array.index-of.js":427,"core-js/modules/es.typed-array.iterator.js":428,"core-js/modules/es.typed-array.join.js":429,"core-js/modules/es.typed-array.last-index-of.js":430,"core-js/modules/es.typed-array.map.js":431,"core-js/modules/es.typed-array.reduce-right.js":432,"core-js/modules/es.typed-array.reduce.js":433,"core-js/modules/es.typed-array.reverse.js":434,"core-js/modules/es.typed-array.set.js":435,"core-js/modules/es.typed-array.slice.js":436,"core-js/modules/es.typed-array.some.js":437,"core-js/modules/es.typed-array.sort.js":438,"core-js/modules/es.typed-array.subarray.js":439,"core-js/modules/es.typed-array.to-locale-string.js":440,"core-js/modules/es.typed-array.to-string.js":441,"core-js/modules/es.typed-array.uint8-array.js":442,"stream":489}],164:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.filter"); - -require("core-js/modules/es.array.find"); - -require("core-js/modules/es.array.for-each"); +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); -require("core-js/modules/es.array.index-of"); +var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); -require("core-js/modules/es.array.map"); +require("core-js/modules/es.regexp.constructor.js"); -require("core-js/modules/es.object.entries"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.regexp.to-string.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.regexp.constructor"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.array.find.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.array.filter.js"); -require("core-js/modules/es.string.match"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.starts-with.js"); -require("core-js/modules/es.string.starts-with"); +require("core-js/modules/es.array.map.js"); -require("core-js/modules/es.string.trim"); +require("core-js/modules/es.object.entries.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.string.match.js"); -var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +require("core-js/modules/es.string.trim.js"); -var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); +require("core-js/modules/es.promise.js"); Object.defineProperty(exports, "__esModule", { value: true @@ -11809,20 +12058,20 @@ exports.default = { parseString: parseString }; -},{"./isArray":142,"./isObject":147,"@babel/runtime/helpers/defineProperty":164,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.find":335,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.map":343,"core-js/modules/es.object.entries":350,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"core-js/modules/es.regexp.constructor":354,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.match":359,"core-js/modules/es.string.replace":360,"core-js/modules/es.string.starts-with":363,"core-js/modules/es.string.trim":364,"core-js/modules/web.dom-collections.for-each":391}],159:[function(require,module,exports){ +},{"./isArray":144,"./isObject":151,"@babel/runtime/helpers/defineProperty":170,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"core-js/modules/es.array.filter.js":376,"core-js/modules/es.array.find.js":377,"core-js/modules/es.array.map.js":382,"core-js/modules/es.object.entries.js":390,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397,"core-js/modules/es.regexp.constructor.js":402,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/es.string.match.js":407,"core-js/modules/es.string.replace.js":408,"core-js/modules/es.string.starts-with.js":411,"core-js/modules/es.string.trim.js":412,"core-js/modules/web.dom-collections.for-each.js":443}],165:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.filter"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/es.function.name"); +require("core-js/modules/es.object.keys.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.array.filter.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/es.function.name.js"); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); @@ -11897,6 +12146,7 @@ var Client = /*#__PURE__*/function () { this.ctx = ctx; this.userAgent = _getUserAgent_1._getUserAgent(); + this.stsTokenFreshTime = new Date(); } }], [{ key: "use", @@ -11928,7 +12178,7 @@ exports.initClient = function (options, ctx) { return new Client(options, ctx); }; -},{"./browser/client/_createStream":1,"./common/client":65,"./common/client/_getUserAgent":60,"./common/client/initOptions":66,"./common/utils/_unSupportBrowserTip":117,"@babel/runtime/helpers/classCallCheck":162,"@babel/runtime/helpers/createClass":163,"@babel/runtime/helpers/interopRequireDefault":167,"agentkeepalive":173,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.for-each":336,"core-js/modules/es.function.name":347,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"urllib":455}],160:[function(require,module,exports){ +},{"./browser/client/_createStream":1,"./common/client":66,"./common/client/_getUserAgent":61,"./common/client/initOptions":67,"./common/utils/_unSupportBrowserTip":118,"@babel/runtime/helpers/classCallCheck":168,"@babel/runtime/helpers/createClass":169,"@babel/runtime/helpers/interopRequireDefault":173,"agentkeepalive":179,"core-js/modules/es.array.filter.js":376,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.object.to-string.js":393,"core-js/modules/web.dom-collections.for-each.js":443,"urllib":512}],166:[function(require,module,exports){ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); @@ -11937,8 +12187,8 @@ function _assertThisInitialized(self) { return self; } -module.exports = _assertThisInitialized; -},{}],161:[function(require,module,exports){ +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],167:[function(require,module,exports){ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); @@ -11975,16 +12225,16 @@ function _asyncToGenerator(fn) { }; } -module.exports = _asyncToGenerator; -},{}],162:[function(require,module,exports){ +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],168:[function(require,module,exports){ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -module.exports = _classCallCheck; -},{}],163:[function(require,module,exports){ +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],169:[function(require,module,exports){ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; @@ -11998,11 +12248,14 @@ function _defineProperties(target, props) { function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); return Constructor; } -module.exports = _createClass; -},{}],164:[function(require,module,exports){ +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],170:[function(require,module,exports){ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { @@ -12018,18 +12271,18 @@ function _defineProperty(obj, key, value) { return obj; } -module.exports = _defineProperty; -},{}],165:[function(require,module,exports){ +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],171:[function(require,module,exports){ function _getPrototypeOf(o) { - module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); - }; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; return _getPrototypeOf(o); } -module.exports = _getPrototypeOf; -},{}],166:[function(require,module,exports){ -var setPrototypeOf = require("./setPrototypeOf"); +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],172:[function(require,module,exports){ +var setPrototypeOf = require("./setPrototypeOf.js"); function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { @@ -12043,822 +12296,439 @@ function _inherits(subClass, superClass) { configurable: true } }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); if (superClass) setPrototypeOf(subClass, superClass); } -module.exports = _inherits; -},{"./setPrototypeOf":169}],167:[function(require,module,exports){ +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./setPrototypeOf.js":176}],173:[function(require,module,exports){ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -module.exports = _interopRequireDefault; -},{}],168:[function(require,module,exports){ -var _typeof = require("@babel/runtime/helpers/typeof"); +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],174:[function(require,module,exports){ +var _typeof = require("./typeof.js")["default"]; -var assertThisInitialized = require("./assertThisInitialized"); +var assertThisInitialized = require("./assertThisInitialized.js"); function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); } return assertThisInitialized(self); } -module.exports = _possibleConstructorReturn; -},{"./assertThisInitialized":160,"@babel/runtime/helpers/typeof":170}],169:[function(require,module,exports){ -function _setPrototypeOf(o, p) { - module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} - -module.exports = _setPrototypeOf; -},{}],170:[function(require,module,exports){ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - module.exports = _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - module.exports = _typeof = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./assertThisInitialized.js":166,"./typeof.js":177}],175:[function(require,module,exports){ +var _typeof = require("./typeof.js")["default"]; - return _typeof(obj); -} - -module.exports = _typeof; -},{}],171:[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. - */ - -var runtime = (function (exports) { +function _regeneratorRuntime() { "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"; + /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ + + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { + return exports; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + var exports = {}, + Op = Object.prototype, + hasOwn = Op.hasOwnProperty, + $Symbol = "function" == typeof Symbol ? Symbol : {}, + iteratorSymbol = $Symbol.iterator || "@@iterator", + asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", + toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { - Object.defineProperty(obj, key, { + return Object.defineProperty(obj, key, { value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; + enumerable: !0, + configurable: !0, + writable: !0 + }), obj[key]; } + try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { - define = function(obj, key, value) { + define = function define(obj, key, value) { return obj[key] = value; }; } 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 || []); + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, + generator = Object.create(protoGenerator.prototype), + context = new Context(tryLocsList || []); + return generator._invoke = function (innerFn, self, context) { + var state = "suspendedStart"; + return function (method, arg) { + if ("executing" === state) throw new Error("Generator is already running"); + + if ("completed" === state) { + if ("throw" === method) throw arg; + return doneResult(); + } + + for (context.method = method, context.arg = arg;;) { + var delegate = context.delegate; - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); - return generator; + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { + if ("suspendedStart" === state) throw state = "completed", context.arg; + context.dispatchException(context.arg); + } else "return" === context.method && context.abrupt("return", context.arg); + state = "executing"; + var record = tryCatch(innerFn, self, context); + + if ("normal" === record.type) { + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; + return { + value: record.arg, + done: context.done + }; + } + + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); + } + }; + }(innerFn, self, context), generator; } - exports.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) }; + return { + type: "normal", + arg: fn.call(obj, arg) + }; } catch (err) { - return { type: "throw", arg: 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. + exports.wrap = wrap; 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 () { + define(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; - GeneratorFunction.displayName = define( - GeneratorFunctionPrototype, - toStringTagSymbol, - "GeneratorFunction" - ); + }); + var getProto = Object.getPrototypeOf, + NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - // 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) { - define(prototype, method, function(arg) { + ["next", "throw", "return"].forEach(function (method) { + define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } - exports.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; - }; - - exports.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(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. - exports.awrap = function(arg) { - return { __await: arg }; - }; - function AsyncIterator(generator, PromiseImpl) { 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 PromiseImpl.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - return PromiseImpl.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. - result.value = unwrapped; - resolve(result); - }, function(error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. + if ("throw" !== record.type) { + var result = record.arg, + value = result.value; + return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }) : PromiseImpl.resolve(value).then(function (unwrapped) { + result.value = unwrapped, resolve(result); + }, function (error) { return invoke("throw", error, resolve, reject); }); } + + reject(record.arg); } var previousPromise; - function enqueue(method, arg) { + this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { + return new PromiseImpl(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; - }; - exports.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. - exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList), - PromiseImpl - ); - - return exports.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; - } - } + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } - // 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") { - // Note: ["return"] must be used for ES3 parsing compatibility. - 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"); + if (undefined === method) { + if (context.delegate = null, "throw" === context.method) { + if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) 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 ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; + var info = record.arg; + return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); + } - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0] + }; + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); + } - var info = record.arg; + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal", delete record.arg, entry.completion = record; + } - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } + function Context(tryLocsList) { + this.tryEntries = [{ + tryLoc: "root" + }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); + } + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) return iteratorMethod.call(iterable); + if ("function" == typeof iterable.next) return iterable; - 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; + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + for (; ++i < iterable.length;) { + if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; + } - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; + return next.value = undefined, next.done = !0, next; + }; - // 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; + return next.next = next; } - - } 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; + return { + next: doneResult + }; } - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - define(Gp, toStringTagSymbol, "Generator"); + function doneResult() { + return { + value: undefined, + done: !0 + }; + } - // 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 GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { + var ctor = "function" == typeof genFun && genFun.constructor; + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); + }, exports.mark = function (genFun) { + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; + }, exports.awrap = function (arg) { + return { + __await: arg + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; - }; - - Gp.toString = function() { + }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { + void 0 === PromiseImpl && (PromiseImpl = Promise); + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { + return this; + }), define(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); - } - - exports.keys = function(object) { + }), exports.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) { + return keys.reverse(), function next() { + for (; keys.length;) { var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } + if (key in object) return next.value = key, next.done = !1, 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; + return next.done = !0, 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 }; - } - exports.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { + }, exports.values = values, 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; - } - } + reset: function reset(skipTempReset) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { + "t" === name.charAt(0) && 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; - } - + stop: function stop() { + this.done = !0; + var rootRecord = this.tryEntries[0].completion; + if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - + dispatchException: function dispatchException(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; + function handle(loc, caught) { + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!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"); - } + var entry = this.tryEntries[i], + record = entry.completion; + if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); + var hasCatch = hasOwn.call(entry, "catchLoc"), + 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); - } - + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); + 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); - } - + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { - throw new Error("try statement without catch or finally"); + if (!hasFinally) throw new Error("try statement without catch or finally"); + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, - - abrupt: function(type, arg) { + abrupt: function abrupt(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) { + + 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; - } - + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (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); + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : 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; + complete: function complete(record, afterLoc) { + if ("throw" === record.type) throw record.arg; + return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, - - finish: function(finallyLoc) { + finish: function finish(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; - } + if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, - - "catch": function(tryLoc) { + "catch": function _catch(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") { + + if ("throw" === record.type) { 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 = { + delegateYield: function delegateYield(iterable, resultName, nextLoc) { + return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc - }; + }, "next" === this.method && (this.arg = undefined), ContinueSentinel; + } + }, exports; +} - 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; - } +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./typeof.js":177}],176:[function(require,module,exports){ +function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + return _setPrototypeOf(o, p); +} - return ContinueSentinel; - } - }; +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],177:[function(require,module,exports){ +function _typeof(obj) { + "@babel/helpers - typeof"; + + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj); +} - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],178:[function(require,module,exports){ +// TODO(Babel 8): Remove this file. -}( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - typeof module === "object" ? module.exports : {} -)); +var runtime = require("../helpers/regeneratorRuntime")(); +module.exports = runtime; +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } } -},{}],172:[function(require,module,exports){ -module.exports = require("regenerator-runtime"); - -},{"regenerator-runtime":171}],173:[function(require,module,exports){ +},{"../helpers/regeneratorRuntime":175}],179:[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 () {} -},{}],174:[function(require,module,exports){ +},{}],180:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -12986,9 +12856,7 @@ function fromByteArray (uint8) { // 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) - )) + 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 @@ -13012,7 +12880,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],175:[function(require,module,exports){ +},{}],181:[function(require,module,exports){ /*! * Bowser - a browser detector * https://github.com/ded/bowser @@ -13658,11944 +13526,9647 @@ function fromByteArray (uint8) { return bowser }); -},{}],176:[function(require,module,exports){ +},{}],182:[function(require,module,exports){ -},{}],177:[function(require,module,exports){ -(function (global){ -var ClientRequest = require('./lib/request') -var response = require('./lib/response') -var extend = require('xtend') -var statusCodes = require('builtin-status-codes') -var url = require('url') +},{}],183:[function(require,module,exports){ +(function (global,Buffer){(function (){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ -var http = exports +'use strict' -http.request = function (opts, cb) { - if (typeof opts === 'string') - opts = url.parse(opts) - else - opts = extend(opts) +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var isArray = require('isarray') - // Normally, the page is loaded from http or https, so not specifying a protocol - // will result in a (valid) protocol-relative url. However, this won't work if - // the protocol is something else, like 'file:' - var defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : '' +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 - var protocol = opts.protocol || defaultProtocol - var host = opts.hostname || opts.host - var port = opts.port - var path = opts.path || '/' +/** + * 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. - // Necessary for IPv6 addresses - if (host && host.indexOf(':') !== -1) - host = '[' + host + ']' + * 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() - // This may be a relative url. The browser should always be able to interpret it correctly. - opts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path - opts.method = (opts.method || 'GET').toUpperCase() - opts.headers = opts.headers || {} +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() - // Also valid opts.auth, opts.mode +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 + } +} - var req = new ClientRequest(opts) - if (cb) - req.on('response', cb) - return req +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff } -http.get = function get (opts, cb) { - var req = http.request(opts, cb) - req.end() - return req +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 } -http.ClientRequest = ClientRequest -http.IncomingMessage = response.IncomingMessage +/** + * 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. + */ -http.Agent = function () {} -http.Agent.defaultMaxSockets = 4 +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } -http.globalAgent = new http.Agent() + // 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) +} -http.STATUS_CODES = statusCodes +Buffer.poolSize = 8192 // not used by this implementation -http.METHODS = [ - 'CHECKOUT', - 'CONNECT', - 'COPY', - 'DELETE', - 'GET', - 'HEAD', - 'LOCK', - 'M-SEARCH', - 'MERGE', - 'MKACTIVITY', - 'MKCOL', - 'MOVE', - 'NOTIFY', - 'OPTIONS', - 'PATCH', - 'POST', - 'PROPFIND', - 'PROPPATCH', - 'PURGE', - 'PUT', - 'REPORT', - 'SEARCH', - 'SUBSCRIBE', - 'TRACE', - 'UNLOCK', - 'UNSUBSCRIBE' -] -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./lib/request":179,"./lib/response":180,"builtin-status-codes":197,"url":452,"xtend":443}],178:[function(require,module,exports){ -(function (global){ -exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream) +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} -exports.writableStream = isFunction(global.WritableStream) +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } -exports.abortController = isFunction(global.AbortController) + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } -// The xhr request to example.com may violate some restrictive CSP configurations, -// so if we're running in a browser that supports `fetch`, avoid calling getXHR() -// and assume support for certain features below. -var xhr -function getXHR () { - // Cache the xhr value - if (xhr !== undefined) return xhr + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } - if (global.XMLHttpRequest) { - xhr = new global.XMLHttpRequest() - // If XDomainRequest is available (ie only, where xhr might not work - // cross domain), use the page location. Otherwise use example.com - // Note: this doesn't actually make an http request. - try { - xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com') - } catch(e) { - xhr = null - } - } else { - // Service workers don't have XHR - xhr = null - } - return xhr + return fromObject(that, value) } -function checkTypeSupport (type) { - var xhr = getXHR() - if (!xhr) return false - try { - xhr.responseType = type - return xhr.responseType === type - } catch (e) {} - return false +/** + * 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 fetch is supported, then arraybuffer will be supported too. Skip calling -// checkTypeSupport(), since that calls getXHR(). -exports.arraybuffer = exports.fetch || checkTypeSupport('arraybuffer') +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 + }) + } +} -// These next two tests unavoidably show warnings in Chrome. Since fetch will always -// be used if it's available, just return false for these to avoid the warnings. -exports.msstream = !exports.fetch && checkTypeSupport('ms-stream') -exports.mozchunkedarraybuffer = !exports.fetch && checkTypeSupport('moz-chunked-arraybuffer') +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') + } +} -// If fetch is supported, then overrideMimeType will be supported too. Skip calling -// getXHR(). -exports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false) +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) +} -function isFunction (value) { - return typeof value === 'function' +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) } -xhr = null // Help gc +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 +} -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],179:[function(require,module,exports){ -(function (process,global,Buffer){ -var capability = require('./capability') -var inherits = require('inherits') -var response = require('./response') -var stream = require('readable-stream') +/** + * 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) +} -var IncomingMessage = response.IncomingMessage -var rStates = response.readyStates +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } -function decideMode (preferBinary, useFetch) { - if (capability.fetch && useFetch) { - return 'fetch' - } else if (capability.mozchunkedarraybuffer) { - return 'moz-chunked-arraybuffer' - } else if (capability.msstream) { - return 'ms-stream' - } else if (capability.arraybuffer && preferBinary) { - return 'arraybuffer' - } else { - return 'text' - } + 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 } -var ClientRequest = module.exports = function (opts) { - var self = this - stream.Writable.call(self) +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 +} - self._opts = opts - self._body = [] - self._headers = {} - if (opts.auth) - self.setHeader('Authorization', 'Basic ' + Buffer.from(opts.auth).toString('base64')) - Object.keys(opts.headers).forEach(function (name) { - self.setHeader(name, opts.headers[name]) - }) +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer - var preferBinary - var useFetch = true - if (opts.mode === 'disable-fetch' || ('requestTimeout' in opts && !capability.abortController)) { - // If the use of XHR should be preferred. Not typically needed. - useFetch = false - preferBinary = true - } else if (opts.mode === 'prefer-streaming') { - // If streaming is a high priority but binary compatibility and - // the accuracy of the 'content-type' header aren't - preferBinary = false - } else if (opts.mode === 'allow-wrong-content-type') { - // If streaming is more important than preserving the 'content-type' header - preferBinary = !capability.overrideMimeType - } else if (!opts.mode || opts.mode === 'default' || opts.mode === 'prefer-fast') { - // Use binary if text streaming may corrupt data or the content-type header, or for speed - preferBinary = true - } else { - throw new Error('Invalid value for opts.mode') - } - self._mode = decideMode(preferBinary, useFetch) - self._fetchTimer = null + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } - self.on('finish', function () { - self._onFinish() - }) + 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 } -inherits(ClientRequest, stream.Writable) +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) -ClientRequest.prototype.setHeader = function (name, value) { - var self = this - var lowerName = name.toLowerCase() - // This check is not necessary, but it prevents warnings from browsers about setting unsafe - // headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but - // http-browserify did it, so I will too. - if (unsafeHeaders.indexOf(lowerName) !== -1) - return + if (that.length === 0) { + return that + } - self._headers[lowerName] = { - name: name, - value: value - } + 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.') } -ClientRequest.prototype.getHeader = function (name) { - var header = this._headers[name.toLowerCase()] - if (header) - return header.value - return null +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 } -ClientRequest.prototype.removeHeader = function (name) { - var self = this - delete self._headers[name.toLowerCase()] +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) } -ClientRequest.prototype._onFinish = function () { - var self = this +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} - if (self._destroyed) - return - var opts = self._opts +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } - var headersObj = self._headers - var body = null - if (opts.method !== 'GET' && opts.method !== 'HEAD') { - body = new Blob(self._body, { - type: (headersObj['content-type'] || {}).value || '' - }); - } + if (a === b) return 0 - // create flattened list of headers - var headersList = [] - Object.keys(headersObj).forEach(function (keyName) { - var name = headersObj[keyName].name - var value = headersObj[keyName].value - if (Array.isArray(value)) { - value.forEach(function (v) { - headersList.push([name, v]) - }) - } else { - headersList.push([name, value]) - } - }) + var x = a.length + var y = b.length - if (self._mode === 'fetch') { - var signal = null - if (capability.abortController) { - var controller = new AbortController() - signal = controller.signal - self._fetchAbortController = controller + 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 ('requestTimeout' in opts && opts.requestTimeout !== 0) { - self._fetchTimer = global.setTimeout(function () { - self.emit('requestTimeout') - if (self._fetchAbortController) - self._fetchAbortController.abort() - }, opts.requestTimeout) - } - } - - global.fetch(self._opts.url, { - method: self._opts.method, - headers: headersList, - body: body || undefined, - mode: 'cors', - credentials: opts.withCredentials ? 'include' : 'same-origin', - signal: signal - }).then(function (response) { - self._fetchResponse = response - self._connect() - }, function (reason) { - global.clearTimeout(self._fetchTimer) - if (!self._destroyed) - self.emit('error', reason) - }) - } else { - var xhr = self._xhr = new global.XMLHttpRequest() - try { - xhr.open(self._opts.method, self._opts.url, true) - } catch (err) { - process.nextTick(function () { - self.emit('error', err) - }) - return - } + if (x < y) return -1 + if (y < x) return 1 + return 0 +} - // Can't set responseType on really old browsers - if ('responseType' in xhr) - xhr.responseType = self._mode +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 + } +} - if ('withCredentials' in xhr) - xhr.withCredentials = !!opts.withCredentials +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } - if (self._mode === 'text' && 'overrideMimeType' in xhr) - xhr.overrideMimeType('text/plain; charset=x-user-defined') + if (list.length === 0) { + return Buffer.alloc(0) + } - if ('requestTimeout' in opts) { - xhr.timeout = opts.requestTimeout - xhr.ontimeout = function () { - self.emit('requestTimeout') - } - } + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } - headersList.forEach(function (header) { - xhr.setRequestHeader(header[0], header[1]) - }) + 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 +} - self._response = null - xhr.onreadystatechange = function () { - switch (xhr.readyState) { - case rStates.LOADING: - case rStates.DONE: - self._onXHRProgress() - break - } - } - // Necessary for streaming in Firefox, since xhr.response is ONLY defined - // in onprogress, not in onreadystatechange with xhr.readyState = 3 - if (self._mode === 'moz-chunked-arraybuffer') { - xhr.onprogress = function () { - self._onXHRProgress() - } - } +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 + } - xhr.onerror = function () { - if (self._destroyed) - return - self.emit('error', new Error('XHR error')) - } + var len = string.length + if (len === 0) return 0 - try { - xhr.send(body) - } catch (err) { - process.nextTick(function () { - self.emit('error', err) - }) - return - } - } + // 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 -/** - * Checks if xhr.status is readable and non-zero, indicating no error. - * Even though the spec says it should be available in readyState 3, - * accessing it throws an exception in IE8 - */ -function statusValid (xhr) { - try { - var status = xhr.status - return (status !== null && status !== 0) - } catch (e) { - return false - } -} +function slowToString (encoding, start, end) { + var loweredCase = false -ClientRequest.prototype._onXHRProgress = function () { - var self = this + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. - if (!statusValid(self._xhr) || self._destroyed) - return + // 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 (!self._response) - self._connect() + if (end === undefined || end > this.length) { + end = this.length + } - self._response._onXHRProgress() -} + if (end <= 0) { + return '' + } -ClientRequest.prototype._connect = function () { - var self = this + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 - if (self._destroyed) - return + if (end <= start) { + return '' + } - self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer) - self._response.on('error', function(err) { - self.emit('error', err) - }) + if (!encoding) encoding = 'utf8' - self.emit('response', self._response) -} + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) -ClientRequest.prototype._write = function (chunk, encoding, cb) { - var self = this + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) - self._body.push(chunk) - cb() -} + case 'ascii': + return asciiSlice(this, start, end) -ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () { - var self = this - self._destroyed = true - global.clearTimeout(self._fetchTimer) - if (self._response) - self._response._destroyed = true - if (self._xhr) - self._xhr.abort() - else if (self._fetchAbortController) - self._fetchAbortController.abort() -} + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) -ClientRequest.prototype.end = function (data, encoding, cb) { - var self = this - if (typeof data === 'function') { - cb = data - data = undefined - } + case 'base64': + return base64Slice(this, start, end) - stream.Writable.prototype.end.call(self, data, encoding, cb) + 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 + } + } } -ClientRequest.prototype.flushHeaders = function () {} -ClientRequest.prototype.setTimeout = function () {} -ClientRequest.prototype.setNoDelay = function () {} -ClientRequest.prototype.setSocketKeepAlive = function () {} +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true -// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method -var unsafeHeaders = [ - 'accept-charset', - 'accept-encoding', - 'access-control-request-headers', - 'access-control-request-method', - 'connection', - 'content-length', - 'cookie', - 'cookie2', - 'date', - 'dnt', - 'expect', - 'host', - 'keep-alive', - 'origin', - 'referer', - 'te', - 'trailer', - 'transfer-encoding', - 'upgrade', - 'via' -] +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":178,"./response":180,"_process":451,"buffer":196,"inherits":405,"readable-stream":195}],180:[function(require,module,exports){ -(function (process,global,Buffer){ -var capability = require('./capability') -var inherits = require('inherits') -var stream = require('readable-stream') +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 +} -var rStates = exports.readyStates = { - UNSENT: 0, - OPENED: 1, - HEADERS_RECEIVED: 2, - LOADING: 3, - DONE: 4 +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 } -var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) { - var self = this - stream.Readable.call(self) +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 +} - self._mode = mode - self.headers = {} - self.rawHeaders = [] - self.trailers = {} - self.rawTrailers = [] +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) +} - // Fake the 'close' event, but only once 'end' fires - self.on('end', function () { - // The nextTick is necessary to prevent the 'request' module from causing an infinite loop - process.nextTick(function () { - self.emit('close') - }) - }) +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 +} - if (mode === 'fetch') { - self._fetchResponse = response +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 '' +} - self.url = response.url - self.statusCode = response.status - self.statusMessage = response.statusText - - response.headers.forEach(function (header, key){ - self.headers[key.toLowerCase()] = header - self.rawHeaders.push(key, header) - }) +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } - if (capability.writableStream) { - var writable = new WritableStream({ - write: function (chunk) { - return new Promise(function (resolve, reject) { - if (self._destroyed) { - reject() - } else if(self.push(Buffer.from(chunk))) { - resolve() - } else { - self._resumeFetch = resolve - } - }) - }, - close: function () { - global.clearTimeout(fetchTimer) - if (!self._destroyed) - self.push(null) - }, - abort: function (err) { - if (!self._destroyed) - self.emit('error', err) - } - }) + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } - try { - response.body.pipeTo(writable).catch(function (err) { - global.clearTimeout(fetchTimer) - if (!self._destroyed) - self.emit('error', err) - }) - return - } catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this - } - // fallback for when writableStream or pipeTo aren't available - var reader = response.body.getReader() - function read () { - reader.read().then(function (result) { - if (self._destroyed) - return - if (result.done) { - global.clearTimeout(fetchTimer) - self.push(null) - return - } - self.push(Buffer.from(result.value)) - read() - }).catch(function (err) { - global.clearTimeout(fetchTimer) - if (!self._destroyed) - self.emit('error', err) - }) - } - read() - } else { - self._xhr = xhr - self._pos = 0 + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } - self.url = xhr.responseURL - self.statusCode = xhr.status - self.statusMessage = xhr.statusText - var headers = xhr.getAllResponseHeaders().split(/\r?\n/) - headers.forEach(function (header) { - var matches = header.match(/^([^:]+):\s*(.*)/) - if (matches) { - var key = matches[1].toLowerCase() - if (key === 'set-cookie') { - if (self.headers[key] === undefined) { - self.headers[key] = [] - } - self.headers[key].push(matches[2]) - } else if (self.headers[key] !== undefined) { - self.headers[key] += ', ' + matches[2] - } else { - self.headers[key] = matches[2] - } - self.rawHeaders.push(matches[1], matches[2]) - } - }) + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } - self._charset = 'x-user-defined' - if (!capability.overrideMimeType) { - var mimeType = self.rawHeaders['mime-type'] - if (mimeType) { - var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/) - if (charsetMatch) { - self._charset = charsetMatch[1].toLowerCase() - } - } - if (!self._charset) - self._charset = 'utf-8' // best guess - } - } -} + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 -inherits(IncomingMessage, stream.Readable) + if (this === target) return 0 -IncomingMessage.prototype._read = function () { - var self = this + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) - var resolve = self._resumeFetch - if (resolve) { - self._resumeFetch = null - resolve() - } -} + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) -IncomingMessage.prototype._onXHRProgress = function () { - var self = this + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } - var xhr = self._xhr + if (x < y) return -1 + if (y < x) return 1 + return 0 +} - var response = null - switch (self._mode) { - case 'text': - response = xhr.responseText - if (response.length > self._pos) { - var newData = response.substr(self._pos) - if (self._charset === 'x-user-defined') { - var buffer = Buffer.alloc(newData.length) - for (var i = 0; i < newData.length; i++) - buffer[i] = newData.charCodeAt(i) & 0xff +// 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 - self.push(buffer) - } else { - self.push(newData, self._charset) - } - self._pos = response.length - } - break - case 'arraybuffer': - if (xhr.readyState !== rStates.DONE || !xhr.response) - break - response = xhr.response - self.push(Buffer.from(new Uint8Array(response))) - break - case 'moz-chunked-arraybuffer': // take whole - response = xhr.response - if (xhr.readyState !== rStates.LOADING || !response) - break - self.push(Buffer.from(new Uint8Array(response))) - break - case 'ms-stream': - response = xhr.response - if (xhr.readyState !== rStates.LOADING) - break - var reader = new global.MSStreamReader() - reader.onprogress = function () { - if (reader.result.byteLength > self._pos) { - self.push(Buffer.from(new Uint8Array(reader.result.slice(self._pos)))) - self._pos = reader.result.byteLength - } - } - reader.onload = function () { - self.push(null) - } - // reader.onerror = ??? // TODO: this - reader.readAsArrayBuffer(response) - break - } + // 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) + } - // The ms-stream case handles end separately in reader.onload() - if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') { - self.push(null) - } -} + // 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 + } -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":178,"_process":451,"buffer":196,"inherits":405,"readable-stream":195}],181:[function(require,module,exports){ -'use strict'; + // 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) + } -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } + throw new TypeError('val must be string, number or Buffer') +} -var codes = {}; +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; + 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 getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; + function read (buf, i) { + if (indexSize === 1) { + return buf[i] } else { - return message(arg1, arg2, arg3); + return buf.readUInt16BE(i * indexSize) } } - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; + 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 NodeError; - }(Base); + return -1 +} - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js +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) +} -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining } else { - return "of ".concat(thing, " ").concat(String(expected)); + length = Number(length) + if (length > remaining) { + length = remaining + } } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; + 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 +} - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes +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 includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) } -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); +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 { - determiner = 'must be'; + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) } - var msg; + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } -},{}],182:[function(require,module,exports){ -(function (process){ -// 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 objectKeys = Object.keys || function (obj) { - var keys = []; + if (!encoding) encoding = 'utf8' - for (var key in obj) { - keys.push(key); - } + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) - return keys; -}; -/**/ + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + case 'ascii': + return asciiWrite(this, string, offset, length) -module.exports = Duplex; + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) -var Readable = require('./_stream_readable'); + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) -var Writable = require('./_stream_writable'); + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) -require('inherits')(Duplex, Readable); + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) } } -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - Readable.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; + 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 (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); + 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) } -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; - } -}); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // 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 && this._writableState.getBuffer(); +// 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() } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // 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.length; + + // 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) + ) } -}); // the no-half-open enforcer + return res +} -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) - process.nextTick(onEndNT, this); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret } -function onEndNT(self) { - self.end(); +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 } -Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } +function hexSlice (buf, start, end) { + var len = buf.length - 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 + 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 +} - this._readableState.destroyed = value; - this._writableState.destroyed = value; +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) } -}); -}).call(this,require('_process')) -},{"./_stream_readable":184,"./_stream_writable":186,"_process":451,"inherits":405}],183:[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'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -require('inherits')(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); + return res } -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; -},{"./_stream_transform":185,"inherits":405}],184:[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'; +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end -module.exports = Readable; -/**/ + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } -var Duplex; -/**/ + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } -Readable.ReadableState = ReadableState; -/**/ + if (end < start) end = start -var EE = require('events').EventEmitter; + 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] + } + } -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ + 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 Stream = require('./internal/streams/stream'); -/**/ + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + return val +} -var Buffer = require('buffer').Buffer; +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } -var OurUint8Array = global.Uint8Array || function () {}; + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); + return val } -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +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) +} -var debugUtil = require('util'); +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} -var debug; +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; + 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) -var BufferList = require('./internal/streams/buffer_list'); + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} -var destroyImpl = require('./internal/streams/destroy'); +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + return val +} -var StringDecoder; -var createReadableStreamAsyncIterator; -var from; +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) -require('inherits')(Readable, Stream); + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + if (val >= mul) val -= Math.pow(2, 8 * byteLength) -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. + return val +} - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +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) } -function ReadableState(options, stream, isDuplex) { - 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. +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 +} - if (typeof isDuplex !== 'boolean') 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 +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 +} - 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" +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // 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() + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} - 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. +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) - this.sync = true; // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} - this.autoDestroy = !!options.autoDestroy; // has it been destroyed +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} - 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. +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s +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') +} - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled +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) + } - 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; + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); // legacy + return offset + byteLength +} - this.readable = true; +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) + } - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF } - Stream.call(this); + return offset + byteLength } -Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - 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 - +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 +} - this._readableState.destroyed = value; +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 } -}); -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; - -Readable.prototype._destroy = function (err, cb) { - 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; +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 +} - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; +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 +} - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } +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 + } +} - skipChunkCheck = true; - } +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 { - skipChunkCheck = true; + objectWriteUInt32(this, value, offset, true) } + return offset + 4 +} - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; // Unshift should *always* be something directly out of read() +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) -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; + 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 + } - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); + return offset + byteLength +} - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } - 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; - maybeReadMore(stream, state); + 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 } - } // We can push more data if we are below the highWaterMark. - // 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. + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + return offset + byteLength +} - return !state.ended && (state.length < state.highWaterMark || state.length === 0); +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 } -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); +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 { - // 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); + objectWriteUInt16(this, value, offset, true) } - - maybeReadMore(stream, state); + return offset + 2 } -function chunkInvalid(state, chunk) { - var er; - - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); +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 +} - return er; +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 } -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; // backwards compatibility. +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') +} -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 +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 +} - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} - var p = this._readableState.buffer.head; - var content = ''; +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} - while (p !== null) { - content += decoder.write(p.data); - p = p.next; +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 +} - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; // Don't raise the hwm > 1GB +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) +} -var MAX_HWM = 0x40000000; - -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - 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. - +// 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 - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 - if (!state.ended) { - state.needReadable = true; - 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') - 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.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start } - 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. + var len = end - start + var i - if (!state.reading) n = howMuchToRead(nOrig, state); + 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 + ) } - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; + return len +} - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; +// 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 } - 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); + // 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 (ret !== null) this.emit('data', ret); - return ret; -}; + if (end <= start) { + return this + } -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 - if (state.decoder) { - var chunk = state.decoder.end(); + if (!val) val = 0 - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val } - } - - state.ended = true; - - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); + 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] } } -} // 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; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } + return this } -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - 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. +// HELPER FUNCTIONS +// ================ +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); +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 maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; - } +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} - 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. +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 = [] -Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); -}; + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; + // 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 + } - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; + // valid lead + leadSurrogate = codePoint - case 1: - state.pipes = [state.pipes, dest]; - break; + continue + } - default: - state.pipes.push(dest); - break; - } + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } - 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) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); + // 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) + } - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); + leadSurrogate = null - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } + // 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') } } - 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. + 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 +} - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break - function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } - 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. + return byteArray +} - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} - src.on('data', ondata); +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 ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} - if (ret === false) { - // 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', state.awaitDrain); - state.awaitDrain++; - } +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"base64-js":180,"buffer":183,"ieee754":451,"isarray":460}],184:[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" +} - src.pause(); - } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. +},{}],185:[function(require,module,exports){ +/*! + * copy-to - index.js + * Copyright(c) 2014 dead_horse + * MIT Licensed + */ +'use strict'; - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. +/** + * slice() reference. + */ +var slice = Array.prototype.slice; - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. +/** + * Expose copy + * + * ``` + * copy({foo: 'nar', hello: 'copy'}).to({hello: 'world'}); + * copy({foo: 'nar', hello: 'copy'}).toCover({hello: 'world'}); + * ``` + * + * @param {Object} src + * @return {Copy} + */ - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } +module.exports = Copy; - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } +/** + * Copy + * @param {Object} src + * @param {Boolean} withAccess + */ - dest.once('finish', onfinish); +function Copy(src, withAccess) { + if (!(this instanceof Copy)) return new Copy(src, withAccess); + this.src = src; + this._withAccess = withAccess; +} - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } // tell the dest that it's being piped to +/** + * copy properties include getter and setter + * @param {[type]} val [description] + * @return {[type]} [description] + */ +Copy.prototype.withAccess = function (w) { + this._withAccess = w !== false; + return this; +}; - dest.emit('pipe', src); // start the flow if it hasn't been started already. +/** + * pick keys in src + * + * @api: public + */ - if (!state.flowing) { - debug('pipe resume'); - src.resume(); +Copy.prototype.pick = function(keys) { + if (!Array.isArray(keys)) { + keys = slice.call(arguments); } - - return dest; + if (keys.length) { + this.keys = keys; + } + return this; }; -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - 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. +/** + * copy src to target, + * do not cover any property target has + * @param {Object} to + * + * @api: public + */ +Copy.prototype.to = function(to) { + to = to || {}; - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; + if (!this.src) return to; + var keys = this.keys || Object.keys(this.src); - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); + 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; + } - 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 + 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; +}; -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; +/** + * copy src to target, + * override any property target has + * @param {Object} to + * + * @api: public + */ - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused +Copy.prototype.toCover = function(to) { + var keys = this.keys || Object.keys(this.src); - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); + 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 (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } + if (!getter && !setter) { + to[key] = this.src[key]; } } - - return res; }; -Readable.prototype.addListener = Readable.prototype.on; +Copy.prototype.override = Copy.prototype.toCover; -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); +/** + * append another object to src + * @param {Obj} obj + * @return {Copy} + */ - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } +Copy.prototype.and = function (obj) { + var src = {}; + this.to(src); + this.src = obj; + this.to(src); + this.src = src; - return res; + return this; }; -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); +/** + * check obj[key] if not defiend + * @param {Object} obj + * @param {String} key + * @return {Boolean} + */ - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } +function notDefined(obj, key) { + return obj[key] === undefined + && obj.__lookupGetter__(key) === undefined + && obj.__lookupSetter__(key) === undefined; +} - return res; -}; +},{}],186:[function(require,module,exports){ +var isCallable = require('../internals/is-callable'); +var tryToString = require('../internals/try-to-string'); -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; +var $TypeError = TypeError; - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} +// `Assert: IsCallable(argument) is true` +module.exports = function (argument) { + if (isCallable(argument)) return argument; + throw $TypeError(tryToString(argument) + ' is not a function'); +}; -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. +},{"../internals/is-callable":275,"../internals/try-to-string":358}],187:[function(require,module,exports){ +var isConstructor = require('../internals/is-constructor'); +var tryToString = require('../internals/try-to-string'); +var $TypeError = TypeError; -Readable.prototype.resume = function () { - var state = this._readableState; +// `Assert: IsConstructor(argument) is true` +module.exports = function (argument) { + if (isConstructor(argument)) return argument; + throw $TypeError(tryToString(argument) + ' is not a constructor'); +}; - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() +},{"../internals/is-constructor":276,"../internals/try-to-string":358}],188:[function(require,module,exports){ +var isCallable = require('../internals/is-callable'); - state.flowing = !state.readableListening; - resume(this, state); - } +var $String = String; +var $TypeError = TypeError; - state.paused = false; - return this; +module.exports = function (argument) { + if (typeof argument == 'object' || isCallable(argument)) return argument; + throw $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - debug('resume', state.reading); +},{"../internals/is-callable":275}],189:[function(require,module,exports){ +var wellKnownSymbol = require('../internals/well-known-symbol'); +var create = require('../internals/object-create'); +var defineProperty = require('../internals/object-define-property').f; - if (!state.reading) { - stream.read(0); - } +var UNSCOPABLES = wellKnownSymbol('unscopables'); +var ArrayPrototype = Array.prototype; - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); +// Array.prototype[@@unscopables] +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +if (ArrayPrototype[UNSCOPABLES] == undefined) { + defineProperty(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null) + }); } -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); +// add a key to Array.prototype[@@unscopables] +module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; +}; - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } +},{"../internals/object-create":297,"../internals/object-define-property":299,"../internals/well-known-symbol":371}],190:[function(require,module,exports){ +'use strict'; +var charAt = require('../internals/string-multibyte').charAt; - this._readableState.paused = true; - return this; +// `AdvanceStringIndex` abstract operation +// https://tc39.es/ecma262/#sec-advancestringindex +module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); }; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); +},{"../internals/string-multibyte":337}],191:[function(require,module,exports){ +var isPrototypeOf = require('../internals/object-is-prototype-of'); - 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. +var $TypeError = TypeError; +module.exports = function (it, Prototype) { + if (isPrototypeOf(Prototype, it)) return it; + throw $TypeError('Incorrect invocation'); +}; -Readable.prototype.wrap = function (stream) { - var _this = this; +},{"../internals/object-is-prototype-of":305}],192:[function(require,module,exports){ +var isObject = require('../internals/is-object'); - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); +var $String = String; +var $TypeError = TypeError; - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } +// `Assert: Type(argument) is Object` +module.exports = function (argument) { + if (isObject(argument)) return argument; + throw $TypeError($String(argument) + ' is not an object'); +}; - _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 +},{"../internals/is-object":280}],193:[function(require,module,exports){ +// eslint-disable-next-line es/no-typed-arrays -- safe +module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; +},{}],194:[function(require,module,exports){ +'use strict'; +var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection'); +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var hasOwn = require('../internals/has-own-property'); +var classof = require('../internals/classof'); +var tryToString = require('../internals/try-to-string'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIn = require('../internals/define-built-in'); +var defineProperty = require('../internals/object-define-property').f; +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var uid = require('../internals/uid'); +var InternalStateModule = require('../internals/internal-state'); - var ret = _this.push(chunk); +var enforceInternalState = InternalStateModule.enforce; +var getInternalState = InternalStateModule.get; +var Int8Array = global.Int8Array; +var Int8ArrayPrototype = Int8Array && Int8Array.prototype; +var Uint8ClampedArray = global.Uint8ClampedArray; +var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; +var TypedArray = Int8Array && getPrototypeOf(Int8Array); +var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); +var ObjectPrototype = Object.prototype; +var TypeError = global.TypeError; - if (!ret) { - paused = true; - stream.pause(); - } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); +var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; +// Fixing native typed arrays in Opera Presto crashes the browser, see #595 +var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; +var TYPED_ARRAY_TAG_REQUIRED = false; +var NAME, Constructor, Prototype; - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } // proxy certain important events. +var TypedArrayConstructorsList = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8 +}; +var BigIntArrayConstructorsList = { + BigInt64Array: 8, + BigUint64Array: 8 +}; - 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. +var isView = function isView(it) { + if (!isObject(it)) return false; + var klass = classof(it); + return klass === 'DataView' + || hasOwn(TypedArrayConstructorsList, klass) + || hasOwn(BigIntArrayConstructorsList, klass); +}; +var getTypedArrayConstructor = function (it) { + var proto = getPrototypeOf(it); + if (!isObject(proto)) return; + var state = getInternalState(proto); + return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto); +}; - this._read = function (n) { - debug('wrapped _read', n); +var isTypedArray = function (it) { + if (!isObject(it)) return false; + var klass = classof(it); + return hasOwn(TypedArrayConstructorsList, klass) + || hasOwn(BigIntArrayConstructorsList, klass); +}; - if (paused) { - paused = false; - stream.resume(); - } - }; +var aTypedArray = function (it) { + if (isTypedArray(it)) return it; + throw TypeError('Target is not a typed array'); +}; - return this; +var aTypedArrayConstructor = function (C) { + if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C; + throw TypeError(tryToString(C) + ' is not a typed array constructor'); }; -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); +var exportTypedArrayMethod = function (KEY, property, forced, options) { + if (!DESCRIPTORS) return; + if (forced) for (var ARRAY in TypedArrayConstructorsList) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try { + delete TypedArrayConstructor.prototype[KEY]; + } catch (error) { + // old WebKit bug - some methods are non-configurable + try { + TypedArrayConstructor.prototype[KEY] = property; + } catch (error2) { /* empty */ } } - - return createReadableStreamAsyncIterator(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; } -}); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // 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 && this._readableState.buffer; + if (!TypedArrayPrototype[KEY] || forced) { + defineBuiltIn(TypedArrayPrototype, KEY, forced ? property + : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options); } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // 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.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; +}; + +var exportTypedArrayStaticMethod = function (KEY, property, forced) { + var ARRAY, TypedArrayConstructor; + if (!DESCRIPTORS) return; + if (setPrototypeOf) { + if (forced) for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try { + delete TypedArrayConstructor[KEY]; + } catch (error) { /* empty */ } + } + if (!TypedArray[KEY] || forced) { + // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable + try { + return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property); + } catch (error) { /* empty */ } + } else return; + } + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { + defineBuiltIn(TypedArrayConstructor, KEY, property); } } -}); // exposed for testing purposes only. +}; -Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // 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.length; +for (NAME in TypedArrayConstructorsList) { + Constructor = global[NAME]; + Prototype = Constructor && Constructor.prototype; + if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; + else NATIVE_ARRAY_BUFFER_VIEWS = false; +} + +for (NAME in BigIntArrayConstructorsList) { + Constructor = global[NAME]; + Prototype = Constructor && Constructor.prototype; + if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; +} + +// WebKit bug - typed arrays constructors prototype is Object.prototype +if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) { + // eslint-disable-next-line no-shadow -- safe + TypedArray = function TypedArray() { + throw TypeError('Incorrect invocation'); + }; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); } -}); // 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.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); +if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { + TypedArrayPrototype = TypedArray.prototype; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); } - return ret; } -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); +// WebKit bug - one more object in Uint8ClampedArray prototype chain +if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { + setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); +} - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); +if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { + TYPED_ARRAY_TAG_REQUIRED = true; + defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + } }); + for (NAME in TypedArrayConstructorsList) if (global[NAME]) { + createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); } } -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. +module.exports = { + NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, + aTypedArray: aTypedArray, + aTypedArrayConstructor: aTypedArrayConstructor, + exportTypedArrayMethod: exportTypedArrayMethod, + exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, + getTypedArrayConstructor: getTypedArrayConstructor, + isView: isView, + isTypedArray: isTypedArray, + TypedArray: TypedArray, + TypedArrayPrototype: TypedArrayPrototype +}; - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); +},{"../internals/array-buffer-basic-detection":193,"../internals/classof":216,"../internals/create-non-enumerable-property":221,"../internals/define-built-in":224,"../internals/descriptors":228,"../internals/global":261,"../internals/has-own-property":262,"../internals/internal-state":271,"../internals/is-callable":275,"../internals/is-object":280,"../internals/object-define-property":299,"../internals/object-get-prototype-of":304,"../internals/object-is-prototype-of":305,"../internals/object-set-prototype-of":309,"../internals/try-to-string":358,"../internals/uid":364,"../internals/well-known-symbol":371}],195:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var DESCRIPTORS = require('../internals/descriptors'); +var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection'); +var FunctionName = require('../internals/function-name'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIns = require('../internals/define-built-ins'); +var fails = require('../internals/fails'); +var anInstance = require('../internals/an-instance'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toLength = require('../internals/to-length'); +var toIndex = require('../internals/to-index'); +var IEEE754 = require('../internals/ieee754'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var defineProperty = require('../internals/object-define-property').f; +var arrayFill = require('../internals/array-fill'); +var arraySlice = require('../internals/array-slice-simple'); +var setToStringTag = require('../internals/set-to-string-tag'); +var InternalStateModule = require('../internals/internal-state'); - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; +var PROPER_FUNCTION_NAME = FunctionName.PROPER; +var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length'; +var WRONG_INDEX = 'Wrong index'; +var NativeArrayBuffer = global[ARRAY_BUFFER]; +var $ArrayBuffer = NativeArrayBuffer; +var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; +var $DataView = global[DATA_VIEW]; +var DataViewPrototype = $DataView && $DataView[PROTOTYPE]; +var ObjectPrototype = Object.prototype; +var Array = global.Array; +var RangeError = global.RangeError; +var fill = uncurryThis(arrayFill); +var reverse = uncurryThis([].reverse); - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} +var packIEEE754 = IEEE754.pack; +var unpackIEEE754 = IEEE754.unpack; -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } +var packInt8 = function (number) { + return [number & 0xFF]; +}; - return from(Readable, iterable, opts); - }; -} +var packInt16 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF]; +}; -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } +var packInt32 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; +}; - return -1; -} -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":181,"./_stream_duplex":182,"./internal/streams/async_iterator":187,"./internal/streams/buffer_list":188,"./internal/streams/destroy":189,"./internal/streams/from":191,"./internal/streams/state":193,"./internal/streams/stream":194,"_process":451,"buffer":196,"events":395,"inherits":405,"string_decoder/":437,"util":176}],185:[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'; - -module.exports = Transform; +var unpackInt32 = function (buffer) { + return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; +}; -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; +var packFloat32 = function (number) { + return packIEEE754(number, 23, 4); +}; -var Duplex = require('./_stream_duplex'); +var packFloat64 = function (number) { + return packIEEE754(number, 52, 8); +}; -require('inherits')(Transform, Duplex); +var addGetter = function (Constructor, key) { + defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } }); +}; -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; +var get = function (view, count, index, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = arraySlice(bytes, start, start + count); + return isLittleEndian ? pack : reverse(pack); +}; - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } +var set = function (view, count, index, conversion, value, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = conversion(+value); + for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; +}; - 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 (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, ArrayBufferPrototype); + var byteLength = toIndex(length); + setInternalState(this, { + bytes: fill(Array(byteLength), 0), + byteLength: byteLength + }); + if (!DESCRIPTORS) this.byteLength = byteLength; + }; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} + ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE]; -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. + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, DataViewPrototype); + anInstance(buffer, ArrayBufferPrototype); + var bufferLength = getInternalState(buffer).byteLength; + var offset = toIntegerOrInfinity(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + setInternalState(this, { + buffer: buffer, + byteLength: byteLength, + byteOffset: offset + }); + if (!DESCRIPTORS) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; - 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. + DataViewPrototype = $DataView[PROTOTYPE]; - this._readableState.sync = false; + if (DESCRIPTORS) { + addGetter($ArrayBuffer, 'byteLength'); + addGetter($DataView, 'buffer'); + addGetter($DataView, 'byteLength'); + addGetter($DataView, 'byteOffset'); + } - 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. + defineBuiltIns(DataViewPrototype, { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); + } + }); +} else { + var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER; + /* eslint-disable no-new -- required for testing */ + if (!fails(function () { + NativeArrayBuffer(1); + }) || !fails(function () { + new NativeArrayBuffer(-1); + }) || fails(function () { + new NativeArrayBuffer(); + new NativeArrayBuffer(1.5); + new NativeArrayBuffer(NaN); + return NativeArrayBuffer.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; + })) { + /* eslint-enable no-new -- required for testing */ + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, ArrayBufferPrototype); + return new NativeArrayBuffer(toIndex(length)); + }; + $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype; - this.on('prefinish', prefinish); -} + for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) { + createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); + } + } -function prefinish() { - var _this = this; + ArrayBufferPrototype.constructor = $ArrayBuffer; + } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { + createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER); + } - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); + // WebKit bug - the same parent prototype for typed arrays and data view + if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) { + setPrototypeOf(DataViewPrototype, ObjectPrototype); } -} -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. + // iOS Safari 7.x bug + var testView = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = uncurryThis(DataViewPrototype.setInt8); + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, { + setInt8: function setInt8(byteOffset, value) { + $setInt8(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8(this, byteOffset, value << 24 >> 24); + } + }, { unsafe: true }); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); -Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); +module.exports = { + ArrayBuffer: $ArrayBuffer, + DataView: $DataView }; -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; +},{"../internals/an-instance":191,"../internals/array-buffer-basic-detection":193,"../internals/array-fill":197,"../internals/array-slice-simple":208,"../internals/create-non-enumerable-property":221,"../internals/define-built-ins":225,"../internals/descriptors":228,"../internals/fails":247,"../internals/function-name":254,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/ieee754":267,"../internals/internal-state":271,"../internals/object-define-property":299,"../internals/object-get-own-property-names":302,"../internals/object-get-prototype-of":304,"../internals/object-set-prototype-of":309,"../internals/set-to-string-tag":332,"../internals/to-index":347,"../internals/to-integer-or-infinity":349,"../internals/to-length":350}],196:[function(require,module,exports){ +'use strict'; +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var deletePropertyOrThrow = require('../internals/delete-property-or-throw'); - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; +var min = Math.min; - 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; +// `Array.prototype.copyWithin` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.copywithin +// eslint-disable-next-line es/no-array-prototype-copywithin -- safe +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = lengthOfArrayLike(O); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else deletePropertyOrThrow(O, to); + to += inc; + from += inc; + } return O; }; -Transform.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; - -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); // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} -},{"../errors":181,"./_stream_duplex":182,"inherits":405}],186:[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. +},{"../internals/delete-property-or-throw":227,"../internals/length-of-array-like":290,"../internals/to-absolute-index":345,"../internals/to-object":351}],197:[function(require,module,exports){ 'use strict'; +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); -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 - +// `Array.prototype.fill` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.fill +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = lengthOfArrayLike(O); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; -function CorkedRequest(state) { - var _this = this; +},{"../internals/length-of-array-like":290,"../internals/to-absolute-index":345,"../internals/to-object":351}],198:[function(require,module,exports){ +'use strict'; +var $forEach = require('../internals/array-iteration').forEach; +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); - this.next = null; - this.entry = null; +var STRICT_METHOD = arrayMethodIsStrict('forEach'); - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ +// `Array.prototype.forEach` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.foreach +module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); +// eslint-disable-next-line es/no-array-prototype-foreach -- safe +} : [].forEach; -/**/ +},{"../internals/array-iteration":202,"../internals/array-method-is-strict":205}],199:[function(require,module,exports){ +var lengthOfArrayLike = require('../internals/length-of-array-like'); +module.exports = function (Constructor, list) { + var index = 0; + var length = lengthOfArrayLike(list); + var result = new Constructor(length); + while (length > index) result[index] = list[index++]; + return result; +}; -var Duplex; -/**/ +},{"../internals/length-of-array-like":290}],200:[function(require,module,exports){ +'use strict'; +var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var toObject = require('../internals/to-object'); +var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var isConstructor = require('../internals/is-constructor'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var createProperty = require('../internals/create-property'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); -Writable.WritableState = WritableState; -/**/ +var $Array = Array; -var internalUtil = { - deprecate: require('util-deprecate') +// `Array.from` method implementation +// https://tc39.es/ecma262/#sec-array.from +module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var IS_CONSTRUCTOR = isConstructor(this); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined); + var iteratorMethod = getIteratorMethod(O); + var index = 0; + var length, result, step, iterator, next, value; + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = getIterator(O, iteratorMethod); + next = iterator.next; + result = IS_CONSTRUCTOR ? new this() : []; + for (;!(step = call(next, iterator)).done; index++) { + value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; + createProperty(result, index, value); + } + } else { + length = lengthOfArrayLike(O); + result = IS_CONSTRUCTOR ? new this(length) : $Array(length); + for (;length > index; index++) { + value = mapping ? mapfn(O[index], index) : O[index]; + createProperty(result, index, value); + } + } + result.length = index; + return result; }; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ +},{"../internals/call-with-safe-iteration-closing":213,"../internals/create-property":223,"../internals/function-bind-context":250,"../internals/function-call":253,"../internals/get-iterator":258,"../internals/get-iterator-method":257,"../internals/is-array-iterator-method":272,"../internals/is-constructor":276,"../internals/length-of-array-like":290,"../internals/to-object":351}],201:[function(require,module,exports){ +var toIndexedObject = require('../internals/to-indexed-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +// `Array.prototype.{ indexOf, includes }` methods implementation +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = lengthOfArrayLike(O); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare -- NaN check + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare -- NaN check + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; -var Buffer = require('buffer').Buffer; +module.exports = { + // `Array.prototype.includes` method + // https://tc39.es/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; -var OurUint8Array = global.Uint8Array || function () {}; +},{"../internals/length-of-array-like":290,"../internals/to-absolute-index":345,"../internals/to-indexed-object":348}],202:[function(require,module,exports){ +var bind = require('../internals/function-bind-context'); +var uncurryThis = require('../internals/function-uncurry-this'); +var IndexedObject = require('../internals/indexed-object'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var arraySpeciesCreate = require('../internals/array-species-create'); -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} +var push = uncurryThis([].push); -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation +var createMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var IS_FILTER_REJECT = TYPE == 7; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var boundFunction = bind(callbackfn, that); + var length = lengthOfArrayLike(self); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; + var value, result; + for (;length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: return true; // some + case 5: return value; // find + case 6: return index; // findIndex + case 2: push(target, value); // filter + } else switch (TYPE) { + case 4: return false; // every + case 7: push(target, value); // filterReject + } + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; +}; -var destroyImpl = require('./internal/streams/destroy'); +module.exports = { + // `Array.prototype.forEach` method + // https://tc39.es/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.es/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.es/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.es/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.es/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.es/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.es/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6), + // `Array.prototype.filterReject` method + // https://github.com/tc39/proposal-array-filtering + filterReject: createMethod(7) +}; -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; +},{"../internals/array-species-create":212,"../internals/function-bind-context":250,"../internals/function-uncurry-this":255,"../internals/indexed-object":268,"../internals/length-of-array-like":290,"../internals/to-object":351}],203:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-array-prototype-lastindexof -- safe */ +var apply = require('../internals/function-apply'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; +var min = Math.min; +var $lastIndexOf = [].lastIndexOf; +var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; +var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); +var FORCED = NEGATIVE_ZERO || !STRICT_METHOD; -var errorOrDestroy = destroyImpl.errorOrDestroy; +// `Array.prototype.lastIndexOf` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.lastindexof +module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0; + var O = toIndexedObject(this); + var length = lengthOfArrayLike(O); + var index = length - 1; + if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; + return -1; +} : $lastIndexOf; -require('inherits')(Writable, Stream); +},{"../internals/array-method-is-strict":205,"../internals/function-apply":249,"../internals/length-of-array-like":290,"../internals/to-indexed-object":348,"../internals/to-integer-or-infinity":349}],204:[function(require,module,exports){ +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var V8_VERSION = require('../internals/engine-v8-version'); -function nop() {} +var SPECIES = wellKnownSymbol('species'); -function WritableState(options, stream, isDuplex) { - 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, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - - if (typeof isDuplex !== 'boolean') 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() +module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called +},{"../internals/engine-v8-version":243,"../internals/fails":247,"../internals/well-known-symbol":371}],205:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); - this.finalCalled = false; // drain event flag. +module.exports = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call -- required for testing + method.call(null, argument || function () { return 1; }, 1); + }); +}; - this.needDrain = false; // at the start of calling end() +},{"../internals/fails":247}],206:[function(require,module,exports){ +var aCallable = require('../internals/a-callable'); +var toObject = require('../internals/to-object'); +var IndexedObject = require('../internals/indexed-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); - this.ending = false; // when end() has been called, and returned +var $TypeError = TypeError; - this.ended = false; // when 'finish' is emitted +// `Array.prototype.{ reduce, reduceRight }` methods implementation +var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aCallable(callbackfn); + var O = toObject(that); + var self = IndexedObject(O); + var length = lengthOfArrayLike(O); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw $TypeError('Reduce of empty array with no initial value'); + } + } + for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; +}; - this.finished = false; // has it been destroyed +module.exports = { + // `Array.prototype.reduce` method + // https://tc39.es/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.es/ecma262/#sec-array.prototype.reduceright + right: createMethod(true) +}; - 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. +},{"../internals/a-callable":186,"../internals/indexed-object":268,"../internals/length-of-array-like":290,"../internals/to-object":351}],207:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var isArray = require('../internals/is-array'); - 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. +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - 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. +// Safari < 13 does not throw an error in this case +var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () { + // makes no sense without proper strict mode support + if (this !== undefined) return true; + try { + // eslint-disable-next-line es/no-object-defineproperty -- safe + Object.defineProperty([], 'length', { writable: false }).length = 1; + } catch (error) { + return error instanceof TypeError; + } +}(); - this.length = 0; // a flag to see when we're in the middle of a write. +module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { + if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) { + throw $TypeError('Cannot set read only .length'); + } return O.length = length; +} : function (O, length) { + return O.length = length; +}; - this.writing = false; // when true all writes will be buffered until .uncork() call +},{"../internals/descriptors":228,"../internals/is-array":273}],208:[function(require,module,exports){ +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var createProperty = require('../internals/create-property'); - 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. +var $Array = Array; +var max = Math.max; - 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. +module.exports = function (O, start, end) { + var length = lengthOfArrayLike(O); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + var result = $Array(max(fin - k, 0)); + for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]); + result.length = n; + return result; +}; - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) +},{"../internals/create-property":223,"../internals/length-of-array-like":290,"../internals/to-absolute-index":345}],209:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); - this.onwrite = function (er) { - onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) +module.exports = uncurryThis([].slice); +},{"../internals/function-uncurry-this":255}],210:[function(require,module,exports){ +var arraySlice = require('../internals/array-slice-simple'); - this.writecb = null; // the amount that is being written when _write is called. +var floor = Math.floor; - 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 +var mergeSort = function (array, comparefn) { + var length = array.length; + var middle = floor(length / 2); + return length < 8 ? insertionSort(array, comparefn) : merge( + array, + mergeSort(arraySlice(array, 0, middle), comparefn), + mergeSort(arraySlice(array, middle), comparefn), + comparefn + ); +}; - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams +var insertionSort = function (array, comparefn) { + var length = array.length; + var i = 1; + var element, j; - this.prefinished = false; // True if the error was already emitted and should not be thrown again + while (i < length) { + j = i; + element = array[i]; + while (j && comparefn(array[j - 1], element) > 0) { + array[j] = array[--j]; + } + if (j !== i++) array[j] = element; + } return array; +}; - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. +var merge = function (array, left, right, comparefn) { + var llength = left.length; + var rlength = right.length; + var lindex = 0; + var rindex = 0; - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') + while (lindex < llength || rindex < rlength) { + array[lindex + rindex] = (lindex < llength && rindex < rlength) + ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] + : lindex < llength ? left[lindex++] : right[rindex++]; + } return array; +}; - this.autoDestroy = !!options.autoDestroy; // count buffered requests +module.exports = mergeSort; - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two +},{"../internals/array-slice-simple":208}],211:[function(require,module,exports){ +var isArray = require('../internals/is-array'); +var isConstructor = require('../internals/is-constructor'); +var isObject = require('../internals/is-object'); +var wellKnownSymbol = require('../internals/well-known-symbol'); - this.corkedRequestsFree = new CorkedRequest(this); -} +var SPECIES = wellKnownSymbol('species'); +var $Array = Array; -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; +// a part of `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return C === undefined ? $Array : C; +}; - while (current) { - out.push(current); - current = current.next; - } +},{"../internals/is-array":273,"../internals/is-constructor":276,"../internals/is-object":280,"../internals/well-known-symbol":371}],212:[function(require,module,exports){ +var arraySpeciesConstructor = require('../internals/array-species-constructor'); - return out; +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; -(function () { +},{"../internals/array-species-constructor":211}],213:[function(require,module,exports){ +var anObject = require('../internals/an-object'); +var iteratorClose = require('../internals/iterator-close'); + +// call something on iterator step with safe closing on error +module.exports = function (iterator, fn, value, ENTRIES) { try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - 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. + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + } catch (error) { + iteratorClose(iterator, 'throw', error); + } +}; +},{"../internals/an-object":192,"../internals/iterator-close":285}],214:[function(require,module,exports){ +var wellKnownSymbol = require('../internals/well-known-symbol'); -var realHasInstance; +var ITERATOR = wellKnownSymbol('iterator'); +var SAFE_CLOSING = false; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - return object && object._writableState instanceof WritableState; +try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { done: !!called++ }; + }, + 'return': function () { + SAFE_CLOSING = true; } - }); -} 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. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. - - this.writable = true; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing + Array.from(iteratorWithReturn, function () { throw 2; }); +} catch (error) { /* empty */ } - 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; - } +module.exports = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR] = function () { + return { + next: function () { + return { done: ITERATION_SUPPORT = true }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ } + return ITERATION_SUPPORT; +}; - Stream.call(this); -} // Otherwise people can pipe Writable streams, which is just wrong. +},{"../internals/well-known-symbol":371}],215:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var toString = uncurryThis({}.toString); +var stringSlice = uncurryThis(''.slice); -Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); +module.exports = function (it) { + return stringSlice(toString(it), 8, -1); }; -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb +},{"../internals/function-uncurry-this":255}],216:[function(require,module,exports){ +var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); +var isCallable = require('../internals/is-callable'); +var classofRaw = require('../internals/classof-raw'); +var wellKnownSymbol = require('../internals/well-known-symbol'); - errorOrDestroy(stream, er); - process.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. +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var $Object = Object; +// ES3 wrong here +var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; -function validChunk(stream, state, chunk, cb) { - var er; +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ } +}; - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); - } +// getting tag from ES6+ `Object.prototype.toString` +module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result; +}; - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } +},{"../internals/classof-raw":215,"../internals/is-callable":275,"../internals/to-string-tag-support":356,"../internals/well-known-symbol":371}],217:[function(require,module,exports){ +var hasOwn = require('../internals/has-own-property'); +var ownKeys = require('../internals/own-keys'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var definePropertyModule = require('../internals/object-define-property'); - return true; -} +module.exports = function (target, source, exceptions) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { + defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } + } +}; -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; +},{"../internals/has-own-property":262,"../internals/object-define-property":299,"../internals/object-get-own-property-descriptor":300,"../internals/own-keys":313}],218:[function(require,module,exports){ +var wellKnownSymbol = require('../internals/well-known-symbol'); - var isBuf = !state.objectMode && _isUint8Array(chunk); +var MATCH = wellKnownSymbol('match'); - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } +module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + '/./'[METHOD_NAME](regexp); + } catch (error1) { + try { + regexp[MATCH] = false; + return '/./'[METHOD_NAME](regexp); + } catch (error2) { /* empty */ } + } return false; +}; - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } +},{"../internals/well-known-symbol":371}],219:[function(require,module,exports){ +var fails = require('../internals/fails'); - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; +module.exports = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + // eslint-disable-next-line es/no-object-getprototypeof -- required for testing + return Object.getPrototypeOf(new F()) !== F.prototype; +}); + +},{"../internals/fails":247}],220:[function(require,module,exports){ +// `CreateIterResultObject` abstract operation +// https://tc39.es/ecma262/#sec-createiterresultobject +module.exports = function (value, done) { + return { value: value, done: done }; }; -Writable.prototype.cork = function () { - this._writableState.corked++; +},{}],221:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var definePropertyModule = require('../internals/object-define-property'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; }; -Writable.prototype.uncork = function () { - var state = this._writableState; +},{"../internals/create-property-descriptor":222,"../internals/descriptors":228,"../internals/object-define-property":299}],222:[function(require,module,exports){ +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } +},{}],223:[function(require,module,exports){ +'use strict'; +var toPropertyKey = require('../internals/to-property-key'); +var definePropertyModule = require('../internals/object-define-property'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +module.exports = function (object, key, value) { + var propertyKey = toPropertyKey(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; }; -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 ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; +},{"../internals/create-property-descriptor":222,"../internals/object-define-property":299,"../internals/to-property-key":355}],224:[function(require,module,exports){ +var isCallable = require('../internals/is-callable'); +var definePropertyModule = require('../internals/object-define-property'); +var makeBuiltIn = require('../internals/make-built-in'); +var defineGlobalProperty = require('../internals/define-global-property'); + +module.exports = function (O, key, value, options) { + if (!options) options = {}; + var simple = options.enumerable; + var name = options.name !== undefined ? options.name : key; + if (isCallable(value)) makeBuiltIn(value, name, options); + if (options.global) { + if (simple) O[key] = value; + else defineGlobalProperty(key, value); + } else { + try { + if (!options.unsafe) delete O[key]; + else if (O[key]) simple = true; + } catch (error) { /* empty */ } + if (simple) O[key] = value; + else definePropertyModule.f(O, key, { + value: value, + enumerable: false, + configurable: !options.nonConfigurable, + writable: !options.nonWritable + }); + } return O; }; -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // 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 && this._writableState.getBuffer(); - } -}); +},{"../internals/define-global-property":226,"../internals/is-callable":275,"../internals/make-built-in":291,"../internals/object-define-property":299}],225:[function(require,module,exports){ +var defineBuiltIn = require('../internals/define-built-in'); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } +module.exports = function (target, src, options) { + for (var key in src) defineBuiltIn(target, key, src[key], options); + return target; +}; - return chunk; -} +},{"../internals/define-built-in":224}],226:[function(require,module,exports){ +var global = require('../internals/global'); -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. +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); +module.exports = function (key, value) { + try { + defineProperty(global, key, { value: value, configurable: true, writable: true }); + } catch (error) { + global[key] = value; + } return value; +}; - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } +},{"../internals/global":261}],227:[function(require,module,exports){ +'use strict'; +var tryToString = require('../internals/try-to-string'); - 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. +var $TypeError = TypeError; - if (!ret) state.needDrain = true; +module.exports = function (O, P) { + if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); +}; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; +},{"../internals/try-to-string":358}],228:[function(require,module,exports){ +var fails = require('../internals/fails'); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } +// Detect IE8's incomplete defineProperty implementation +module.exports = !fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; +}); - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } +},{"../internals/fails":247}],229:[function(require,module,exports){ +var documentAll = typeof document == 'object' && document.all; - return ret; -} +// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot +var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined; -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} +module.exports = { + all: documentAll, + IS_HTMLDDA: IS_HTMLDDA +}; -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; +},{}],230:[function(require,module,exports){ +var global = require('../internals/global'); +var isObject = require('../internals/is-object'); - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen - // after error +var document = global.document; +// typeof document.createElement is 'object' in old IE +var EXISTS = isObject(document) && isObject(document.createElement); - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); // this can emit finish, but finish must - // always follow error +module.exports = function (it) { + return EXISTS ? document.createElement(it) : {}; +}; - finishMaybe(stream, state); - } -} +},{"../internals/global":261,"../internals/is-object":280}],231:[function(require,module,exports){ +var $TypeError = TypeError; +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} +module.exports = function (it) { + if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); + return it; +}; -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); - 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) || stream.destroyed; +},{}],232:[function(require,module,exports){ +// iterable DOM collections +// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods +module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 +}; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } +},{}],233:[function(require,module,exports){ +// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` +var documentCreateElement = require('../internals/document-create-element'); - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} +var classList = documentCreateElement('span').classList; +var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; -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. +module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; +},{"../internals/document-create-element":230}],234:[function(require,module,exports){ +var userAgent = require('../internals/engine-user-agent'); -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 +var firefox = userAgent.match(/firefox\/(\d+)/i); +module.exports = !!firefox && +firefox[1]; -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +},{"../internals/engine-user-agent":242}],235:[function(require,module,exports){ +var IS_DENO = require('../internals/engine-is-deno'); +var IS_NODE = require('../internals/engine-is-node'); - 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; +module.exports = !IS_DENO && !IS_NODE + && typeof window == 'object' + && typeof document == 'object'; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } +},{"../internals/engine-is-deno":236,"../internals/engine-is-node":240}],236:[function(require,module,exports){ +/* global Deno -- Deno case */ +module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; - 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 +},{}],237:[function(require,module,exports){ +var UA = require('../internals/engine-user-agent'); - state.pendingcb++; - state.lastBufferedRequest = null; +module.exports = /MSIE|Trident/.test(UA); - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } +},{"../internals/engine-user-agent":242}],238:[function(require,module,exports){ +var userAgent = require('../internals/engine-user-agent'); +var global = require('../internals/global'); - 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. +module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined; - if (state.writing) { - break; - } - } +},{"../internals/engine-user-agent":242,"../internals/global":261}],239:[function(require,module,exports){ +var userAgent = require('../internals/engine-user-agent'); - if (entry === null) state.lastBufferedRequest = null; - } +module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); - state.bufferedRequest = entry; - state.bufferProcessing = false; -} +},{"../internals/engine-user-agent":242}],240:[function(require,module,exports){ +var classof = require('../internals/classof-raw'); +var global = require('../internals/global'); -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); -}; +module.exports = classof(global.process) == 'process'; -Writable.prototype._writev = null; +},{"../internals/classof-raw":215,"../internals/global":261}],241:[function(require,module,exports){ +var userAgent = require('../internals/engine-user-agent'); -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; +module.exports = /web0s(?!.*chrome)/i.test(userAgent); - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } +},{"../internals/engine-user-agent":242}],242:[function(require,module,exports){ +var getBuiltIn = require('../internals/get-built-in'); - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks +module.exports = getBuiltIn('navigator', 'userAgent') || ''; - if (state.corked) { - state.corked = 1; - this.uncork(); - } // ignore unnecessary end() calls. +},{"../internals/get-built-in":256}],243:[function(require,module,exports){ +var global = require('../internals/global'); +var userAgent = require('../internals/engine-user-agent'); +var process = global.process; +var Deno = global.Deno; +var versions = process && process.versions || Deno && Deno.version; +var v8 = versions && versions.v8; +var match, version; - if (!state.ending) endWritable(this, state, cb); - return this; -}; +if (v8) { + match = v8.split('.'); + // in old Chrome, versions of V8 isn't V8 = Chrome / 10 + // but their correct versions are not interesting for us + version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); +} -Object.defineProperty(Writable.prototype, 'writableLength', { - // 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.length; +// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` +// so check `userAgent` even if `.v8` exists, but 0 +if (!version && userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = +match[1]; } -}); - -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--; +module.exports = version; - if (err) { - errorOrDestroy(stream, err); - } +},{"../internals/engine-user-agent":242,"../internals/global":261}],244:[function(require,module,exports){ +var userAgent = require('../internals/engine-user-agent'); - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} +var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); +module.exports = !!webkit && +webkit[1]; + +},{"../internals/engine-user-agent":242}],245:[function(require,module,exports){ +// IE8- don't enum bug keys +module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' +]; + +},{}],246:[function(require,module,exports){ +var global = require('../internals/global'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIn = require('../internals/define-built-in'); +var defineGlobalProperty = require('../internals/define-global-property'); +var copyConstructorProperties = require('../internals/copy-constructor-properties'); +var isForced = require('../internals/is-forced'); + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.dontCallGetSet - prevent calling a getter on target + options.name - the .name of the function if it does not match the key +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || defineGlobalProperty(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.dontCallGetSet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty == typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } + defineBuiltIn(target, key, sourceProperty, options); } -} +}; -function finishMaybe(stream, state) { - var need = needFinish(state); +},{"../internals/copy-constructor-properties":217,"../internals/create-non-enumerable-property":221,"../internals/define-built-in":224,"../internals/define-global-property":226,"../internals/global":261,"../internals/is-forced":277,"../internals/object-get-own-property-descriptor":300}],247:[function(require,module,exports){ +module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } +}; - if (need) { - prefinish(stream, state); +},{}],248:[function(require,module,exports){ +'use strict'; +// TODO: Remove from `core-js@4` since it's moved to entry points +require('../modules/es.regexp.exec'); +var uncurryThis = require('../internals/function-uncurry-this'); +var defineBuiltIn = require('../internals/define-built-in'); +var regexpExec = require('../internals/regexp-exec'); +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); +var SPECIES = wellKnownSymbol('species'); +var RegExpPrototype = RegExp.prototype; - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; +module.exports = function (KEY, exec, FORCED, SHAM) { + var SYMBOL = wellKnownSymbol(KEY); - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + + if (KEY === 'split') { + // We can't use real regex here since it causes deoptimization + // and serious performance degradation in V8 + // https://github.com/zloirock/core-js/issues/306 + re = {}; + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; + re.flags = ''; + re[SYMBOL] = /./[SYMBOL]; } - } - return need; -} + re.exec = function () { execCalled = true; return null; }; -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); + re[SYMBOL](''); + return !execCalled; + }); - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + FORCED + ) { + var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]); + var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { + var uncurriedNativeMethod = uncurryThis(nativeMethod); + var $exec = regexp.exec; + if ($exec === regexpExec || $exec === RegExpPrototype.exec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; + } + return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) }; + } + return { done: false }; + }); + + defineBuiltIn(String.prototype, KEY, methods[0]); + defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]); } - state.ended = true; - stream.writable = false; -} + if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true); +}; -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; +},{"../internals/create-non-enumerable-property":221,"../internals/define-built-in":224,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/regexp-exec":323,"../internals/well-known-symbol":371,"../modules/es.regexp.exec":403}],249:[function(require,module,exports){ +var NATIVE_BIND = require('../internals/function-bind-native'); - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } // reuse the free corkReq. +var FunctionPrototype = Function.prototype; +var apply = FunctionPrototype.apply; +var call = FunctionPrototype.call; +// eslint-disable-next-line es/no-reflect -- safe +module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { + return call.apply(apply, arguments); +}); - state.corkedRequestsFree.next = corkReq; -} +},{"../internals/function-bind-native":251}],250:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var aCallable = require('../internals/a-callable'); +var NATIVE_BIND = require('../internals/function-bind-native'); -Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } +var bind = uncurryThis(uncurryThis.bind); - 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 +// optional / simple context binding +module.exports = function (fn, that) { + aCallable(fn); + return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; +},{"../internals/a-callable":186,"../internals/function-bind-native":251,"../internals/function-uncurry-this":255}],251:[function(require,module,exports){ +var fails = require('../internals/fails'); - this._writableState.destroyed = value; - } +module.exports = !fails(function () { + // eslint-disable-next-line es/no-function-prototype-bind -- safe + var test = (function () { /* empty */ }).bind(); + // eslint-disable-next-line no-prototype-builtins -- safe + return typeof test != 'function' || test.hasOwnProperty('prototype'); }); -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - cb(err); -}; -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":181,"./_stream_duplex":182,"./internal/streams/destroy":189,"./internal/streams/state":193,"./internal/streams/stream":194,"_process":451,"buffer":196,"inherits":405,"util-deprecate":439}],187:[function(require,module,exports){ -(function (process){ +},{"../internals/fails":247}],252:[function(require,module,exports){ 'use strict'; - -var _Object$setPrototypeO; - -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; } - -var finished = require('./end-of-stream'); - -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); - -function createIterResult(value, done) { - return { - value: value, - done: done +var uncurryThis = require('../internals/function-uncurry-this'); +var aCallable = require('../internals/a-callable'); +var isObject = require('../internals/is-object'); +var hasOwn = require('../internals/has-own-property'); +var arraySlice = require('../internals/array-slice'); +var NATIVE_BIND = require('../internals/function-bind-native'); + +var $Function = Function; +var concat = uncurryThis([].concat); +var join = uncurryThis([].join); +var factories = {}; + +var construct = function (C, argsLength, args) { + if (!hasOwn(factories, argsLength)) { + for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; + factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')'); + } return factories[argsLength](C, args); +}; + +// `Function.prototype.bind` method implementation +// https://tc39.es/ecma262/#sec-function.prototype.bind +module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) { + var F = aCallable(this); + var Prototype = F.prototype; + var partArgs = arraySlice(arguments, 1); + var boundFunction = function bound(/* args... */) { + var args = concat(partArgs, arraySlice(arguments)); + return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args); }; -} + if (isObject(Prototype)) boundFunction.prototype = Prototype; + return boundFunction; +}; -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; +},{"../internals/a-callable":186,"../internals/array-slice":209,"../internals/function-bind-native":251,"../internals/function-uncurry-this":255,"../internals/has-own-property":262,"../internals/is-object":280}],253:[function(require,module,exports){ +var NATIVE_BIND = require('../internals/function-bind-native'); - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' +var call = Function.prototype.call; - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} +module.exports = NATIVE_BIND ? call.bind(call) : function () { + return call.apply(call, arguments); +}; -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} +},{"../internals/function-bind-native":251}],254:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var hasOwn = require('../internals/has-own-property'); -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } +var FunctionPrototype = Function.prototype; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} +var EXISTS = hasOwn(FunctionPrototype, 'name'); +// additional protection from minified / mangled / dropped function names +var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; +var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, +module.exports = { + EXISTS: EXISTS, + PROPER: PROPER, + CONFIGURABLE: CONFIGURABLE +}; - next: function next() { - var _this = this; +},{"../internals/descriptors":228,"../internals/has-own-property":262}],255:[function(require,module,exports){ +var NATIVE_BIND = require('../internals/function-bind-native'); - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; +var FunctionPrototype = Function.prototype; +var bind = FunctionPrototype.bind; +var call = FunctionPrototype.call; +var uncurryThis = NATIVE_BIND && bind.bind(call, call); + +module.exports = NATIVE_BIND ? function (fn) { + return fn && uncurryThis(fn); +} : function (fn) { + return fn && function () { + return call.apply(fn, arguments); + }; +}; - if (error !== null) { - return Promise.reject(error); - } +},{"../internals/function-bind-native":251}],256:[function(require,module,exports){ +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } +var aFunction = function (argument) { + return isCallable(argument) ? argument : undefined; +}; - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time +module.exports = function (namespace, method) { + return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; +}; +},{"../internals/global":261,"../internals/is-callable":275}],257:[function(require,module,exports){ +var classof = require('../internals/classof'); +var getMethod = require('../internals/get-method'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var Iterators = require('../internals/iterators'); +var wellKnownSymbol = require('../internals/well-known-symbol'); - var lastPromise = this[kLastPromise]; - var promise; +var ITERATOR = wellKnownSymbol('iterator'); - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); +module.exports = function (it) { + if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) + || getMethod(it, '@@iterator') + || Iterators[classof(it)]; +}; - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } +},{"../internals/classof":216,"../internals/get-method":259,"../internals/is-null-or-undefined":279,"../internals/iterators":289,"../internals/well-known-symbol":371}],258:[function(require,module,exports){ +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var anObject = require('../internals/an-object'); +var tryToString = require('../internals/try-to-string'); +var getIteratorMethod = require('../internals/get-iterator-method'); - promise = new Promise(this[kHandlePromise]); - } +var $TypeError = TypeError; - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; +module.exports = function (argument, usingIterator) { + var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; + if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); + throw $TypeError(tryToString(argument) + ' is not iterable'); +}; - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } +},{"../internals/a-callable":186,"../internals/an-object":192,"../internals/function-call":253,"../internals/get-iterator-method":257,"../internals/try-to-string":358}],259:[function(require,module,exports){ +var aCallable = require('../internals/a-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); - -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } +// `GetMethod` abstract operation +// https://tc39.es/ecma262/#sec-getmethod +module.exports = function (V, P) { + var func = V[P]; + return isNullOrUndefined(func) ? undefined : aCallable(func); +}; - var resolve = iterator[kLastResolve]; +},{"../internals/a-callable":186,"../internals/is-null-or-undefined":279}],260:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var toObject = require('../internals/to-object'); - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); +var floor = Math.floor; +var charAt = uncurryThis(''.charAt); +var replace = uncurryThis(''.replace); +var stringSlice = uncurryThis(''.slice); +var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; + +// `GetSubstitution` abstract operation +// https://tc39.es/ecma262/#sec-getsubstitution +module.exports = function (matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return replace(replacement, symbols, function (match, ch) { + var capture; + switch (charAt(ch, 0)) { + case '$': return '$'; + case '&': return matched; + case '`': return stringSlice(str, 0, position); + case "'": return stringSlice(str, tailPos); + case '<': + capture = namedCaptures[stringSlice(ch, 1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1); + return match; + } + capture = captures[n - 1]; } - - iterator[kEnded] = true; + return capture === undefined ? '' : capture; }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; }; -module.exports = createReadableStreamAsyncIterator; -}).call(this,require('_process')) -},{"./end-of-stream":190,"_process":451}],188:[function(require,module,exports){ -'use strict'; +},{"../internals/function-uncurry-this":255,"../internals/to-object":351}],261:[function(require,module,exports){ +(function (global){(function (){ +var check = function (it) { + return it && it.Math == Math && it; +}; -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; } +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +module.exports = + // eslint-disable-next-line es/no-global-this -- safe + check(typeof globalThis == 'object' && globalThis) || + check(typeof window == 'object' && window) || + // eslint-disable-next-line no-restricted-globals -- safe + check(typeof self == 'object' && self) || + check(typeof global == 'object' && global) || + // eslint-disable-next-line no-new-func -- fallback + (function () { return this; })() || Function('return this')(); -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) { _defineProperty(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; } +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],262:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var toObject = require('../internals/to-object'); -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; } +var hasOwnProperty = uncurryThis({}.hasOwnProperty); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +// `HasOwnProperty` abstract operation +// https://tc39.es/ecma262/#sec-hasownproperty +// eslint-disable-next-line es/no-object-hasown -- safe +module.exports = Object.hasOwn || function hasOwn(it, key) { + return hasOwnProperty(toObject(it), key); +}; -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); } } +},{"../internals/function-uncurry-this":255,"../internals/to-object":351}],263:[function(require,module,exports){ +module.exports = {}; -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } +},{}],264:[function(require,module,exports){ +var global = require('../internals/global'); -var _require = require('buffer'), - Buffer = _require.Buffer; +module.exports = function (a, b) { + var console = global.console; + if (console && console.error) { + arguments.length == 1 ? console.error(a) : console.error(a, b); + } +}; -var _require2 = require('util'), - inspect = _require2.inspect; +},{"../internals/global":261}],265:[function(require,module,exports){ +var getBuiltIn = require('../internals/get-built-in'); -var custom = inspect && inspect.custom || 'inspect'; +module.exports = getBuiltIn('document', 'documentElement'); -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} +},{"../internals/get-built-in":256}],266:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); +var createElement = require('../internals/document-create-element'); -module.exports = -/*#__PURE__*/ -function () { - function BufferList() { - _classCallCheck(this, BufferList); +// Thanks to IE8 for its funny defineProperty +module.exports = !DESCRIPTORS && !fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a != 7; +}); - this.head = null; - this.tail = null; - this.length = 0; - } +},{"../internals/descriptors":228,"../internals/document-create-element":230,"../internals/fails":247}],267:[function(require,module,exports){ +// IEEE754 conversions based on https://github.com/feross/ieee754 +var $Array = Array; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; - _createClass(BufferList, [{ - key: "push", - value: 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; +var pack = function (number, mantissaLength, bytes) { + var buffer = $Array(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var index = 0; + var exponent, mantissa, c; + number = abs(number); + // eslint-disable-next-line no-self-compare -- NaN check + if (number != number || number === Infinity) { + // eslint-disable-next-line no-self-compare -- NaN check + mantissa = number != number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + c = pow(2, -exponent); + if (number * c < 1) { + exponent--; + c *= 2; } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; + if (exponent + eBias >= 1) { + number += rt / c; + } else { + number += rt * pow(2, 1 - eBias); } - }, { - key: "shift", - value: 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; + if (number * c >= 2) { + exponent++; + c /= 2; } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c - 1) * pow(2, mantissaLength); + exponent = exponent + eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; + } + while (mantissaLength >= 8) { + buffer[index++] = mantissa & 255; + mantissa /= 256; + mantissaLength -= 8; + } + exponent = exponent << mantissaLength | mantissa; + exponentLength += mantissaLength; + while (exponentLength > 0) { + buffer[index++] = exponent & 255; + exponent /= 256; + exponentLength -= 8; + } + buffer[--index] |= sign * 128; + return buffer; +}; - while (p = p.next) { - ret += s + p.data; - } +var unpack = function (buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + while (nBits > 0) { + exponent = exponent * 256 + buffer[index--]; + nBits -= 8; + } + mantissa = exponent & (1 << -nBits) - 1; + exponent >>= -nBits; + nBits += mantissaLength; + while (nBits > 0) { + mantissa = mantissa * 256 + buffer[index--]; + nBits -= 8; + } + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? -Infinity : Infinity; + } else { + mantissa = mantissa + pow(2, mantissaLength); + exponent = exponent - eBias; + } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); +}; - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; +module.exports = { + pack: pack, + unpack: unpack +}; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } +},{}],268:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var classof = require('../internals/classof-raw'); - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. +var $Object = Object; +var split = uncurryThis(''.split); - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } +// fallback for non-array-like ES3 and non-enumerable old V8 strings +module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins -- safe + return !$Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classof(it) == 'String' ? split(it, '') : $Object(it); +} : $Object; - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. +},{"../internals/classof-raw":215,"../internals/fails":247,"../internals/function-uncurry-this":255}],269:[function(require,module,exports){ +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); - }, { - key: "_getString", - value: function _getString(n) { - var p = this.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) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } +// makes subclassing work correct for wrapped built-ins +module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + isCallable(NewTarget = dummy.constructor) && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; +}; - break; - } +},{"../internals/is-callable":275,"../internals/is-object":280,"../internals/object-set-prototype-of":309}],270:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var isCallable = require('../internals/is-callable'); +var store = require('../internals/shared-store'); - ++c; - } +var functionToString = uncurryThis(Function.toString); - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. +// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper +if (!isCallable(store.inspectSource)) { + store.inspectSource = function (it) { + return functionToString(it); + }; +} - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.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) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } +module.exports = store.inspectSource; - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. +},{"../internals/function-uncurry-this":255,"../internals/is-callable":275,"../internals/shared-store":334}],271:[function(require,module,exports){ +var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var isObject = require('../internals/is-object'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var hasOwn = require('../internals/has-own-property'); +var shared = require('../internals/shared-store'); +var sharedKey = require('../internals/shared-key'); +var hiddenKeys = require('../internals/hidden-keys'); - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); +var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; +var TypeError = global.TypeError; +var WeakMap = global.WeakMap; +var set, get, has; - return BufferList; -}(); -},{"buffer":196,"util":176}],189:[function(require,module,exports){ -(function (process){ -'use strict'; // undocumented cb() API, needed for core, not for public API +var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); +}; -function destroy(err, cb) { - var _this = this; +var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; +}; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; +if (NATIVE_WEAK_MAP || shared.state) { + var store = shared.state || (shared.state = new WeakMap()); + var wmget = uncurryThis(store.get); + var wmhas = uncurryThis(store.has); + var wmset = uncurryThis(store.set); + set = function (it, metadata) { + if (wmhas(store, it)) throw TypeError(OBJECT_ALREADY_INITIALIZED); + metadata.facade = it; + wmset(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget(store, it) || {}; + }; + has = function (it) { + return wmhas(store, it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED); + metadata.facade = it; + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return hasOwn(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return hasOwn(it, STATE); + }; +} - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } +module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor +}; - 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 +},{"../internals/create-non-enumerable-property":221,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/has-own-property":262,"../internals/hidden-keys":263,"../internals/is-object":280,"../internals/shared-key":333,"../internals/shared-store":334,"../internals/weak-map-basic-detection":368}],272:[function(require,module,exports){ +var wellKnownSymbol = require('../internals/well-known-symbol'); +var Iterators = require('../internals/iterators'); +var ITERATOR = wellKnownSymbol('iterator'); +var ArrayPrototype = Array.prototype; - if (this._readableState) { - this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well +// check on default Array iterator +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); +}; +},{"../internals/iterators":289,"../internals/well-known-symbol":371}],273:[function(require,module,exports){ +var classof = require('../internals/classof-raw'); - if (this._writableState) { - this._writableState.destroyed = true; - } +// `IsArray` abstract operation +// https://tc39.es/ecma262/#sec-isarray +// eslint-disable-next-line es/no-array-isarray -- safe +module.exports = Array.isArray || function isArray(argument) { + return classof(argument) == 'Array'; +}; - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); +},{"../internals/classof-raw":215}],274:[function(require,module,exports){ +var classof = require('../internals/classof'); +var uncurryThis = require('../internals/function-uncurry-this'); - return this; -} +var slice = uncurryThis(''.slice); -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} +module.exports = function (it) { + return slice(classof(it), 0, 3) === 'Big'; +}; -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} +},{"../internals/classof":216,"../internals/function-uncurry-this":255}],275:[function(require,module,exports){ +var $documentAll = require('../internals/document-all'); -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } +var documentAll = $documentAll.all; - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} +// `IsCallable` abstract operation +// https://tc39.es/ecma262/#sec-iscallable +module.exports = $documentAll.IS_HTMLDDA ? function (argument) { + return typeof argument == 'function' || argument === documentAll; +} : function (argument) { + return typeof argument == 'function'; +}; -function emitErrorNT(self, err) { - self.emit('error', err); -} +},{"../internals/document-all":229}],276:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var classof = require('../internals/classof'); +var getBuiltIn = require('../internals/get-built-in'); +var inspectSource = require('../internals/inspect-source'); -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} +var noop = function () { /* empty */ }; +var empty = []; +var construct = getBuiltIn('Reflect', 'construct'); +var constructorRegExp = /^\s*(?:class|function)\b/; +var exec = uncurryThis(constructorRegExp.exec); +var INCORRECT_TO_STRING = !constructorRegExp.exec(noop); -module.exports = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy +var isConstructorModern = function isConstructor(argument) { + if (!isCallable(argument)) return false; + try { + construct(noop, empty, argument); + return true; + } catch (error) { + return false; + } }; -}).call(this,require('_process')) -},{"_process":451}],190:[function(require,module,exports){ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; +var isConstructorLegacy = function isConstructor(argument) { + if (!isCallable(argument)) return false; + switch (classof(argument)) { + case 'AsyncFunction': + case 'GeneratorFunction': + case 'AsyncGeneratorFunction': return false; + } + try { + // we can't check .prototype since constructors produced by .bind haven't it + // `Function#toString` throws on some built-it function in some legacy engines + // (for example, `DOMQuad` and similar in FF41-) + return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); + } catch (error) { + return true; + } +}; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; +isConstructorLegacy.sham = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } +// `IsConstructor` abstract operation +// https://tc39.es/ecma262/#sec-isconstructor +module.exports = !construct || fails(function () { + var called; + return isConstructorModern(isConstructorModern.call) + || !isConstructorModern(Object) + || !isConstructorModern(function () { called = true; }) + || called; +}) ? isConstructorLegacy : isConstructorModern; - callback.apply(this, args); - }; -} +},{"../internals/classof":216,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/get-built-in":256,"../internals/inspect-source":270,"../internals/is-callable":275}],277:[function(require,module,exports){ +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); -function noop() {} +var replacement = /#|\.prototype\./; -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} +var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL ? true + : value == NATIVE ? false + : isCallable(detection) ? fails(detection) + : !!detection; +}; -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; +var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); +}; - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; +var data = isForced.data = {}; +var NATIVE = isForced.NATIVE = 'N'; +var POLYFILL = isForced.POLYFILL = 'P'; - var writableEnded = stream._writableState && stream._writableState.finished; +module.exports = isForced; - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; +},{"../internals/fails":247,"../internals/is-callable":275}],278:[function(require,module,exports){ +var isObject = require('../internals/is-object'); - var readableEnded = stream._readableState && stream._readableState.endEmitted; +var floor = Math.floor; - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; +// `IsIntegralNumber` abstract operation +// https://tc39.es/ecma262/#sec-isintegralnumber +// eslint-disable-next-line es/no-number-isinteger -- safe +module.exports = Number.isInteger || function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; - var onerror = function onerror(err) { - callback.call(stream, err); - }; +},{"../internals/is-object":280}],279:[function(require,module,exports){ +// we can't use just `it == null` since of `document.all` special case +// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec +module.exports = function (it) { + return it === null || it === undefined; +}; - var onclose = function onclose() { - var err; +},{}],280:[function(require,module,exports){ +var isCallable = require('../internals/is-callable'); +var $documentAll = require('../internals/document-all'); - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } +var documentAll = $documentAll.all; - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; +module.exports = $documentAll.IS_HTMLDDA ? function (it) { + return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll; +} : function (it) { + return typeof it == 'object' ? it !== null : isCallable(it); +}; - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; +},{"../internals/document-all":229,"../internals/is-callable":275}],281:[function(require,module,exports){ +module.exports = false; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } +},{}],282:[function(require,module,exports){ +var isObject = require('../internals/is-object'); +var classof = require('../internals/classof-raw'); +var wellKnownSymbol = require('../internals/well-known-symbol'); - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} +var MATCH = wellKnownSymbol('match'); -module.exports = eos; -},{"../../../errors":181}],191:[function(require,module,exports){ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') +// `IsRegExp` abstract operation +// https://tc39.es/ecma262/#sec-isregexp +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); }; -},{}],192:[function(require,module,exports){ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; +},{"../internals/classof-raw":215,"../internals/is-object":280,"../internals/well-known-symbol":371}],283:[function(require,module,exports){ +var getBuiltIn = require('../internals/get-built-in'); +var isCallable = require('../internals/is-callable'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); -var eos; +var $Object = Object; -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} +module.exports = USE_SYMBOL_AS_UID ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + var $Symbol = getBuiltIn('Symbol'); + return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); +}; -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; +},{"../internals/get-built-in":256,"../internals/is-callable":275,"../internals/object-is-prototype-of":305,"../internals/use-symbol-as-uid":365}],284:[function(require,module,exports){ +var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var anObject = require('../internals/an-object'); +var tryToString = require('../internals/try-to-string'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var iteratorClose = require('../internals/iterator-close'); -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} +var $TypeError = TypeError; -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} +var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; +}; -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} +var ResultPrototype = Result.prototype; -function call(fn) { - fn(); -} +module.exports = function (iterable, unboundFunction, options) { + var that = options && options.that; + var AS_ENTRIES = !!(options && options.AS_ENTRIES); + var IS_RECORD = !!(options && options.IS_RECORD); + var IS_ITERATOR = !!(options && options.IS_ITERATOR); + var INTERRUPTED = !!(options && options.INTERRUPTED); + var fn = bind(unboundFunction, that); + var iterator, iterFn, index, length, result, next, step; -function pipe(from, to) { - return from.pipe(to); -} + var stop = function (condition) { + if (iterator) iteratorClose(iterator, 'normal', condition); + return new Result(true, condition); + }; -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} + var callFn = function (value) { + if (AS_ENTRIES) { + anObject(value); + return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); + } return INTERRUPTED ? fn(value, stop) : fn(value); + }; -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; + if (IS_RECORD) { + iterator = iterable.iterator; + } else if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable'); + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { + result = callFn(iterable[index]); + if (result && isPrototypeOf(ResultPrototype, result)) return result; + } return new Result(false); + } + iterator = getIterator(iterable, iterFn); } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; + next = IS_RECORD ? iterable.next : iterator.next; + while (!(step = call(next, iterator)).done) { + try { + result = callFn(step.value); + } catch (error) { + iteratorClose(iterator, 'throw', error); + } + if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; + } return new Result(false); +}; + +},{"../internals/an-object":192,"../internals/function-bind-context":250,"../internals/function-call":253,"../internals/get-iterator":258,"../internals/get-iterator-method":257,"../internals/is-array-iterator-method":272,"../internals/iterator-close":285,"../internals/length-of-array-like":290,"../internals/object-is-prototype-of":305,"../internals/try-to-string":358}],285:[function(require,module,exports){ +var call = require('../internals/function-call'); +var anObject = require('../internals/an-object'); +var getMethod = require('../internals/get-method'); - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); +module.exports = function (iterator, kind, value) { + var innerResult, innerError; + anObject(iterator); + try { + innerResult = getMethod(iterator, 'return'); + if (!innerResult) { + if (kind === 'throw') throw value; + return value; + } + innerResult = call(innerResult, iterator); + } catch (error) { + innerError = true; + innerResult = error; } + if (kind === 'throw') throw value; + if (innerError) throw innerResult; + anObject(innerResult); + return value; +}; - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} - -module.exports = pipeline; -},{"../../../errors":181,"./end-of-stream":190}],193:[function(require,module,exports){ +},{"../internals/an-object":192,"../internals/function-call":253,"../internals/get-method":259}],286:[function(require,module,exports){ 'use strict'; +var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; +var create = require('../internals/object-create'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var setToStringTag = require('../internals/set-to-string-tag'); +var Iterators = require('../internals/iterators'); -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; +var returnThis = function () { return this; }; -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} +module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; +}; -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); +},{"../internals/create-property-descriptor":222,"../internals/iterators":289,"../internals/iterators-core":288,"../internals/object-create":297,"../internals/set-to-string-tag":332}],287:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var IS_PURE = require('../internals/is-pure'); +var FunctionName = require('../internals/function-name'); +var isCallable = require('../internals/is-callable'); +var createIteratorConstructor = require('../internals/iterator-create-constructor'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var setToStringTag = require('../internals/set-to-string-tag'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIn = require('../internals/define-built-in'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var Iterators = require('../internals/iterators'); +var IteratorsCore = require('../internals/iterators-core'); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } +var PROPER_FUNCTION_NAME = FunctionName.PROPER; +var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; +var IteratorPrototype = IteratorsCore.IteratorPrototype; +var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; +var ITERATOR = wellKnownSymbol('iterator'); +var KEYS = 'keys'; +var VALUES = 'values'; +var ENTRIES = 'entries'; - return Math.floor(hwm); - } // Default value +var returnThis = function () { return this; }; +module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); - return state.objectMode ? 16 : 16 * 1024; -} + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; + switch (KIND) { + case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; + case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; + case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; + } return function () { return new IteratorConstructor(this); }; + }; -module.exports = { - getHighWaterMark: getHighWaterMark -}; -},{"../../../errors":181}],194:[function(require,module,exports){ -module.exports = require('events').EventEmitter; + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR] + || IterablePrototype['@@iterator'] + || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; -},{"events":395}],195:[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'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./lib/internal/streams/pipeline.js'); + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); + if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { + if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { + defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); + } + } + // Set @@toStringTag to native iterators + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } -},{"./lib/_stream_duplex.js":182,"./lib/_stream_passthrough.js":183,"./lib/_stream_readable.js":184,"./lib/_stream_transform.js":185,"./lib/_stream_writable.js":186,"./lib/internal/streams/end-of-stream.js":190,"./lib/internal/streams/pipeline.js":192}],196:[function(require,module,exports){ -(function (Buffer){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ + // fix Array.prototype.{ values, @@iterator }.name in V8 / FF + if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { + createNonEnumerableProperty(IterablePrototype, 'name', VALUES); + } else { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { return call(nativeIterator, this); }; + } + } -'use strict' + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + defineBuiltIn(IterablePrototype, KEY, methods[KEY]); + } + } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } -var base64 = require('base64-js') -var ieee754 = require('ieee754') + // define iterator + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); + } + Iterators[NAME] = defaultIterator; -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 + return methods; +}; -var K_MAX_LENGTH = 0x7fffffff -exports.kMaxLength = K_MAX_LENGTH +},{"../internals/create-non-enumerable-property":221,"../internals/define-built-in":224,"../internals/export":246,"../internals/function-call":253,"../internals/function-name":254,"../internals/is-callable":275,"../internals/is-pure":281,"../internals/iterator-create-constructor":286,"../internals/iterators":289,"../internals/iterators-core":288,"../internals/object-get-prototype-of":304,"../internals/object-set-prototype-of":309,"../internals/set-to-string-tag":332,"../internals/well-known-symbol":371}],288:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var create = require('../internals/object-create'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var defineBuiltIn = require('../internals/define-built-in'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_PURE = require('../internals/is-pure'); -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an 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+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ -Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() +var ITERATOR = wellKnownSymbol('iterator'); +var BUGGY_SAFARI_ITERATORS = false; -if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - console.error( - 'This browser lacks typed array (Uint8Array) support which is required by ' + - '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' - ) -} +// `%IteratorPrototype%` object +// https://tc39.es/ecma262/#sec-%iteratorprototype%-object +var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; -function typedArraySupport () { - // Can typed array instances can be augmented? - try { - var arr = new Uint8Array(1) - arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } } - return arr.foo() === 42 - } catch (e) { - return false +/* eslint-disable es/no-array-prototype-keys -- safe */ +if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } -Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } -}) +var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { + var test = {}; + // FF44- legacy iterators case + return IteratorPrototype[ITERATOR].call(test) !== test; +}); -Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } -}) +if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; +else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); -function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - var buf = new Uint8Array(length) - buf.__proto__ = Buffer.prototype - return buf +// `%IteratorPrototype%[@@iterator]()` method +// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator +if (!isCallable(IteratorPrototype[ITERATOR])) { + defineBuiltIn(IteratorPrototype, ITERATOR, function () { + return this; + }); } -/** - * 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. - */ +module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS +}; -function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) -} +},{"../internals/define-built-in":224,"../internals/fails":247,"../internals/is-callable":275,"../internals/is-object":280,"../internals/is-pure":281,"../internals/object-create":297,"../internals/object-get-prototype-of":304,"../internals/well-known-symbol":371}],289:[function(require,module,exports){ +arguments[4][263][0].apply(exports,arguments) +},{"dup":263}],290:[function(require,module,exports){ +var toLength = require('../internals/to-length'); -// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species != null && - Buffer[Symbol.species] === Buffer) { - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true, - enumerable: false, - writable: false - }) -} +// `LengthOfArrayLike` abstract operation +// https://tc39.es/ecma262/#sec-lengthofarraylike +module.exports = function (obj) { + return toLength(obj.length); +}; -Buffer.poolSize = 8192 // not used by this implementation +},{"../internals/to-length":350}],291:[function(require,module,exports){ +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var hasOwn = require('../internals/has-own-property'); +var DESCRIPTORS = require('../internals/descriptors'); +var CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE; +var inspectSource = require('../internals/inspect-source'); +var InternalStateModule = require('../internals/internal-state'); -function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } +var enforceInternalState = InternalStateModule.enforce; +var getInternalState = InternalStateModule.get; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; - if (ArrayBuffer.isView(value)) { - return fromArrayLike(value) - } +var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { + return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; +}); - if (value == null) { - throw TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } +var TEMPLATE = String(String).split('String'); - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) +var makeBuiltIn = module.exports = function (value, name, options) { + if (String(name).slice(0, 7) === 'Symbol(') { + name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']'; } - - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) + if (options && options.getter) name = 'get ' + name; + if (options && options.setter) name = 'set ' + name; + if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { + if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); + else value.name = name; } - - var valueOf = value.valueOf && value.valueOf() - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) + if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { + defineProperty(value, 'length', { value: options.arity }); } + try { + if (options && hasOwn(options, 'constructor') && options.constructor) { + if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); + // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable + } else if (value.prototype) value.prototype = undefined; + } catch (error) { /* empty */ } + var state = enforceInternalState(value); + if (!hasOwn(state, 'source')) { + state.source = TEMPLATE.join(typeof name == 'string' ? name : ''); + } return value; +}; - var b = fromObject(value) - if (b) return b - - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from( - value[Symbol.toPrimitive]('string'), encodingOrOffset, length - ) - } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +// eslint-disable-next-line no-extend-native -- required +Function.prototype.toString = makeBuiltIn(function toString() { + return isCallable(this) && getInternalState(this).source || inspectSource(this); +}, 'toString'); - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) -} +},{"../internals/descriptors":228,"../internals/fails":247,"../internals/function-name":254,"../internals/has-own-property":262,"../internals/inspect-source":270,"../internals/internal-state":271,"../internals/is-callable":275}],292:[function(require,module,exports){ +var ceil = Math.ceil; +var floor = Math.floor; -/** - * 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(value, encodingOrOffset, length) -} +// `Math.trunc` method +// https://tc39.es/ecma262/#sec-math.trunc +// eslint-disable-next-line es/no-math-trunc -- safe +module.exports = Math.trunc || function trunc(x) { + var n = +x; + return (n > 0 ? floor : ceil)(n); +}; -// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: -// https://github.com/feross/buffer/pull/148 -Buffer.prototype.__proto__ = Uint8Array.prototype -Buffer.__proto__ = Uint8Array +},{}],293:[function(require,module,exports){ +var global = require('../internals/global'); +var bind = require('../internals/function-bind-context'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var macrotask = require('../internals/task').set; +var IS_IOS = require('../internals/engine-is-ios'); +var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble'); +var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit'); +var IS_NODE = require('../internals/engine-is-node'); -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } -} +var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; +var document = global.document; +var process = global.process; +var Promise = global.Promise; +// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` +var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); +var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; -function alloc (size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(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(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) -} +var flush, head, last, notify, toggle, node, promise, then; -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) -} - -function allocUnsafe (size) { - assertSize(size) - return createBuffer(size < 0 ? 0 : checked(size) | 0) -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) -} - -function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } +// modern engines have queueMicrotask method +if (!queueMicrotask) { + flush = function () { + var parent, fn; + if (IS_NODE && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (error) { + if (head) notify(); + else last = undefined; + throw error; + } + } last = undefined; + if (parent) parent.enter(); + }; - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 + if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) { + toggle = true; + node = document.createTextNode(''); + new MutationObserver(flush).observe(node, { characterData: true }); + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + promise = Promise.resolve(undefined); + // workaround of WebKit ~ iOS Safari 10.1 bug + promise.constructor = Promise; + then = bind(promise.then, promise); + notify = function () { + then(flush); + }; + // Node.js without promises + } else if (IS_NODE) { + notify = function () { + process.nextTick(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessage + // - onreadystatechange + // - setTimeout + } else { + // strange IE + webpack dev server bug - use .bind(global) + macrotask = bind(macrotask, global); + notify = function () { + macrotask(flush); + }; } +} - var length = byteLength(string, encoding) | 0 - var buf = createBuffer(length) +module.exports = queueMicrotask || function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; +}; - var actual = buf.write(string, encoding) +},{"../internals/engine-is-ios":239,"../internals/engine-is-ios-pebble":238,"../internals/engine-is-node":240,"../internals/engine-is-webos-webkit":241,"../internals/function-bind-context":250,"../internals/global":261,"../internals/object-get-own-property-descriptor":300,"../internals/task":343}],294:[function(require,module,exports){ +'use strict'; +var aCallable = require('../internals/a-callable'); - 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') - buf = buf.slice(0, actual) - } +var $TypeError = TypeError; - return buf -} +var PromiseCapability = function (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 = aCallable(resolve); + this.reject = aCallable(reject); +}; -function fromArrayLike (array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - var buf = createBuffer(length) - for (var i = 0; i < length; i += 1) { - buf[i] = array[i] & 255 - } - return buf -} +// `NewPromiseCapability` abstract operation +// https://tc39.es/ecma262/#sec-newpromisecapability +module.exports.f = function (C) { + return new PromiseCapability(C); +}; -function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } +},{"../internals/a-callable":186}],295:[function(require,module,exports){ +var isRegExp = require('../internals/is-regexp'); - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } +var $TypeError = TypeError; - var buf - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array) - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset) - } else { - buf = new Uint8Array(array, byteOffset, length) - } +module.exports = function (it) { + if (isRegExp(it)) { + throw $TypeError("The method doesn't accept regular expressions"); + } return it; +}; - // Return an augmented `Uint8Array` instance - buf.__proto__ = Buffer.prototype - return buf -} +},{"../internals/is-regexp":282}],296:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var uncurryThis = require('../internals/function-uncurry-this'); +var call = require('../internals/function-call'); +var fails = require('../internals/fails'); +var objectKeys = require('../internals/object-keys'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var toObject = require('../internals/to-object'); +var IndexedObject = require('../internals/indexed-object'); -function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - var buf = createBuffer(len) +// eslint-disable-next-line es/no-object-assign -- safe +var $assign = Object.assign; +// eslint-disable-next-line es/no-object-defineproperty -- required for testing +var defineProperty = Object.defineProperty; +var concat = uncurryThis([].concat); - if (buf.length === 0) { - return buf +// `Object.assign` method +// https://tc39.es/ecma262/#sec-object.assign +module.exports = !$assign || fails(function () { + // should have correct order of operations (Edge bug) + if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', { + enumerable: true, + get: function () { + defineProperty(this, 'b', { + value: 3, + enumerable: false + }); } - - obj.copy(buf, 0, 0, len) - return buf - } - - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) + }), { b: 2 })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) + var A = {}; + var B = {}; + // eslint-disable-next-line es/no-symbol -- safe + var symbol = Symbol(); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { B[chr] = chr; }); + return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key]; } - return fromArrayLike(obj) - } + } return T; +} : $assign; - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } -} +},{"../internals/descriptors":228,"../internals/fails":247,"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/indexed-object":268,"../internals/object-get-own-property-symbols":303,"../internals/object-keys":307,"../internals/object-property-is-enumerable":308,"../internals/to-object":351}],297:[function(require,module,exports){ +/* global ActiveXObject -- old IE, WSH */ +var anObject = require('../internals/an-object'); +var definePropertiesModule = require('../internals/object-define-properties'); +var enumBugKeys = require('../internals/enum-bug-keys'); +var hiddenKeys = require('../internals/hidden-keys'); +var html = require('../internals/html'); +var documentCreateElement = require('../internals/document-create-element'); +var sharedKey = require('../internals/shared-key'); -function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 -} +var GT = '>'; +var LT = '<'; +var PROTOTYPE = 'prototype'; +var SCRIPT = 'script'; +var IE_PROTO = sharedKey('IE_PROTO'); -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} +var EmptyConstructor = function () { /* empty */ }; -Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false -} +var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; +}; -Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) - } +// Create object with fake `null` prototype: use ActiveX Object with cleared prototype +var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag('')); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; +}; - if (a === b) return 0 +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var JS = 'java' + SCRIPT + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + return iframeDocument.F; +}; - var x = a.length - var y = b.length +// Check for document.domain and active x support +// No need to use active x approach when document.domain is not set +// see https://github.com/es-shims/es5-shim/issues/150 +// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 +// avoid IE GC bug +var activeXDocument; +var NullProtoObject = function () { + try { + activeXDocument = new ActiveXObject('htmlfile'); + } catch (error) { /* ignore */ } + NullProtoObject = typeof document != 'undefined' + ? document.domain && activeXDocument + ? NullProtoObjectViaActiveX(activeXDocument) // old IE + : NullProtoObjectViaIFrame() + : NullProtoObjectViaActiveX(activeXDocument); // WSH + var length = enumBugKeys.length; + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); +}; - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } +hiddenKeys[IE_PROTO] = true; - if (x < y) return -1 - if (y < x) return 1 - return 0 -} +// `Object.create` method +// https://tc39.es/ecma262/#sec-object.create +// eslint-disable-next-line es/no-object-create -- safe +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined ? result : definePropertiesModule.f(result, Properties); +}; -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 - } -} +},{"../internals/an-object":192,"../internals/document-create-element":230,"../internals/enum-bug-keys":245,"../internals/hidden-keys":263,"../internals/html":265,"../internals/object-define-properties":298,"../internals/shared-key":333}],298:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); +var definePropertyModule = require('../internals/object-define-property'); +var anObject = require('../internals/an-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var objectKeys = require('../internals/object-keys'); -Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } +// `Object.defineProperties` method +// https://tc39.es/ecma262/#sec-object.defineproperties +// eslint-disable-next-line es/no-object-defineproperties -- safe +exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var props = toIndexedObject(Properties); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); + return O; +}; - if (list.length === 0) { - return Buffer.alloc(0) - } +},{"../internals/an-object":192,"../internals/descriptors":228,"../internals/object-define-property":299,"../internals/object-keys":307,"../internals/to-indexed-object":348,"../internals/v8-prototype-define-bug":366}],299:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); +var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); +var anObject = require('../internals/an-object'); +var toPropertyKey = require('../internals/to-property-key'); - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var $defineProperty = Object.defineProperty; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var ENUMERABLE = 'enumerable'; +var CONFIGURABLE = 'configurable'; +var WRITABLE = 'writable'; - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (isInstance(buf, Uint8Array)) { - buf = Buffer.from(buf) - } - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') +// `Object.defineProperty` method +// https://tc39.es/ecma262/#sec-object.defineproperty +exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { + anObject(O); + P = toPropertyKey(P); + anObject(Attributes); + if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { + var current = $getOwnPropertyDescriptor(O, P); + if (current && current[WRITABLE]) { + O[P] = Attributes.value; + Attributes = { + configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], + enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], + writable: false + }; } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} + } return $defineProperty(O, P, Attributes); +} : $defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPropertyKey(P); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return $defineProperty(O, P, Attributes); + } catch (error) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } +},{"../internals/an-object":192,"../internals/descriptors":228,"../internals/ie8-dom-define":266,"../internals/to-property-key":355,"../internals/v8-prototype-define-bug":366}],300:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var call = require('../internals/function-call'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toPropertyKey = require('../internals/to-property-key'); +var hasOwn = require('../internals/has-own-property'); +var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); - var len = string.length - var mustMatch = (arguments.length > 2 && arguments[2] === true) - if (!mustMatch && len === 0) return 0 +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - // 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': - 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 mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor +exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPropertyKey(P); + if (IE8_DOM_DEFINE) try { + return $getOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); +}; -function slowToString (encoding, start, end) { - var loweredCase = false +},{"../internals/create-property-descriptor":222,"../internals/descriptors":228,"../internals/function-call":253,"../internals/has-own-property":262,"../internals/ie8-dom-define":266,"../internals/object-property-is-enumerable":308,"../internals/to-indexed-object":348,"../internals/to-property-key":355}],301:[function(require,module,exports){ +/* eslint-disable es/no-object-getownpropertynames -- safe */ +var classof = require('../internals/classof-raw'); +var toIndexedObject = require('../internals/to-indexed-object'); +var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var arraySlice = require('../internals/array-slice-simple'); - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; - // 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 '' +var getWindowNames = function (it) { + try { + return $getOwnPropertyNames(it); + } catch (error) { + return arraySlice(windowNames); } +}; - if (end === undefined || end > this.length) { - end = this.length - } +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && classof(it) == 'Window' + ? getWindowNames(it) + : $getOwnPropertyNames(toIndexedObject(it)); +}; - if (end <= 0) { - return '' - } +},{"../internals/array-slice-simple":208,"../internals/classof-raw":215,"../internals/object-get-own-property-names":302,"../internals/to-indexed-object":348}],302:[function(require,module,exports){ +var internalObjectKeys = require('../internals/object-keys-internal'); +var enumBugKeys = require('../internals/enum-bug-keys'); - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); - if (end <= start) { - return '' - } +// `Object.getOwnPropertyNames` method +// https://tc39.es/ecma262/#sec-object.getownpropertynames +// eslint-disable-next-line es/no-object-getownpropertynames -- safe +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); +}; - if (!encoding) encoding = 'utf8' +},{"../internals/enum-bug-keys":245,"../internals/object-keys-internal":306}],303:[function(require,module,exports){ +// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe +exports.f = Object.getOwnPropertySymbols; - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) +},{}],304:[function(require,module,exports){ +var hasOwn = require('../internals/has-own-property'); +var isCallable = require('../internals/is-callable'); +var toObject = require('../internals/to-object'); +var sharedKey = require('../internals/shared-key'); +var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) +var IE_PROTO = sharedKey('IE_PROTO'); +var $Object = Object; +var ObjectPrototype = $Object.prototype; - case 'ascii': - return asciiSlice(this, start, end) +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof +// eslint-disable-next-line es/no-object-getprototypeof -- safe +module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { + var object = toObject(O); + if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; + var constructor = object.constructor; + if (isCallable(constructor) && object instanceof constructor) { + return constructor.prototype; + } return object instanceof $Object ? ObjectPrototype : null; +}; - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) +},{"../internals/correct-prototype-getter":219,"../internals/has-own-property":262,"../internals/is-callable":275,"../internals/shared-key":333,"../internals/to-object":351}],305:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); - case 'base64': - return base64Slice(this, start, end) +module.exports = uncurryThis({}.isPrototypeOf); - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) +},{"../internals/function-uncurry-this":255}],306:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var hasOwn = require('../internals/has-own-property'); +var toIndexedObject = require('../internals/to-indexed-object'); +var indexOf = require('../internals/array-includes').indexOf; +var hiddenKeys = require('../internals/hidden-keys'); - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } +var push = uncurryThis([].push); + +module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); + // Don't enum bug & hidden keys + while (names.length > i) if (hasOwn(O, key = names[i++])) { + ~indexOf(result, key) || push(result, key); } -} + return result; +}; -// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) -// to detect a Buffer instance. It's not possible to use `instanceof Buffer` -// reliably in a browserify context because there could be multiple different -// copies of the 'buffer' package in use. This method works even for Buffer -// instances that were created from another copy of the `buffer` package. -// See: https://github.com/feross/buffer/issues/154 -Buffer.prototype._isBuffer = true +},{"../internals/array-includes":201,"../internals/function-uncurry-this":255,"../internals/has-own-property":262,"../internals/hidden-keys":263,"../internals/to-indexed-object":348}],307:[function(require,module,exports){ +var internalObjectKeys = require('../internals/object-keys-internal'); +var enumBugKeys = require('../internals/enum-bug-keys'); -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys +// eslint-disable-next-line es/no-object-keys -- safe +module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); +}; -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 -} +},{"../internals/enum-bug-keys":245,"../internals/object-keys-internal":306}],308:[function(require,module,exports){ +'use strict'; +var $propertyIsEnumerable = {}.propertyIsEnumerable; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; -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 -} +// Nashorn ~ JDK8 bug +var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); -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 -} +// `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable +exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; +} : $propertyIsEnumerable; -Buffer.prototype.toString = function toString () { - var length = this.length - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} +},{}],309:[function(require,module,exports){ +/* eslint-disable no-proto -- safe */ +var uncurryThis = require('../internals/function-uncurry-this'); +var anObject = require('../internals/an-object'); +var aPossiblePrototype = require('../internals/a-possible-prototype'); -Buffer.prototype.toLocaleString = Buffer.prototype.toString +// `Object.setPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.setprototypeof +// Works with __proto__ only. Old v8 can't work with null proto objects. +// eslint-disable-next-line es/no-object-setprototypeof -- safe +module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set); + setter(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter(O, proto); + else O.__proto__ = proto; + return O; + }; +}() : undefined); -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 -} +},{"../internals/a-possible-prototype":188,"../internals/an-object":192,"../internals/function-uncurry-this":255}],310:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var uncurryThis = require('../internals/function-uncurry-this'); +var objectKeys = require('../internals/object-keys'); +var toIndexedObject = require('../internals/to-indexed-object'); +var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() - if (this.length > max) str += ' ... ' - return '' -} +var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); +var push = uncurryThis([].push); -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength) - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } +// `Object.{ entries, values }` methods implementation +var createMethod = function (TO_ENTRIES) { + return function (it) { + var O = toIndexedObject(it); + var keys = objectKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || propertyIsEnumerable(O, key)) { + push(result, TO_ENTRIES ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } +module.exports = { + // `Object.entries` method + // https://tc39.es/ecma262/#sec-object.entries + entries: createMethod(true), + // `Object.values` method + // https://tc39.es/ecma262/#sec-object.values + values: createMethod(false) +}; - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } +},{"../internals/descriptors":228,"../internals/function-uncurry-this":255,"../internals/object-keys":307,"../internals/object-property-is-enumerable":308,"../internals/to-indexed-object":348}],311:[function(require,module,exports){ +'use strict'; +var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); +var classof = require('../internals/classof'); - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } +// `Object.prototype.toString` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.tostring +module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { + return '[object ' + classof(this) + ']'; +}; - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 +},{"../internals/classof":216,"../internals/to-string-tag-support":356}],312:[function(require,module,exports){ +var call = require('../internals/function-call'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); - if (this === target) return 0 +var $TypeError = TypeError; - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) +// `OrdinaryToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-ordinarytoprimitive +module.exports = function (input, pref) { + var fn, val; + if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; + if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; + if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; + throw $TypeError("Can't convert object to primitive value"); +}; - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) +},{"../internals/function-call":253,"../internals/is-callable":275,"../internals/is-object":280}],313:[function(require,module,exports){ +var getBuiltIn = require('../internals/get-built-in'); +var uncurryThis = require('../internals/function-uncurry-this'); +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var anObject = require('../internals/an-object'); - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } +var concat = uncurryThis([].concat); - if (x < y) return -1 - if (y < x) return 1 - return 0 -} +// all object keys, includes non-enumerable and symbols +module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; +}; -// 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 +},{"../internals/an-object":192,"../internals/function-uncurry-this":255,"../internals/get-built-in":256,"../internals/object-get-own-property-names":302,"../internals/object-get-own-property-symbols":303}],314:[function(require,module,exports){ +var global = require('../internals/global'); - // 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 (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } +module.exports = global; - // 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 +},{"../internals/global":261}],315:[function(require,module,exports){ +module.exports = function (exec) { + try { + return { error: false, value: exec() }; + } catch (error) { + return { error: true, value: error }; } +}; - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } +},{}],316:[function(require,module,exports){ +var global = require('../internals/global'); +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var isCallable = require('../internals/is-callable'); +var isForced = require('../internals/is-forced'); +var inspectSource = require('../internals/inspect-source'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_BROWSER = require('../internals/engine-is-browser'); +var IS_DENO = require('../internals/engine-is-deno'); +var IS_PURE = require('../internals/is-pure'); +var V8_VERSION = require('../internals/engine-v8-version'); - // 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 (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) - } +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; +var SPECIES = wellKnownSymbol('species'); +var SUBCLASSING = false; +var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent); + +var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () { + var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor); + var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor); + // 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 + if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; + // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution + if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true; + // We can't use @@species feature detection in V8 since it causes + // deoptimization and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) { + // Detect correctness of subclassing with @@species support + var promise = new NativePromiseConstructor(function (resolve) { resolve(1); }); + var FakePromise = function (exec) { + exec(function () { /* empty */ }, function () { /* empty */ }); + }; + var constructor = promise.constructor = {}; + constructor[SPECIES] = FakePromise; + SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise; + if (!SUBCLASSING) return true; + // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test + } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT; +}); - throw new TypeError('val must be string, number or Buffer') -} +module.exports = { + CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR, + REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT, + SUBCLASSING: SUBCLASSING +}; -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length +},{"../internals/engine-is-browser":235,"../internals/engine-is-deno":236,"../internals/engine-v8-version":243,"../internals/global":261,"../internals/inspect-source":270,"../internals/is-callable":275,"../internals/is-forced":277,"../internals/is-pure":281,"../internals/promise-native-constructor":317,"../internals/well-known-symbol":371}],317:[function(require,module,exports){ +var global = require('../internals/global'); - 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 - } - } +module.exports = global.Promise; - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } +},{"../internals/global":261}],318:[function(require,module,exports){ +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var newPromiseCapability = require('../internals/new-promise-capability'); - 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 - } - } +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; +}; - return -1 -} +},{"../internals/an-object":192,"../internals/is-object":280,"../internals/new-promise-capability":294}],319:[function(require,module,exports){ +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} +module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) { + NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ }); +}); -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} +},{"../internals/check-correctness-of-iteration":214,"../internals/promise-constructor-detection":316,"../internals/promise-native-constructor":317}],320:[function(require,module,exports){ +var defineProperty = require('../internals/object-define-property').f; -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} +module.exports = function (Target, Source, key) { + key in Target || defineProperty(Target, key, { + configurable: true, + get: function () { return Source[key]; }, + set: function (it) { Source[key] = it; } + }); +}; -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 +},{"../internals/object-define-property":299}],321:[function(require,module,exports){ +var Queue = function () { + this.head = null; + this.tail = null; +}; + +Queue.prototype = { + add: function (item) { + var entry = { item: item, next: null }; + if (this.head) this.tail.next = entry; + else this.head = entry; + this.tail = entry; + }, + get: function () { + var entry = this.head; + if (entry) { + this.head = entry.next; + if (this.tail === entry) this.tail = null; + return entry.item; } } +}; - var strLen = string.length +module.exports = Queue; - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} +},{}],322:[function(require,module,exports){ +var call = require('../internals/function-call'); +var anObject = require('../internals/an-object'); +var isCallable = require('../internals/is-callable'); +var classof = require('../internals/classof-raw'); +var regexpExec = require('../internals/regexp-exec'); -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} +var $TypeError = TypeError; -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} +// `RegExpExec` abstract operation +// https://tc39.es/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (isCallable(exec)) { + var result = call(exec, R, S); + if (result !== null) anObject(result); + return result; + } + if (classof(R) === 'RegExp') return call(regexpExec, R, S); + throw $TypeError('RegExp#exec called on incompatible receiver'); +}; -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} +},{"../internals/an-object":192,"../internals/classof-raw":215,"../internals/function-call":253,"../internals/is-callable":275,"../internals/regexp-exec":323}],323:[function(require,module,exports){ +'use strict'; +/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ +/* eslint-disable regexp/no-useless-quantifier -- testing */ +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var toString = require('../internals/to-string'); +var regexpFlags = require('../internals/regexp-flags'); +var stickyHelpers = require('../internals/regexp-sticky-helpers'); +var shared = require('../internals/shared'); +var create = require('../internals/object-create'); +var getInternalState = require('../internals/internal-state').get; +var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all'); +var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg'); -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} +var nativeReplace = shared('native-string-replace', String.prototype.replace); +var nativeExec = RegExp.prototype.exec; +var patchedExec = nativeExec; +var charAt = uncurryThis(''.charAt); +var indexOf = uncurryThis(''.indexOf); +var replace = uncurryThis(''.replace); +var stringSlice = uncurryThis(''.slice); -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} +var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/; + var re2 = /b*/g; + call(nativeExec, re1, 'a'); + call(nativeExec, re2, 'a'); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; +})(); -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 - } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } +var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining +// nonparticipating capturing group, copied from es5-shim's String#split patch. +var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } +var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; - if (!encoding) encoding = 'utf8' +if (PATCH) { + patchedExec = function exec(string) { + var re = this; + var state = getInternalState(re); + var str = toString(string); + var raw = state.raw; + var result, reCopy, lastIndex, match, i, object, group; + + if (raw) { + raw.lastIndex = re.lastIndex; + result = call(patchedExec, raw, str); + re.lastIndex = raw.lastIndex; + return result; + } - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) + var groups = state.groups; + var sticky = UNSUPPORTED_Y && re.sticky; + var flags = call(regexpFlags, re); + var source = re.source; + var charsAdded = 0; + var strCopy = str; - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) + if (sticky) { + flags = replace(flags, 'y', ''); + if (indexOf(flags, 'g') === -1) { + flags += 'g'; + } - case 'ascii': - return asciiWrite(this, string, offset, length) + strCopy = stringSlice(str, re.lastIndex); + // Support anchored sticky behavior. + if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { + source = '(?: ' + source + ')'; + strCopy = ' ' + strCopy; + charsAdded++; + } + // ^(? + rx + ) is needed, in combination with some str slicing, to + // simulate the 'y' flag. + reCopy = new RegExp('^(?:' + source + ')', flags); + } - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + source + '$(?!\\s)', flags); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) + match = call(nativeExec, sticky ? reCopy : re, strCopy); - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) + if (sticky) { + if (match) { + match.input = stringSlice(match.input, charsAdded); + match[0] = stringSlice(match[0], charsAdded); + match.index = re.lastIndex; + re.lastIndex += match[0].length; + } else re.lastIndex = 0; + } else if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/ + call(nativeReplace, match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true + if (match && groups) { + match.groups = object = create(null); + for (i = 0; i < groups.length; i++) { + group = groups[i]; + object[group[0]] = match[group[1]]; + } } - } -} -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } + return match; + }; } -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} +module.exports = patchedExec; -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] +},{"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/internal-state":271,"../internals/object-create":297,"../internals/regexp-flags":324,"../internals/regexp-sticky-helpers":326,"../internals/regexp-unsupported-dot-all":327,"../internals/regexp-unsupported-ncg":328,"../internals/shared":335,"../internals/to-string":357}],324:[function(require,module,exports){ +'use strict'; +var anObject = require('../internals/an-object'); - 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 +// `RegExp.prototype.flags` getter implementation +// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.hasIndices) result += 'd'; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.dotAll) result += 's'; + if (that.unicode) result += 'u'; + if (that.unicodeSets) result += 'v'; + if (that.sticky) result += 'y'; + return result; +}; - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint +},{"../internals/an-object":192}],325:[function(require,module,exports){ +var call = require('../internals/function-call'); +var hasOwn = require('../internals/has-own-property'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var regExpFlags = require('../internals/regexp-flags'); - 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 - } +var RegExpPrototype = RegExp.prototype; - res.push(codePoint) - i += bytesPerSequence - } +module.exports = function (R) { + var flags = R.flags; + return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) + ? call(regExpFlags, R) : flags; +}; - return decodeCodePointsArray(res) -} +},{"../internals/function-call":253,"../internals/has-own-property":262,"../internals/object-is-prototype-of":305,"../internals/regexp-flags":324}],326:[function(require,module,exports){ +var fails = require('../internals/fails'); +var global = require('../internals/global'); -// 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 +// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError +var $RegExp = global.RegExp; -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } +var UNSUPPORTED_Y = fails(function () { + var re = $RegExp('a', 'y'); + re.lastIndex = 2; + return re.exec('abcd') != null; +}); - // 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 -} +// UC Browser bug +// https://github.com/zloirock/core-js/issues/1008 +var MISSED_STICKY = UNSUPPORTED_Y || fails(function () { + return !$RegExp('a', 'y').sticky; +}); -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) +var BROKEN_CARET = UNSUPPORTED_Y || fails(function () { + // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 + var re = $RegExp('^r', 'gy'); + re.lastIndex = 2; + return re.exec('str') != null; +}); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} +module.exports = { + BROKEN_CARET: BROKEN_CARET, + MISSED_STICKY: MISSED_STICKY, + UNSUPPORTED_Y: UNSUPPORTED_Y +}; -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) +},{"../internals/fails":247,"../internals/global":261}],327:[function(require,module,exports){ +var fails = require('../internals/fails'); +var global = require('../internals/global'); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} +// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError +var $RegExp = global.RegExp; -function hexSlice (buf, start, end) { - var len = buf.length +module.exports = fails(function () { + var re = $RegExp('.', 's'); + return !(re.dotAll && re.exec('\n') && re.flags === 's'); +}); - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len +},{"../internals/fails":247,"../internals/global":261}],328:[function(require,module,exports){ +var fails = require('../internals/fails'); +var global = require('../internals/global'); - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} +// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError +var $RegExp = global.RegExp; -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 -} +module.exports = fails(function () { + var re = $RegExp('(?b)', 'g'); + return re.exec('b').groups.a !== 'b' || + 'b'.replace(re, '$c') !== 'bc'; +}); -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end +},{"../internals/fails":247,"../internals/global":261}],329:[function(require,module,exports){ +var isNullOrUndefined = require('../internals/is-null-or-undefined'); - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } +var $TypeError = TypeError; - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } +// `RequireObjectCoercible` abstract operation +// https://tc39.es/ecma262/#sec-requireobjectcoercible +module.exports = function (it) { + if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it); + return it; +}; - if (end < start) end = start +},{"../internals/is-null-or-undefined":279}],330:[function(require,module,exports){ +// `SameValue` abstract operation +// https://tc39.es/ecma262/#sec-samevalue +// eslint-disable-next-line es/no-object-is -- safe +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare -- NaN check + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; - var newBuf = this.subarray(start, end) - // Return an augmented `Uint8Array` instance - newBuf.__proto__ = Buffer.prototype - return newBuf -} +},{}],331:[function(require,module,exports){ +'use strict'; +var getBuiltIn = require('../internals/get-built-in'); +var definePropertyModule = require('../internals/object-define-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var DESCRIPTORS = require('../internals/descriptors'); -/* - * 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') -} +var SPECIES = wellKnownSymbol('species'); -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) +module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = definePropertyModule.f; - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineProperty(Constructor, SPECIES, { + configurable: true, + get: function () { return this; } + }); } +}; - return val -} +},{"../internals/descriptors":228,"../internals/get-built-in":256,"../internals/object-define-property":299,"../internals/well-known-symbol":371}],332:[function(require,module,exports){ +var defineProperty = require('../internals/object-define-property').f; +var hasOwn = require('../internals/has-own-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul +module.exports = function (target, TAG, STATIC) { + if (target && !STATIC) target = target.prototype; + if (target && !hasOwn(target, TO_STRING_TAG)) { + defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); } +}; - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} +},{"../internals/has-own-property":262,"../internals/object-define-property":299,"../internals/well-known-symbol":371}],333:[function(require,module,exports){ +var shared = require('../internals/shared'); +var uid = require('../internals/uid'); -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) +var keys = shared('keys'); - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} +module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); +}; -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) +},{"../internals/shared":335,"../internals/uid":364}],334:[function(require,module,exports){ +var global = require('../internals/global'); +var defineGlobalProperty = require('../internals/define-global-property'); - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || defineGlobalProperty(SHARED, {}); -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) +module.exports = store; - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 +},{"../internals/define-global-property":226,"../internals/global":261}],335:[function(require,module,exports){ +var IS_PURE = require('../internals/is-pure'); +var store = require('../internals/shared-store'); - if (val >= mul) val -= Math.pow(2, 8 * byteLength) +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: '3.25.3', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE', + source: 'https://github.com/zloirock/core-js' +}); - return val -} +},{"../internals/is-pure":281,"../internals/shared-store":334}],336:[function(require,module,exports){ +var anObject = require('../internals/an-object'); +var aConstructor = require('../internals/a-constructor'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var wellKnownSymbol = require('../internals/well-known-symbol'); -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0 - byteLength = byteLength >>> 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) +var SPECIES = wellKnownSymbol('species'); - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 +// `SpeciesConstructor` abstract operation +// https://tc39.es/ecma262/#sec-speciesconstructor +module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S); +}; - if (val >= mul) val -= Math.pow(2, 8 * byteLength) +},{"../internals/a-constructor":187,"../internals/an-object":192,"../internals/is-null-or-undefined":279,"../internals/well-known-symbol":371}],337:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toString = require('../internals/to-string'); +var requireObjectCoercible = require('../internals/require-object-coercible'); - return val -} +var charAt = uncurryThis(''.charAt); +var charCodeAt = uncurryThis(''.charCodeAt); +var stringSlice = uncurryThis(''.slice); -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} +var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = toString(requireObjectCoercible($this)); + var position = toIntegerOrInfinity(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = charCodeAt(S, position); + return first < 0xD800 || first > 0xDBFF || position + 1 === size + || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF + ? CONVERT_TO_STRING + ? charAt(S, position) + : first + : CONVERT_TO_STRING + ? stringSlice(S, position, position + 2) + : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + }; +}; -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} +module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.es/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true) +}; -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} +},{"../internals/function-uncurry-this":255,"../internals/require-object-coercible":329,"../internals/to-integer-or-infinity":349,"../internals/to-string":357}],338:[function(require,module,exports){ +var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; +var fails = require('../internals/fails'); +var whitespaces = require('../internals/whitespaces'); -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) +var non = '\u200B\u0085\u180E'; - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} +// check that a method works with the correct list +// of whitespaces and has a correct name +module.exports = function (METHOD_NAME) { + return fails(function () { + return !!whitespaces[METHOD_NAME]() + || non[METHOD_NAME]() !== non + || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME); + }); +}; -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) +},{"../internals/fails":247,"../internals/function-name":254,"../internals/whitespaces":372}],339:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var toString = require('../internals/to-string'); +var whitespaces = require('../internals/whitespaces'); - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} +var replace = uncurryThis(''.replace); +var whitespace = '[' + whitespaces + ']'; +var ltrim = RegExp('^' + whitespace + whitespace + '*'); +var rtrim = RegExp(whitespace + whitespace + '*$'); -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var createMethod = function (TYPE) { + return function ($this) { + var string = toString(requireObjectCoercible($this)); + if (TYPE & 1) string = replace(string, ltrim, ''); + if (TYPE & 2) string = replace(string, rtrim, ''); + return string; + }; +}; -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} +module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.es/ecma262/#sec-string.prototype.trim + trim: createMethod(3) +}; -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} +},{"../internals/function-uncurry-this":255,"../internals/require-object-coercible":329,"../internals/to-string":357,"../internals/whitespaces":372}],340:[function(require,module,exports){ +/* eslint-disable es/no-symbol -- required for testing */ +var V8_VERSION = require('../internals/engine-v8-version'); +var fails = require('../internals/fails'); -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0 - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} +// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + var symbol = Symbol(); + // Chrome 38 Symbol has incorrect toString conversion + // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances + return !String(symbol) || !(Object(symbol) instanceof Symbol) || + // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances + !Symbol.sham && V8_VERSION && V8_VERSION < 41; +}); -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') -} +},{"../internals/engine-v8-version":243,"../internals/fails":247}],341:[function(require,module,exports){ +var call = require('../internals/function-call'); +var getBuiltIn = require('../internals/get-built-in'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var defineBuiltIn = require('../internals/define-built-in'); -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) - } +module.exports = function () { + var Symbol = getBuiltIn('Symbol'); + var SymbolPrototype = Symbol && Symbol.prototype; + var valueOf = SymbolPrototype && SymbolPrototype.valueOf; + var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF + if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { + // `Symbol.prototype[@@toPrimitive]` method + // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive + // eslint-disable-next-line no-unused-vars -- required for .length + defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) { + return call(valueOf, this); + }, { arity: 1 }); } +}; - return offset + byteLength -} +},{"../internals/define-built-in":224,"../internals/function-call":253,"../internals/get-built-in":256,"../internals/well-known-symbol":371}],342:[function(require,module,exports){ +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); -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) - } +/* eslint-disable es/no-symbol -- safe */ +module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF +},{"../internals/symbol-constructor-detection":340}],343:[function(require,module,exports){ +var global = require('../internals/global'); +var apply = require('../internals/function-apply'); +var bind = require('../internals/function-bind-context'); +var isCallable = require('../internals/is-callable'); +var hasOwn = require('../internals/has-own-property'); +var fails = require('../internals/fails'); +var html = require('../internals/html'); +var arraySlice = require('../internals/array-slice'); +var createElement = require('../internals/document-create-element'); +var validateArgumentsLength = require('../internals/validate-arguments-length'); +var IS_IOS = require('../internals/engine-is-ios'); +var IS_NODE = require('../internals/engine-is-node'); + +var set = global.setImmediate; +var clear = global.clearImmediate; +var process = global.process; +var Dispatch = global.Dispatch; +var Function = global.Function; +var MessageChannel = global.MessageChannel; +var String = global.String; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var $location, defer, channel, port; + +try { + // Deno throws a ReferenceError on `location` access without `--location` flag + $location = global.location; +} catch (error) { /* empty */ } + +var run = function (id) { + if (hasOwn(queue, id)) { + var fn = queue[id]; + delete queue[id]; + fn(); } +}; - return offset + byteLength -} +var runner = function (id) { + return function () { + run(id); + }; +}; -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - this[offset] = (value & 0xff) - return offset + 1 -} +var listener = function (event) { + run(event.data); +}; -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} +var post = function (id) { + // old engines have not location.origin + global.postMessage(String(id), $location.protocol + '//' + $location.host); +}; -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!set || !clear) { + set = function setImmediate(handler) { + validateArgumentsLength(arguments.length, 1); + var fn = isCallable(handler) ? handler : Function(handler); + var args = arraySlice(arguments, 1); + queue[++counter] = function () { + apply(fn, undefined, args); + }; + defer(counter); + return counter; + }; + clear = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (IS_NODE) { + defer = function (id) { + process.nextTick(runner(id)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(runner(id)); + }; + // Browsers with MessageChannel, includes WebWorkers + // except iOS - https://github.com/zloirock/core-js/issues/624 + } else if (MessageChannel && !IS_IOS) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = bind(port.postMessage, port); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if ( + global.addEventListener && + isCallable(global.postMessage) && + !global.importScripts && + $location && $location.protocol !== 'file:' && + !fails(post) + ) { + defer = post; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in createElement('script')) { + defer = function (id) { + html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(runner(id), 0); + }; + } } -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - return offset + 4 -} +module.exports = { + set: set, + clear: clear +}; -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} +},{"../internals/array-slice":209,"../internals/document-create-element":230,"../internals/engine-is-ios":239,"../internals/engine-is-node":240,"../internals/fails":247,"../internals/function-apply":249,"../internals/function-bind-context":250,"../internals/global":261,"../internals/has-own-property":262,"../internals/html":265,"../internals/is-callable":275,"../internals/validate-arguments-length":367}],344:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) +// `thisNumberValue` abstract operation +// https://tc39.es/ecma262/#sec-thisnumbervalue +module.exports = uncurryThis(1.0.valueOf); - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } +},{"../internals/function-uncurry-this":255}],345:[function(require,module,exports){ +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); - 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 -} +var max = Math.max; +var min = Math.min; -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - var limit = Math.pow(2, (8 * byteLength) - 1) +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). +module.exports = function (index, length) { + var integer = toIntegerOrInfinity(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); +}; - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } +},{"../internals/to-integer-or-infinity":349}],346:[function(require,module,exports){ +var toPrimitive = require('../internals/to-primitive'); - 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 - } +var $TypeError = TypeError; - return offset + byteLength -} +// `ToBigInt` abstract operation +// https://tc39.es/ecma262/#sec-tobigint +module.exports = function (argument) { + var prim = toPrimitive(argument, 'number'); + if (typeof prim == 'number') throw $TypeError("Can't convert number to bigint"); + // eslint-disable-next-line es/no-bigint -- safe + return BigInt(prim); +}; -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} +},{"../internals/to-primitive":354}],347:[function(require,module,exports){ +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toLength = require('../internals/to-length'); -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - return offset + 2 -} +var $RangeError = RangeError; -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - return offset + 2 -} +// `ToIndex` abstract operation +// https://tc39.es/ecma262/#sec-toindex +module.exports = function (it) { + if (it === undefined) return 0; + var number = toIntegerOrInfinity(it); + var length = toLength(number); + if (number !== length) throw $RangeError('Wrong length or index'); + return length; +}; -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - return offset + 4 -} +},{"../internals/to-integer-or-infinity":349,"../internals/to-length":350}],348:[function(require,module,exports){ +// toObject with fallback for non-array-like ES3 strings +var IndexedObject = require('../internals/indexed-object'); +var requireObjectCoercible = require('../internals/require-object-coercible'); -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 - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - return offset + 4 -} +module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); +}; -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') -} +},{"../internals/indexed-object":268,"../internals/require-object-coercible":329}],349:[function(require,module,exports){ +var trunc = require('../internals/math-trunc'); -function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} +// `ToIntegerOrInfinity` abstract operation +// https://tc39.es/ecma262/#sec-tointegerorinfinity +module.exports = function (argument) { + var number = +argument; + // eslint-disable-next-line no-self-compare -- NaN check + return number !== number || number === 0 ? 0 : trunc(number); +}; -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} +},{"../internals/math-trunc":292}],350:[function(require,module,exports){ +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} +var min = Math.min; -function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value - offset = offset >>> 0 - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} +// `ToLength` abstract operation +// https://tc39.es/ecma262/#sec-tolength +module.exports = function (argument) { + return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} +},{"../internals/to-integer-or-infinity":349}],351:[function(require,module,exports){ +var requireObjectCoercible = require('../internals/require-object-coercible'); -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} +var $Object = Object; -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - 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 +// `ToObject` abstract operation +// https://tc39.es/ecma262/#sec-toobject +module.exports = function (argument) { + return $Object(requireObjectCoercible(argument)); +}; - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 +},{"../internals/require-object-coercible":329}],352:[function(require,module,exports){ +var toPositiveInteger = require('../internals/to-positive-integer'); - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') +var $RangeError = RangeError; - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } +module.exports = function (it, BYTES) { + var offset = toPositiveInteger(it); + if (offset % BYTES) throw $RangeError('Wrong offset'); + return offset; +}; - var len = end - start +},{"../internals/to-positive-integer":353}],353:[function(require,module,exports){ +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end) - } else if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (var i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ) - } +var $RangeError = RangeError; - return len -} +module.exports = function (it) { + var result = toIntegerOrInfinity(it); + if (result < 0) throw $RangeError("The argument can't be less than 0"); + return result; +}; -// 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 (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) - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code - } - } - } else if (typeof val === 'number') { - val = val & 255 - } +},{"../internals/to-integer-or-infinity":349}],354:[function(require,module,exports){ +var call = require('../internals/function-call'); +var isObject = require('../internals/is-object'); +var isSymbol = require('../internals/is-symbol'); +var getMethod = require('../internals/get-method'); +var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); +var wellKnownSymbol = require('../internals/well-known-symbol'); - // 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') - } +var $TypeError = TypeError; +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); - if (end <= start) { - return this +// `ToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-toprimitive +module.exports = function (input, pref) { + if (!isObject(input) || isSymbol(input)) return input; + var exoticToPrim = getMethod(input, TO_PRIMITIVE); + var result; + if (exoticToPrim) { + if (pref === undefined) pref = 'default'; + result = call(exoticToPrim, input, pref); + if (!isObject(result) || isSymbol(result)) return result; + throw $TypeError("Can't convert object to primitive value"); } + if (pref === undefined) pref = 'number'; + return ordinaryToPrimitive(input, pref); +}; - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 +},{"../internals/function-call":253,"../internals/get-method":259,"../internals/is-object":280,"../internals/is-symbol":283,"../internals/ordinary-to-primitive":312,"../internals/well-known-symbol":371}],355:[function(require,module,exports){ +var toPrimitive = require('../internals/to-primitive'); +var isSymbol = require('../internals/is-symbol'); - if (!val) val = 0 +// `ToPropertyKey` abstract operation +// https://tc39.es/ecma262/#sec-topropertykey +module.exports = function (argument) { + var key = toPrimitive(argument, 'string'); + return isSymbol(key) ? key : key + ''; +}; - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding) - var len = bytes.length - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } +},{"../internals/is-symbol":283,"../internals/to-primitive":354}],356:[function(require,module,exports){ +var wellKnownSymbol = require('../internals/well-known-symbol'); - return this -} +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var test = {}; -// HELPER FUNCTIONS -// ================ +test[TO_STRING_TAG] = 'z'; -var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g +module.exports = String(test) === '[object z]'; -function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0] - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().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 -} +},{"../internals/well-known-symbol":371}],357:[function(require,module,exports){ +var classof = require('../internals/classof'); -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} +var $String = String; -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] +module.exports = function (argument) { + if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); + return $String(argument); +}; - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) +},{"../internals/classof":216}],358:[function(require,module,exports){ +var $String = String; - // 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 - } +module.exports = function (argument) { + try { + return $String(argument); + } catch (error) { + return 'Object'; + } +}; - // valid lead - leadSurrogate = codePoint +},{}],359:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var DESCRIPTORS = require('../internals/descriptors'); +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var ArrayBufferModule = require('../internals/array-buffer'); +var anInstance = require('../internals/an-instance'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var isIntegralNumber = require('../internals/is-integral-number'); +var toLength = require('../internals/to-length'); +var toIndex = require('../internals/to-index'); +var toOffset = require('../internals/to-offset'); +var toPropertyKey = require('../internals/to-property-key'); +var hasOwn = require('../internals/has-own-property'); +var classof = require('../internals/classof'); +var isObject = require('../internals/is-object'); +var isSymbol = require('../internals/is-symbol'); +var create = require('../internals/object-create'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var typedArrayFrom = require('../internals/typed-array-from'); +var forEach = require('../internals/array-iteration').forEach; +var setSpecies = require('../internals/set-species'); +var definePropertyModule = require('../internals/object-define-property'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var InternalStateModule = require('../internals/internal-state'); +var inheritIfRequired = require('../internals/inherit-if-required'); - continue - } +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var enforceInternalState = InternalStateModule.enforce; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var round = Math.round; +var RangeError = global.RangeError; +var ArrayBuffer = ArrayBufferModule.ArrayBuffer; +var ArrayBufferPrototype = ArrayBuffer.prototype; +var DataView = ArrayBufferModule.DataView; +var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; +var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; +var TypedArray = ArrayBufferViewCore.TypedArray; +var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var isTypedArray = ArrayBufferViewCore.isTypedArray; +var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; +var WRONG_LENGTH = 'Wrong length'; - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } +var fromList = function (C, list) { + aTypedArrayConstructor(C); + var index = 0; + var length = list.length; + var result = new C(length); + while (length > index) result[index] = list[index++]; + return result; +}; - // 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) - } +var addGetter = function (it, key) { + nativeDefineProperty(it, key, { get: function () { + return getInternalState(this)[key]; + } }); +}; - leadSurrogate = null +var isArrayBuffer = function (it) { + var klass; + return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; +}; - // 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') - } - } +var isTypedArrayIndex = function (target, key) { + return isTypedArray(target) + && !isSymbol(key) + && key in target + && isIntegralNumber(+key) + && key >= 0; +}; - return bytes -} +var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { + key = toPropertyKey(key); + return isTypedArrayIndex(target, key) + ? createPropertyDescriptor(2, target[key]) + : nativeGetOwnPropertyDescriptor(target, key); +}; -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) +var wrappedDefineProperty = function defineProperty(target, key, descriptor) { + key = toPropertyKey(key); + if (isTypedArrayIndex(target, key) + && isObject(descriptor) + && hasOwn(descriptor, 'value') + && !hasOwn(descriptor, 'get') + && !hasOwn(descriptor, 'set') + // TODO: add validation descriptor w/o calling accessors + && !descriptor.configurable + && (!hasOwn(descriptor, 'writable') || descriptor.writable) + && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable) + ) { + target[key] = descriptor.value; + return target; + } return nativeDefineProperty(target, key, descriptor); +}; + +if (DESCRIPTORS) { + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; + definePropertyModule.f = wrappedDefineProperty; + addGetter(TypedArrayPrototype, 'buffer'); + addGetter(TypedArrayPrototype, 'byteOffset'); + addGetter(TypedArrayPrototype, 'byteLength'); + addGetter(TypedArrayPrototype, 'length'); } - 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 + $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { + getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, + defineProperty: wrappedDefineProperty + }); - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } + module.exports = function (TYPE, wrapper, CLAMPED) { + var BYTES = TYPE.match(/\d+$/)[0] / 8; + var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + TYPE; + var SETTER = 'set' + TYPE; + var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; + var TypedArrayConstructor = NativeTypedArrayConstructor; + var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; + var exported = {}; - return byteArray -} + var getter = function (that, index) { + var data = getInternalState(that); + return data.view[GETTER](index * BYTES + data.byteOffset, true); + }; -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} + var setter = function (that, index, value) { + var data = getInternalState(that); + if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; + data.view[SETTER](index * BYTES + data.byteOffset, value, true); + }; -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 -} + var addElement = function (that, index) { + nativeDefineProperty(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; -// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass -// the `instanceof` check but they should be treated as of that type. -// See: https://github.com/feross/buffer/issues/166 -function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) -} -function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare -} + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + TypedArrayConstructor = wrapper(function (that, data, offset, $length) { + anInstance(that, TypedArrayConstructorPrototype); + var index = 0; + var byteOffset = 0; + var buffer, byteLength, length; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new ArrayBuffer(byteLength); + } else if (isArrayBuffer(data)) { + buffer = data; + byteOffset = toOffset(offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - byteOffset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (isTypedArray(data)) { + return fromList(TypedArrayConstructor, data); + } else { + return call(typedArrayFrom, TypedArrayConstructor, data); + } + setInternalState(that, { + buffer: buffer, + byteOffset: byteOffset, + byteLength: byteLength, + length: length, + view: new DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); -}).call(this,require("buffer").Buffer) -},{"base64-js":174,"buffer":196,"ieee754":398}],197:[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" -} + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); + } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { + TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { + anInstance(dummy, TypedArrayConstructorPrototype); + return inheritIfRequired(function () { + if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); + if (isArrayBuffer(data)) return $length !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) + : typedArrayOffset !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) + : new NativeTypedArrayConstructor(data); + if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); + return call(typedArrayFrom, TypedArrayConstructor, data); + }(), dummy, TypedArrayConstructor); + }); -},{}],198:[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 -} - -},{}],199:[function(require,module,exports){ -/*! - * copy-to - index.js - * Copyright(c) 2014 dead_horse - * MIT Licensed - */ + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { + if (!(key in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); + } + }); + TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; + } -'use strict'; + if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); + } -/** - * slice() reference. - */ + enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor; -var slice = Array.prototype.slice; + if (TYPED_ARRAY_TAG) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); + } -/** - * Expose copy - * - * ``` - * copy({foo: 'nar', hello: 'copy'}).to({hello: 'world'}); - * copy({foo: 'nar', hello: 'copy'}).toCover({hello: 'world'}); - * ``` - * - * @param {Object} src - * @return {Copy} - */ + var FORCED = TypedArrayConstructor != NativeTypedArrayConstructor; -module.exports = Copy; + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; + $({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); -/** - * Copy - * @param {Object} src - * @param {Boolean} withAccess - */ + if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); + } -function Copy(src, withAccess) { - if (!(this instanceof Copy)) return new Copy(src, withAccess); - this.src = src; - this._withAccess = withAccess; -} + if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); + } -/** - * copy properties include getter and setter - * @param {[type]} val [description] - * @return {[type]} [description] - */ + setSpecies(CONSTRUCTOR_NAME); + }; +} else module.exports = function () { /* empty */ }; -Copy.prototype.withAccess = function (w) { - this._withAccess = w !== false; - return this; +},{"../internals/an-instance":191,"../internals/array-buffer":195,"../internals/array-buffer-view-core":194,"../internals/array-iteration":202,"../internals/classof":216,"../internals/create-non-enumerable-property":221,"../internals/create-property-descriptor":222,"../internals/descriptors":228,"../internals/export":246,"../internals/function-call":253,"../internals/global":261,"../internals/has-own-property":262,"../internals/inherit-if-required":269,"../internals/internal-state":271,"../internals/is-integral-number":278,"../internals/is-object":280,"../internals/is-symbol":283,"../internals/object-create":297,"../internals/object-define-property":299,"../internals/object-get-own-property-descriptor":300,"../internals/object-get-own-property-names":302,"../internals/object-is-prototype-of":305,"../internals/object-set-prototype-of":309,"../internals/set-species":331,"../internals/to-index":347,"../internals/to-length":350,"../internals/to-offset":352,"../internals/to-property-key":355,"../internals/typed-array-constructors-require-wrappers":360,"../internals/typed-array-from":362}],360:[function(require,module,exports){ +/* eslint-disable no-new -- required for testing */ +var global = require('../internals/global'); +var fails = require('../internals/fails'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS; + +var ArrayBuffer = global.ArrayBuffer; +var Int8Array = global.Int8Array; + +module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { + Int8Array(1); +}) || !fails(function () { + new Int8Array(-1); +}) || !checkCorrectnessOfIteration(function (iterable) { + new Int8Array(); + new Int8Array(null); + new Int8Array(1.5); + new Int8Array(iterable); +}, true) || fails(function () { + // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill + return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; +}); + +},{"../internals/array-buffer-view-core":194,"../internals/check-correctness-of-iteration":214,"../internals/fails":247,"../internals/global":261}],361:[function(require,module,exports){ +var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list'); +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); + +module.exports = function (instance, list) { + return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list); }; -/** - * pick keys in src - * - * @api: public - */ +},{"../internals/array-from-constructor-and-list":199,"../internals/typed-array-species-constructor":363}],362:[function(require,module,exports){ +var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var aConstructor = require('../internals/a-constructor'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var isBigIntArray = require('../internals/is-big-int-array'); +var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor; +var toBigInt = require('../internals/to-big-int'); -Copy.prototype.pick = function(keys) { - if (!Array.isArray(keys)) { - keys = slice.call(arguments); +module.exports = function from(source /* , mapfn, thisArg */) { + var C = aConstructor(this); + var O = toObject(source); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var i, length, result, thisIsBigIntArray, value, step, iterator, next; + if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { + iterator = getIterator(O, iteratorMethod); + next = iterator.next; + O = []; + while (!(step = call(next, iterator)).done) { + O.push(step.value); + } } - if (keys.length) { - this.keys = keys; + if (mapping && argumentsLength > 2) { + mapfn = bind(mapfn, arguments[2]); } - return this; + length = lengthOfArrayLike(O); + result = new (aTypedArrayConstructor(C))(length); + thisIsBigIntArray = isBigIntArray(result); + for (i = 0; length > i; i++) { + value = mapping ? mapfn(O[i], i) : O[i]; + // FF30- typed arrays doesn't properly convert objects to typed array values + result[i] = thisIsBigIntArray ? toBigInt(value) : +value; + } + return result; }; -/** - * copy src to target, - * do not cover any property target has - * @param {Object} to - * - * @api: public - */ +},{"../internals/a-constructor":187,"../internals/array-buffer-view-core":194,"../internals/function-bind-context":250,"../internals/function-call":253,"../internals/get-iterator":258,"../internals/get-iterator-method":257,"../internals/is-array-iterator-method":272,"../internals/is-big-int-array":274,"../internals/length-of-array-like":290,"../internals/to-big-int":346,"../internals/to-object":351}],363:[function(require,module,exports){ +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var speciesConstructor = require('../internals/species-constructor'); -Copy.prototype.to = function(to) { - to = to || {}; +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; - if (!this.src) return to; - var keys = this.keys || Object.keys(this.src); +// a part of `TypedArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#typedarray-species-create +module.exports = function (originalArray) { + return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray))); +}; - 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; - } +},{"../internals/array-buffer-view-core":194,"../internals/species-constructor":336}],364:[function(require,module,exports){ +var uncurryThis = require('../internals/function-uncurry-this'); - 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); +var id = 0; +var postfix = Math.random(); +var toString = uncurryThis(1.0.toString); - if (!getter && !setter) { - to[key] = this.src[key]; - } - } - return to; +module.exports = function (key) { + return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; -/** - * copy src to target, - * override any property target has - * @param {Object} to - * - * @api: public - */ +},{"../internals/function-uncurry-this":255}],365:[function(require,module,exports){ +/* eslint-disable es/no-symbol -- required for testing */ +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); -Copy.prototype.toCover = function(to) { - var keys = this.keys || Object.keys(this.src); +module.exports = NATIVE_SYMBOL + && !Symbol.sham + && typeof Symbol.iterator == 'symbol'; - 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); +},{"../internals/symbol-constructor-detection":340}],366:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); - if (!getter && !setter) { - to[key] = this.src[key]; - } - } +// V8 ~ Chrome 36- +// https://bugs.chromium.org/p/v8/issues/detail?id=3334 +module.exports = DESCRIPTORS && fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty(function () { /* empty */ }, 'prototype', { + value: 42, + writable: false + }).prototype != 42; +}); + +},{"../internals/descriptors":228,"../internals/fails":247}],367:[function(require,module,exports){ +var $TypeError = TypeError; + +module.exports = function (passed, required) { + if (passed < required) throw $TypeError('Not enough arguments'); + return passed; }; -Copy.prototype.override = Copy.prototype.toCover; +},{}],368:[function(require,module,exports){ +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); -/** - * 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; -} +var WeakMap = global.WeakMap; -},{}],200:[function(require,module,exports){ -module.exports = function (it) { - if (typeof it != 'function') { - throw TypeError(String(it) + ' is not a function'); - } return it; -}; +module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); -},{}],201:[function(require,module,exports){ -var isObject = require('../internals/is-object'); +},{"../internals/global":261,"../internals/is-callable":275}],369:[function(require,module,exports){ +var path = require('../internals/path'); +var hasOwn = require('../internals/has-own-property'); +var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); +var defineProperty = require('../internals/object-define-property').f; -module.exports = function (it) { - if (!isObject(it) && it !== null) { - throw TypeError("Can't set " + String(it) + ' as a prototype'); - } return it; +module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); }; -},{"../internals/is-object":262}],202:[function(require,module,exports){ +},{"../internals/has-own-property":262,"../internals/object-define-property":299,"../internals/path":314,"../internals/well-known-symbol-wrapped":370}],370:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); -var create = require('../internals/object-create'); -var definePropertyModule = require('../internals/object-define-property'); -var UNSCOPABLES = wellKnownSymbol('unscopables'); -var ArrayPrototype = Array.prototype; - -// Array.prototype[@@unscopables] -// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables -if (ArrayPrototype[UNSCOPABLES] == undefined) { - definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { - configurable: true, - value: create(null) - }); -} +exports.f = wellKnownSymbol; -// add a key to Array.prototype[@@unscopables] -module.exports = function (key) { - ArrayPrototype[UNSCOPABLES][key] = true; -}; +},{"../internals/well-known-symbol":371}],371:[function(require,module,exports){ +var global = require('../internals/global'); +var shared = require('../internals/shared'); +var hasOwn = require('../internals/has-own-property'); +var uid = require('../internals/uid'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); -},{"../internals/object-create":276,"../internals/object-define-property":278,"../internals/well-known-symbol":329}],203:[function(require,module,exports){ -'use strict'; -var charAt = require('../internals/string-multibyte').charAt; +var WellKnownSymbolsStore = shared('wks'); +var Symbol = global.Symbol; +var symbolFor = Symbol && Symbol['for']; +var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; -// `AdvanceStringIndex` abstract operation -// https://tc39.github.io/ecma262/#sec-advancestringindex -module.exports = function (S, index, unicode) { - return index + (unicode ? charAt(S, index).length : 1); +module.exports = function (name) { + if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { + var description = 'Symbol.' + name; + if (NATIVE_SYMBOL && hasOwn(Symbol, name)) { + WellKnownSymbolsStore[name] = Symbol[name]; + } else if (USE_SYMBOL_AS_UID && symbolFor) { + WellKnownSymbolsStore[name] = symbolFor(description); + } else { + WellKnownSymbolsStore[name] = createWellKnownSymbol(description); + } + } return WellKnownSymbolsStore[name]; }; -},{"../internals/string-multibyte":309}],204:[function(require,module,exports){ -module.exports = function (it, Constructor, name) { - if (!(it instanceof Constructor)) { - throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); - } return it; -}; +},{"../internals/global":261,"../internals/has-own-property":262,"../internals/shared":335,"../internals/symbol-constructor-detection":340,"../internals/uid":364,"../internals/use-symbol-as-uid":365}],372:[function(require,module,exports){ +// a string of all valid unicode whitespaces +module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; -},{}],205:[function(require,module,exports){ -var isObject = require('../internals/is-object'); +},{}],373:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var ArrayBufferModule = require('../internals/array-buffer'); +var anObject = require('../internals/an-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toLength = require('../internals/to-length'); +var speciesConstructor = require('../internals/species-constructor'); -module.exports = function (it) { - if (!isObject(it)) { - throw TypeError(String(it) + ' is not an object'); - } return it; -}; +var ArrayBuffer = ArrayBufferModule.ArrayBuffer; +var DataView = ArrayBufferModule.DataView; +var DataViewPrototype = DataView.prototype; +var nativeArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice); +var getUint8 = uncurryThis(DataViewPrototype.getUint8); +var setUint8 = uncurryThis(DataViewPrototype.setUint8); + +var INCORRECT_SLICE = fails(function () { + return !new ArrayBuffer(2).slice(1, undefined).byteLength; +}); -},{"../internals/is-object":262}],206:[function(require,module,exports){ -module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined'; +// `ArrayBuffer.prototype.slice` method +// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice +$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { + slice: function slice(start, end) { + if (nativeArrayBufferSlice && end === undefined) { + return nativeArrayBufferSlice(anObject(this), start); // FF fix + } + var length = anObject(this).byteLength; + var first = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first)); + var viewSource = new DataView(this); + var viewTarget = new DataView(result); + var index = 0; + while (first < fin) { + setUint8(viewTarget, index++, getUint8(viewSource, first++)); + } return result; + } +}); -},{}],207:[function(require,module,exports){ +},{"../internals/an-object":192,"../internals/array-buffer":195,"../internals/export":246,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/species-constructor":336,"../internals/to-absolute-index":345,"../internals/to-length":350}],374:[function(require,module,exports){ 'use strict'; -var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native'); -var DESCRIPTORS = require('../internals/descriptors'); -var global = require('../internals/global'); +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var isArray = require('../internals/is-array'); var isObject = require('../internals/is-object'); -var has = require('../internals/has'); -var classof = require('../internals/classof'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var redefine = require('../internals/redefine'); -var defineProperty = require('../internals/object-define-property').f; -var getPrototypeOf = require('../internals/object-get-prototype-of'); -var setPrototypeOf = require('../internals/object-set-prototype-of'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); +var createProperty = require('../internals/create-property'); +var arraySpeciesCreate = require('../internals/array-species-create'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); var wellKnownSymbol = require('../internals/well-known-symbol'); -var uid = require('../internals/uid'); - -var Int8Array = global.Int8Array; -var Int8ArrayPrototype = Int8Array && Int8Array.prototype; -var Uint8ClampedArray = global.Uint8ClampedArray; -var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; -var TypedArray = Int8Array && getPrototypeOf(Int8Array); -var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); -var ObjectPrototype = Object.prototype; -var isPrototypeOf = ObjectPrototype.isPrototypeOf; - -var TO_STRING_TAG = wellKnownSymbol('toStringTag'); -var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); -// Fixing native typed arrays in Opera Presto crashes the browser, see #595 -var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; -var TYPED_ARRAY_TAG_REQIRED = false; -var NAME; - -var TypedArrayConstructorsList = { - Int8Array: 1, - Uint8Array: 1, - Uint8ClampedArray: 1, - Int16Array: 2, - Uint16Array: 2, - Int32Array: 4, - Uint32Array: 4, - Float32Array: 4, - Float64Array: 8 -}; +var V8_VERSION = require('../internals/engine-v8-version'); -var isView = function isView(it) { - var klass = classof(it); - return klass === 'DataView' || has(TypedArrayConstructorsList, klass); -}; +var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); -var isTypedArray = function (it) { - return isObject(it) && has(TypedArrayConstructorsList, classof(it)); -}; +// We can't use this feature detection in V8 since it causes +// deoptimization and serious performance degradation +// https://github.com/zloirock/core-js/issues/679 +var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; +}); -var aTypedArray = function (it) { - if (isTypedArray(it)) return it; - throw TypeError('Target is not a typed array'); -}; +var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); -var aTypedArrayConstructor = function (C) { - if (setPrototypeOf) { - if (isPrototypeOf.call(TypedArray, C)) return C; - } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) { - var TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) { - return C; - } - } throw TypeError('Target is not a typed array constructor'); +var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); }; -var exportTypedArrayMethod = function (KEY, property, forced) { - if (!DESCRIPTORS) return; - if (forced) for (var ARRAY in TypedArrayConstructorsList) { - var TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) { - delete TypedArrayConstructor.prototype[KEY]; - } - } - if (!TypedArrayPrototype[KEY] || forced) { - redefine(TypedArrayPrototype, KEY, forced ? property - : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property); - } -}; +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; -var exportTypedArrayStaticMethod = function (KEY, property, forced) { - var ARRAY, TypedArrayConstructor; - if (!DESCRIPTORS) return; - if (setPrototypeOf) { - if (forced) for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) { - delete TypedArrayConstructor[KEY]; +// `Array.prototype.concat` method +// https://tc39.es/ecma262/#sec-array.prototype.concat +// with adding support of @@isConcatSpreadable and @@species +$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` + concat: function concat(arg) { + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = lengthOfArrayLike(E); + doesNotExceedSafeInteger(n + len); + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + doesNotExceedSafeInteger(n + 1); + createProperty(A, n++, E); } } - if (!TypedArray[KEY] || forced) { - // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable - try { - return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property); - } catch (error) { /* empty */ } - } else return; - } - for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { - redefine(TypedArrayConstructor, KEY, property); - } + A.length = n; + return A; } -}; +}); -for (NAME in TypedArrayConstructorsList) { - if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; -} +},{"../internals/array-method-has-species-support":204,"../internals/array-species-create":212,"../internals/create-property":223,"../internals/does-not-exceed-safe-integer":231,"../internals/engine-v8-version":243,"../internals/export":246,"../internals/fails":247,"../internals/is-array":273,"../internals/is-object":280,"../internals/length-of-array-like":290,"../internals/to-object":351,"../internals/well-known-symbol":371}],375:[function(require,module,exports){ +var $ = require('../internals/export'); +var fill = require('../internals/array-fill'); +var addToUnscopables = require('../internals/add-to-unscopables'); -// WebKit bug - typed arrays constructors prototype is Object.prototype -if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) { - // eslint-disable-next-line no-shadow - TypedArray = function TypedArray() { - throw TypeError('Incorrect invocation'); - }; - if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); - } -} +// `Array.prototype.fill` method +// https://tc39.es/ecma262/#sec-array.prototype.fill +$({ target: 'Array', proto: true }, { + fill: fill +}); -if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { - TypedArrayPrototype = TypedArray.prototype; - if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); - } -} +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('fill'); -// WebKit bug - one more object in Uint8ClampedArray prototype chain -if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { - setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); -} +},{"../internals/add-to-unscopables":189,"../internals/array-fill":197,"../internals/export":246}],376:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $filter = require('../internals/array-iteration').filter; +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { - TYPED_ARRAY_TAG_REQIRED = true; - defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () { - return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; - } }); - for (NAME in TypedArrayConstructorsList) if (global[NAME]) { - createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + +// `Array.prototype.filter` method +// https://tc39.es/ecma262/#sec-array.prototype.filter +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } -} +}); -module.exports = { - NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, - TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, - aTypedArray: aTypedArray, - aTypedArrayConstructor: aTypedArrayConstructor, - exportTypedArrayMethod: exportTypedArrayMethod, - exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, - isView: isView, - isTypedArray: isTypedArray, - TypedArray: TypedArray, - TypedArrayPrototype: TypedArrayPrototype -}; +},{"../internals/array-iteration":202,"../internals/array-method-has-species-support":204,"../internals/export":246}],377:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $find = require('../internals/array-iteration').find; +var addToUnscopables = require('../internals/add-to-unscopables'); + +var FIND = 'find'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.find` method +// https://tc39.es/ecma262/#sec-array.prototype.find +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND); + +},{"../internals/add-to-unscopables":189,"../internals/array-iteration":202,"../internals/export":246}],378:[function(require,module,exports){ +var $ = require('../internals/export'); +var from = require('../internals/array-from'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); + +var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + // eslint-disable-next-line es/no-array-from -- required for testing + Array.from(iterable); +}); + +// `Array.from` method +// https://tc39.es/ecma262/#sec-array.from +$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { + from: from +}); -},{"../internals/array-buffer-native":206,"../internals/classof":224,"../internals/create-non-enumerable-property":229,"../internals/descriptors":234,"../internals/global":248,"../internals/has":249,"../internals/is-object":262,"../internals/object-define-property":278,"../internals/object-get-prototype-of":283,"../internals/object-set-prototype-of":287,"../internals/redefine":295,"../internals/uid":326,"../internals/well-known-symbol":329}],208:[function(require,module,exports){ +},{"../internals/array-from":200,"../internals/check-correctness-of-iteration":214,"../internals/export":246}],379:[function(require,module,exports){ 'use strict'; -var global = require('../internals/global'); -var DESCRIPTORS = require('../internals/descriptors'); -var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var redefineAll = require('../internals/redefine-all'); +var $ = require('../internals/export'); +var $includes = require('../internals/array-includes').includes; var fails = require('../internals/fails'); -var anInstance = require('../internals/an-instance'); -var toInteger = require('../internals/to-integer'); -var toLength = require('../internals/to-length'); -var toIndex = require('../internals/to-index'); -var IEEE754 = require('../internals/ieee754'); -var getPrototypeOf = require('../internals/object-get-prototype-of'); -var setPrototypeOf = require('../internals/object-set-prototype-of'); -var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; -var defineProperty = require('../internals/object-define-property').f; -var arrayFill = require('../internals/array-fill'); -var setToStringTag = require('../internals/set-to-string-tag'); +var addToUnscopables = require('../internals/add-to-unscopables'); + +// FF99+ bug +var BROKEN_ON_SPARSE = fails(function () { + return !Array(1).includes(); +}); + +// `Array.prototype.includes` method +// https://tc39.es/ecma262/#sec-array.prototype.includes +$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('includes'); + +},{"../internals/add-to-unscopables":189,"../internals/array-includes":201,"../internals/export":246,"../internals/fails":247}],380:[function(require,module,exports){ +'use strict'; +var toIndexedObject = require('../internals/to-indexed-object'); +var addToUnscopables = require('../internals/add-to-unscopables'); +var Iterators = require('../internals/iterators'); var InternalStateModule = require('../internals/internal-state'); +var defineProperty = require('../internals/object-define-property').f; +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); +var IS_PURE = require('../internals/is-pure'); +var DESCRIPTORS = require('../internals/descriptors'); -var getInternalState = InternalStateModule.get; +var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length'; -var WRONG_INDEX = 'Wrong index'; -var NativeArrayBuffer = global[ARRAY_BUFFER]; -var $ArrayBuffer = NativeArrayBuffer; -var $DataView = global[DATA_VIEW]; -var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; -var ObjectPrototype = Object.prototype; -var RangeError = global.RangeError; +var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); -var packIEEE754 = IEEE754.pack; -var unpackIEEE754 = IEEE754.unpack; +// `Array.prototype.entries` method +// https://tc39.es/ecma262/#sec-array.prototype.entries +// `Array.prototype.keys` method +// https://tc39.es/ecma262/#sec-array.prototype.keys +// `Array.prototype.values` method +// https://tc39.es/ecma262/#sec-array.prototype.values +// `Array.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-array.prototype-@@iterator +// `CreateArrayIterator` internal method +// https://tc39.es/ecma262/#sec-createarrayiterator +module.exports = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), // target + index: 0, // next index + kind: kind // kind + }); +// `%ArrayIteratorPrototype%.next` method +// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next +}, function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return createIterResultObject(undefined, true); + } + if (kind == 'keys') return createIterResultObject(index, false); + if (kind == 'values') return createIterResultObject(target[index], false); + return createIterResultObject([index, target[index]], false); +}, 'values'); -var packInt8 = function (number) { - return [number & 0xFF]; -}; +// argumentsList[@@iterator] is %ArrayProto_values% +// https://tc39.es/ecma262/#sec-createunmappedargumentsobject +// https://tc39.es/ecma262/#sec-createmappedargumentsobject +var values = Iterators.Arguments = Iterators.Array; -var packInt16 = function (number) { - return [number & 0xFF, number >> 8 & 0xFF]; -}; +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); -var packInt32 = function (number) { - return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; -}; +// V8 ~ Chrome 45- bug +if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { + defineProperty(values, 'name', { value: 'values' }); +} catch (error) { /* empty */ } -var unpackInt32 = function (buffer) { - return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; -}; +},{"../internals/add-to-unscopables":189,"../internals/create-iter-result-object":220,"../internals/descriptors":228,"../internals/internal-state":271,"../internals/is-pure":281,"../internals/iterator-define":287,"../internals/iterators":289,"../internals/object-define-property":299,"../internals/to-indexed-object":348}],381:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var IndexedObject = require('../internals/indexed-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); -var packFloat32 = function (number) { - return packIEEE754(number, 23, 4); -}; +var nativeJoin = uncurryThis([].join); -var packFloat64 = function (number) { - return packIEEE754(number, 52, 8); -}; +var ES3_STRINGS = IndexedObject != Object; +var STRICT_METHOD = arrayMethodIsStrict('join', ','); -var addGetter = function (Constructor, key) { - defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } }); -}; +// `Array.prototype.join` method +// https://tc39.es/ecma262/#sec-array.prototype.join +$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, { + join: function join(separator) { + return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator); + } +}); -var get = function (view, count, index, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; - var start = intIndex + store.byteOffset; - var pack = bytes.slice(start, start + count); - return isLittleEndian ? pack : pack.reverse(); -}; +},{"../internals/array-method-is-strict":205,"../internals/export":246,"../internals/function-uncurry-this":255,"../internals/indexed-object":268,"../internals/to-indexed-object":348}],382:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $map = require('../internals/array-iteration').map; +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -var set = function (view, count, index, conversion, value, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; - var start = intIndex + store.byteOffset; - var pack = conversion(+value); - for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; -}; +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); -if (!NATIVE_ARRAY_BUFFER) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - setInternalState(this, { - bytes: arrayFill.call(new Array(byteLength), 0), - byteLength: byteLength - }); - if (!DESCRIPTORS) this.byteLength = byteLength; - }; +// `Array.prototype.map` method +// https://tc39.es/ecma262/#sec-array.prototype.map +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = getInternalState(buffer).byteLength; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - setInternalState(this, { - buffer: buffer, - byteLength: byteLength, - byteOffset: offset - }); - if (!DESCRIPTORS) { - this.buffer = buffer; - this.byteLength = byteLength; - this.byteOffset = offset; - } - }; +},{"../internals/array-iteration":202,"../internals/array-method-has-species-support":204,"../internals/export":246}],383:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var isArray = require('../internals/is-array'); +var isConstructor = require('../internals/is-constructor'); +var isObject = require('../internals/is-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var toIndexedObject = require('../internals/to-indexed-object'); +var createProperty = require('../internals/create-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); +var nativeSlice = require('../internals/array-slice'); - if (DESCRIPTORS) { - addGetter($ArrayBuffer, 'byteLength'); - addGetter($DataView, 'buffer'); - addGetter($DataView, 'byteLength'); - addGetter($DataView, 'byteOffset'); +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); + +var SPECIES = wellKnownSymbol('species'); +var $Array = Array; +var max = Math.max; + +// `Array.prototype.slice` method +// https://tc39.es/ecma262/#sec-array.prototype.slice +// fallback for not array-like ES3 strings and DOM objects +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = lengthOfArrayLike(O); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === $Array || Constructor === undefined) { + return nativeSlice(O, k, fin); + } + } + result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0)); + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; } +}); - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); +},{"../internals/array-method-has-species-support":204,"../internals/array-slice":209,"../internals/create-property":223,"../internals/export":246,"../internals/is-array":273,"../internals/is-constructor":276,"../internals/is-object":280,"../internals/length-of-array-like":290,"../internals/to-absolute-index":345,"../internals/to-indexed-object":348,"../internals/well-known-symbol":371}],384:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var aCallable = require('../internals/a-callable'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var deletePropertyOrThrow = require('../internals/delete-property-or-throw'); +var toString = require('../internals/to-string'); +var fails = require('../internals/fails'); +var internalSort = require('../internals/array-sort'); +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); +var FF = require('../internals/engine-ff-version'); +var IE_OR_EDGE = require('../internals/engine-is-ie-or-edge'); +var V8 = require('../internals/engine-v8-version'); +var WEBKIT = require('../internals/engine-webkit-version'); + +var test = []; +var nativeSort = uncurryThis(test.sort); +var push = uncurryThis(test.push); + +// IE8- +var FAILS_ON_UNDEFINED = fails(function () { + test.sort(undefined); +}); +// V8 bug +var FAILS_ON_NULL = fails(function () { + test.sort(null); +}); +// Old WebKit +var STRICT_METHOD = arrayMethodIsStrict('sort'); + +var STABLE_SORT = !fails(function () { + // feature detection can be too slow, so check engines versions + if (V8) return V8 < 70; + if (FF && FF > 3) return; + if (IE_OR_EDGE) return true; + if (WEBKIT) return WEBKIT < 603; + + var result = ''; + var code, chr, value, index; + + // generate an array with more 512 elements (Chakra and old V8 fails only in this case) + for (code = 65; code < 76; code++) { + chr = String.fromCharCode(code); + + switch (code) { + case 66: case 69: case 70: case 72: value = 3; break; + case 68: case 71: value = 4; break; + default: value = 2; } - }); -} else { - if (!fails(function () { - NativeArrayBuffer(1); - }) || !fails(function () { - new NativeArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new NativeArrayBuffer(); // eslint-disable-line no-new - new NativeArrayBuffer(1.5); // eslint-disable-line no-new - new NativeArrayBuffer(NaN); // eslint-disable-line no-new - return NativeArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new NativeArrayBuffer(toIndex(length)); - }; - var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE]; - for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) { - createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); - } + + for (index = 0; index < 47; index++) { + test.push({ k: chr + index, v: value }); } - ArrayBufferPrototype.constructor = $ArrayBuffer; } - // WebKit bug - the same parent prototype for typed arrays and data view - if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) { - setPrototypeOf($DataViewPrototype, ObjectPrototype); + test.sort(function (a, b) { return b.v - a.v; }); + + for (index = 0; index < test.length; index++) { + chr = test[index].k.charAt(0); + if (result.charAt(result.length - 1) !== chr) result += chr; } - // iOS Safari 7.x bug - var testView = new $DataView(new $ArrayBuffer(2)); - var nativeSetInt8 = $DataViewPrototype.setInt8; - testView.setInt8(0, 2147483648); - testView.setInt8(1, 2147483649); - if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, { - setInt8: function setInt8(byteOffset, value) { - nativeSetInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - nativeSetInt8.call(this, byteOffset, value << 24 >> 24); - } - }, { unsafe: true }); -} + return result !== 'DGBEFHACIJK'; +}); -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); +var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT; -module.exports = { - ArrayBuffer: $ArrayBuffer, - DataView: $DataView +var getSortCompare = function (comparefn) { + return function (x, y) { + if (y === undefined) return -1; + if (x === undefined) return 1; + if (comparefn !== undefined) return +comparefn(x, y) || 0; + return toString(x) > toString(y) ? 1 : -1; + }; }; -},{"../internals/an-instance":204,"../internals/array-buffer-native":206,"../internals/array-fill":210,"../internals/create-non-enumerable-property":229,"../internals/descriptors":234,"../internals/fails":243,"../internals/global":248,"../internals/ieee754":254,"../internals/internal-state":258,"../internals/object-define-property":278,"../internals/object-get-own-property-names":281,"../internals/object-get-prototype-of":283,"../internals/object-set-prototype-of":287,"../internals/redefine-all":294,"../internals/set-to-string-tag":304,"../internals/to-index":314,"../internals/to-integer":316,"../internals/to-length":317}],209:[function(require,module,exports){ -'use strict'; -var toObject = require('../internals/to-object'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var toLength = require('../internals/to-length'); +// `Array.prototype.sort` method +// https://tc39.es/ecma262/#sec-array.prototype.sort +$({ target: 'Array', proto: true, forced: FORCED }, { + sort: function sort(comparefn) { + if (comparefn !== undefined) aCallable(comparefn); -var min = Math.min; + var array = toObject(this); -// `Array.prototype.copyWithin` method implementation -// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; + if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn); -},{"../internals/to-absolute-index":313,"../internals/to-length":317,"../internals/to-object":318}],210:[function(require,module,exports){ -'use strict'; -var toObject = require('../internals/to-object'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var toLength = require('../internals/to-length'); + var items = []; + var arrayLength = lengthOfArrayLike(array); + var itemsLength, index; -// `Array.prototype.fill` method implementation -// https://tc39.github.io/ecma262/#sec-array.prototype.fill -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var argumentsLength = arguments.length; - var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); - var end = argumentsLength > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; + for (index = 0; index < arrayLength; index++) { + if (index in array) push(items, array[index]); + } -},{"../internals/to-absolute-index":313,"../internals/to-length":317,"../internals/to-object":318}],211:[function(require,module,exports){ -'use strict'; -var $forEach = require('../internals/array-iteration').forEach; -var arrayMethodIsStrict = require('../internals/array-method-is-strict'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); + internalSort(items, getSortCompare(comparefn)); -var STRICT_METHOD = arrayMethodIsStrict('forEach'); -var USES_TO_LENGTH = arrayMethodUsesToLength('forEach'); + itemsLength = lengthOfArrayLike(items); + index = 0; -// `Array.prototype.forEach` method implementation -// https://tc39.github.io/ecma262/#sec-array.prototype.foreach -module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); -} : [].forEach; + while (index < itemsLength) array[index] = items[index++]; + while (index < arrayLength) deletePropertyOrThrow(array, index++); + + return array; + } +}); -},{"../internals/array-iteration":214,"../internals/array-method-is-strict":217,"../internals/array-method-uses-to-length":218}],212:[function(require,module,exports){ +},{"../internals/a-callable":186,"../internals/array-method-is-strict":205,"../internals/array-sort":210,"../internals/delete-property-or-throw":227,"../internals/engine-ff-version":234,"../internals/engine-is-ie-or-edge":237,"../internals/engine-v8-version":243,"../internals/engine-webkit-version":244,"../internals/export":246,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/length-of-array-like":290,"../internals/to-object":351,"../internals/to-string":357}],385:[function(require,module,exports){ 'use strict'; -var bind = require('../internals/function-bind-context'); +var $ = require('../internals/export'); var toObject = require('../internals/to-object'); -var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); -var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); -var toLength = require('../internals/to-length'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var setArrayLength = require('../internals/array-set-length'); +var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); +var arraySpeciesCreate = require('../internals/array-species-create'); var createProperty = require('../internals/create-property'); -var getIteratorMethod = require('../internals/get-iterator-method'); +var deletePropertyOrThrow = require('../internals/delete-property-or-throw'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -// `Array.from` method implementation -// https://tc39.github.io/ecma262/#sec-array.from -module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var index = 0; - var length, result, step, iterator, next, value; - if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); - // if the target is not iterable or it's an array with the default iterator - use a simple case - if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); - next = iterator.next; - result = new C(); - for (;!(step = next.call(iterator)).done; index++) { - value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; - createProperty(result, index, value); +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); + +var max = Math.max; +var min = Math.min; + +// `Array.prototype.splice` method +// https://tc39.es/ecma262/#sec-array.prototype.splice +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + splice: function splice(start, deleteCount /* , ...items */) { + var O = toObject(this); + var len = lengthOfArrayLike(O); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); } - } else { - length = toLength(O.length); - result = new C(length); - for (;length > index; index++) { - value = mapping ? mapfn(O[index], index) : O[index]; - createProperty(result, index, value); + doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from]; + else deletePropertyOrThrow(O, to); + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1); + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from]; + else deletePropertyOrThrow(O, to); + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; } + setArrayLength(O, len - actualDeleteCount + insertCount); + return A; } - result.length = index; - return result; -}; +}); -},{"../internals/call-with-safe-iteration-closing":221,"../internals/create-property":231,"../internals/function-bind-context":245,"../internals/get-iterator-method":247,"../internals/is-array-iterator-method":259,"../internals/to-length":317,"../internals/to-object":318}],213:[function(require,module,exports){ -var toIndexedObject = require('../internals/to-indexed-object'); -var toLength = require('../internals/to-length'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); +},{"../internals/array-method-has-species-support":204,"../internals/array-set-length":207,"../internals/array-species-create":212,"../internals/create-property":223,"../internals/delete-property-or-throw":227,"../internals/does-not-exceed-safe-integer":231,"../internals/export":246,"../internals/length-of-array-like":290,"../internals/to-absolute-index":345,"../internals/to-integer-or-infinity":349,"../internals/to-object":351}],386:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS; +var uncurryThis = require('../internals/function-uncurry-this'); +var defineProperty = require('../internals/object-define-property').f; -// `Array.prototype.{ indexOf, includes }` methods implementation -var createMethod = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIndexedObject($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) && O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; +var FunctionPrototype = Function.prototype; +var functionToString = uncurryThis(FunctionPrototype.toString); +var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; +var regExpExec = uncurryThis(nameRE.exec); +var NAME = 'name'; -module.exports = { - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - includes: createMethod(true), - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - indexOf: createMethod(false) -}; - -},{"../internals/to-absolute-index":313,"../internals/to-indexed-object":315,"../internals/to-length":317}],214:[function(require,module,exports){ -var bind = require('../internals/function-bind-context'); -var IndexedObject = require('../internals/indexed-object'); -var toObject = require('../internals/to-object'); -var toLength = require('../internals/to-length'); -var arraySpeciesCreate = require('../internals/array-species-create'); - -var push = [].push; - -// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation -var createMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - return function ($this, callbackfn, that, specificCreate) { - var O = toObject($this); - var self = IndexedObject(O); - var boundFunction = bind(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var value, result; - for (;length > index; index++) if (NO_HOLES || index in self) { - value = self[index]; - result = boundFunction(value, index, O); - if (TYPE) { - if (IS_MAP) target[index] = result; // map - else if (result) switch (TYPE) { - case 3: return true; // some - case 5: return value; // find - case 6: return index; // findIndex - case 2: push.call(target, value); // filter - } else if (IS_EVERY) return false; // every +// Function instances `.name` property +// https://tc39.es/ecma262/#sec-function-instances-name +if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { + defineProperty(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return regExpExec(nameRE, functionToString(this))[1]; + } catch (error) { + return ''; } } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; - }; -}; - -module.exports = { - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - forEach: createMethod(0), - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - map: createMethod(1), - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - filter: createMethod(2), - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - some: createMethod(3), - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - every: createMethod(4), - // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find - find: createMethod(5), - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - findIndex: createMethod(6) -}; - -},{"../internals/array-species-create":220,"../internals/function-bind-context":245,"../internals/indexed-object":255,"../internals/to-length":317,"../internals/to-object":318}],215:[function(require,module,exports){ -'use strict'; -var toIndexedObject = require('../internals/to-indexed-object'); -var toInteger = require('../internals/to-integer'); -var toLength = require('../internals/to-length'); -var arrayMethodIsStrict = require('../internals/array-method-is-strict'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var min = Math.min; -var nativeLastIndexOf = [].lastIndexOf; -var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; -var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); -// For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method -var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); -var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH; - -// `Array.prototype.lastIndexOf` method implementation -// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof -module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0; - var O = toIndexedObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; - return -1; -} : nativeLastIndexOf; + }); +} -},{"../internals/array-method-is-strict":217,"../internals/array-method-uses-to-length":218,"../internals/to-indexed-object":315,"../internals/to-integer":316,"../internals/to-length":317}],216:[function(require,module,exports){ +},{"../internals/descriptors":228,"../internals/function-name":254,"../internals/function-uncurry-this":255,"../internals/object-define-property":299}],387:[function(require,module,exports){ +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var V8_VERSION = require('../internals/engine-v8-version'); - -var SPECIES = wellKnownSymbol('species'); +var isArray = require('../internals/is-array'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var isSymbol = require('../internals/is-symbol'); +var arraySlice = require('../internals/array-slice'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); -module.exports = function (METHOD_NAME) { - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/677 - return V8_VERSION >= 51 || !fails(function () { - var array = []; - var constructor = array.constructor = {}; - constructor[SPECIES] = function () { - return { foo: 1 }; - }; - return array[METHOD_NAME](Boolean).foo !== 1; - }); +var $stringify = getBuiltIn('JSON', 'stringify'); +var exec = uncurryThis(/./.exec); +var charAt = uncurryThis(''.charAt); +var charCodeAt = uncurryThis(''.charCodeAt); +var replace = uncurryThis(''.replace); +var numberToString = uncurryThis(1.0.toString); + +var tester = /[\uD800-\uDFFF]/g; +var low = /^[\uD800-\uDBFF]$/; +var hi = /^[\uDC00-\uDFFF]$/; + +var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { + var symbol = getBuiltIn('Symbol')(); + // MS Edge converts symbol values to JSON as {} + return $stringify([symbol]) != '[null]' + // WebKit converts symbol values to JSON as null + || $stringify({ a: symbol }) != '{}' + // V8 throws on boxed symbols + || $stringify(Object(symbol)) != '{}'; +}); + +// https://github.com/tc39/proposal-well-formed-stringify +var ILL_FORMED_UNICODE = fails(function () { + return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' + || $stringify('\uDEAD') !== '"\\udead"'; +}); + +var stringifyWithSymbolsFix = function (it, replacer) { + var args = arraySlice(arguments); + var $replacer = replacer; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (isCallable($replacer)) value = call($replacer, this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return apply($stringify, null, args); }; -},{"../internals/engine-v8-version":240,"../internals/fails":243,"../internals/well-known-symbol":329}],217:[function(require,module,exports){ -'use strict'; -var fails = require('../internals/fails'); +var fixIllFormed = function (match, offset, string) { + var prev = charAt(string, offset - 1); + var next = charAt(string, offset + 1); + if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) { + return '\\u' + numberToString(charCodeAt(match, 0), 16); + } return match; +}; -module.exports = function (METHOD_NAME, argument) { - var method = [][METHOD_NAME]; - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call,no-throw-literal - method.call(null, argument || function () { throw 1; }, 1); +if ($stringify) { + // `JSON.stringify` method + // https://tc39.es/ecma262/#sec-json.stringify + $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` + stringify: function stringify(it, replacer, space) { + var args = arraySlice(arguments); + var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args); + return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result; + } }); -}; +} -},{"../internals/fails":243}],218:[function(require,module,exports){ +},{"../internals/array-slice":209,"../internals/export":246,"../internals/fails":247,"../internals/function-apply":249,"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/get-built-in":256,"../internals/is-array":273,"../internals/is-callable":275,"../internals/is-object":280,"../internals/is-symbol":283,"../internals/symbol-constructor-detection":340}],388:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var isForced = require('../internals/is-forced'); +var defineBuiltIn = require('../internals/define-built-in'); +var hasOwn = require('../internals/has-own-property'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var isSymbol = require('../internals/is-symbol'); +var toPrimitive = require('../internals/to-primitive'); var fails = require('../internals/fails'); -var has = require('../internals/has'); - -var defineProperty = Object.defineProperty; -var cache = {}; - -var thrower = function (it) { throw it; }; - -module.exports = function (METHOD_NAME, options) { - if (has(cache, METHOD_NAME)) return cache[METHOD_NAME]; - if (!options) options = {}; - var method = [][METHOD_NAME]; - var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false; - var argument0 = has(options, 0) ? options[0] : thrower; - var argument1 = has(options, 1) ? options[1] : undefined; - - return cache[METHOD_NAME] = !!method && !fails(function () { - if (ACCESSORS && !DESCRIPTORS) return true; - var O = { length: -1 }; +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var defineProperty = require('../internals/object-define-property').f; +var thisNumberValue = require('../internals/this-number-value'); +var trim = require('../internals/string-trim').trim; - if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower }); - else O[1] = 1; +var NUMBER = 'Number'; +var NativeNumber = global[NUMBER]; +var NumberPrototype = NativeNumber.prototype; +var TypeError = global.TypeError; +var arraySlice = uncurryThis(''.slice); +var charCodeAt = uncurryThis(''.charCodeAt); - method.call(O, argument0, argument1); - }); +// `ToNumeric` abstract operation +// https://tc39.es/ecma262/#sec-tonumeric +var toNumeric = function (value) { + var primValue = toPrimitive(value, 'number'); + return typeof primValue == 'bigint' ? primValue : toNumber(primValue); }; -},{"../internals/descriptors":234,"../internals/fails":243,"../internals/has":249}],219:[function(require,module,exports){ -var aFunction = require('../internals/a-function'); -var toObject = require('../internals/to-object'); -var IndexedObject = require('../internals/indexed-object'); -var toLength = require('../internals/to-length'); - -// `Array.prototype.{ reduce, reduceRight }` methods implementation -var createMethod = function (IS_RIGHT) { - return function (that, callbackfn, argumentsLength, memo) { - aFunction(callbackfn); - var O = toObject(that); - var self = IndexedObject(O); - var length = toLength(O.length); - var index = IS_RIGHT ? length - 1 : 0; - var i = IS_RIGHT ? -1 : 1; - if (argumentsLength < 2) while (true) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (IS_RIGHT ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); +// `ToNumber` abstract operation +// https://tc39.es/ecma262/#sec-tonumber +var toNumber = function (argument) { + var it = toPrimitive(argument, 'number'); + var first, third, radix, maxCode, digits, length, index, code; + if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number'); + if (typeof it == 'string' && it.length > 2) { + it = trim(it); + first = charCodeAt(it, 0); + if (first === 43 || first === 45) { + third = charCodeAt(it, 2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (charCodeAt(it, 1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i + default: return +it; } + digits = arraySlice(it, 2); + length = digits.length; + for (index = 0; index < length; index++) { + code = charCodeAt(digits, index); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); } - for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; - }; -}; - -module.exports = { - // `Array.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - left: createMethod(false), - // `Array.prototype.reduceRight` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright - right: createMethod(true) + } return +it; }; -},{"../internals/a-function":200,"../internals/indexed-object":255,"../internals/to-length":317,"../internals/to-object":318}],220:[function(require,module,exports){ -var isObject = require('../internals/is-object'); -var isArray = require('../internals/is-array'); -var wellKnownSymbol = require('../internals/well-known-symbol'); +// `Number` constructor +// https://tc39.es/ecma262/#sec-number-constructor +if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { + var NumberWrapper = function Number(value) { + var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); + var dummy = this; + // check on 1..constructor(foo) case + return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); }) + ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n; + }; + for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES2015 (in case, if modules with ES2015 Number statics required before): + 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + + // ESNext + 'fromString,range' + ).split(','), j = 0, key; keys.length > j; j++) { + if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) { + defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); + } + } + NumberWrapper.prototype = NumberPrototype; + NumberPrototype.constructor = NumberWrapper; + defineBuiltIn(global, NUMBER, NumberWrapper, { constructor: true }); +} -var SPECIES = wellKnownSymbol('species'); +},{"../internals/define-built-in":224,"../internals/descriptors":228,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/has-own-property":262,"../internals/inherit-if-required":269,"../internals/is-forced":277,"../internals/is-symbol":283,"../internals/object-define-property":299,"../internals/object-get-own-property-descriptor":300,"../internals/object-get-own-property-names":302,"../internals/object-is-prototype-of":305,"../internals/string-trim":339,"../internals/this-number-value":344,"../internals/to-primitive":354}],389:[function(require,module,exports){ +var $ = require('../internals/export'); +var assign = require('../internals/object-assign'); -// `ArraySpeciesCreate` abstract operation -// https://tc39.github.io/ecma262/#sec-arrayspeciescreate -module.exports = function (originalArray, length) { - var C; - if (isArray(originalArray)) { - C = originalArray.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); -}; +// `Object.assign` method +// https://tc39.es/ecma262/#sec-object.assign +// eslint-disable-next-line es/no-object-assign -- required for testing +$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { + assign: assign +}); -},{"../internals/is-array":260,"../internals/is-object":262,"../internals/well-known-symbol":329}],221:[function(require,module,exports){ -var anObject = require('../internals/an-object'); -var iteratorClose = require('../internals/iterator-close'); +},{"../internals/export":246,"../internals/object-assign":296}],390:[function(require,module,exports){ +var $ = require('../internals/export'); +var $entries = require('../internals/object-to-array').entries; -// call something on iterator step with safe closing on error -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 (error) { - iteratorClose(iterator); - throw error; +// `Object.entries` method +// https://tc39.es/ecma262/#sec-object.entries +$({ target: 'Object', stat: true }, { + entries: function entries(O) { + return $entries(O); } -}; +}); -},{"../internals/an-object":205,"../internals/iterator-close":266}],222:[function(require,module,exports){ -var wellKnownSymbol = require('../internals/well-known-symbol'); +},{"../internals/export":246,"../internals/object-to-array":310}],391:[function(require,module,exports){ +var $ = require('../internals/export'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var fails = require('../internals/fails'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var toObject = require('../internals/to-object'); -var ITERATOR = wellKnownSymbol('iterator'); -var SAFE_CLOSING = false; +// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 +var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); }); -try { - var called = 0; - var iteratorWithReturn = { - next: function () { - return { done: !!called++ }; - }, - 'return': function () { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR] = function () { - return this; - }; - // eslint-disable-next-line no-throw-literal - Array.from(iteratorWithReturn, function () { throw 2; }); -} catch (error) { /* empty */ } +// `Object.getOwnPropertySymbols` method +// https://tc39.es/ecma262/#sec-object.getownpropertysymbols +$({ target: 'Object', stat: true, forced: FORCED }, { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : []; + } +}); -module.exports = function (exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) return false; - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR] = function () { - return { - next: function () { - return { done: ITERATION_SUPPORT = true }; - } - }; - }; - exec(object); - } catch (error) { /* empty */ } - return ITERATION_SUPPORT; -}; +},{"../internals/export":246,"../internals/fails":247,"../internals/object-get-own-property-symbols":303,"../internals/symbol-constructor-detection":340,"../internals/to-object":351}],392:[function(require,module,exports){ +var $ = require('../internals/export'); +var toObject = require('../internals/to-object'); +var nativeKeys = require('../internals/object-keys'); +var fails = require('../internals/fails'); -},{"../internals/well-known-symbol":329}],223:[function(require,module,exports){ -var toString = {}.toString; +var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + keys: function keys(it) { + return nativeKeys(toObject(it)); + } +}); -},{}],224:[function(require,module,exports){ +},{"../internals/export":246,"../internals/fails":247,"../internals/object-keys":307,"../internals/to-object":351}],393:[function(require,module,exports){ var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); -var classofRaw = require('../internals/classof-raw'); -var wellKnownSymbol = require('../internals/well-known-symbol'); - -var TO_STRING_TAG = wellKnownSymbol('toStringTag'); -// ES3 wrong here -var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; - -// fallback for IE11 Script Access Denied error -var tryGet = function (it, key) { - try { - return it[key]; - } catch (error) { /* empty */ } -}; +var defineBuiltIn = require('../internals/define-built-in'); +var toString = require('../internals/object-to-string'); -// getting tag from ES6+ `Object.prototype.toString` -module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { - var O, tag, result; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag - // builtinTag case - : CORRECT_ARGUMENTS ? classofRaw(O) - // ES3 arguments fallback - : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; -}; +// `Object.prototype.toString` method +// https://tc39.es/ecma262/#sec-object.prototype.tostring +if (!TO_STRING_TAG_SUPPORT) { + defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true }); +} -},{"../internals/classof-raw":223,"../internals/to-string-tag-support":322,"../internals/well-known-symbol":329}],225:[function(require,module,exports){ -var has = require('../internals/has'); -var ownKeys = require('../internals/own-keys'); -var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); -var definePropertyModule = require('../internals/object-define-property'); +},{"../internals/define-built-in":224,"../internals/object-to-string":311,"../internals/to-string-tag-support":356}],394:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var iterate = require('../internals/iterate'); +var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); -module.exports = function (target, source) { - var keys = ownKeys(source); - var defineProperty = definePropertyModule.f; - var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); +// `Promise.all` method +// https://tc39.es/ecma262/#sec-promise.all +$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { + all: function all(iterable) { + var C = this; + var capability = newPromiseCapabilityModule.f(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aCallable(C.resolve); + var values = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + remaining++; + call($promiseResolve, C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; } -}; - -},{"../internals/has":249,"../internals/object-define-property":278,"../internals/object-get-own-property-descriptor":279,"../internals/own-keys":290}],226:[function(require,module,exports){ -var wellKnownSymbol = require('../internals/well-known-symbol'); - -var MATCH = wellKnownSymbol('match'); - -module.exports = function (METHOD_NAME) { - var regexp = /./; - try { - '/./'[METHOD_NAME](regexp); - } catch (error1) { - try { - regexp[MATCH] = false; - return '/./'[METHOD_NAME](regexp); - } catch (error2) { /* empty */ } - } return false; -}; - -},{"../internals/well-known-symbol":329}],227:[function(require,module,exports){ -var fails = require('../internals/fails'); - -module.exports = !fails(function () { - function F() { /* empty */ } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; }); -},{"../internals/fails":243}],228:[function(require,module,exports){ +},{"../internals/a-callable":186,"../internals/export":246,"../internals/function-call":253,"../internals/iterate":284,"../internals/new-promise-capability":294,"../internals/perform":315,"../internals/promise-statics-incorrect-iteration":319}],395:[function(require,module,exports){ 'use strict'; -var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; -var create = require('../internals/object-create'); -var createPropertyDescriptor = require('../internals/create-property-descriptor'); -var setToStringTag = require('../internals/set-to-string-tag'); -var Iterators = require('../internals/iterators'); - -var returnThis = function () { return this; }; - -module.exports = function (IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + ' Iterator'; - IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; -}; - -},{"../internals/create-property-descriptor":230,"../internals/iterators":268,"../internals/iterators-core":267,"../internals/object-create":276,"../internals/set-to-string-tag":304}],229:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var definePropertyModule = require('../internals/object-define-property'); -var createPropertyDescriptor = require('../internals/create-property-descriptor'); - -module.exports = DESCRIPTORS ? function (object, key, value) { - return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var getBuiltIn = require('../internals/get-built-in'); +var isCallable = require('../internals/is-callable'); +var defineBuiltIn = require('../internals/define-built-in'); -},{"../internals/create-property-descriptor":230,"../internals/descriptors":234,"../internals/object-define-property":278}],230:[function(require,module,exports){ -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; -},{}],231:[function(require,module,exports){ -'use strict'; -var toPrimitive = require('../internals/to-primitive'); -var definePropertyModule = require('../internals/object-define-property'); -var createPropertyDescriptor = require('../internals/create-property-descriptor'); +// `Promise.prototype.catch` method +// https://tc39.es/ecma262/#sec-promise.prototype.catch +$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, { + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } +}); -module.exports = function (object, key, value) { - var propertyKey = toPrimitive(key); - if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else object[propertyKey] = value; -}; +// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` +if (!IS_PURE && isCallable(NativePromiseConstructor)) { + var method = getBuiltIn('Promise').prototype['catch']; + if (NativePromisePrototype['catch'] !== method) { + defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true }); + } +} -},{"../internals/create-property-descriptor":230,"../internals/object-define-property":278,"../internals/to-primitive":321}],232:[function(require,module,exports){ +},{"../internals/define-built-in":224,"../internals/export":246,"../internals/get-built-in":256,"../internals/is-callable":275,"../internals/is-pure":281,"../internals/promise-constructor-detection":316,"../internals/promise-native-constructor":317}],396:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); -var createIteratorConstructor = require('../internals/create-iterator-constructor'); -var getPrototypeOf = require('../internals/object-get-prototype-of'); +var IS_PURE = require('../internals/is-pure'); +var IS_NODE = require('../internals/engine-is-node'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var defineBuiltIn = require('../internals/define-built-in'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var redefine = require('../internals/redefine'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var IS_PURE = require('../internals/is-pure'); -var Iterators = require('../internals/iterators'); -var IteratorsCore = require('../internals/iterators-core'); - -var IteratorPrototype = IteratorsCore.IteratorPrototype; -var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; -var ITERATOR = wellKnownSymbol('iterator'); -var KEYS = 'keys'; -var VALUES = 'values'; -var ENTRIES = 'entries'; +var setSpecies = require('../internals/set-species'); +var aCallable = require('../internals/a-callable'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var anInstance = require('../internals/an-instance'); +var speciesConstructor = require('../internals/species-constructor'); +var task = require('../internals/task').set; +var microtask = require('../internals/microtask'); +var hostReportErrors = require('../internals/host-report-errors'); +var perform = require('../internals/perform'); +var Queue = require('../internals/queue'); +var InternalStateModule = require('../internals/internal-state'); +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var PromiseConstructorDetection = require('../internals/promise-constructor-detection'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); -var returnThis = function () { return this; }; +var PROMISE = 'Promise'; +var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR; +var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT; +var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING; +var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); +var setInternalState = InternalStateModule.set; +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; +var PromiseConstructor = NativePromiseConstructor; +var PromisePrototype = NativePromisePrototype; +var TypeError = global.TypeError; +var document = global.document; +var process = global.process; +var newPromiseCapability = newPromiseCapabilityModule.f; +var newGenericPromiseCapability = newPromiseCapability; -module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); +var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); +var UNHANDLED_REJECTION = 'unhandledrejection'; +var REJECTION_HANDLED = 'rejectionhandled'; +var PENDING = 0; +var FULFILLED = 1; +var REJECTED = 2; +var HANDLED = 1; +var UNHANDLED = 2; - var getIterationMethod = function (KIND) { - if (KIND === DEFAULT && defaultIterator) return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; - case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; - case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; - } return function () { return new IteratorConstructor(this); }; - }; +var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; - var TO_STRING_TAG = NAME + ' Iterator'; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR] - || IterablePrototype['@@iterator'] - || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && isCallable(then = it.then) ? then : false; +}; - // fix native - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { - if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { - createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); +var callReaction = function (reaction, state) { + var value = state.value; + var ok = state.state == FULFILLED; + 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 (state.rejection === UNHANDLED) onHandleUnhandled(state); + state.rejection = HANDLED; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // can throw + if (domain) { + domain.exit(); + exited = true; } } - // Set @@toStringTag to native iterators - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; - } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + call(then, result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (error) { + if (domain && !exited) domain.exit(); + reject(error); } +}; - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { return nativeIterator.call(this); }; - } +var notify = function (state, isReject) { + if (state.notified) return; + state.notified = true; + microtask(function () { + var reactions = state.reactions; + var reaction; + while (reaction = reactions.get()) { + callReaction(reaction, state); + } + state.notified = false; + if (isReject && !state.rejection) onUnhandled(state); + }); +}; - // define iterator - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); - } - Iterators[NAME] = defaultIterator; - - // export additional methods - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); - } - - return methods; +var dispatchEvent = function (name, promise, reason) { + var event, handler; + if (DISPATCH_EVENT) { + event = document.createEvent('Event'); + event.promise = promise; + event.reason = reason; + event.initEvent(name, false, true); + global.dispatchEvent(event); + } else event = { promise: promise, reason: reason }; + if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event); + else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; -},{"../internals/create-iterator-constructor":228,"../internals/create-non-enumerable-property":229,"../internals/export":242,"../internals/is-pure":263,"../internals/iterators":268,"../internals/iterators-core":267,"../internals/object-get-prototype-of":283,"../internals/object-set-prototype-of":287,"../internals/redefine":295,"../internals/set-to-string-tag":304,"../internals/well-known-symbol":329}],233:[function(require,module,exports){ -var path = require('../internals/path'); -var has = require('../internals/has'); -var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); -var defineProperty = require('../internals/object-define-property').f; - -module.exports = function (NAME) { - var Symbol = path.Symbol || (path.Symbol = {}); - if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { - value: wrappedWellKnownSymbolModule.f(NAME) +var onUnhandled = function (state) { + call(task, global, function () { + var promise = state.facade; + var value = state.value; + var IS_UNHANDLED = isUnhandled(state); + var result; + if (IS_UNHANDLED) { + result = perform(function () { + if (IS_NODE) { + process.emit('unhandledRejection', value, promise); + } else dispatchEvent(UNHANDLED_REJECTION, promise, value); + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; + if (result.error) throw result.value; + } }); }; -},{"../internals/has":249,"../internals/object-define-property":278,"../internals/path":291,"../internals/well-known-symbol-wrapped":328}],234:[function(require,module,exports){ -var fails = require('../internals/fails'); - -// Thank's IE8 for his funny defineProperty -module.exports = !fails(function () { - return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; -}); +var isUnhandled = function (state) { + return state.rejection !== HANDLED && !state.parent; +}; -},{"../internals/fails":243}],235:[function(require,module,exports){ -var global = require('../internals/global'); -var isObject = require('../internals/is-object'); +var onHandleUnhandled = function (state) { + call(task, global, function () { + var promise = state.facade; + if (IS_NODE) { + process.emit('rejectionHandled', promise); + } else dispatchEvent(REJECTION_HANDLED, promise, state.value); + }); +}; -var document = global.document; -// typeof document.createElement is 'object' in old IE -var EXISTS = isObject(document) && isObject(document.createElement); +var bind = function (fn, state, unwrap) { + return function (value) { + fn(state, value, unwrap); + }; +}; -module.exports = function (it) { - return EXISTS ? document.createElement(it) : {}; +var internalReject = function (state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + state.value = value; + state.state = REJECTED; + notify(state, true); }; -},{"../internals/global":248,"../internals/is-object":262}],236:[function(require,module,exports){ -// iterable DOM collections -// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods -module.exports = { - CSSRuleList: 0, - CSSStyleDeclaration: 0, - CSSValueList: 0, - ClientRectList: 0, - DOMRectList: 0, - DOMStringList: 0, - DOMTokenList: 1, - DataTransferItemList: 0, - FileList: 0, - HTMLAllCollection: 0, - HTMLCollection: 0, - HTMLFormElement: 0, - HTMLSelectElement: 0, - MediaList: 0, - MimeTypeArray: 0, - NamedNodeMap: 0, - NodeList: 1, - PaintRequestList: 0, - Plugin: 0, - PluginArray: 0, - SVGLengthList: 0, - SVGNumberList: 0, - SVGPathSegList: 0, - SVGPointList: 0, - SVGStringList: 0, - SVGTransformList: 0, - SourceBufferList: 0, - StyleSheetList: 0, - TextTrackCueList: 0, - TextTrackList: 0, - TouchList: 0 +var internalResolve = function (state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + try { + if (state.facade === value) throw TypeError("Promise can't be resolved itself"); + var then = isThenable(value); + if (then) { + microtask(function () { + var wrapper = { done: false }; + try { + call(then, value, + bind(internalResolve, wrapper, state), + bind(internalReject, wrapper, state) + ); + } catch (error) { + internalReject(wrapper, error, state); + } + }); + } else { + state.value = value; + state.state = FULFILLED; + notify(state, false); + } + } catch (error) { + internalReject({ done: false }, error, state); + } }; -},{}],237:[function(require,module,exports){ -var userAgent = require('../internals/engine-user-agent'); +// constructor polyfill +if (FORCED_PROMISE_CONSTRUCTOR) { + // 25.4.3.1 Promise(executor) + PromiseConstructor = function Promise(executor) { + anInstance(this, PromisePrototype); + aCallable(executor); + call(Internal, this); + var state = getInternalPromiseState(this); + try { + executor(bind(internalResolve, state), bind(internalReject, state)); + } catch (error) { + internalReject(state, error); + } + }; -module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent); + PromisePrototype = PromiseConstructor.prototype; -},{"../internals/engine-user-agent":239}],238:[function(require,module,exports){ -var classof = require('../internals/classof-raw'); -var global = require('../internals/global'); + // eslint-disable-next-line no-unused-vars -- required for `.length` + Internal = function Promise(executor) { + setInternalState(this, { + type: PROMISE, + done: false, + notified: false, + parent: false, + reactions: new Queue(), + rejection: false, + state: PENDING, + value: undefined + }); + }; -module.exports = classof(global.process) == 'process'; + // `Promise.prototype.then` method + // https://tc39.es/ecma262/#sec-promise.prototype.then + Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) { + var state = getInternalPromiseState(this); + var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); + state.parent = true; + reaction.ok = isCallable(onFulfilled) ? onFulfilled : true; + reaction.fail = isCallable(onRejected) && onRejected; + reaction.domain = IS_NODE ? process.domain : undefined; + if (state.state == PENDING) state.reactions.add(reaction); + else microtask(function () { + callReaction(reaction, state); + }); + return reaction.promise; + }); -},{"../internals/classof-raw":223,"../internals/global":248}],239:[function(require,module,exports){ -var getBuiltIn = require('../internals/get-built-in'); + OwnPromiseCapability = function () { + var promise = new Internal(); + var state = getInternalPromiseState(promise); + this.promise = promise; + this.resolve = bind(internalResolve, state); + this.reject = bind(internalReject, state); + }; -module.exports = getBuiltIn('navigator', 'userAgent') || ''; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === PromiseConstructor || C === PromiseWrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; -},{"../internals/get-built-in":246}],240:[function(require,module,exports){ -var global = require('../internals/global'); -var userAgent = require('../internals/engine-user-agent'); + if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) { + nativeThen = NativePromisePrototype.then; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8; -var match, version; + if (!NATIVE_PROMISE_SUBCLASSING) { + // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs + defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { + var that = this; + return new PromiseConstructor(function (resolve, reject) { + call(nativeThen, that, resolve, reject); + }).then(onFulfilled, onRejected); + // https://github.com/zloirock/core-js/issues/640 + }, { unsafe: true }); + } -if (v8) { - match = v8.split('.'); - version = match[0] + match[1]; -} else if (userAgent) { - match = userAgent.match(/Edge\/(\d+)/); - if (!match || match[1] >= 74) { - match = userAgent.match(/Chrome\/(\d+)/); - if (match) version = match[1]; + // make `.constructor === Promise` work for native promise-based APIs + try { + delete NativePromisePrototype.constructor; + } catch (error) { /* empty */ } + + // make `instanceof Promise` work for native promise-based APIs + if (setPrototypeOf) { + setPrototypeOf(NativePromisePrototype, PromisePrototype); + } } } -module.exports = version && +version; - -},{"../internals/engine-user-agent":239,"../internals/global":248}],241:[function(require,module,exports){ -// IE8- don't enum bug keys -module.exports = [ - 'constructor', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'toLocaleString', - 'toString', - 'valueOf' -]; - -},{}],242:[function(require,module,exports){ -var global = require('../internals/global'); -var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var redefine = require('../internals/redefine'); -var setGlobal = require('../internals/set-global'); -var copyConstructorProperties = require('../internals/copy-constructor-properties'); -var isForced = require('../internals/is-forced'); +$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { + Promise: PromiseConstructor +}); -/* - options.target - name of the target object - options.global - target is the global object - options.stat - export as static methods of target - options.proto - export as prototype methods of target - options.real - real prototype method for the `pure` version - options.forced - export even if the native feature is available - options.bind - bind methods to the target, required for the `pure` version - options.wrap - wrap constructors to preventing global pollution, required for the `pure` version - options.unsafe - use the simple assignment of property instead of delete + defineProperty - options.sham - add a flag to not completely full polyfills - options.enumerable - export as enumerable property - options.noTargetGet - prevent calling a getter on target -*/ -module.exports = function (options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global; - } else if (STATIC) { - target = global[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global[TARGET] || {}).prototype; - } - if (target) for (key in source) { - sourceProperty = source[key]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key); - targetProperty = descriptor && descriptor.value; - } else targetProperty = target[key]; - FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); - // contained in target - if (!FORCED && targetProperty !== undefined) { - if (typeof sourceProperty === typeof targetProperty) continue; - copyConstructorProperties(sourceProperty, targetProperty); - } - // add a flag to not completely full polyfills - if (options.sham || (targetProperty && targetProperty.sham)) { - createNonEnumerableProperty(sourceProperty, 'sham', true); - } - // extend global - redefine(target, key, sourceProperty, options); - } -}; +setToStringTag(PromiseConstructor, PROMISE, false, true); +setSpecies(PROMISE); -},{"../internals/copy-constructor-properties":225,"../internals/create-non-enumerable-property":229,"../internals/global":248,"../internals/is-forced":261,"../internals/object-get-own-property-descriptor":279,"../internals/redefine":295,"../internals/set-global":302}],243:[function(require,module,exports){ -module.exports = function (exec) { - try { - return !!exec(); - } catch (error) { - return true; - } -}; +},{"../internals/a-callable":186,"../internals/an-instance":191,"../internals/define-built-in":224,"../internals/engine-is-node":240,"../internals/export":246,"../internals/function-call":253,"../internals/global":261,"../internals/host-report-errors":264,"../internals/internal-state":271,"../internals/is-callable":275,"../internals/is-object":280,"../internals/is-pure":281,"../internals/microtask":293,"../internals/new-promise-capability":294,"../internals/object-set-prototype-of":309,"../internals/perform":315,"../internals/promise-constructor-detection":316,"../internals/promise-native-constructor":317,"../internals/queue":321,"../internals/set-species":331,"../internals/set-to-string-tag":332,"../internals/species-constructor":336,"../internals/task":343}],397:[function(require,module,exports){ +// TODO: Remove this module from `core-js@4` since it's split to modules listed below +require('../modules/es.promise.constructor'); +require('../modules/es.promise.all'); +require('../modules/es.promise.catch'); +require('../modules/es.promise.race'); +require('../modules/es.promise.reject'); +require('../modules/es.promise.resolve'); -},{}],244:[function(require,module,exports){ +},{"../modules/es.promise.all":394,"../modules/es.promise.catch":395,"../modules/es.promise.constructor":396,"../modules/es.promise.race":398,"../modules/es.promise.reject":399,"../modules/es.promise.resolve":400}],398:[function(require,module,exports){ 'use strict'; -// TODO: Remove from `core-js@4` since it's moved to entry points -require('../modules/es.regexp.exec'); -var redefine = require('../internals/redefine'); -var fails = require('../internals/fails'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var regexpExec = require('../internals/regexp-exec'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); - -var SPECIES = wellKnownSymbol('species'); +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var iterate = require('../internals/iterate'); +var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); -var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = []; - result.groups = { a: '7' }; - return result; - }; - return ''.replace(re, '$') !== '7'; +// `Promise.race` method +// https://tc39.es/ecma262/#sec-promise.race +$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { + race: function race(iterable) { + var C = this; + var capability = newPromiseCapabilityModule.f(C); + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aCallable(C.resolve); + iterate(iterable, function (promise) { + call($promiseResolve, C, promise).then(capability.resolve, reject); + }); + }); + if (result.error) reject(result.value); + return capability.promise; + } }); -// IE <= 11 replaces $0 with the whole match, as if it was $& -// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 -var REPLACE_KEEPS_$0 = (function () { - return 'a'.replace(/./, '$0') === '$0'; -})(); +},{"../internals/a-callable":186,"../internals/export":246,"../internals/function-call":253,"../internals/iterate":284,"../internals/new-promise-capability":294,"../internals/perform":315,"../internals/promise-statics-incorrect-iteration":319}],399:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; -var REPLACE = wellKnownSymbol('replace'); -// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string -var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { - if (/./[REPLACE]) { - return /./[REPLACE]('a', '$0') === ''; +// `Promise.reject` method +// https://tc39.es/ecma262/#sec-promise.reject +$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { + reject: function reject(r) { + var capability = newPromiseCapabilityModule.f(this); + call(capability.reject, undefined, r); + return capability.promise; } - return false; -})(); - -// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec -// Weex JS has frozen built-in prototypes, so use try / catch wrapper -var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { return originalExec.apply(this, arguments); }; - var result = 'ab'.split(re); - return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; }); -module.exports = function (KEY, length, exec, sham) { - var SYMBOL = wellKnownSymbol(KEY); +},{"../internals/export":246,"../internals/function-call":253,"../internals/new-promise-capability":294,"../internals/promise-constructor-detection":316}],400:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var IS_PURE = require('../internals/is-pure'); +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; +var promiseResolve = require('../internals/promise-resolve'); - var DELEGATES_TO_SYMBOL = !fails(function () { - // String methods call symbol-named RegEp methods - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - }); +var PromiseConstructorWrapper = getBuiltIn('Promise'); +var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR; - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; +// `Promise.resolve` method +// https://tc39.es/ecma262/#sec-promise.resolve +$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, { + resolve: function resolve(x) { + return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x); + } +}); - if (KEY === 'split') { - // We can't use real regex here since it causes deoptimization - // and serious performance degradation in V8 - // https://github.com/zloirock/core-js/issues/306 - re = {}; - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES] = function () { return re; }; - re.flags = ''; - re[SYMBOL] = /./[SYMBOL]; - } +},{"../internals/export":246,"../internals/get-built-in":256,"../internals/is-pure":281,"../internals/promise-constructor-detection":316,"../internals/promise-native-constructor":317,"../internals/promise-resolve":318}],401:[function(require,module,exports){ +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var apply = require('../internals/function-apply'); +var bind = require('../internals/function-bind'); +var aConstructor = require('../internals/a-constructor'); +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var create = require('../internals/object-create'); +var fails = require('../internals/fails'); - re.exec = function () { execCalled = true; return null; }; +var nativeConstruct = getBuiltIn('Reflect', 'construct'); +var ObjectPrototype = Object.prototype; +var push = [].push; - re[SYMBOL](''); - return !execCalled; - }); +// `Reflect.construct` method +// https://tc39.es/ecma262/#sec-reflect.construct +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F); +}); - if ( - !DELEGATES_TO_SYMBOL || - !DELEGATES_TO_EXEC || - (KEY === 'replace' && !( - REPLACE_SUPPORTS_NAMED_GROUPS && - REPLACE_KEEPS_$0 && - !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE - )) || - (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) - ) { - var nativeRegExpMethod = /./[SYMBOL]; - var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; - } - return { done: true, value: nativeMethod.call(str, regexp, arg2) }; +var ARGS_BUG = !fails(function () { + nativeConstruct(function () { /* empty */ }); +}); + +var FORCED = NEW_TARGET_BUG || ARGS_BUG; + +$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, { + construct: function construct(Target, args /* , newTarget */) { + aConstructor(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); } - return { done: false }; - }, { - REPLACE_KEEPS_$0: REPLACE_KEEPS_$0, - REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE - }); - var stringMethod = methods[0]; - var regexMethod = methods[1]; - - redefine(String.prototype, KEY, stringMethod); - redefine(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return regexMethod.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return regexMethod.call(string, this); } - ); + // w/o altered newTarget, lot of arguments case + var $args = [null]; + apply(push, $args, args); + return new (apply(bind, Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : ObjectPrototype); + var result = apply(Target, instance, args); + return isObject(result) ? result : instance; } +}); - if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true); -}; +},{"../internals/a-constructor":187,"../internals/an-object":192,"../internals/export":246,"../internals/fails":247,"../internals/function-apply":249,"../internals/function-bind":252,"../internals/get-built-in":256,"../internals/is-object":280,"../internals/object-create":297}],402:[function(require,module,exports){ +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var isForced = require('../internals/is-forced'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var isRegExp = require('../internals/is-regexp'); +var toString = require('../internals/to-string'); +var getRegExpFlags = require('../internals/regexp-get-flags'); +var stickyHelpers = require('../internals/regexp-sticky-helpers'); +var proxyAccessor = require('../internals/proxy-accessor'); +var defineBuiltIn = require('../internals/define-built-in'); +var fails = require('../internals/fails'); +var hasOwn = require('../internals/has-own-property'); +var enforceInternalState = require('../internals/internal-state').enforce; +var setSpecies = require('../internals/set-species'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all'); +var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg'); -},{"../internals/create-non-enumerable-property":229,"../internals/fails":243,"../internals/redefine":295,"../internals/regexp-exec":297,"../internals/well-known-symbol":329,"../modules/es.regexp.exec":355}],245:[function(require,module,exports){ -var aFunction = require('../internals/a-function'); +var MATCH = wellKnownSymbol('match'); +var NativeRegExp = global.RegExp; +var RegExpPrototype = NativeRegExp.prototype; +var SyntaxError = global.SyntaxError; +var exec = uncurryThis(RegExpPrototype.exec); +var charAt = uncurryThis(''.charAt); +var replace = uncurryThis(''.replace); +var stringIndexOf = uncurryThis(''.indexOf); +var stringSlice = uncurryThis(''.slice); +// TODO: Use only proper RegExpIdentifierName +var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/; +var re1 = /a/g; +var re2 = /a/g; -// optional / simple context binding -module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 0: return function () { - return fn.call(that); - }; - 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); - }; -}; +// "new" should create a new object, old webkit bug +var CORRECT_NEW = new NativeRegExp(re1) !== re1; -},{"../internals/a-function":200}],246:[function(require,module,exports){ -var path = require('../internals/path'); -var global = require('../internals/global'); +var MISSED_STICKY = stickyHelpers.MISSED_STICKY; +var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; + +var BASE_FORCED = DESCRIPTORS && + (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () { + re2[MATCH] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; + })); -var aFunction = function (variable) { - return typeof variable == 'function' ? variable : undefined; +var handleDotAll = function (string) { + var length = string.length; + var index = 0; + var result = ''; + var brackets = false; + var chr; + for (; index <= length; index++) { + chr = charAt(string, index); + if (chr === '\\') { + result += chr + charAt(string, ++index); + continue; + } + if (!brackets && chr === '.') { + result += '[\\s\\S]'; + } else { + if (chr === '[') { + brackets = true; + } else if (chr === ']') { + brackets = false; + } result += chr; + } + } return result; }; -module.exports = function (namespace, method) { - return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) - : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; +var handleNCG = function (string) { + var length = string.length; + var index = 0; + var result = ''; + var named = []; + var names = {}; + var brackets = false; + var ncg = false; + var groupid = 0; + var groupname = ''; + var chr; + for (; index <= length; index++) { + chr = charAt(string, index); + if (chr === '\\') { + chr = chr + charAt(string, ++index); + } else if (chr === ']') { + brackets = false; + } else if (!brackets) switch (true) { + case chr === '[': + brackets = true; + break; + case chr === '(': + if (exec(IS_NCG, stringSlice(string, index + 1))) { + index += 2; + ncg = true; + } + result += chr; + groupid++; + continue; + case chr === '>' && ncg: + if (groupname === '' || hasOwn(names, groupname)) { + throw new SyntaxError('Invalid capture group name'); + } + names[groupname] = true; + named[named.length] = [groupname, groupid]; + ncg = false; + groupname = ''; + continue; + } + if (ncg) groupname += chr; + else result += chr; + } return [result, named]; }; -},{"../internals/global":248,"../internals/path":291}],247:[function(require,module,exports){ -var classof = require('../internals/classof'); -var Iterators = require('../internals/iterators'); -var wellKnownSymbol = require('../internals/well-known-symbol'); +// `RegExp` constructor +// https://tc39.es/ecma262/#sec-regexp-constructor +if (isForced('RegExp', BASE_FORCED)) { + var RegExpWrapper = function RegExp(pattern, flags) { + var thisIsRegExp = isPrototypeOf(RegExpPrototype, this); + var patternIsRegExp = isRegExp(pattern); + var flagsAreUndefined = flags === undefined; + var groups = []; + var rawPattern = pattern; + var rawFlags, dotAll, sticky, handled, result, state; -var ITERATOR = wellKnownSymbol('iterator'); + if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) { + return pattern; + } -module.exports = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; + if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) { + pattern = pattern.source; + if (flagsAreUndefined) flags = getRegExpFlags(rawPattern); + } -},{"../internals/classof":224,"../internals/iterators":268,"../internals/well-known-symbol":329}],248:[function(require,module,exports){ -(function (global){ -var check = function (it) { - return it && it.Math == Math && it; -}; + pattern = pattern === undefined ? '' : toString(pattern); + flags = flags === undefined ? '' : toString(flags); + rawPattern = pattern; -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -module.exports = - // eslint-disable-next-line no-undef - check(typeof globalThis == 'object' && globalThis) || - check(typeof window == 'object' && window) || - check(typeof self == 'object' && self) || - check(typeof global == 'object' && global) || - // eslint-disable-next-line no-new-func - (function () { return this; })() || Function('return this')(); + if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) { + dotAll = !!flags && stringIndexOf(flags, 's') > -1; + if (dotAll) flags = replace(flags, /s/g, ''); + } -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],249:[function(require,module,exports){ -var hasOwnProperty = {}.hasOwnProperty; + rawFlags = flags; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; + if (MISSED_STICKY && 'sticky' in re1) { + sticky = !!flags && stringIndexOf(flags, 'y') > -1; + if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, ''); + } -},{}],250:[function(require,module,exports){ -module.exports = {}; + if (UNSUPPORTED_NCG) { + handled = handleNCG(pattern); + pattern = handled[0]; + groups = handled[1]; + } -},{}],251:[function(require,module,exports){ -var global = require('../internals/global'); + result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); -module.exports = function (a, b) { - var console = global.console; - if (console && console.error) { - arguments.length === 1 ? console.error(a) : console.error(a, b); + if (dotAll || sticky || groups.length) { + state = enforceInternalState(result); + if (dotAll) { + state.dotAll = true; + state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags); + } + if (sticky) state.sticky = true; + if (groups.length) state.groups = groups; + } + + if (pattern !== rawPattern) try { + // fails in old engines, but we have no alternatives for unsupported regex syntax + createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern); + } catch (error) { /* empty */ } + + return result; + }; + + for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) { + proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]); } -}; -},{"../internals/global":248}],252:[function(require,module,exports){ -var getBuiltIn = require('../internals/get-built-in'); + RegExpPrototype.constructor = RegExpWrapper; + RegExpWrapper.prototype = RegExpPrototype; + defineBuiltIn(global, 'RegExp', RegExpWrapper, { constructor: true }); +} -module.exports = getBuiltIn('document', 'documentElement'); +// https://tc39.es/ecma262/#sec-get-regexp-@@species +setSpecies('RegExp'); -},{"../internals/get-built-in":246}],253:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var fails = require('../internals/fails'); -var createElement = require('../internals/document-create-element'); +},{"../internals/create-non-enumerable-property":221,"../internals/define-built-in":224,"../internals/descriptors":228,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/has-own-property":262,"../internals/inherit-if-required":269,"../internals/internal-state":271,"../internals/is-forced":277,"../internals/is-regexp":282,"../internals/object-get-own-property-names":302,"../internals/object-is-prototype-of":305,"../internals/proxy-accessor":320,"../internals/regexp-get-flags":325,"../internals/regexp-sticky-helpers":326,"../internals/regexp-unsupported-dot-all":327,"../internals/regexp-unsupported-ncg":328,"../internals/set-species":331,"../internals/to-string":357,"../internals/well-known-symbol":371}],403:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var exec = require('../internals/regexp-exec'); -// Thank's IE8 for his funny defineProperty -module.exports = !DESCRIPTORS && !fails(function () { - return Object.defineProperty(createElement('div'), 'a', { - get: function () { return 7; } - }).a != 7; +// `RegExp.prototype.exec` method +// https://tc39.es/ecma262/#sec-regexp.prototype.exec +$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { + exec: exec }); -},{"../internals/descriptors":234,"../internals/document-create-element":235,"../internals/fails":243}],254:[function(require,module,exports){ -// IEEE754 conversions based on https://github.com/feross/ieee754 -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = 1 / 0; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; +},{"../internals/export":246,"../internals/regexp-exec":323}],404:[function(require,module,exports){ +'use strict'; +var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; +var defineBuiltIn = require('../internals/define-built-in'); +var anObject = require('../internals/an-object'); +var $toString = require('../internals/to-string'); +var fails = require('../internals/fails'); +var getRegExpFlags = require('../internals/regexp-get-flags'); -var pack = function (number, mantissaLength, bytes) { - var buffer = new Array(bytes); - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; - var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; - var index = 0; - var exponent, mantissa, c; - number = abs(number); - // eslint-disable-next-line no-self-compare - if (number != number || number === Infinity) { - // eslint-disable-next-line no-self-compare - mantissa = number != number ? 1 : 0; - exponent = eMax; - } else { - exponent = floor(log(number) / LN2); - if (number * (c = pow(2, -exponent)) < 1) { - exponent--; - c *= 2; - } - if (exponent + eBias >= 1) { - number += rt / c; - } else { - number += rt * pow(2, 1 - eBias); - } - if (number * c >= 2) { - exponent++; - c /= 2; - } - if (exponent + eBias >= eMax) { - mantissa = 0; - exponent = eMax; - } else if (exponent + eBias >= 1) { - mantissa = (number * c - 1) * pow(2, mantissaLength); - exponent = exponent + eBias; - } else { - mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); - exponent = 0; - } - } - for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); - exponent = exponent << mantissaLength | mantissa; - exponentLength += mantissaLength; - for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); - buffer[--index] |= sign * 128; - return buffer; -}; - -var unpack = function (buffer, mantissaLength) { - var bytes = buffer.length; - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var nBits = exponentLength - 7; - var index = bytes - 1; - var sign = buffer[index--]; - var exponent = sign & 127; - var mantissa; - sign >>= 7; - for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); - mantissa = exponent & (1 << -nBits) - 1; - exponent >>= -nBits; - nBits += mantissaLength; - for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); - if (exponent === 0) { - exponent = 1 - eBias; - } else if (exponent === eMax) { - return mantissa ? NaN : sign ? -Infinity : Infinity; - } else { - mantissa = mantissa + pow(2, mantissaLength); - exponent = exponent - eBias; - } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); -}; +var TO_STRING = 'toString'; +var RegExpPrototype = RegExp.prototype; +var nativeToString = RegExpPrototype[TO_STRING]; -module.exports = { - pack: pack, - unpack: unpack -}; +var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING; -},{}],255:[function(require,module,exports){ -var fails = require('../internals/fails'); -var classof = require('../internals/classof-raw'); +// `RegExp.prototype.toString` method +// https://tc39.es/ecma262/#sec-regexp.prototype.tostring +if (NOT_GENERIC || INCORRECT_NAME) { + defineBuiltIn(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var pattern = $toString(R.source); + var flags = $toString(getRegExpFlags(R)); + return '/' + pattern + '/' + flags; + }, { unsafe: true }); +} -var split = ''.split; +},{"../internals/an-object":192,"../internals/define-built-in":224,"../internals/fails":247,"../internals/function-name":254,"../internals/regexp-get-flags":325,"../internals/to-string":357}],405:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var toString = require('../internals/to-string'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); -// fallback for non-array-like ES3 and non-enumerable old V8 strings -module.exports = fails(function () { - // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 - // eslint-disable-next-line no-prototype-builtins - return !Object('z').propertyIsEnumerable(0); -}) ? function (it) { - return classof(it) == 'String' ? split.call(it, '') : Object(it); -} : Object; +var stringIndexOf = uncurryThis(''.indexOf); -},{"../internals/classof-raw":223,"../internals/fails":243}],256:[function(require,module,exports){ -var isObject = require('../internals/is-object'); -var setPrototypeOf = require('../internals/object-set-prototype-of'); +// `String.prototype.includes` method +// https://tc39.es/ecma262/#sec-string.prototype.includes +$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { + includes: function includes(searchString /* , position = 0 */) { + return !!~stringIndexOf( + toString(requireObjectCoercible(this)), + toString(notARegExp(searchString)), + arguments.length > 1 ? arguments[1] : undefined + ); + } +}); -// makes subclassing work correct for wrapped built-ins -module.exports = function ($this, dummy, Wrapper) { - var NewTarget, NewTargetPrototype; - if ( - // it can work only with native `setPrototypeOf` - setPrototypeOf && - // we haven't completely correct pre-ES6 way for getting `new.target`, so use this - typeof (NewTarget = dummy.constructor) == 'function' && - NewTarget !== Wrapper && - isObject(NewTargetPrototype = NewTarget.prototype) && - NewTargetPrototype !== Wrapper.prototype - ) setPrototypeOf($this, NewTargetPrototype); - return $this; -}; +},{"../internals/correct-is-regexp-logic":218,"../internals/export":246,"../internals/function-uncurry-this":255,"../internals/not-a-regexp":295,"../internals/require-object-coercible":329,"../internals/to-string":357}],406:[function(require,module,exports){ +'use strict'; +var charAt = require('../internals/string-multibyte').charAt; +var toString = require('../internals/to-string'); +var InternalStateModule = require('../internals/internal-state'); +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); -},{"../internals/is-object":262,"../internals/object-set-prototype-of":287}],257:[function(require,module,exports){ -var store = require('../internals/shared-store'); +var STRING_ITERATOR = 'String Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); -var functionToString = Function.toString; +// `String.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-string.prototype-@@iterator +defineIterator(String, 'String', function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: toString(iterated), + index: 0 + }); +// `%StringIteratorPrototype%.next` method +// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next +}, function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return createIterResultObject(undefined, true); + point = charAt(string, index); + state.index += point.length; + return createIterResultObject(point, false); +}); -// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper -if (typeof store.inspectSource != 'function') { - store.inspectSource = function (it) { - return functionToString.call(it); - }; -} +},{"../internals/create-iter-result-object":220,"../internals/internal-state":271,"../internals/iterator-define":287,"../internals/string-multibyte":337,"../internals/to-string":357}],407:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var getMethod = require('../internals/get-method'); +var advanceStringIndex = require('../internals/advance-string-index'); +var regExpExec = require('../internals/regexp-exec-abstract'); -module.exports = store.inspectSource; +// @@match logic +fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.es/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH); + return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@match + function (string) { + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(nativeMatch, rx, S); -},{"../internals/shared-store":306}],258:[function(require,module,exports){ -var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); -var global = require('../internals/global'); -var isObject = require('../internals/is-object'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var objectHas = require('../internals/has'); -var shared = require('../internals/shared-store'); -var sharedKey = require('../internals/shared-key'); -var hiddenKeys = require('../internals/hidden-keys'); + if (res.done) return res.value; -var WeakMap = global.WeakMap; -var set, get, has; + if (!rx.global) return regExpExec(rx, S); -var enforce = function (it) { - return has(it) ? get(it) : set(it, {}); -}; + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = toString(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; +}); -var getterFor = function (TYPE) { - return function (it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError('Incompatible receiver, ' + TYPE + ' required'); - } return state; - }; -}; +},{"../internals/advance-string-index":190,"../internals/an-object":192,"../internals/fix-regexp-well-known-symbol-logic":248,"../internals/function-call":253,"../internals/get-method":259,"../internals/is-null-or-undefined":279,"../internals/regexp-exec-abstract":322,"../internals/require-object-coercible":329,"../internals/to-length":350,"../internals/to-string":357}],408:[function(require,module,exports){ +'use strict'; +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var fails = require('../internals/fails'); +var anObject = require('../internals/an-object'); +var isCallable = require('../internals/is-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var advanceStringIndex = require('../internals/advance-string-index'); +var getMethod = require('../internals/get-method'); +var getSubstitution = require('../internals/get-substitution'); +var regExpExec = require('../internals/regexp-exec-abstract'); +var wellKnownSymbol = require('../internals/well-known-symbol'); -if (NATIVE_WEAK_MAP) { - var store = shared.state || (shared.state = new WeakMap()); - var wmget = store.get; - var wmhas = store.has; - var wmset = store.set; - set = function (it, metadata) { - metadata.facade = it; - wmset.call(store, it, metadata); - return metadata; - }; - get = function (it) { - return wmget.call(store, it) || {}; - }; - has = function (it) { - return wmhas.call(store, it); - }; -} else { - var STATE = sharedKey('state'); - hiddenKeys[STATE] = true; - set = function (it, metadata) { - metadata.facade = it; - createNonEnumerableProperty(it, STATE, metadata); - return metadata; - }; - get = function (it) { - return objectHas(it, STATE) ? it[STATE] : {}; - }; - has = function (it) { - return objectHas(it, STATE); - }; -} +var REPLACE = wellKnownSymbol('replace'); +var max = Math.max; +var min = Math.min; +var concat = uncurryThis([].concat); +var push = uncurryThis([].push); +var stringIndexOf = uncurryThis(''.indexOf); +var stringSlice = uncurryThis(''.slice); -module.exports = { - set: set, - get: get, - has: has, - enforce: enforce, - getterFor: getterFor +var maybeToString = function (it) { + return it === undefined ? it : String(it); }; -},{"../internals/create-non-enumerable-property":229,"../internals/global":248,"../internals/has":249,"../internals/hidden-keys":250,"../internals/is-object":262,"../internals/native-weak-map":272,"../internals/shared-key":305,"../internals/shared-store":306}],259:[function(require,module,exports){ -var wellKnownSymbol = require('../internals/well-known-symbol'); -var Iterators = require('../internals/iterators'); +// IE <= 11 replaces $0 with the whole match, as if it was $& +// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 +var REPLACE_KEEPS_$0 = (function () { + // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing + return 'a'.replace(/./, '$0') === '$0'; +})(); -var ITERATOR = wellKnownSymbol('iterator'); -var ArrayPrototype = Array.prototype; +// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string +var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { + if (/./[REPLACE]) { + return /./[REPLACE]('a', '$0') === ''; + } + return false; +})(); -// check on default Array iterator -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); -}; +var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive + return ''.replace(re, '$') !== '7'; +}); -},{"../internals/iterators":268,"../internals/well-known-symbol":329}],260:[function(require,module,exports){ -var classof = require('../internals/classof-raw'); +// @@replace logic +fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { + var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; -// `IsArray` abstract operation -// https://tc39.github.io/ecma262/#sec-isarray -module.exports = Array.isArray || function isArray(arg) { - return classof(arg) == 'Array'; -}; + return [ + // `String.prototype.replace` method + // https://tc39.es/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE); + return replacer + ? call(replacer, searchValue, O, replaceValue) + : call(nativeReplace, toString(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace + function (string, replaceValue) { + var rx = anObject(this); + var S = toString(string); -},{"../internals/classof-raw":223}],261:[function(require,module,exports){ -var fails = require('../internals/fails'); + if ( + typeof replaceValue == 'string' && + stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && + stringIndexOf(replaceValue, '$<') === -1 + ) { + var res = maybeCallNative(nativeReplace, rx, S, replaceValue); + if (res.done) return res.value; + } -var replacement = /#|\.prototype\./; + var functionalReplace = isCallable(replaceValue); + if (!functionalReplace) replaceValue = toString(replaceValue); -var isForced = function (feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL ? true - : value == NATIVE ? false - : typeof detection == 'function' ? fails(detection) - : !!detection; -}; + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; -var normalize = isForced.normalize = function (string) { - return String(string).replace(replacement, '.').toLowerCase(); -}; + push(results, result); + if (!global) break; -var data = isForced.data = {}; -var NATIVE = isForced.NATIVE = 'N'; -var POLYFILL = isForced.POLYFILL = 'P'; + var matchStr = toString(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } -module.exports = isForced; + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; -},{"../internals/fails":243}],262:[function(require,module,exports){ -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; + var matched = toString(result[0]); + var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = concat([matched], captures, position, S); + if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); + var replacement = toString(apply(replaceValue, undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + stringSlice(S, nextSourcePosition); + } + ]; +}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); -},{}],263:[function(require,module,exports){ -module.exports = false; +},{"../internals/advance-string-index":190,"../internals/an-object":192,"../internals/fails":247,"../internals/fix-regexp-well-known-symbol-logic":248,"../internals/function-apply":249,"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/get-method":259,"../internals/get-substitution":260,"../internals/is-callable":275,"../internals/is-null-or-undefined":279,"../internals/regexp-exec-abstract":322,"../internals/require-object-coercible":329,"../internals/to-integer-or-infinity":349,"../internals/to-length":350,"../internals/to-string":357,"../internals/well-known-symbol":371}],409:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var sameValue = require('../internals/same-value'); +var toString = require('../internals/to-string'); +var getMethod = require('../internals/get-method'); +var regExpExec = require('../internals/regexp-exec-abstract'); -},{}],264:[function(require,module,exports){ -var isObject = require('../internals/is-object'); -var classof = require('../internals/classof-raw'); -var wellKnownSymbol = require('../internals/well-known-symbol'); +// @@search logic +fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.es/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH); + return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@search + function (string) { + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(nativeSearch, rx, S); -var MATCH = wellKnownSymbol('match'); + if (res.done) return res.value; -// `IsRegExp` abstract operation -// https://tc39.github.io/ecma262/#sec-isregexp -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); -}; + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); -},{"../internals/classof-raw":223,"../internals/is-object":262,"../internals/well-known-symbol":329}],265:[function(require,module,exports){ +},{"../internals/an-object":192,"../internals/fix-regexp-well-known-symbol-logic":248,"../internals/function-call":253,"../internals/get-method":259,"../internals/is-null-or-undefined":279,"../internals/regexp-exec-abstract":322,"../internals/require-object-coercible":329,"../internals/same-value":330,"../internals/to-string":357}],410:[function(require,module,exports){ +'use strict'; +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); var anObject = require('../internals/an-object'); -var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var isRegExp = require('../internals/is-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var speciesConstructor = require('../internals/species-constructor'); +var advanceStringIndex = require('../internals/advance-string-index'); var toLength = require('../internals/to-length'); -var bind = require('../internals/function-bind-context'); -var getIteratorMethod = require('../internals/get-iterator-method'); -var iteratorClose = require('../internals/iterator-close'); +var toString = require('../internals/to-string'); +var getMethod = require('../internals/get-method'); +var arraySlice = require('../internals/array-slice-simple'); +var callRegExpExec = require('../internals/regexp-exec-abstract'); +var regexpExec = require('../internals/regexp-exec'); +var stickyHelpers = require('../internals/regexp-sticky-helpers'); +var fails = require('../internals/fails'); -var Result = function (stopped, result) { - this.stopped = stopped; - this.result = result; -}; +var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; +var MAX_UINT32 = 0xFFFFFFFF; +var min = Math.min; +var $push = [].push; +var exec = uncurryThis(/./.exec); +var push = uncurryThis($push); +var stringSlice = uncurryThis(''.slice); -module.exports = function (iterable, unboundFunction, options) { - var that = options && options.that; - var AS_ENTRIES = !!(options && options.AS_ENTRIES); - var IS_ITERATOR = !!(options && options.IS_ITERATOR); - var INTERRUPTED = !!(options && options.INTERRUPTED); - var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED); - var iterator, iterFn, index, length, result, next, step; +// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec +// Weex JS has frozen built-in prototypes, so use try / catch wrapper +var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + // eslint-disable-next-line regexp/no-empty-group -- required for testing + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; +}); - var stop = function (condition) { - if (iterator) iteratorClose(iterator); - return new Result(true, condition); - }; +// @@split logic +fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { + var internalSplit; + if ( + 'abbc'.split(/(b)*/)[1] == 'c' || + // eslint-disable-next-line regexp/no-empty-group -- required for testing + 'test'.split(/(?:)/, -1).length != 4 || + 'ab'.split(/(?:ab)*/).length != 2 || + '.'.split(/(.?)(.?)/).length != 4 || + // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing + '.'.split(/()()/).length > 1 || + ''.split(/.?/).length + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = toString(requireObjectCoercible(this)); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) { + return call(nativeSplit, string, separator, lim); + } + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = call(regexpExec, separatorCopy, string)) { + lastIndex = separatorCopy.lastIndex; + if (lastIndex > lastLastIndex) { + push(output, stringSlice(string, lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1)); + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= lim) break; + } + if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop + } + if (lastLastIndex === string.length) { + if (lastLength || !exec(separatorCopy, '')) push(output, ''); + } else push(output, stringSlice(string, lastLastIndex)); + return output.length > lim ? arraySlice(output, 0, lim) : output; + }; + // Chakra, V8 + } else if ('0'.split(undefined, 0).length) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit); + }; + } else internalSplit = nativeSplit; - var callFn = function (value) { - if (AS_ENTRIES) { - anObject(value); - return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); - } return INTERRUPTED ? fn(value, stop) : fn(value); - }; + return [ + // `String.prototype.split` method + // https://tc39.es/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = requireObjectCoercible(this); + var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT); + return splitter + ? call(splitter, separator, O, limit) + : call(internalSplit, toString(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (string, limit) { + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); - if (IS_ITERATOR) { - iterator = iterable; - } else { - iterFn = getIteratorMethod(iterable); - if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); - // optimisation for array iterators - if (isArrayIteratorMethod(iterFn)) { - for (index = 0, length = toLength(iterable.length); length > index; index++) { - result = callFn(iterable[index]); - if (result && result instanceof Result) return result; - } return new Result(false); - } - iterator = iterFn.call(iterable); - } + if (res.done) return res.value; - next = iterator.next; - while (!(step = next.call(iterator)).done) { - try { - result = callFn(step.value); - } catch (error) { - iteratorClose(iterator); - throw error; - } - if (typeof result == 'object' && result && result instanceof Result) return result; - } return new Result(false); -}; + var C = speciesConstructor(rx, RegExp); -},{"../internals/an-object":205,"../internals/function-bind-context":245,"../internals/get-iterator-method":247,"../internals/is-array-iterator-method":259,"../internals/iterator-close":266,"../internals/to-length":317}],266:[function(require,module,exports){ -var anObject = require('../internals/an-object'); + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (UNSUPPORTED_Y ? 'g' : 'y'); -module.exports = function (iterator) { - var returnMethod = iterator['return']; - if (returnMethod !== undefined) { - return anObject(returnMethod.call(iterator)).value; - } -}; + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; + var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S); + var e; + if ( + z === null || + (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + push(A, stringSlice(S, p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + push(A, z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + push(A, stringSlice(S, p)); + return A; + } + ]; +}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); -},{"../internals/an-object":205}],267:[function(require,module,exports){ +},{"../internals/advance-string-index":190,"../internals/an-object":192,"../internals/array-slice-simple":208,"../internals/fails":247,"../internals/fix-regexp-well-known-symbol-logic":248,"../internals/function-apply":249,"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/get-method":259,"../internals/is-null-or-undefined":279,"../internals/is-regexp":282,"../internals/regexp-exec":323,"../internals/regexp-exec-abstract":322,"../internals/regexp-sticky-helpers":326,"../internals/require-object-coercible":329,"../internals/species-constructor":336,"../internals/to-length":350,"../internals/to-string":357}],411:[function(require,module,exports){ 'use strict'; -var getPrototypeOf = require('../internals/object-get-prototype-of'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var has = require('../internals/has'); -var wellKnownSymbol = require('../internals/well-known-symbol'); +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var IS_PURE = require('../internals/is-pure'); -var ITERATOR = wellKnownSymbol('iterator'); -var BUGGY_SAFARI_ITERATORS = false; +// eslint-disable-next-line es/no-string-prototype-startswith -- safe +var nativeStartsWith = uncurryThis(''.startsWith); +var stringSlice = uncurryThis(''.slice); +var min = Math.min; -var returnThis = function () { return this; }; +var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); +// https://github.com/zloirock/core-js/pull/702 +var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { + var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); + return descriptor && !descriptor.writable; +}(); -// `%IteratorPrototype%` object -// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object -var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; +// `String.prototype.startsWith` method +// https://tc39.es/ecma262/#sec-string.prototype.startswith +$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = toString(requireObjectCoercible(this)); + notARegExp(searchString); + var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = toString(searchString); + return nativeStartsWith + ? nativeStartsWith(that, search, index) + : stringSlice(that, index, index + search.length) === search; + } +}); -if ([].keys) { - arrayIterator = [].keys(); - // Safari 8 has buggy iterators w/o `next` - if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } -} +},{"../internals/correct-is-regexp-logic":218,"../internals/export":246,"../internals/function-uncurry-this":255,"../internals/is-pure":281,"../internals/not-a-regexp":295,"../internals/object-get-own-property-descriptor":300,"../internals/require-object-coercible":329,"../internals/to-length":350,"../internals/to-string":357}],412:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $trim = require('../internals/string-trim').trim; +var forcedStringTrimMethod = require('../internals/string-trim-forced'); -if (IteratorPrototype == undefined) IteratorPrototype = {}; +// `String.prototype.trim` method +// https://tc39.es/ecma262/#sec-string.prototype.trim +$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + trim: function trim() { + return $trim(this); + } +}); -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { - createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); -} +},{"../internals/export":246,"../internals/string-trim":339,"../internals/string-trim-forced":338}],413:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var IS_PURE = require('../internals/is-pure'); +var DESCRIPTORS = require('../internals/descriptors'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var fails = require('../internals/fails'); +var hasOwn = require('../internals/has-own-property'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var anObject = require('../internals/an-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toPropertyKey = require('../internals/to-property-key'); +var $toString = require('../internals/to-string'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var nativeObjectCreate = require('../internals/object-create'); +var objectKeys = require('../internals/object-keys'); +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var definePropertyModule = require('../internals/object-define-property'); +var definePropertiesModule = require('../internals/object-define-properties'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var defineBuiltIn = require('../internals/define-built-in'); +var shared = require('../internals/shared'); +var sharedKey = require('../internals/shared-key'); +var hiddenKeys = require('../internals/hidden-keys'); +var uid = require('../internals/uid'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); +var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); +var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); +var setToStringTag = require('../internals/set-to-string-tag'); +var InternalStateModule = require('../internals/internal-state'); +var $forEach = require('../internals/array-iteration').forEach; -module.exports = { - IteratorPrototype: IteratorPrototype, - BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS -}; +var HIDDEN = sharedKey('hidden'); +var SYMBOL = 'Symbol'; +var PROTOTYPE = 'prototype'; -},{"../internals/create-non-enumerable-property":229,"../internals/has":249,"../internals/is-pure":263,"../internals/object-get-prototype-of":283,"../internals/well-known-symbol":329}],268:[function(require,module,exports){ -arguments[4][250][0].apply(exports,arguments) -},{"dup":250}],269:[function(require,module,exports){ -var global = require('../internals/global'); -var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; -var macrotask = require('../internals/task').set; -var IS_IOS = require('../internals/engine-is-ios'); -var IS_NODE = require('../internals/engine-is-node'); +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(SYMBOL); -var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; -var document = global.document; -var process = global.process; -var Promise = global.Promise; -// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` -var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); -var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; +var ObjectPrototype = Object[PROTOTYPE]; +var $Symbol = global.Symbol; +var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; +var TypeError = global.TypeError; +var QObject = global.QObject; +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; +var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; +var push = uncurryThis([].push); -var flush, head, last, notify, toggle, node, promise, then; +var AllSymbols = shared('symbols'); +var ObjectPrototypeSymbols = shared('op-symbols'); +var WellKnownSymbolsStore = shared('wks'); -// modern engines have queueMicrotask method -if (!queueMicrotask) { - flush = function () { - var parent, fn; - if (IS_NODE && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (error) { - if (head) notify(); - else last = undefined; - throw error; - } - } last = undefined; - if (parent) parent.enter(); - }; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 - if (!IS_IOS && !IS_NODE && MutationObserver && document) { - toggle = true; - node = document.createTextNode(''); - new MutationObserver(flush).observe(node, { characterData: true }); - 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 - promise = Promise.resolve(undefined); - then = promise.then; - notify = function () { - then.call(promise, flush); - }; - // Node.js without promises - } else if (IS_NODE) { - notify = function () { - process.nextTick(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); - }; +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDescriptor = DESCRIPTORS && fails(function () { + return nativeObjectCreate(nativeDefineProperty({}, 'a', { + get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (O, P, Attributes) { + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; + nativeDefineProperty(O, P, Attributes); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { + nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); } -} +} : nativeDefineProperty; -module.exports = queueMicrotask || function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; +var wrap = function (tag, description) { + var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); + setInternalState(symbol, { + type: SYMBOL, + tag: tag, + description: description + }); + if (!DESCRIPTORS) symbol.description = description; + return symbol; }; -},{"../internals/engine-is-ios":237,"../internals/engine-is-node":238,"../internals/global":248,"../internals/object-get-own-property-descriptor":279,"../internals/task":312}],270:[function(require,module,exports){ -var global = require('../internals/global'); - -module.exports = global.Promise; - -},{"../internals/global":248}],271:[function(require,module,exports){ -var fails = require('../internals/fails'); - -module.exports = !!Object.getOwnPropertySymbols && !fails(function () { - // Chrome 38 Symbol has incorrect toString conversion - // eslint-disable-next-line no-undef - return !String(Symbol()); -}); +var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPropertyKey(P); + anObject(Attributes); + if (hasOwn(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); + O[HIDDEN][key] = true; + } else { + if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); + } return setSymbolDescriptor(O, key, Attributes); + } return nativeDefineProperty(O, key, Attributes); +}; -},{"../internals/fails":243}],272:[function(require,module,exports){ -var global = require('../internals/global'); -var inspectSource = require('../internals/inspect-source'); +var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); + $forEach(keys, function (key) { + if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]); + }); + return O; +}; -var WeakMap = global.WeakMap; +var $create = function create(O, Properties) { + return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); +}; -module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); +var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPropertyKey(V); + var enumerable = call(nativePropertyIsEnumerable, this, P); + if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false; + return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] + ? enumerable : true; +}; -},{"../internals/global":248,"../internals/inspect-source":257}],273:[function(require,module,exports){ -'use strict'; -var aFunction = require('../internals/a-function'); +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { + var it = toIndexedObject(O); + var key = toPropertyKey(P); + if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return; + var descriptor = nativeGetOwnPropertyDescriptor(it, key); + if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { + descriptor.enumerable = true; + } + return descriptor; +}; -var PromiseCapability = function (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; +var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames(toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key); }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); + return result; }; -// 25.4.1.5 NewPromiseCapability(C) -module.exports.f = function (C) { - return new PromiseCapability(C); +var $getOwnPropertySymbols = function (O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; + var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) { + push(result, AllSymbols[key]); + } + }); + return result; }; -},{"../internals/a-function":200}],274:[function(require,module,exports){ -var isRegExp = require('../internals/is-regexp'); +// `Symbol` constructor +// https://tc39.es/ecma262/#sec-symbol-constructor +if (!NATIVE_SYMBOL) { + $Symbol = function Symbol() { + if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor'); + var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]); + var tag = uid(description); + var setter = function (value) { + if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); + if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); + }; + if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); + return wrap(tag, description); + }; -module.exports = function (it) { - if (isRegExp(it)) { - throw TypeError("The method doesn't accept regular expressions"); - } return it; -}; + SymbolPrototype = $Symbol[PROTOTYPE]; -},{"../internals/is-regexp":264}],275:[function(require,module,exports){ -'use strict'; -var DESCRIPTORS = require('../internals/descriptors'); -var fails = require('../internals/fails'); -var objectKeys = require('../internals/object-keys'); -var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); -var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); -var toObject = require('../internals/to-object'); -var IndexedObject = require('../internals/indexed-object'); + defineBuiltIn(SymbolPrototype, 'toString', function toString() { + return getInternalState(this).tag; + }); -var nativeAssign = Object.assign; -var defineProperty = Object.defineProperty; + defineBuiltIn($Symbol, 'withoutSetter', function (description) { + return wrap(uid(description), description); + }); -// `Object.assign` method -// https://tc39.github.io/ecma262/#sec-object.assign -module.exports = !nativeAssign || fails(function () { - // should have correct order of operations (Edge bug) - if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', { - enumerable: true, - get: function () { - defineProperty(this, 'b', { - value: 3, - enumerable: false - }); - } - }), { b: 2 })).b !== 1) return true; - // should work with symbols and should have deterministic property order (V8 bug) - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var symbol = Symbol(); - var alphabet = 'abcdefghijklmnopqrst'; - A[symbol] = 7; - alphabet.split('').forEach(function (chr) { B[chr] = chr; }); - return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; -}) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var argumentsLength = arguments.length; - var index = 1; - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - var propertyIsEnumerable = propertyIsEnumerableModule.f; - while (argumentsLength > index) { - var S = IndexedObject(arguments[index++]); - var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; - } - } return T; -} : nativeAssign; - -},{"../internals/descriptors":234,"../internals/fails":243,"../internals/indexed-object":255,"../internals/object-get-own-property-symbols":282,"../internals/object-keys":285,"../internals/object-property-is-enumerable":286,"../internals/to-object":318}],276:[function(require,module,exports){ -var anObject = require('../internals/an-object'); -var defineProperties = require('../internals/object-define-properties'); -var enumBugKeys = require('../internals/enum-bug-keys'); -var hiddenKeys = require('../internals/hidden-keys'); -var html = require('../internals/html'); -var documentCreateElement = require('../internals/document-create-element'); -var sharedKey = require('../internals/shared-key'); + propertyIsEnumerableModule.f = $propertyIsEnumerable; + definePropertyModule.f = $defineProperty; + definePropertiesModule.f = $defineProperties; + getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; + getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; + getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; -var GT = '>'; -var LT = '<'; -var PROTOTYPE = 'prototype'; -var SCRIPT = 'script'; -var IE_PROTO = sharedKey('IE_PROTO'); + wrappedWellKnownSymbolModule.f = function (name) { + return wrap(wellKnownSymbol(name), name); + }; -var EmptyConstructor = function () { /* empty */ }; + if (DESCRIPTORS) { + // https://github.com/tc39/proposal-Symbol-description + nativeDefineProperty(SymbolPrototype, 'description', { + configurable: true, + get: function description() { + return getInternalState(this).description; + } + }); + if (!IS_PURE) { + defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); + } + } +} -var scriptTag = function (content) { - return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; -}; +$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { + Symbol: $Symbol +}); -// Create object with fake `null` prototype: use ActiveX Object with cleared prototype -var NullProtoObjectViaActiveX = function (activeXDocument) { - activeXDocument.write(scriptTag('')); - activeXDocument.close(); - var temp = activeXDocument.parentWindow.Object; - activeXDocument = null; // avoid memory leak - return temp; -}; +$forEach(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); +}); -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var NullProtoObjectViaIFrame = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = documentCreateElement('iframe'); - var JS = 'java' + SCRIPT + ':'; - var iframeDocument; - iframe.style.display = 'none'; - html.appendChild(iframe); - // https://github.com/zloirock/core-js/issues/475 - iframe.src = String(JS); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(scriptTag('document.F=Object')); - iframeDocument.close(); - return iframeDocument.F; -}; +$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { + useSetter: function () { USE_SETTER = true; }, + useSimple: function () { USE_SETTER = false; } +}); -// Check for document.domain and active x support -// No need to use active x approach when document.domain is not set -// see https://github.com/es-shims/es5-shim/issues/150 -// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 -// avoid IE GC bug -var activeXDocument; -var NullProtoObject = function () { - try { - /* global ActiveXObject */ - activeXDocument = document.domain && new ActiveXObject('htmlfile'); - } catch (error) { /* ignore */ } - NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); - var length = enumBugKeys.length; - while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return NullProtoObject(); -}; +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { + // `Object.create` method + // https://tc39.es/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.es/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.es/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor +}); -hiddenKeys[IE_PROTO] = true; +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { + // `Object.getOwnPropertyNames` method + // https://tc39.es/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames +}); -// `Object.create` method -// https://tc39.github.io/ecma262/#sec-object.create -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - EmptyConstructor[PROTOTYPE] = anObject(O); - result = new EmptyConstructor(); - EmptyConstructor[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = NullProtoObject(); - return Properties === undefined ? result : defineProperties(result, Properties); -}; +// `Symbol.prototype[@@toPrimitive]` method +// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive +defineSymbolToPrimitive(); -},{"../internals/an-object":205,"../internals/document-create-element":235,"../internals/enum-bug-keys":241,"../internals/hidden-keys":250,"../internals/html":252,"../internals/object-define-properties":277,"../internals/shared-key":305}],277:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var definePropertyModule = require('../internals/object-define-property'); -var anObject = require('../internals/an-object'); -var objectKeys = require('../internals/object-keys'); +// `Symbol.prototype[@@toStringTag]` property +// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag +setToStringTag($Symbol, SYMBOL); -// `Object.defineProperties` method -// https://tc39.github.io/ecma262/#sec-object.defineproperties -module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var index = 0; - var key; - while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); - return O; -}; +hiddenKeys[HIDDEN] = true; -},{"../internals/an-object":205,"../internals/descriptors":234,"../internals/object-define-property":278,"../internals/object-keys":285}],278:[function(require,module,exports){ +},{"../internals/an-object":192,"../internals/array-iteration":202,"../internals/create-property-descriptor":222,"../internals/define-built-in":224,"../internals/descriptors":228,"../internals/export":246,"../internals/fails":247,"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/has-own-property":262,"../internals/hidden-keys":263,"../internals/internal-state":271,"../internals/is-pure":281,"../internals/object-create":297,"../internals/object-define-properties":298,"../internals/object-define-property":299,"../internals/object-get-own-property-descriptor":300,"../internals/object-get-own-property-names":302,"../internals/object-get-own-property-names-external":301,"../internals/object-get-own-property-symbols":303,"../internals/object-is-prototype-of":305,"../internals/object-keys":307,"../internals/object-property-is-enumerable":308,"../internals/set-to-string-tag":332,"../internals/shared":335,"../internals/shared-key":333,"../internals/symbol-constructor-detection":340,"../internals/symbol-define-to-primitive":341,"../internals/to-indexed-object":348,"../internals/to-property-key":355,"../internals/to-string":357,"../internals/uid":364,"../internals/well-known-symbol":371,"../internals/well-known-symbol-define":369,"../internals/well-known-symbol-wrapped":370}],414:[function(require,module,exports){ +// `Symbol.prototype.description` getter +// https://tc39.es/ecma262/#sec-symbol.prototype.description +'use strict'; +var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); -var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); -var anObject = require('../internals/an-object'); -var toPrimitive = require('../internals/to-primitive'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var hasOwn = require('../internals/has-own-property'); +var isCallable = require('../internals/is-callable'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var toString = require('../internals/to-string'); +var defineProperty = require('../internals/object-define-property').f; +var copyConstructorProperties = require('../internals/copy-constructor-properties'); -var nativeDefineProperty = Object.defineProperty; +var NativeSymbol = global.Symbol; +var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; -// `Object.defineProperty` method -// https://tc39.github.io/ecma262/#sec-object.defineproperty -exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; +if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || + // Safari 12 bug + NativeSymbol().description !== undefined +)) { + var EmptyStringDescriptionStore = {}; + // wrap Symbol constructor for correct work with undefined description + var SymbolWrapper = function Symbol() { + var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); + var result = isPrototypeOf(SymbolPrototype, this) + ? new NativeSymbol(description) + // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + : description === undefined ? NativeSymbol() : NativeSymbol(description); + if (description === '') EmptyStringDescriptionStore[result] = true; + return result; + }; -},{"../internals/an-object":205,"../internals/descriptors":234,"../internals/ie8-dom-define":253,"../internals/to-primitive":321}],279:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); -var createPropertyDescriptor = require('../internals/create-property-descriptor'); -var toIndexedObject = require('../internals/to-indexed-object'); -var toPrimitive = require('../internals/to-primitive'); -var has = require('../internals/has'); -var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); + copyConstructorProperties(SymbolWrapper, NativeSymbol); + SymbolWrapper.prototype = SymbolPrototype; + SymbolPrototype.constructor = SymbolWrapper; -var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)'; + var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); + var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); + var regexp = /^Symbol\((.*)\)[^)]+$/; + var replace = uncurryThis(''.replace); + var stringSlice = uncurryThis(''.slice); -// `Object.getOwnPropertyDescriptor` method -// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor -exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return nativeGetOwnPropertyDescriptor(O, P); - } catch (error) { /* empty */ } - if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); -}; + defineProperty(SymbolPrototype, 'description', { + configurable: true, + get: function description() { + var symbol = thisSymbolValue(this); + if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; + var string = symbolDescriptiveString(symbol); + var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1'); + return desc === '' ? undefined : desc; + } + }); -},{"../internals/create-property-descriptor":230,"../internals/descriptors":234,"../internals/has":249,"../internals/ie8-dom-define":253,"../internals/object-property-is-enumerable":286,"../internals/to-indexed-object":315,"../internals/to-primitive":321}],280:[function(require,module,exports){ -var toIndexedObject = require('../internals/to-indexed-object'); -var nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names').f; + $({ global: true, constructor: true, forced: true }, { + Symbol: SymbolWrapper + }); +} -var toString = {}.toString; +},{"../internals/copy-constructor-properties":217,"../internals/descriptors":228,"../internals/export":246,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/has-own-property":262,"../internals/is-callable":275,"../internals/object-define-property":299,"../internals/object-is-prototype-of":305,"../internals/to-string":357}],415:[function(require,module,exports){ +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var hasOwn = require('../internals/has-own-property'); +var toString = require('../internals/to-string'); +var shared = require('../internals/shared'); +var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); -var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; +var StringToSymbolRegistry = shared('string-to-symbol-registry'); +var SymbolToStringRegistry = shared('symbol-to-string-registry'); -var getWindowNames = function (it) { - try { - return nativeGetOwnPropertyNames(it); - } catch (error) { - return windowNames.slice(); +// `Symbol.for` method +// https://tc39.es/ecma262/#sec-symbol.for +$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { + 'for': function (key) { + var string = toString(key); + if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; + var symbol = getBuiltIn('Symbol')(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; } -}; +}); -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' - ? getWindowNames(it) - : nativeGetOwnPropertyNames(toIndexedObject(it)); -}; +},{"../internals/export":246,"../internals/get-built-in":256,"../internals/has-own-property":262,"../internals/shared":335,"../internals/symbol-registry-detection":342,"../internals/to-string":357}],416:[function(require,module,exports){ +var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); -},{"../internals/object-get-own-property-names":281,"../internals/to-indexed-object":315}],281:[function(require,module,exports){ -var internalObjectKeys = require('../internals/object-keys-internal'); -var enumBugKeys = require('../internals/enum-bug-keys'); +// `Symbol.iterator` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.iterator +defineWellKnownSymbol('iterator'); -var hiddenKeys = enumBugKeys.concat('length', 'prototype'); +},{"../internals/well-known-symbol-define":369}],417:[function(require,module,exports){ +// TODO: Remove this module from `core-js@4` since it's split to modules listed below +require('../modules/es.symbol.constructor'); +require('../modules/es.symbol.for'); +require('../modules/es.symbol.key-for'); +require('../modules/es.json.stringify'); +require('../modules/es.object.get-own-property-symbols'); -// `Object.getOwnPropertyNames` method -// https://tc39.github.io/ecma262/#sec-object.getownpropertynames -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); -}; +},{"../modules/es.json.stringify":387,"../modules/es.object.get-own-property-symbols":391,"../modules/es.symbol.constructor":413,"../modules/es.symbol.for":415,"../modules/es.symbol.key-for":418}],418:[function(require,module,exports){ +var $ = require('../internals/export'); +var hasOwn = require('../internals/has-own-property'); +var isSymbol = require('../internals/is-symbol'); +var tryToString = require('../internals/try-to-string'); +var shared = require('../internals/shared'); +var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); -},{"../internals/enum-bug-keys":241,"../internals/object-keys-internal":284}],282:[function(require,module,exports){ -exports.f = Object.getOwnPropertySymbols; +var SymbolToStringRegistry = shared('symbol-to-string-registry'); -},{}],283:[function(require,module,exports){ -var has = require('../internals/has'); -var toObject = require('../internals/to-object'); -var sharedKey = require('../internals/shared-key'); -var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); +// `Symbol.keyFor` method +// https://tc39.es/ecma262/#sec-symbol.keyfor +$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol'); + if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; + } +}); -var IE_PROTO = sharedKey('IE_PROTO'); -var ObjectPrototype = Object.prototype; +},{"../internals/export":246,"../internals/has-own-property":262,"../internals/is-symbol":283,"../internals/shared":335,"../internals/symbol-registry-detection":342,"../internals/try-to-string":358}],419:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $ArrayCopyWithin = require('../internals/array-copy-within'); -// `Object.getPrototypeOf` method -// https://tc39.github.io/ecma262/#sec-object.getprototypeof -module.exports = CORRECT_PROTOTYPE_GETTER ? 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 ? ObjectPrototype : null; -}; +var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -},{"../internals/correct-prototype-getter":227,"../internals/has":249,"../internals/shared-key":305,"../internals/to-object":318}],284:[function(require,module,exports){ -var has = require('../internals/has'); -var toIndexedObject = require('../internals/to-indexed-object'); -var indexOf = require('../internals/array-includes').indexOf; -var hiddenKeys = require('../internals/hidden-keys'); +// `%TypedArray%.prototype.copyWithin` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin +exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) { + return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); +}); -module.exports = function (object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~indexOf(result, key) || result.push(key); - } - return result; -}; +},{"../internals/array-buffer-view-core":194,"../internals/array-copy-within":196,"../internals/function-uncurry-this":255}],420:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $every = require('../internals/array-iteration').every; -},{"../internals/array-includes":213,"../internals/has":249,"../internals/hidden-keys":250,"../internals/to-indexed-object":315}],285:[function(require,module,exports){ -var internalObjectKeys = require('../internals/object-keys-internal'); -var enumBugKeys = require('../internals/enum-bug-keys'); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -// `Object.keys` method -// https://tc39.github.io/ecma262/#sec-object.keys -module.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); -}; +// `%TypedArray%.prototype.every` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every +exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) { + return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); -},{"../internals/enum-bug-keys":241,"../internals/object-keys-internal":284}],286:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202}],421:[function(require,module,exports){ 'use strict'; -var nativePropertyIsEnumerable = {}.propertyIsEnumerable; -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $fill = require('../internals/array-fill'); +var toBigInt = require('../internals/to-big-int'); +var classof = require('../internals/classof'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); -// Nashorn ~ JDK8 bug -var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var slice = uncurryThis(''.slice); -// `Object.prototype.propertyIsEnumerable` method implementation -// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable -exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; -} : nativePropertyIsEnumerable; +// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 +var CONVERSION_BUG = fails(function () { + var count = 0; + // eslint-disable-next-line es/no-typed-arrays -- safe + new Int8Array(2).fill({ valueOf: function () { return count++; } }); + return count !== 1; +}); -},{}],287:[function(require,module,exports){ -var anObject = require('../internals/an-object'); -var aPossiblePrototype = require('../internals/a-possible-prototype'); +// `%TypedArray%.prototype.fill` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill +exportTypedArrayMethod('fill', function fill(value /* , start, end */) { + var length = arguments.length; + aTypedArray(this); + var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; + return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined); +}, CONVERSION_BUG); -// `Object.setPrototypeOf` method -// https://tc39.github.io/ecma262/#sec-object.setprototypeof -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { - var CORRECT_SETTER = false; - var test = {}; - var setter; - try { - setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; - setter.call(test, []); - CORRECT_SETTER = test instanceof Array; - } catch (error) { /* empty */ } - return function setPrototypeOf(O, proto) { - anObject(O); - aPossiblePrototype(proto); - if (CORRECT_SETTER) setter.call(O, proto); - else O.__proto__ = proto; - return O; - }; -}() : undefined); +},{"../internals/array-buffer-view-core":194,"../internals/array-fill":197,"../internals/classof":216,"../internals/fails":247,"../internals/function-call":253,"../internals/function-uncurry-this":255,"../internals/to-big-int":346}],422:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $filter = require('../internals/array-iteration').filter; +var fromSpeciesAndList = require('../internals/typed-array-from-species-and-list'); -},{"../internals/a-possible-prototype":201,"../internals/an-object":205}],288:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var objectKeys = require('../internals/object-keys'); -var toIndexedObject = require('../internals/to-indexed-object'); -var propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -// `Object.{ entries, values }` methods implementation -var createMethod = function (TO_ENTRIES) { - return function (it) { - var O = toIndexedObject(it); - var keys = objectKeys(O); - var length = keys.length; - var i = 0; - var result = []; - var key; - while (length > i) { - key = keys[i++]; - if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) { - result.push(TO_ENTRIES ? [key, O[key]] : O[key]); - } - } - return result; - }; -}; +// `%TypedArray%.prototype.filter` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter +exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) { + var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return fromSpeciesAndList(this, list); +}); -module.exports = { - // `Object.entries` method - // https://tc39.github.io/ecma262/#sec-object.entries - entries: createMethod(true), - // `Object.values` method - // https://tc39.github.io/ecma262/#sec-object.values - values: createMethod(false) -}; +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202,"../internals/typed-array-from-species-and-list":361}],423:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $findIndex = require('../internals/array-iteration').findIndex; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.findIndex` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex +exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) { + return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); -},{"../internals/descriptors":234,"../internals/object-keys":285,"../internals/object-property-is-enumerable":286,"../internals/to-indexed-object":315}],289:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202}],424:[function(require,module,exports){ 'use strict'; -var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); -var classof = require('../internals/classof'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $find = require('../internals/array-iteration').find; -// `Object.prototype.toString` method implementation -// https://tc39.github.io/ecma262/#sec-object.prototype.tostring -module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { - return '[object ' + classof(this) + ']'; -}; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -},{"../internals/classof":224,"../internals/to-string-tag-support":322}],290:[function(require,module,exports){ -var getBuiltIn = require('../internals/get-built-in'); -var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); -var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); -var anObject = require('../internals/an-object'); +// `%TypedArray%.prototype.find` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find +exportTypedArrayMethod('find', function find(predicate /* , thisArg */) { + return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); -// all object keys, includes non-enumerable and symbols -module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { - var keys = getOwnPropertyNamesModule.f(anObject(it)); - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; -}; +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202}],425:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $forEach = require('../internals/array-iteration').forEach; -},{"../internals/an-object":205,"../internals/get-built-in":246,"../internals/object-get-own-property-names":281,"../internals/object-get-own-property-symbols":282}],291:[function(require,module,exports){ -var global = require('../internals/global'); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -module.exports = global; +// `%TypedArray%.prototype.forEach` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach +exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) { + $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); -},{"../internals/global":248}],292:[function(require,module,exports){ -module.exports = function (exec) { - try { - return { error: false, value: exec() }; - } catch (error) { - return { error: true, value: error }; - } -}; +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202}],426:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $includes = require('../internals/array-includes').includes; -},{}],293:[function(require,module,exports){ -var anObject = require('../internals/an-object'); -var isObject = require('../internals/is-object'); -var newPromiseCapability = require('../internals/new-promise-capability'); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -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; -}; +// `%TypedArray%.prototype.includes` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes +exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) { + return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); -},{"../internals/an-object":205,"../internals/is-object":262,"../internals/new-promise-capability":273}],294:[function(require,module,exports){ -var redefine = require('../internals/redefine'); +},{"../internals/array-buffer-view-core":194,"../internals/array-includes":201}],427:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $indexOf = require('../internals/array-includes').indexOf; -module.exports = function (target, src, options) { - for (var key in src) redefine(target, key, src[key], options); - return target; -}; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -},{"../internals/redefine":295}],295:[function(require,module,exports){ +// `%TypedArray%.prototype.indexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof +exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) { + return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":194,"../internals/array-includes":201}],428:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var has = require('../internals/has'); -var setGlobal = require('../internals/set-global'); -var inspectSource = require('../internals/inspect-source'); -var InternalStateModule = require('../internals/internal-state'); +var fails = require('../internals/fails'); +var uncurryThis = require('../internals/function-uncurry-this'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var ArrayIterators = require('../modules/es.array.iterator'); +var wellKnownSymbol = require('../internals/well-known-symbol'); -var getInternalState = InternalStateModule.get; -var enforceInternalState = InternalStateModule.enforce; -var TEMPLATE = String(String).split('String'); +var ITERATOR = wellKnownSymbol('iterator'); +var Uint8Array = global.Uint8Array; +var arrayValues = uncurryThis(ArrayIterators.values); +var arrayKeys = uncurryThis(ArrayIterators.keys); +var arrayEntries = uncurryThis(ArrayIterators.entries); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var TypedArrayPrototype = Uint8Array && Uint8Array.prototype; -(module.exports = function (O, key, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - var state; - if (typeof value == 'function') { - if (typeof key == 'string' && !has(value, 'name')) { - createNonEnumerableProperty(value, 'name', key); - } - state = enforceInternalState(value); - if (!state.source) { - state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); - } - } - if (O === global) { - if (simple) O[key] = value; - else setGlobal(key, value); - return; - } else if (!unsafe) { - delete O[key]; - } else if (!noTargetGet && O[key]) { - simple = true; - } - if (simple) O[key] = value; - else createNonEnumerableProperty(O, key, value); -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, 'toString', function toString() { - return typeof this == 'function' && getInternalState(this).source || inspectSource(this); +var GENERIC = !fails(function () { + TypedArrayPrototype[ITERATOR].call([1]); }); -},{"../internals/create-non-enumerable-property":229,"../internals/global":248,"../internals/has":249,"../internals/inspect-source":257,"../internals/internal-state":258,"../internals/set-global":302}],296:[function(require,module,exports){ -var classof = require('./classof-raw'); -var regexpExec = require('./regexp-exec'); +var ITERATOR_IS_VALUES = !!TypedArrayPrototype + && TypedArrayPrototype.values + && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values + && TypedArrayPrototype.values.name === 'values'; -// `RegExpExec` abstract operation -// https://tc39.github.io/ecma262/#sec-regexpexec -module.exports = function (R, S) { - var exec = R.exec; - if (typeof exec === 'function') { - var result = exec.call(R, S); - if (typeof result !== 'object') { - throw TypeError('RegExp exec method returned something other than an Object or null'); - } - return result; - } +var typedArrayValues = function values() { + return arrayValues(aTypedArray(this)); +}; - if (classof(R) !== 'RegExp') { - throw TypeError('RegExp#exec called on incompatible receiver'); - } +// `%TypedArray%.prototype.entries` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries +exportTypedArrayMethod('entries', function entries() { + return arrayEntries(aTypedArray(this)); +}, GENERIC); +// `%TypedArray%.prototype.keys` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys +exportTypedArrayMethod('keys', function keys() { + return arrayKeys(aTypedArray(this)); +}, GENERIC); +// `%TypedArray%.prototype.values` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values +exportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); +// `%TypedArray%.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator +exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); - return regexpExec.call(R, S); -}; +},{"../internals/array-buffer-view-core":194,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/global":261,"../internals/well-known-symbol":371,"../modules/es.array.iterator":380}],429:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var uncurryThis = require('../internals/function-uncurry-this'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var $join = uncurryThis([].join); +// `%TypedArray%.prototype.join` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join +exportTypedArrayMethod('join', function join(separator) { + return $join(aTypedArray(this), separator); +}); -},{"./classof-raw":223,"./regexp-exec":297}],297:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":194,"../internals/function-uncurry-this":255}],430:[function(require,module,exports){ 'use strict'; -var regexpFlags = require('./regexp-flags'); -var stickyHelpers = require('./regexp-sticky-helpers'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var apply = require('../internals/function-apply'); +var $lastIndexOf = require('../internals/array-last-index-of'); -var nativeExec = RegExp.prototype.exec; -// This always refers to the native implementation, because the -// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, -// which loads this file before patching the method. -var nativeReplace = String.prototype.replace; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var patchedExec = nativeExec; +// `%TypedArray%.prototype.lastIndexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof +exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { + var length = arguments.length; + return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]); +}); -var UPDATES_LAST_INDEX_WRONG = (function () { - var re1 = /a/; - var re2 = /b*/g; - nativeExec.call(re1, 'a'); - nativeExec.call(re2, 'a'); - return re1.lastIndex !== 0 || re2.lastIndex !== 0; -})(); +},{"../internals/array-buffer-view-core":194,"../internals/array-last-index-of":203,"../internals/function-apply":249}],431:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $map = require('../internals/array-iteration').map; +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); -var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -// nonparticipating capturing group, copied from es5-shim's String#split patch. -var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; +// `%TypedArray%.prototype.map` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map +exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) { + return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { + return new (typedArraySpeciesConstructor(O))(length); + }); +}); -var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y; +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202,"../internals/typed-array-species-constructor":363}],432:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $reduceRight = require('../internals/array-reduce').right; -if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, reCopy, match, i; - var sticky = UNSUPPORTED_Y && re.sticky; - var flags = regexpFlags.call(re); - var source = re.source; - var charsAdded = 0; - var strCopy = str; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - if (sticky) { - flags = flags.replace('y', ''); - if (flags.indexOf('g') === -1) { - flags += 'g'; - } +// `%TypedArray%.prototype.reduceRight` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright +exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) { + var length = arguments.length; + return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); +}); - strCopy = String(str).slice(re.lastIndex); - // Support anchored sticky behavior. - if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) { - source = '(?: ' + source + ')'; - strCopy = ' ' + strCopy; - charsAdded++; - } - // ^(? + rx + ) is needed, in combination with some str slicing, to - // simulate the 'y' flag. - reCopy = new RegExp('^(?:' + source + ')', flags); - } +},{"../internals/array-buffer-view-core":194,"../internals/array-reduce":206}],433:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $reduce = require('../internals/array-reduce').left; - if (NPCG_INCLUDED) { - reCopy = new RegExp('^' + source + '$(?!\\s)', flags); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - match = nativeExec.call(sticky ? reCopy : re, strCopy); +// `%TypedArray%.prototype.reduce` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce +exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) { + var length = arguments.length; + return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); +}); - if (sticky) { - if (match) { - match.input = match.input.slice(charsAdded); - match[0] = match[0].slice(charsAdded); - match.index = re.lastIndex; - re.lastIndex += match[0].length; - } else re.lastIndex = 0; - } else if (UPDATES_LAST_INDEX_WRONG && match) { - re.lastIndex = re.global ? match.index + match[0].length : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } +},{"../internals/array-buffer-view-core":194,"../internals/array-reduce":206}],434:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); - return match; - }; -} +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var floor = Math.floor; -module.exports = patchedExec; +// `%TypedArray%.prototype.reverse` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse +exportTypedArrayMethod('reverse', function reverse() { + var that = this; + var length = aTypedArray(that).length; + var middle = floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; +}); -},{"./regexp-flags":298,"./regexp-sticky-helpers":299}],298:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":194}],435:[function(require,module,exports){ 'use strict'; -var anObject = require('../internals/an-object'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var toOffset = require('../internals/to-offset'); +var toIndexedObject = require('../internals/to-object'); +var fails = require('../internals/fails'); -// `RegExp.prototype.flags` getter implementation -// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.dotAll) result += 's'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; +var RangeError = global.RangeError; +var Int8Array = global.Int8Array; +var Int8ArrayPrototype = Int8Array && Int8Array.prototype; +var $set = Int8ArrayPrototype && Int8ArrayPrototype.set; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -},{"../internals/an-object":205}],299:[function(require,module,exports){ -'use strict'; +var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function () { + // eslint-disable-next-line es/no-typed-arrays -- required for testing + var array = new Uint8ClampedArray(2); + call($set, array, { length: 1, 0: 3 }, 1); + return array[1] !== 3; +}); -var fails = require('./fails'); +// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other +var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () { + var array = new Int8Array(2); + array.set(1); + array.set('2', 1); + return array[0] !== 0 || array[1] !== 2; +}); -// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, -// so we use an intermediate function. -function RE(s, f) { - return RegExp(s, f); -} +// `%TypedArray%.prototype.set` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set +exportTypedArrayMethod('set', function set(arrayLike /* , offset */) { + aTypedArray(this); + var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); + var src = toIndexedObject(arrayLike); + if (WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset); + var length = this.length; + var len = lengthOfArrayLike(src); + var index = 0; + if (len + offset > length) throw RangeError('Wrong length'); + while (index < len) this[offset + index] = src[index++]; +}, !WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); -exports.UNSUPPORTED_Y = fails(function () { - // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError - var re = RE('a', 'y'); - re.lastIndex = 2; - return re.exec('abcd') != null; -}); +},{"../internals/array-buffer-view-core":194,"../internals/fails":247,"../internals/function-call":253,"../internals/global":261,"../internals/length-of-array-like":290,"../internals/to-object":351,"../internals/to-offset":352}],436:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); +var fails = require('../internals/fails'); +var arraySlice = require('../internals/array-slice'); -exports.BROKEN_CARET = fails(function () { - // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 - var re = RE('^r', 'gy'); - re.lastIndex = 2; - return re.exec('str') != null; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +var FORCED = fails(function () { + // eslint-disable-next-line es/no-typed-arrays -- required for testing + new Int8Array(1).slice(); }); -},{"./fails":243}],300:[function(require,module,exports){ -// `RequireObjectCoercible` abstract operation -// https://tc39.github.io/ecma262/#sec-requireobjectcoercible -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; +// `%TypedArray%.prototype.slice` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice +exportTypedArrayMethod('slice', function slice(start, end) { + var list = arraySlice(aTypedArray(this), start, end); + var C = typedArraySpeciesConstructor(this); + var index = 0; + var length = list.length; + var result = new C(length); + while (length > index) result[index] = list[index++]; + return result; +}, FORCED); -},{}],301:[function(require,module,exports){ -// `SameValue` abstract operation -// https://tc39.github.io/ecma262/#sec-samevalue -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; +},{"../internals/array-buffer-view-core":194,"../internals/array-slice":209,"../internals/fails":247,"../internals/typed-array-species-constructor":363}],437:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $some = require('../internals/array-iteration').some; -},{}],302:[function(require,module,exports){ -var global = require('../internals/global'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -module.exports = function (key, value) { - try { - createNonEnumerableProperty(global, key, value); - } catch (error) { - global[key] = value; - } return value; -}; +// `%TypedArray%.prototype.some` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some +exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) { + return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); -},{"../internals/create-non-enumerable-property":229,"../internals/global":248}],303:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":194,"../internals/array-iteration":202}],438:[function(require,module,exports){ 'use strict'; -var getBuiltIn = require('../internals/get-built-in'); -var definePropertyModule = require('../internals/object-define-property'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var aCallable = require('../internals/a-callable'); +var internalSort = require('../internals/array-sort'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var FF = require('../internals/engine-ff-version'); +var IE_OR_EDGE = require('../internals/engine-is-ie-or-edge'); +var V8 = require('../internals/engine-v8-version'); +var WEBKIT = require('../internals/engine-webkit-version'); -var SPECIES = wellKnownSymbol('species'); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var Uint16Array = global.Uint16Array; +var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort); + +// WebKit +var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () { + nativeSort(new Uint16Array(2), null); +}) && fails(function () { + nativeSort(new Uint16Array(2), {}); +})); -module.exports = function (CONSTRUCTOR_NAME) { - var Constructor = getBuiltIn(CONSTRUCTOR_NAME); - var defineProperty = definePropertyModule.f; +var STABLE_SORT = !!nativeSort && !fails(function () { + // feature detection can be too slow, so check engines versions + if (V8) return V8 < 74; + if (FF) return FF < 67; + if (IE_OR_EDGE) return true; + if (WEBKIT) return WEBKIT < 602; - if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { - defineProperty(Constructor, SPECIES, { - configurable: true, - get: function () { return this; } - }); - } -}; + var array = new Uint16Array(516); + var expected = Array(516); + var index, mod; -},{"../internals/descriptors":234,"../internals/get-built-in":246,"../internals/object-define-property":278,"../internals/well-known-symbol":329}],304:[function(require,module,exports){ -var defineProperty = require('../internals/object-define-property').f; -var has = require('../internals/has'); -var wellKnownSymbol = require('../internals/well-known-symbol'); + for (index = 0; index < 516; index++) { + mod = index % 4; + array[index] = 515 - index; + expected[index] = index - 2 * mod + 3; + } -var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + nativeSort(array, function (a, b) { + return (a / 4 | 0) - (b / 4 | 0); + }); -module.exports = function (it, TAG, STATIC) { - if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { - defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); + for (index = 0; index < 516; index++) { + if (array[index] !== expected[index]) return true; } +}); + +var getSortCompare = function (comparefn) { + return function (x, y) { + if (comparefn !== undefined) return +comparefn(x, y) || 0; + // eslint-disable-next-line no-self-compare -- NaN check + if (y !== y) return -1; + // eslint-disable-next-line no-self-compare -- NaN check + if (x !== x) return 1; + if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1; + return x > y; + }; }; -},{"../internals/has":249,"../internals/object-define-property":278,"../internals/well-known-symbol":329}],305:[function(require,module,exports){ -var shared = require('../internals/shared'); -var uid = require('../internals/uid'); +// `%TypedArray%.prototype.sort` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort +exportTypedArrayMethod('sort', function sort(comparefn) { + if (comparefn !== undefined) aCallable(comparefn); + if (STABLE_SORT) return nativeSort(this, comparefn); -var keys = shared('keys'); + return internalSort(aTypedArray(this), getSortCompare(comparefn)); +}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); -module.exports = function (key) { - return keys[key] || (keys[key] = uid(key)); -}; +},{"../internals/a-callable":186,"../internals/array-buffer-view-core":194,"../internals/array-sort":210,"../internals/engine-ff-version":234,"../internals/engine-is-ie-or-edge":237,"../internals/engine-v8-version":243,"../internals/engine-webkit-version":244,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/global":261}],439:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var toLength = require('../internals/to-length'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); -},{"../internals/shared":307,"../internals/uid":326}],306:[function(require,module,exports){ -var global = require('../internals/global'); -var setGlobal = require('../internals/set-global'); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || setGlobal(SHARED, {}); +// `%TypedArray%.prototype.subarray` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray +exportTypedArrayMethod('subarray', function subarray(begin, end) { + var O = aTypedArray(this); + var length = O.length; + var beginIndex = toAbsoluteIndex(begin, length); + var C = typedArraySpeciesConstructor(O); + return new C( + O.buffer, + O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) + ); +}); -module.exports = store; +},{"../internals/array-buffer-view-core":194,"../internals/to-absolute-index":345,"../internals/to-length":350,"../internals/typed-array-species-constructor":363}],440:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var apply = require('../internals/function-apply'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var fails = require('../internals/fails'); +var arraySlice = require('../internals/array-slice'); -},{"../internals/global":248,"../internals/set-global":302}],307:[function(require,module,exports){ -var IS_PURE = require('../internals/is-pure'); -var store = require('../internals/shared-store'); +var Int8Array = global.Int8Array; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var $toLocaleString = [].toLocaleString; -(module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); -})('versions', []).push({ - version: '3.7.0', - mode: IS_PURE ? 'pure' : 'global', - copyright: '© 2020 Denis Pushkarev (zloirock.ru)' +// iOS Safari 6.x fails here +var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { + $toLocaleString.call(new Int8Array(1)); }); -},{"../internals/is-pure":263,"../internals/shared-store":306}],308:[function(require,module,exports){ -var anObject = require('../internals/an-object'); -var aFunction = require('../internals/a-function'); -var wellKnownSymbol = require('../internals/well-known-symbol'); +var FORCED = fails(function () { + return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString(); +}) || !fails(function () { + Int8Array.prototype.toLocaleString.call([1, 2]); +}); -var SPECIES = wellKnownSymbol('species'); +// `%TypedArray%.prototype.toLocaleString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring +exportTypedArrayMethod('toLocaleString', function toLocaleString() { + return apply( + $toLocaleString, + TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this), + arraySlice(arguments) + ); +}, FORCED); -// `SpeciesConstructor` abstract operation -// https://tc39.github.io/ecma262/#sec-speciesconstructor -module.exports = function (O, defaultConstructor) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); -}; +},{"../internals/array-buffer-view-core":194,"../internals/array-slice":209,"../internals/fails":247,"../internals/function-apply":249,"../internals/global":261}],441:[function(require,module,exports){ +'use strict'; +var exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod; +var fails = require('../internals/fails'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); -},{"../internals/a-function":200,"../internals/an-object":205,"../internals/well-known-symbol":329}],309:[function(require,module,exports){ -var toInteger = require('../internals/to-integer'); -var requireObjectCoercible = require('../internals/require-object-coercible'); +var Uint8Array = global.Uint8Array; +var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; +var arrayToString = [].toString; +var join = uncurryThis([].join); -// `String.prototype.{ codePointAt, at }` methods implementation -var createMethod = function (CONVERT_TO_STRING) { - return function ($this, pos) { - var S = String(requireObjectCoercible($this)); - var position = toInteger(pos); - var size = S.length; - var first, second; - if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; - first = S.charCodeAt(position); - return first < 0xD800 || first > 0xDBFF || position + 1 === size - || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF - ? CONVERT_TO_STRING ? S.charAt(position) : first - : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; +if (fails(function () { arrayToString.call({}); })) { + arrayToString = function toString() { + return join(this); }; -}; +} -module.exports = { - // `String.prototype.codePointAt` method - // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat - codeAt: createMethod(false), - // `String.prototype.at` method - // https://github.com/mathiasbynens/String.prototype.at - charAt: createMethod(true) -}; +var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; -},{"../internals/require-object-coercible":300,"../internals/to-integer":316}],310:[function(require,module,exports){ -var fails = require('../internals/fails'); -var whitespaces = require('../internals/whitespaces'); +// `%TypedArray%.prototype.toString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring +exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); -var non = '\u200B\u0085\u180E'; - -// check that a method works with the correct list -// of whitespaces and has a correct name -module.exports = function (METHOD_NAME) { - return fails(function () { - return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; - }); -}; +},{"../internals/array-buffer-view-core":194,"../internals/fails":247,"../internals/function-uncurry-this":255,"../internals/global":261}],442:[function(require,module,exports){ +var createTypedArrayConstructor = require('../internals/typed-array-constructor'); -},{"../internals/fails":243,"../internals/whitespaces":330}],311:[function(require,module,exports){ -var requireObjectCoercible = require('../internals/require-object-coercible'); -var whitespaces = require('../internals/whitespaces'); +// `Uint8Array` constructor +// https://tc39.es/ecma262/#sec-typedarray-objects +createTypedArrayConstructor('Uint8', function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); -var whitespace = '[' + whitespaces + ']'; -var ltrim = RegExp('^' + whitespace + whitespace + '*'); -var rtrim = RegExp(whitespace + whitespace + '*$'); +},{"../internals/typed-array-constructor":359}],443:[function(require,module,exports){ +var global = require('../internals/global'); +var DOMIterables = require('../internals/dom-iterables'); +var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); +var forEach = require('../internals/array-for-each'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation -var createMethod = function (TYPE) { - return function ($this) { - var string = String(requireObjectCoercible($this)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; - }; +var handlePrototype = function (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { + createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); + } catch (error) { + CollectionPrototype.forEach = forEach; + } }; -module.exports = { - // `String.prototype.{ trimLeft, trimStart }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart - start: createMethod(1), - // `String.prototype.{ trimRight, trimEnd }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimend - end: createMethod(2), - // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim - trim: createMethod(3) -}; +for (var COLLECTION_NAME in DOMIterables) { + if (DOMIterables[COLLECTION_NAME]) { + handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype); + } +} + +handlePrototype(DOMTokenListPrototype); -},{"../internals/require-object-coercible":300,"../internals/whitespaces":330}],312:[function(require,module,exports){ +},{"../internals/array-for-each":198,"../internals/create-non-enumerable-property":221,"../internals/dom-iterables":232,"../internals/dom-token-list-prototype":233,"../internals/global":261}],444:[function(require,module,exports){ var global = require('../internals/global'); -var fails = require('../internals/fails'); -var bind = require('../internals/function-bind-context'); -var html = require('../internals/html'); -var createElement = require('../internals/document-create-element'); -var IS_IOS = require('../internals/engine-is-ios'); -var IS_NODE = require('../internals/engine-is-node'); +var DOMIterables = require('../internals/dom-iterables'); +var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); +var ArrayIteratorMethods = require('../modules/es.array.iterator'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); -var location = global.location; -var set = global.setImmediate; -var clear = global.clearImmediate; -var process = global.process; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; +var ITERATOR = wellKnownSymbol('iterator'); +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var ArrayValues = ArrayIteratorMethods.values; -var run = function (id) { - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); +var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) try { + createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + if (!CollectionPrototype[TO_STRING_TAG]) { + createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); + } + if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { + createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); + } catch (error) { + CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; + } + } } }; -var runner = function (id) { - return function () { - run(id); - }; -}; +for (var COLLECTION_NAME in DOMIterables) { + handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); +} -var listener = function (event) { - run(event.data); -}; +handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); -var post = function (id) { - // old engines have not location.origin - global.postMessage(id + '', location.protocol + '//' + location.host); -}; +},{"../internals/create-non-enumerable-property":221,"../internals/dom-iterables":232,"../internals/dom-token-list-prototype":233,"../internals/global":261,"../internals/well-known-symbol":371,"../modules/es.array.iterator":380}],445:[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. -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!set || !clear) { - set = 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 - (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); - }; - defer(counter); - return counter; - }; - clear = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (IS_NODE) { - defer = function (id) { - process.nextTick(runner(id)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(runner(id)); - }; - // Browsers with MessageChannel, includes WebWorkers - // except iOS - https://github.com/zloirock/core-js/issues/624 - } else if (MessageChannel && !IS_IOS) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = bind(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 && - location && location.protocol !== 'file:' && - !fails(post) - ) { - defer = post; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in createElement('script')) { - defer = function (id) { - html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(runner(id), 0); - }; +// 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; -module.exports = { - set: set, - clear: clear -}; +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; -},{"../internals/document-create-element":235,"../internals/engine-is-ios":237,"../internals/engine-is-node":238,"../internals/fails":243,"../internals/function-bind-context":245,"../internals/global":248,"../internals/html":252}],313:[function(require,module,exports){ -var toInteger = require('../internals/to-integer'); +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; -var max = Math.max; -var min = Math.min; +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; -// Helper for a popular repeating case of the spec: -// Let integer be ? ToInteger(index). -// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). -module.exports = function (index, length) { - var integer = toInteger(index); - return integer < 0 ? max(integer + length, 0) : min(integer, length); -}; +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; -},{"../internals/to-integer":316}],314:[function(require,module,exports){ -var toInteger = require('../internals/to-integer'); -var toLength = require('../internals/to-length'); +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; -// `ToIndex` abstract operation -// https://tc39.github.io/ecma262/#sec-toindex -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length or index'); - return length; -}; +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; -},{"../internals/to-integer":316,"../internals/to-length":317}],315:[function(require,module,exports){ -// toObject with fallback for non-array-like ES3 strings -var IndexedObject = require('../internals/indexed-object'); -var requireObjectCoercible = require('../internals/require-object-coercible'); +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; -module.exports = function (it) { - return IndexedObject(requireObjectCoercible(it)); -}; +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; -},{"../internals/indexed-object":255,"../internals/require-object-coercible":300}],316:[function(require,module,exports){ -var ceil = Math.ceil; -var floor = Math.floor; +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; -// `ToInteger` abstract operation -// https://tc39.github.io/ecma262/#sec-tointeger -module.exports = function (argument) { - return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); -}; +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; -},{}],317:[function(require,module,exports){ -var toInteger = require('../internals/to-integer'); +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; -var min = Math.min; +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; -// `ToLength` abstract operation -// https://tc39.github.io/ecma262/#sec-tolength -module.exports = function (argument) { - return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 -}; +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; -},{"../internals/to-integer":316}],318:[function(require,module,exports){ -var requireObjectCoercible = require('../internals/require-object-coercible'); - -// `ToObject` abstract operation -// https://tc39.github.io/ecma262/#sec-toobject -module.exports = function (argument) { - return Object(requireObjectCoercible(argument)); -}; - -},{"../internals/require-object-coercible":300}],319:[function(require,module,exports){ -var toPositiveInteger = require('../internals/to-positive-integer'); - -module.exports = function (it, BYTES) { - var offset = toPositiveInteger(it); - if (offset % BYTES) throw RangeError('Wrong offset'); - return offset; -}; - -},{"../internals/to-positive-integer":320}],320:[function(require,module,exports){ -var toInteger = require('../internals/to-integer'); - -module.exports = function (it) { - var result = toInteger(it); - if (result < 0) throw RangeError("The argument can't be less than 0"); - return result; -}; - -},{"../internals/to-integer":316}],321:[function(require,module,exports){ -var isObject = require('../internals/is-object'); - -// `ToPrimitive` abstract operation -// https://tc39.github.io/ecma262/#sec-toprimitive -// 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 (input, PREFERRED_STRING) { - if (!isObject(input)) return input; - var fn, val; - if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; - if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; - if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; - throw TypeError("Can't convert object to primitive value"); -}; - -},{"../internals/is-object":262}],322:[function(require,module,exports){ -var wellKnownSymbol = require('../internals/well-known-symbol'); - -var TO_STRING_TAG = wellKnownSymbol('toStringTag'); -var test = {}; - -test[TO_STRING_TAG] = 'z'; - -module.exports = String(test) === '[object z]'; - -},{"../internals/well-known-symbol":329}],323:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var global = require('../internals/global'); -var DESCRIPTORS = require('../internals/descriptors'); -var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers'); -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var ArrayBufferModule = require('../internals/array-buffer'); -var anInstance = require('../internals/an-instance'); -var createPropertyDescriptor = require('../internals/create-property-descriptor'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var toLength = require('../internals/to-length'); -var toIndex = require('../internals/to-index'); -var toOffset = require('../internals/to-offset'); -var toPrimitive = require('../internals/to-primitive'); -var has = require('../internals/has'); -var classof = require('../internals/classof'); -var isObject = require('../internals/is-object'); -var create = require('../internals/object-create'); -var setPrototypeOf = require('../internals/object-set-prototype-of'); -var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; -var typedArrayFrom = require('../internals/typed-array-from'); -var forEach = require('../internals/array-iteration').forEach; -var setSpecies = require('../internals/set-species'); -var definePropertyModule = require('../internals/object-define-property'); -var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); -var InternalStateModule = require('../internals/internal-state'); -var inheritIfRequired = require('../internals/inherit-if-required'); - -var getInternalState = InternalStateModule.get; -var setInternalState = InternalStateModule.set; -var nativeDefineProperty = definePropertyModule.f; -var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; -var round = Math.round; -var RangeError = global.RangeError; -var ArrayBuffer = ArrayBufferModule.ArrayBuffer; -var DataView = ArrayBufferModule.DataView; -var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; -var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; -var TypedArray = ArrayBufferViewCore.TypedArray; -var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; -var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; -var isTypedArray = ArrayBufferViewCore.isTypedArray; -var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; -var WRONG_LENGTH = 'Wrong length'; - -var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C))(length); - while (length > index) result[index] = list[index++]; - return result; -}; - -var addGetter = function (it, key) { - nativeDefineProperty(it, key, { get: function () { - return getInternalState(this)[key]; - } }); -}; - -var isArrayBuffer = function (it) { - var klass; - return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; -}; - -var isTypedArrayIndex = function (target, key) { - return isTypedArray(target) - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); -}; - -var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { - return isTypedArrayIndex(target, key = toPrimitive(key, true)) - ? createPropertyDescriptor(2, target[key]) - : nativeGetOwnPropertyDescriptor(target, key); -}; - -var wrappedDefineProperty = function defineProperty(target, key, descriptor) { - if (isTypedArrayIndex(target, key = toPrimitive(key, true)) - && isObject(descriptor) - && has(descriptor, 'value') - && !has(descriptor, 'get') - && !has(descriptor, 'set') - // TODO: add validation descriptor w/o calling accessors - && !descriptor.configurable - && (!has(descriptor, 'writable') || descriptor.writable) - && (!has(descriptor, 'enumerable') || descriptor.enumerable) - ) { - target[key] = descriptor.value; - return target; - } return nativeDefineProperty(target, key, descriptor); -}; - -if (DESCRIPTORS) { - if (!NATIVE_ARRAY_BUFFER_VIEWS) { - getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; - definePropertyModule.f = wrappedDefineProperty; - addGetter(TypedArrayPrototype, 'buffer'); - addGetter(TypedArrayPrototype, 'byteOffset'); - addGetter(TypedArrayPrototype, 'byteLength'); - addGetter(TypedArrayPrototype, 'length'); - } - - $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { - getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, - defineProperty: wrappedDefineProperty - }); - - module.exports = function (TYPE, wrapper, CLAMPED) { - var BYTES = TYPE.match(/\d+$/)[0] / 8; - var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + TYPE; - var SETTER = 'set' + TYPE; - var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; - var TypedArrayConstructor = NativeTypedArrayConstructor; - var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; - var exported = {}; - - var getter = function (that, index) { - var data = getInternalState(that); - return data.view[GETTER](index * BYTES + data.byteOffset, true); - }; - - var setter = function (that, index, value) { - var data = getInternalState(that); - if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; - data.view[SETTER](index * BYTES + data.byteOffset, value, true); - }; - - var addElement = function (that, index) { - nativeDefineProperty(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - - if (!NATIVE_ARRAY_BUFFER_VIEWS) { - TypedArrayConstructor = wrapper(function (that, data, offset, $length) { - anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); - var index = 0; - var byteOffset = 0; - var buffer, byteLength, length; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new ArrayBuffer(byteLength); - } else if (isArrayBuffer(data)) { - buffer = data; - byteOffset = toOffset(offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - byteOffset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (isTypedArray(data)) { - return fromList(TypedArrayConstructor, data); - } else { - return typedArrayFrom.call(TypedArrayConstructor, data); - } - setInternalState(that, { - buffer: buffer, - byteOffset: byteOffset, - byteLength: byteLength, - length: length, - view: new DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - - if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); - TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); - } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { - TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { - anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); - return inheritIfRequired(function () { - if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); - if (isArrayBuffer(data)) return $length !== undefined - ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) - : typedArrayOffset !== undefined - ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) - : new NativeTypedArrayConstructor(data); - if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); - return typedArrayFrom.call(TypedArrayConstructor, data); - }(), dummy, TypedArrayConstructor); - }); - - if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); - forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { - if (!(key in TypedArrayConstructor)) { - createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); - } - }); - TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; - } - - if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { - createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); - } - - if (TYPED_ARRAY_TAG) { - createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); - } - - exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; - - $({ - global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS - }, exported); - - if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { - createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); - } - - if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { - createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); - } - - setSpecies(CONSTRUCTOR_NAME); - }; -} else module.exports = function () { /* empty */ }; - -},{"../internals/an-instance":204,"../internals/array-buffer":208,"../internals/array-buffer-view-core":207,"../internals/array-iteration":214,"../internals/classof":224,"../internals/create-non-enumerable-property":229,"../internals/create-property-descriptor":230,"../internals/descriptors":234,"../internals/export":242,"../internals/global":248,"../internals/has":249,"../internals/inherit-if-required":256,"../internals/internal-state":258,"../internals/is-object":262,"../internals/object-create":276,"../internals/object-define-property":278,"../internals/object-get-own-property-descriptor":279,"../internals/object-get-own-property-names":281,"../internals/object-set-prototype-of":287,"../internals/set-species":303,"../internals/to-index":314,"../internals/to-length":317,"../internals/to-offset":319,"../internals/to-primitive":321,"../internals/typed-array-constructors-require-wrappers":324,"../internals/typed-array-from":325}],324:[function(require,module,exports){ -/* eslint-disable no-new */ -var global = require('../internals/global'); -var fails = require('../internals/fails'); -var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); -var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS; - -var ArrayBuffer = global.ArrayBuffer; -var Int8Array = global.Int8Array; - -module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { - Int8Array(1); -}) || !fails(function () { - new Int8Array(-1); -}) || !checkCorrectnessOfIteration(function (iterable) { - new Int8Array(); - new Int8Array(null); - new Int8Array(1.5); - new Int8Array(iterable); -}, true) || fails(function () { - // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill - return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; -}); - -},{"../internals/array-buffer-view-core":207,"../internals/check-correctness-of-iteration":222,"../internals/fails":243,"../internals/global":248}],325:[function(require,module,exports){ -var toObject = require('../internals/to-object'); -var toLength = require('../internals/to-length'); -var getIteratorMethod = require('../internals/get-iterator-method'); -var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); -var bind = require('../internals/function-bind-context'); -var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor; - -module.exports = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var i, length, result, step, iterator, next; - if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) { - iterator = iteratorMethod.call(O); - next = iterator.next; - O = []; - while (!(step = next.call(iterator)).done) { - O.push(step.value); - } - } - if (mapping && argumentsLength > 2) { - mapfn = bind(mapfn, arguments[2], 2); - } - length = toLength(O.length); - result = new (aTypedArrayConstructor(this))(length); - for (i = 0; length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; -}; - -},{"../internals/array-buffer-view-core":207,"../internals/function-bind-context":245,"../internals/get-iterator-method":247,"../internals/is-array-iterator-method":259,"../internals/to-length":317,"../internals/to-object":318}],326:[function(require,module,exports){ -var id = 0; -var postfix = Math.random(); - -module.exports = function (key) { - return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); -}; - -},{}],327:[function(require,module,exports){ -var NATIVE_SYMBOL = require('../internals/native-symbol'); - -module.exports = NATIVE_SYMBOL - // eslint-disable-next-line no-undef - && !Symbol.sham - // eslint-disable-next-line no-undef - && typeof Symbol.iterator == 'symbol'; - -},{"../internals/native-symbol":271}],328:[function(require,module,exports){ -var wellKnownSymbol = require('../internals/well-known-symbol'); - -exports.f = wellKnownSymbol; - -},{"../internals/well-known-symbol":329}],329:[function(require,module,exports){ -var global = require('../internals/global'); -var shared = require('../internals/shared'); -var has = require('../internals/has'); -var uid = require('../internals/uid'); -var NATIVE_SYMBOL = require('../internals/native-symbol'); -var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); - -var WellKnownSymbolsStore = shared('wks'); -var Symbol = global.Symbol; -var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; - -module.exports = function (name) { - if (!has(WellKnownSymbolsStore, name)) { - if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; - else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); - } return WellKnownSymbolsStore[name]; -}; - -},{"../internals/global":248,"../internals/has":249,"../internals/native-symbol":271,"../internals/shared":307,"../internals/uid":326,"../internals/use-symbol-as-uid":327}],330:[function(require,module,exports){ -// a string of all valid unicode whitespaces -// eslint-disable-next-line max-len -module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - -},{}],331:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var fails = require('../internals/fails'); -var ArrayBufferModule = require('../internals/array-buffer'); -var anObject = require('../internals/an-object'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var toLength = require('../internals/to-length'); -var speciesConstructor = require('../internals/species-constructor'); - -var ArrayBuffer = ArrayBufferModule.ArrayBuffer; -var DataView = ArrayBufferModule.DataView; -var nativeArrayBufferSlice = ArrayBuffer.prototype.slice; - -var INCORRECT_SLICE = fails(function () { - return !new ArrayBuffer(2).slice(1, undefined).byteLength; -}); - -// `ArrayBuffer.prototype.slice` method -// https://tc39.github.io/ecma262/#sec-arraybuffer.prototype.slice -$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { - slice: function slice(start, end) { - if (nativeArrayBufferSlice !== undefined && end === undefined) { - return nativeArrayBufferSlice.call(anObject(this), start); // FF fix - } - var length = anObject(this).byteLength; - var first = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex(end === undefined ? length : end, length); - var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first)); - var viewSource = new DataView(this); - var viewTarget = new DataView(result); - var index = 0; - while (first < fin) { - viewTarget.setUint8(index++, viewSource.getUint8(first++)); - } return result; - } -}); - -},{"../internals/an-object":205,"../internals/array-buffer":208,"../internals/export":242,"../internals/fails":243,"../internals/species-constructor":308,"../internals/to-absolute-index":313,"../internals/to-length":317}],332:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var fails = require('../internals/fails'); -var isArray = require('../internals/is-array'); -var isObject = require('../internals/is-object'); -var toObject = require('../internals/to-object'); -var toLength = require('../internals/to-length'); -var createProperty = require('../internals/create-property'); -var arraySpeciesCreate = require('../internals/array-species-create'); -var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var V8_VERSION = require('../internals/engine-v8-version'); - -var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); -var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; -var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; - -// We can't use this feature detection in V8 since it causes -// deoptimization and serious performance degradation -// https://github.com/zloirock/core-js/issues/679 -var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { - var array = []; - array[IS_CONCAT_SPREADABLE] = false; - return array.concat()[0] !== array; -}); - -var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); - -var isConcatSpreadable = function (O) { - if (!isObject(O)) return false; - var spreadable = O[IS_CONCAT_SPREADABLE]; - return spreadable !== undefined ? !!spreadable : isArray(O); -}; - -var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; - -// `Array.prototype.concat` method -// https://tc39.github.io/ecma262/#sec-array.prototype.concat -// with adding support of @@isConcatSpreadable and @@species -$({ target: 'Array', proto: true, forced: FORCED }, { - concat: function concat(arg) { // eslint-disable-line no-unused-vars - var O = toObject(this); - var A = arraySpeciesCreate(O, 0); - var n = 0; - var i, k, length, len, E; - for (i = -1, length = arguments.length; i < length; i++) { - E = i === -1 ? O : arguments[i]; - if (isConcatSpreadable(E)) { - len = toLength(E.length); - if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); - for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); - } else { - if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); - createProperty(A, n++, E); - } - } - A.length = n; - return A; - } -}); - -},{"../internals/array-method-has-species-support":216,"../internals/array-species-create":220,"../internals/create-property":231,"../internals/engine-v8-version":240,"../internals/export":242,"../internals/fails":243,"../internals/is-array":260,"../internals/is-object":262,"../internals/to-length":317,"../internals/to-object":318,"../internals/well-known-symbol":329}],333:[function(require,module,exports){ -var $ = require('../internals/export'); -var fill = require('../internals/array-fill'); -var addToUnscopables = require('../internals/add-to-unscopables'); - -// `Array.prototype.fill` method -// https://tc39.github.io/ecma262/#sec-array.prototype.fill -$({ target: 'Array', proto: true }, { - fill: fill -}); - -// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables -addToUnscopables('fill'); - -},{"../internals/add-to-unscopables":202,"../internals/array-fill":210,"../internals/export":242}],334:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var $filter = require('../internals/array-iteration').filter; -var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); -// Edge 14- issue -var USES_TO_LENGTH = arrayMethodUsesToLength('filter'); - -// `Array.prototype.filter` method -// https://tc39.github.io/ecma262/#sec-array.prototype.filter -// with adding support of @@species -$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -},{"../internals/array-iteration":214,"../internals/array-method-has-species-support":216,"../internals/array-method-uses-to-length":218,"../internals/export":242}],335:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var $find = require('../internals/array-iteration').find; -var addToUnscopables = require('../internals/add-to-unscopables'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var FIND = 'find'; -var SKIPS_HOLES = true; - -var USES_TO_LENGTH = arrayMethodUsesToLength(FIND); - -// Shouldn't skip holes -if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); - -// `Array.prototype.find` method -// https://tc39.github.io/ecma262/#sec-array.prototype.find -$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables -addToUnscopables(FIND); - -},{"../internals/add-to-unscopables":202,"../internals/array-iteration":214,"../internals/array-method-uses-to-length":218,"../internals/export":242}],336:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var forEach = require('../internals/array-for-each'); - -// `Array.prototype.forEach` method -// https://tc39.github.io/ecma262/#sec-array.prototype.foreach -$({ target: 'Array', proto: true, forced: [].forEach != forEach }, { - forEach: forEach -}); - -},{"../internals/array-for-each":211,"../internals/export":242}],337:[function(require,module,exports){ -var $ = require('../internals/export'); -var from = require('../internals/array-from'); -var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); - -var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { - Array.from(iterable); -}); - -// `Array.from` method -// https://tc39.github.io/ecma262/#sec-array.from -$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { - from: from -}); - -},{"../internals/array-from":212,"../internals/check-correctness-of-iteration":222,"../internals/export":242}],338:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var $includes = require('../internals/array-includes').includes; -var addToUnscopables = require('../internals/add-to-unscopables'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); - -// `Array.prototype.includes` method -// https://tc39.github.io/ecma262/#sec-array.prototype.includes -$({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables -addToUnscopables('includes'); - -},{"../internals/add-to-unscopables":202,"../internals/array-includes":213,"../internals/array-method-uses-to-length":218,"../internals/export":242}],339:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var $indexOf = require('../internals/array-includes').indexOf; -var arrayMethodIsStrict = require('../internals/array-method-is-strict'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var nativeIndexOf = [].indexOf; - -var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; -var STRICT_METHOD = arrayMethodIsStrict('indexOf'); -var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); - -// `Array.prototype.indexOf` method -// https://tc39.github.io/ecma262/#sec-array.prototype.indexof -$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, { - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? nativeIndexOf.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -},{"../internals/array-includes":213,"../internals/array-method-is-strict":217,"../internals/array-method-uses-to-length":218,"../internals/export":242}],340:[function(require,module,exports){ -'use strict'; -var toIndexedObject = require('../internals/to-indexed-object'); -var addToUnscopables = require('../internals/add-to-unscopables'); -var Iterators = require('../internals/iterators'); -var InternalStateModule = require('../internals/internal-state'); -var defineIterator = require('../internals/define-iterator'); - -var ARRAY_ITERATOR = 'Array Iterator'; -var setInternalState = InternalStateModule.set; -var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); - -// `Array.prototype.entries` method -// https://tc39.github.io/ecma262/#sec-array.prototype.entries -// `Array.prototype.keys` method -// https://tc39.github.io/ecma262/#sec-array.prototype.keys -// `Array.prototype.values` method -// https://tc39.github.io/ecma262/#sec-array.prototype.values -// `Array.prototype[@@iterator]` method -// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator -// `CreateArrayIterator` internal method -// https://tc39.github.io/ecma262/#sec-createarrayiterator -module.exports = defineIterator(Array, 'Array', function (iterated, kind) { - setInternalState(this, { - type: ARRAY_ITERATOR, - target: toIndexedObject(iterated), // target - index: 0, // next index - kind: kind // kind - }); -// `%ArrayIteratorPrototype%.next` method -// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next -}, function () { - var state = getInternalState(this); - var target = state.target; - var kind = state.kind; - var index = state.index++; - if (!target || index >= target.length) { - state.target = undefined; - return { value: undefined, done: true }; - } - if (kind == 'keys') return { value: index, done: false }; - if (kind == 'values') return { value: target[index], done: false }; - return { value: [index, target[index]], done: false }; -}, 'values'); - -// argumentsList[@@iterator] is %ArrayProto_values% -// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject -// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject -Iterators.Arguments = Iterators.Array; - -// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables -addToUnscopables('keys'); -addToUnscopables('values'); -addToUnscopables('entries'); - -},{"../internals/add-to-unscopables":202,"../internals/define-iterator":232,"../internals/internal-state":258,"../internals/iterators":268,"../internals/to-indexed-object":315}],341:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var IndexedObject = require('../internals/indexed-object'); -var toIndexedObject = require('../internals/to-indexed-object'); -var arrayMethodIsStrict = require('../internals/array-method-is-strict'); - -var nativeJoin = [].join; - -var ES3_STRINGS = IndexedObject != Object; -var STRICT_METHOD = arrayMethodIsStrict('join', ','); - -// `Array.prototype.join` method -// https://tc39.github.io/ecma262/#sec-array.prototype.join -$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, { - join: function join(separator) { - return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); - } -}); - -},{"../internals/array-method-is-strict":217,"../internals/export":242,"../internals/indexed-object":255,"../internals/to-indexed-object":315}],342:[function(require,module,exports){ -var $ = require('../internals/export'); -var lastIndexOf = require('../internals/array-last-index-of'); - -// `Array.prototype.lastIndexOf` method -// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof -$({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { - lastIndexOf: lastIndexOf -}); - -},{"../internals/array-last-index-of":215,"../internals/export":242}],343:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var $map = require('../internals/array-iteration').map; -var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); -// FF49- issue -var USES_TO_LENGTH = arrayMethodUsesToLength('map'); - -// `Array.prototype.map` method -// https://tc39.github.io/ecma262/#sec-array.prototype.map -// with adding support of @@species -$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -},{"../internals/array-iteration":214,"../internals/array-method-has-species-support":216,"../internals/array-method-uses-to-length":218,"../internals/export":242}],344:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var isObject = require('../internals/is-object'); -var isArray = require('../internals/is-array'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var toLength = require('../internals/to-length'); -var toIndexedObject = require('../internals/to-indexed-object'); -var createProperty = require('../internals/create-property'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); -var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 }); - -var SPECIES = wellKnownSymbol('species'); -var nativeSlice = [].slice; -var max = Math.max; - -// `Array.prototype.slice` method -// https://tc39.github.io/ecma262/#sec-array.prototype.slice -// fallback for not array-like ES3 strings and DOM objects -$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { - slice: function slice(start, end) { - var O = toIndexedObject(this); - var length = toLength(O.length); - var k = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex(end === undefined ? length : end, length); - // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible - var Constructor, result, n; - if (isArray(O)) { - Constructor = O.constructor; - // cross-realm fallback - if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { - Constructor = undefined; - } else if (isObject(Constructor)) { - Constructor = Constructor[SPECIES]; - if (Constructor === null) Constructor = undefined; - } - if (Constructor === Array || Constructor === undefined) { - return nativeSlice.call(O, k, fin); - } - } - result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)); - for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); - result.length = n; - return result; - } -}); - -},{"../internals/array-method-has-species-support":216,"../internals/array-method-uses-to-length":218,"../internals/create-property":231,"../internals/export":242,"../internals/is-array":260,"../internals/is-object":262,"../internals/to-absolute-index":313,"../internals/to-indexed-object":315,"../internals/to-length":317,"../internals/well-known-symbol":329}],345:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var aFunction = require('../internals/a-function'); -var toObject = require('../internals/to-object'); -var fails = require('../internals/fails'); -var arrayMethodIsStrict = require('../internals/array-method-is-strict'); - -var test = []; -var nativeSort = test.sort; - -// IE8- -var FAILS_ON_UNDEFINED = fails(function () { - test.sort(undefined); -}); -// V8 bug -var FAILS_ON_NULL = fails(function () { - test.sort(null); -}); -// Old WebKit -var STRICT_METHOD = arrayMethodIsStrict('sort'); - -var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD; - -// `Array.prototype.sort` method -// https://tc39.github.io/ecma262/#sec-array.prototype.sort -$({ target: 'Array', proto: true, forced: FORCED }, { - sort: function sort(comparefn) { - return comparefn === undefined - ? nativeSort.call(toObject(this)) - : nativeSort.call(toObject(this), aFunction(comparefn)); - } -}); - -},{"../internals/a-function":200,"../internals/array-method-is-strict":217,"../internals/export":242,"../internals/fails":243,"../internals/to-object":318}],346:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var toInteger = require('../internals/to-integer'); -var toLength = require('../internals/to-length'); -var toObject = require('../internals/to-object'); -var arraySpeciesCreate = require('../internals/array-species-create'); -var createProperty = require('../internals/create-property'); -var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); -var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length'); - -var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); -var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 }); - -var max = Math.max; -var min = Math.min; -var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; -var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; - -// `Array.prototype.splice` method -// https://tc39.github.io/ecma262/#sec-array.prototype.splice -// with adding support of @@species -$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { - splice: function splice(start, deleteCount /* , ...items */) { - var O = toObject(this); - var len = toLength(O.length); - var actualStart = toAbsoluteIndex(start, len); - var argumentsLength = arguments.length; - var insertCount, actualDeleteCount, A, k, from, to; - if (argumentsLength === 0) { - insertCount = actualDeleteCount = 0; - } else if (argumentsLength === 1) { - insertCount = 0; - actualDeleteCount = len - actualStart; - } else { - insertCount = argumentsLength - 2; - actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); - } - if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { - throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); - } - A = arraySpeciesCreate(O, actualDeleteCount); - for (k = 0; k < actualDeleteCount; k++) { - from = actualStart + k; - if (from in O) createProperty(A, k, O[from]); - } - A.length = actualDeleteCount; - if (insertCount < actualDeleteCount) { - for (k = actualStart; k < len - actualDeleteCount; k++) { - from = k + actualDeleteCount; - to = k + insertCount; - if (from in O) O[to] = O[from]; - else delete O[to]; - } - for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; - } else if (insertCount > actualDeleteCount) { - for (k = len - actualDeleteCount; k > actualStart; k--) { - from = k + actualDeleteCount - 1; - to = k + insertCount - 1; - if (from in O) O[to] = O[from]; - else delete O[to]; - } - } - for (k = 0; k < insertCount; k++) { - O[k + actualStart] = arguments[k + 2]; - } - O.length = len - actualDeleteCount + insertCount; - return A; - } -}); - -},{"../internals/array-method-has-species-support":216,"../internals/array-method-uses-to-length":218,"../internals/array-species-create":220,"../internals/create-property":231,"../internals/export":242,"../internals/to-absolute-index":313,"../internals/to-integer":316,"../internals/to-length":317,"../internals/to-object":318}],347:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var defineProperty = require('../internals/object-define-property').f; - -var FunctionPrototype = Function.prototype; -var FunctionPrototypeToString = FunctionPrototype.toString; -var nameRE = /^\s*function ([^ (]*)/; -var NAME = 'name'; - -// Function instances `.name` property -// https://tc39.github.io/ecma262/#sec-function-instances-name -if (DESCRIPTORS && !(NAME in FunctionPrototype)) { - defineProperty(FunctionPrototype, NAME, { - configurable: true, - get: function () { - try { - return FunctionPrototypeToString.call(this).match(nameRE)[1]; - } catch (error) { - return ''; - } - } - }); -} - -},{"../internals/descriptors":234,"../internals/object-define-property":278}],348:[function(require,module,exports){ -'use strict'; -var DESCRIPTORS = require('../internals/descriptors'); -var global = require('../internals/global'); -var isForced = require('../internals/is-forced'); -var redefine = require('../internals/redefine'); -var has = require('../internals/has'); -var classof = require('../internals/classof-raw'); -var inheritIfRequired = require('../internals/inherit-if-required'); -var toPrimitive = require('../internals/to-primitive'); -var fails = require('../internals/fails'); -var create = require('../internals/object-create'); -var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; -var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; -var defineProperty = require('../internals/object-define-property').f; -var trim = require('../internals/string-trim').trim; - -var NUMBER = 'Number'; -var NativeNumber = global[NUMBER]; -var NumberPrototype = NativeNumber.prototype; - -// Opera ~12 has broken Object#toString -var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; - -// `ToNumber` abstract operation -// https://tc39.github.io/ecma262/#sec-tonumber -var toNumber = function (argument) { - var it = toPrimitive(argument, false); - var first, third, radix, maxCode, digits, length, index, code; - if (typeof it == 'string' && it.length > 2) { - it = trim(it); - first = it.charCodeAt(0); - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i - default: return +it; - } - digits = it.slice(2); - length = digits.length; - for (index = 0; index < length; index++) { - code = digits.charCodeAt(index); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } return parseInt(digits, radix); - } - } return +it; -}; - -// `Number` constructor -// https://tc39.github.io/ecma262/#sec-number-constructor -if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { - var NumberWrapper = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var dummy = this; - return dummy instanceof NumberWrapper - // check on 1..constructor(foo) case - && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER) - ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it); - }; - for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( - // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + - // ES2015 (in case, if modules with ES2015 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' - ).split(','), j = 0, key; keys.length > j; j++) { - if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) { - defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); - } - } - NumberWrapper.prototype = NumberPrototype; - NumberPrototype.constructor = NumberWrapper; - redefine(global, NUMBER, NumberWrapper); -} - -},{"../internals/classof-raw":223,"../internals/descriptors":234,"../internals/fails":243,"../internals/global":248,"../internals/has":249,"../internals/inherit-if-required":256,"../internals/is-forced":261,"../internals/object-create":276,"../internals/object-define-property":278,"../internals/object-get-own-property-descriptor":279,"../internals/object-get-own-property-names":281,"../internals/redefine":295,"../internals/string-trim":311,"../internals/to-primitive":321}],349:[function(require,module,exports){ -var $ = require('../internals/export'); -var assign = require('../internals/object-assign'); - -// `Object.assign` method -// https://tc39.github.io/ecma262/#sec-object.assign -$({ target: 'Object', stat: true, forced: Object.assign !== assign }, { - assign: assign -}); - -},{"../internals/export":242,"../internals/object-assign":275}],350:[function(require,module,exports){ -var $ = require('../internals/export'); -var $entries = require('../internals/object-to-array').entries; - -// `Object.entries` method -// https://tc39.github.io/ecma262/#sec-object.entries -$({ target: 'Object', stat: true }, { - entries: function entries(O) { - return $entries(O); - } -}); - -},{"../internals/export":242,"../internals/object-to-array":288}],351:[function(require,module,exports){ -var $ = require('../internals/export'); -var toObject = require('../internals/to-object'); -var nativeKeys = require('../internals/object-keys'); -var fails = require('../internals/fails'); - -var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); - -// `Object.keys` method -// https://tc39.github.io/ecma262/#sec-object.keys -$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { - keys: function keys(it) { - return nativeKeys(toObject(it)); - } -}); - -},{"../internals/export":242,"../internals/fails":243,"../internals/object-keys":285,"../internals/to-object":318}],352:[function(require,module,exports){ -var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); -var redefine = require('../internals/redefine'); -var toString = require('../internals/object-to-string'); - -// `Object.prototype.toString` method -// https://tc39.github.io/ecma262/#sec-object.prototype.tostring -if (!TO_STRING_TAG_SUPPORT) { - redefine(Object.prototype, 'toString', toString, { unsafe: true }); -} - -},{"../internals/object-to-string":289,"../internals/redefine":295,"../internals/to-string-tag-support":322}],353:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var IS_PURE = require('../internals/is-pure'); -var global = require('../internals/global'); -var getBuiltIn = require('../internals/get-built-in'); -var NativePromise = require('../internals/native-promise-constructor'); -var redefine = require('../internals/redefine'); -var redefineAll = require('../internals/redefine-all'); -var setToStringTag = require('../internals/set-to-string-tag'); -var setSpecies = require('../internals/set-species'); -var isObject = require('../internals/is-object'); -var aFunction = require('../internals/a-function'); -var anInstance = require('../internals/an-instance'); -var inspectSource = require('../internals/inspect-source'); -var iterate = require('../internals/iterate'); -var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); -var speciesConstructor = require('../internals/species-constructor'); -var task = require('../internals/task').set; -var microtask = require('../internals/microtask'); -var promiseResolve = require('../internals/promise-resolve'); -var hostReportErrors = require('../internals/host-report-errors'); -var newPromiseCapabilityModule = require('../internals/new-promise-capability'); -var perform = require('../internals/perform'); -var InternalStateModule = require('../internals/internal-state'); -var isForced = require('../internals/is-forced'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var IS_NODE = require('../internals/engine-is-node'); -var V8_VERSION = require('../internals/engine-v8-version'); - -var SPECIES = wellKnownSymbol('species'); -var PROMISE = 'Promise'; -var getInternalState = InternalStateModule.get; -var setInternalState = InternalStateModule.set; -var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); -var PromiseConstructor = NativePromise; -var TypeError = global.TypeError; -var document = global.document; -var process = global.process; -var $fetch = getBuiltIn('fetch'); -var newPromiseCapability = newPromiseCapabilityModule.f; -var newGenericPromiseCapability = newPromiseCapability; -var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); -var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function'; -var UNHANDLED_REJECTION = 'unhandledrejection'; -var REJECTION_HANDLED = 'rejectionhandled'; -var PENDING = 0; -var FULFILLED = 1; -var REJECTED = 2; -var HANDLED = 1; -var UNHANDLED = 2; -var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; - -var FORCED = isForced(PROMISE, function () { - var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor); - if (!GLOBAL_CORE_JS_PROMISE) { - // 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 - if (V8_VERSION === 66) return true; - // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test - if (!IS_NODE && !NATIVE_REJECTION_EVENT) return true; - } - // We need Promise#finally in the pure version for preventing prototype pollution - if (IS_PURE && !PromiseConstructor.prototype['finally']) return true; - // We can't use @@species feature detection in V8 since it causes - // deoptimization and performance degradation - // https://github.com/zloirock/core-js/issues/679 - if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false; - // Detect correctness of subclassing with @@species support - var promise = PromiseConstructor.resolve(1); - var FakePromise = function (exec) { - exec(function () { /* empty */ }, function () { /* empty */ }); - }; - var constructor = promise.constructor = {}; - constructor[SPECIES] = FakePromise; - return !(promise.then(function () { /* empty */ }) instanceof FakePromise); -}); - -var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { - PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); -}); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; - -var notify = function (state, isReject) { - if (state.notified) return; - state.notified = true; - var chain = state.reactions; - microtask(function () { - var value = state.value; - var ok = state.state == FULFILLED; - var index = 0; - // variable length - can't use forEach - while (chain.length > index) { - var reaction = chain[index++]; - 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 (state.rejection === UNHANDLED) onHandleUnhandled(state); - state.rejection = HANDLED; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // can 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 (error) { - if (domain && !exited) domain.exit(); - reject(error); - } - } - state.reactions = []; - state.notified = false; - if (isReject && !state.rejection) onUnhandled(state); - }); -}; - -var dispatchEvent = function (name, promise, reason) { - var event, handler; - if (DISPATCH_EVENT) { - event = document.createEvent('Event'); - event.promise = promise; - event.reason = reason; - event.initEvent(name, false, true); - global.dispatchEvent(event); - } else event = { promise: promise, reason: reason }; - if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event); - else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); -}; - -var onUnhandled = function (state) { - task.call(global, function () { - var promise = state.facade; - var value = state.value; - var IS_UNHANDLED = isUnhandled(state); - var result; - if (IS_UNHANDLED) { - result = perform(function () { - if (IS_NODE) { - process.emit('unhandledRejection', value, promise); - } else dispatchEvent(UNHANDLED_REJECTION, promise, value); - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; - if (result.error) throw result.value; - } - }); -}; - -var isUnhandled = function (state) { - return state.rejection !== HANDLED && !state.parent; -}; - -var onHandleUnhandled = function (state) { - task.call(global, function () { - var promise = state.facade; - if (IS_NODE) { - process.emit('rejectionHandled', promise); - } else dispatchEvent(REJECTION_HANDLED, promise, state.value); - }); -}; - -var bind = function (fn, state, unwrap) { - return function (value) { - fn(state, value, unwrap); - }; -}; - -var internalReject = function (state, value, unwrap) { - if (state.done) return; - state.done = true; - if (unwrap) state = unwrap; - state.value = value; - state.state = REJECTED; - notify(state, true); -}; - -var internalResolve = function (state, value, unwrap) { - if (state.done) return; - state.done = true; - if (unwrap) state = unwrap; - try { - if (state.facade === value) throw TypeError("Promise can't be resolved itself"); - var then = isThenable(value); - if (then) { - microtask(function () { - var wrapper = { done: false }; - try { - then.call(value, - bind(internalResolve, wrapper, state), - bind(internalReject, wrapper, state) - ); - } catch (error) { - internalReject(wrapper, error, state); - } - }); - } else { - state.value = value; - state.state = FULFILLED; - notify(state, false); - } - } catch (error) { - internalReject({ done: false }, error, state); - } -}; - -// constructor polyfill -if (FORCED) { - // 25.4.3.1 Promise(executor) - PromiseConstructor = function Promise(executor) { - anInstance(this, PromiseConstructor, PROMISE); - aFunction(executor); - Internal.call(this); - var state = getInternalState(this); - try { - executor(bind(internalResolve, state), bind(internalReject, state)); - } catch (error) { - internalReject(state, error); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - setInternalState(this, { - type: PROMISE, - done: false, - notified: false, - parent: false, - reactions: [], - rejection: false, - state: PENDING, - value: undefined - }); - }; - Internal.prototype = redefineAll(PromiseConstructor.prototype, { - // `Promise.prototype.then` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.then - then: function then(onFulfilled, onRejected) { - var state = getInternalPromiseState(this); - var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = IS_NODE ? process.domain : undefined; - state.parent = true; - state.reactions.push(reaction); - if (state.state != PENDING) notify(state, false); - return reaction.promise; - }, - // `Promise.prototype.catch` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.catch - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - var state = getInternalState(promise); - this.promise = promise; - this.resolve = bind(internalResolve, state); - this.reject = bind(internalReject, state); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === PromiseConstructor || C === PromiseWrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; - - if (!IS_PURE && typeof NativePromise == 'function') { - nativeThen = NativePromise.prototype.then; - - // wrap native Promise#then for native async functions - redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) { - var that = this; - return new PromiseConstructor(function (resolve, reject) { - nativeThen.call(that, resolve, reject); - }).then(onFulfilled, onRejected); - // https://github.com/zloirock/core-js/issues/640 - }, { unsafe: true }); - - // wrap fetch result - if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, { - // eslint-disable-next-line no-unused-vars - fetch: function fetch(input /* , init */) { - return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments)); - } - }); - } -} - -$({ global: true, wrap: true, forced: FORCED }, { - Promise: PromiseConstructor -}); - -setToStringTag(PromiseConstructor, PROMISE, false, true); -setSpecies(PROMISE); - -PromiseWrapper = getBuiltIn(PROMISE); - -// statics -$({ target: PROMISE, stat: true, forced: FORCED }, { - // `Promise.reject` method - // https://tc39.github.io/ecma262/#sec-promise.reject - reject: function reject(r) { - var capability = newPromiseCapability(this); - capability.reject.call(undefined, r); - return capability.promise; - } -}); - -$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, { - // `Promise.resolve` method - // https://tc39.github.io/ecma262/#sec-promise.resolve - resolve: function resolve(x) { - return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x); - } -}); - -$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, { - // `Promise.all` method - // https://tc39.github.io/ecma262/#sec-promise.all - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var $promiseResolve = aFunction(C.resolve); - var values = []; - var counter = 0; - var remaining = 1; - iterate(iterable, function (promise) { - var index = counter++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - $promiseResolve.call(C, promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.error) reject(result.value); - return capability.promise; - }, - // `Promise.race` method - // https://tc39.github.io/ecma262/#sec-promise.race - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - var $promiseResolve = aFunction(C.resolve); - iterate(iterable, function (promise) { - $promiseResolve.call(C, promise).then(capability.resolve, reject); - }); - }); - if (result.error) reject(result.value); - return capability.promise; - } -}); - -},{"../internals/a-function":200,"../internals/an-instance":204,"../internals/check-correctness-of-iteration":222,"../internals/engine-is-node":238,"../internals/engine-v8-version":240,"../internals/export":242,"../internals/get-built-in":246,"../internals/global":248,"../internals/host-report-errors":251,"../internals/inspect-source":257,"../internals/internal-state":258,"../internals/is-forced":261,"../internals/is-object":262,"../internals/is-pure":263,"../internals/iterate":265,"../internals/microtask":269,"../internals/native-promise-constructor":270,"../internals/new-promise-capability":273,"../internals/perform":292,"../internals/promise-resolve":293,"../internals/redefine":295,"../internals/redefine-all":294,"../internals/set-species":303,"../internals/set-to-string-tag":304,"../internals/species-constructor":308,"../internals/task":312,"../internals/well-known-symbol":329}],354:[function(require,module,exports){ -var DESCRIPTORS = require('../internals/descriptors'); -var global = require('../internals/global'); -var isForced = require('../internals/is-forced'); -var inheritIfRequired = require('../internals/inherit-if-required'); -var defineProperty = require('../internals/object-define-property').f; -var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; -var isRegExp = require('../internals/is-regexp'); -var getFlags = require('../internals/regexp-flags'); -var stickyHelpers = require('../internals/regexp-sticky-helpers'); -var redefine = require('../internals/redefine'); -var fails = require('../internals/fails'); -var setInternalState = require('../internals/internal-state').set; -var setSpecies = require('../internals/set-species'); -var wellKnownSymbol = require('../internals/well-known-symbol'); - -var MATCH = wellKnownSymbol('match'); -var NativeRegExp = global.RegExp; -var RegExpPrototype = NativeRegExp.prototype; -var re1 = /a/g; -var re2 = /a/g; - -// "new" should create a new object, old webkit bug -var CORRECT_NEW = new NativeRegExp(re1) !== re1; - -var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; - -var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () { - re2[MATCH] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; -}))); - -// `RegExp` constructor -// https://tc39.github.io/ecma262/#sec-regexp-constructor -if (FORCED) { - var RegExpWrapper = function RegExp(pattern, flags) { - var thisIsRegExp = this instanceof RegExpWrapper; - var patternIsRegExp = isRegExp(pattern); - var flagsAreUndefined = flags === undefined; - var sticky; - - if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) { - return pattern; - } - - if (CORRECT_NEW) { - if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source; - } else if (pattern instanceof RegExpWrapper) { - if (flagsAreUndefined) flags = getFlags.call(pattern); - pattern = pattern.source; - } - - if (UNSUPPORTED_Y) { - sticky = !!flags && flags.indexOf('y') > -1; - if (sticky) flags = flags.replace(/y/g, ''); - } - - var result = inheritIfRequired( - CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags), - thisIsRegExp ? this : RegExpPrototype, - RegExpWrapper - ); - - if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky }); - - return result; - }; - var proxy = function (key) { - key in RegExpWrapper || defineProperty(RegExpWrapper, key, { - configurable: true, - get: function () { return NativeRegExp[key]; }, - set: function (it) { NativeRegExp[key] = it; } - }); - }; - var keys = getOwnPropertyNames(NativeRegExp); - var index = 0; - while (keys.length > index) proxy(keys[index++]); - RegExpPrototype.constructor = RegExpWrapper; - RegExpWrapper.prototype = RegExpPrototype; - redefine(global, 'RegExp', RegExpWrapper); -} - -// https://tc39.github.io/ecma262/#sec-get-regexp-@@species -setSpecies('RegExp'); - -},{"../internals/descriptors":234,"../internals/fails":243,"../internals/global":248,"../internals/inherit-if-required":256,"../internals/internal-state":258,"../internals/is-forced":261,"../internals/is-regexp":264,"../internals/object-define-property":278,"../internals/object-get-own-property-names":281,"../internals/redefine":295,"../internals/regexp-flags":298,"../internals/regexp-sticky-helpers":299,"../internals/set-species":303,"../internals/well-known-symbol":329}],355:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var exec = require('../internals/regexp-exec'); - -$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { - exec: exec -}); - -},{"../internals/export":242,"../internals/regexp-exec":297}],356:[function(require,module,exports){ -'use strict'; -var redefine = require('../internals/redefine'); -var anObject = require('../internals/an-object'); -var fails = require('../internals/fails'); -var flags = require('../internals/regexp-flags'); - -var TO_STRING = 'toString'; -var RegExpPrototype = RegExp.prototype; -var nativeToString = RegExpPrototype[TO_STRING]; - -var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); -// FF44- RegExp#toString has a wrong name -var INCORRECT_NAME = nativeToString.name != TO_STRING; - -// `RegExp.prototype.toString` method -// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring -if (NOT_GENERIC || INCORRECT_NAME) { - redefine(RegExp.prototype, TO_STRING, function toString() { - var R = anObject(this); - var p = String(R.source); - var rf = R.flags; - var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); - return '/' + p + '/' + f; - }, { unsafe: true }); -} - -},{"../internals/an-object":205,"../internals/fails":243,"../internals/redefine":295,"../internals/regexp-flags":298}],357:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var notARegExp = require('../internals/not-a-regexp'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); - -// `String.prototype.includes` method -// https://tc39.github.io/ecma262/#sec-string.prototype.includes -$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { - includes: function includes(searchString /* , position = 0 */) { - return !!~String(requireObjectCoercible(this)) - .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined); - } -}); - -},{"../internals/correct-is-regexp-logic":226,"../internals/export":242,"../internals/not-a-regexp":274,"../internals/require-object-coercible":300}],358:[function(require,module,exports){ -'use strict'; -var charAt = require('../internals/string-multibyte').charAt; -var InternalStateModule = require('../internals/internal-state'); -var defineIterator = require('../internals/define-iterator'); - -var STRING_ITERATOR = 'String Iterator'; -var setInternalState = InternalStateModule.set; -var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - -// `String.prototype[@@iterator]` method -// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator -defineIterator(String, 'String', function (iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: String(iterated), - index: 0 - }); -// `%StringIteratorPrototype%.next` method -// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next -}, function next() { - var state = getInternalState(this); - var string = state.string; - var index = state.index; - var point; - if (index >= string.length) return { value: undefined, done: true }; - point = charAt(string, index); - state.index += point.length; - return { value: point, done: false }; -}); - -},{"../internals/define-iterator":232,"../internals/internal-state":258,"../internals/string-multibyte":309}],359:[function(require,module,exports){ -'use strict'; -var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); -var anObject = require('../internals/an-object'); -var toLength = require('../internals/to-length'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var advanceStringIndex = require('../internals/advance-string-index'); -var regExpExec = require('../internals/regexp-exec-abstract'); - -// @@match logic -fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { - return [ - // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match - function match(regexp) { - var O = requireObjectCoercible(this); - var matcher = regexp == undefined ? undefined : regexp[MATCH]; - return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, - // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match - function (regexp) { - var res = maybeCallNative(nativeMatch, regexp, this); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - - if (!rx.global) return regExpExec(rx, S); - - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - var A = []; - var n = 0; - var result; - while ((result = regExpExec(rx, S)) !== null) { - var matchStr = String(result[0]); - A[n] = matchStr; - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - n++; - } - return n === 0 ? null : A; - } - ]; -}); - -},{"../internals/advance-string-index":203,"../internals/an-object":205,"../internals/fix-regexp-well-known-symbol-logic":244,"../internals/regexp-exec-abstract":296,"../internals/require-object-coercible":300,"../internals/to-length":317}],360:[function(require,module,exports){ -'use strict'; -var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); -var anObject = require('../internals/an-object'); -var toObject = require('../internals/to-object'); -var toLength = require('../internals/to-length'); -var toInteger = require('../internals/to-integer'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var advanceStringIndex = require('../internals/advance-string-index'); -var regExpExec = require('../internals/regexp-exec-abstract'); - -var max = Math.max; -var min = Math.min; -var floor = Math.floor; -var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; -var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; - -var maybeToString = function (it) { - return it === undefined ? it : String(it); -}; - -// @@replace logic -fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) { - var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE; - var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0; - var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; - - return [ - // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = requireObjectCoercible(this); - var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; - return replacer !== undefined - ? replacer.call(searchValue, O, replaceValue) - : nativeReplace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - if ( - (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) || - (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1) - ) { - var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); - if (res.done) return res.value; - } - - var rx = anObject(regexp); - var S = String(this); - - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); - - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = []; - while (true) { - var result = regExpExec(rx, S); - if (result === null) break; - - results.push(result); - if (!global) break; - - var matchStr = String(result[0]); - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - } - - var accumulatedResult = ''; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - - var matched = String(result[0]); - var position = max(min(toInteger(result.index), S.length), 0); - var captures = []; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [matched].concat(captures, position, S); - if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); - } else { - replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); - } - if (position >= nextSourcePosition) { - accumulatedResult += S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - } - ]; - - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return nativeReplace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': return '$'; - case '&': return matched; - case '`': return str.slice(0, position); - case "'": return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: // \d\d? - var n = +ch; - if (n === 0) return match; - if (n > m) { - var f = floor(n / 10); - if (f === 0) return match; - if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } -}); - -},{"../internals/advance-string-index":203,"../internals/an-object":205,"../internals/fix-regexp-well-known-symbol-logic":244,"../internals/regexp-exec-abstract":296,"../internals/require-object-coercible":300,"../internals/to-integer":316,"../internals/to-length":317,"../internals/to-object":318}],361:[function(require,module,exports){ -'use strict'; -var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); -var anObject = require('../internals/an-object'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var sameValue = require('../internals/same-value'); -var regExpExec = require('../internals/regexp-exec-abstract'); - -// @@search logic -fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { - return [ - // `String.prototype.search` method - // https://tc39.github.io/ecma262/#sec-string.prototype.search - function search(regexp) { - var O = requireObjectCoercible(this); - var searcher = regexp == undefined ? undefined : regexp[SEARCH]; - return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); - }, - // `RegExp.prototype[@@search]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search - function (regexp) { - var res = maybeCallNative(nativeSearch, regexp, this); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - - var previousLastIndex = rx.lastIndex; - if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; - var result = regExpExec(rx, S); - if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; - return result === null ? -1 : result.index; - } - ]; -}); - -},{"../internals/an-object":205,"../internals/fix-regexp-well-known-symbol-logic":244,"../internals/regexp-exec-abstract":296,"../internals/require-object-coercible":300,"../internals/same-value":301}],362:[function(require,module,exports){ -'use strict'; -var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); -var isRegExp = require('../internals/is-regexp'); -var anObject = require('../internals/an-object'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var speciesConstructor = require('../internals/species-constructor'); -var advanceStringIndex = require('../internals/advance-string-index'); -var toLength = require('../internals/to-length'); -var callRegExpExec = require('../internals/regexp-exec-abstract'); -var regexpExec = require('../internals/regexp-exec'); -var fails = require('../internals/fails'); - -var arrayPush = [].push; -var min = Math.min; -var MAX_UINT32 = 0xFFFFFFFF; - -// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError -var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); }); - -// @@split logic -fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) { - var internalSplit; - if ( - 'abbc'.split(/(b)*/)[1] == 'c' || - 'test'.split(/(?:)/, -1).length != 4 || - 'ab'.split(/(?:ab)*/).length != 2 || - '.'.split(/(.?)(.?)/).length != 4 || - '.'.split(/()()/).length > 1 || - ''.split(/.?/).length - ) { - // based on es5-shim implementation, need to rework it - internalSplit = function (separator, limit) { - var string = String(requireObjectCoercible(this)); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (separator === undefined) return [string]; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) { - return nativeSplit.call(string, separator, lim); - } - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var match, lastIndex, lastLength; - while (match = regexpExec.call(separatorCopy, string)) { - lastIndex = separatorCopy.lastIndex; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1)); - lastLength = match[0].length; - lastLastIndex = lastIndex; - if (output.length >= lim) break; - } - if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop - } - if (lastLastIndex === string.length) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output.length > lim ? output.slice(0, lim) : output; - }; - // Chakra, V8 - } else if ('0'.split(undefined, 0).length) { - internalSplit = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit); - }; - } else internalSplit = nativeSplit; - - return [ - // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split - function split(separator, limit) { - var O = requireObjectCoercible(this); - var splitter = separator == undefined ? undefined : separator[SPLIT]; - return splitter !== undefined - ? splitter.call(separator, O, limit) - : internalSplit.call(String(O), separator, limit); - }, - // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split - // - // NOTE: This cannot be properly polyfilled in engines that don't support - // the 'y' flag. - function (regexp, limit) { - var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - var C = speciesConstructor(rx, RegExp); - - var unicodeMatching = rx.unicode; - var flags = (rx.ignoreCase ? 'i' : '') + - (rx.multiline ? 'm' : '') + - (rx.unicode ? 'u' : '') + - (SUPPORTS_Y ? 'y' : 'g'); - - // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. - var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; - var p = 0; - var q = 0; - var A = []; - while (q < S.length) { - splitter.lastIndex = SUPPORTS_Y ? q : 0; - var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); - var e; - if ( - z === null || - (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p - ) { - q = advanceStringIndex(S, q, unicodeMatching); - } else { - A.push(S.slice(p, q)); - if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); - if (A.length === lim) return A; - } - q = p = e; - } - } - A.push(S.slice(p)); - return A; - } - ]; -}, !SUPPORTS_Y); - -},{"../internals/advance-string-index":203,"../internals/an-object":205,"../internals/fails":243,"../internals/fix-regexp-well-known-symbol-logic":244,"../internals/is-regexp":264,"../internals/regexp-exec":297,"../internals/regexp-exec-abstract":296,"../internals/require-object-coercible":300,"../internals/species-constructor":308,"../internals/to-length":317}],363:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; -var toLength = require('../internals/to-length'); -var notARegExp = require('../internals/not-a-regexp'); -var requireObjectCoercible = require('../internals/require-object-coercible'); -var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); -var IS_PURE = require('../internals/is-pure'); - -var nativeStartsWith = ''.startsWith; -var min = Math.min; - -var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); -// https://github.com/zloirock/core-js/pull/702 -var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { - var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); - return descriptor && !descriptor.writable; -}(); - -// `String.prototype.startsWith` method -// https://tc39.github.io/ecma262/#sec-string.prototype.startswith -$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = String(requireObjectCoercible(this)); - notARegExp(searchString); - var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return nativeStartsWith - ? nativeStartsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); - -},{"../internals/correct-is-regexp-logic":226,"../internals/export":242,"../internals/is-pure":263,"../internals/not-a-regexp":274,"../internals/object-get-own-property-descriptor":279,"../internals/require-object-coercible":300,"../internals/to-length":317}],364:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var $trim = require('../internals/string-trim').trim; -var forcedStringTrimMethod = require('../internals/string-trim-forced'); - -// `String.prototype.trim` method -// https://tc39.github.io/ecma262/#sec-string.prototype.trim -$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { - trim: function trim() { - return $trim(this); - } -}); - -},{"../internals/export":242,"../internals/string-trim":311,"../internals/string-trim-forced":310}],365:[function(require,module,exports){ -// `Symbol.prototype.description` getter -// https://tc39.github.io/ecma262/#sec-symbol.prototype.description -'use strict'; -var $ = require('../internals/export'); -var DESCRIPTORS = require('../internals/descriptors'); -var global = require('../internals/global'); -var has = require('../internals/has'); -var isObject = require('../internals/is-object'); -var defineProperty = require('../internals/object-define-property').f; -var copyConstructorProperties = require('../internals/copy-constructor-properties'); - -var NativeSymbol = global.Symbol; - -if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) || - // Safari 12 bug - NativeSymbol().description !== undefined -)) { - var EmptyStringDescriptionStore = {}; - // wrap Symbol constructor for correct work with undefined description - var SymbolWrapper = function Symbol() { - var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]); - var result = this instanceof SymbolWrapper - ? new NativeSymbol(description) - // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' - : description === undefined ? NativeSymbol() : NativeSymbol(description); - if (description === '') EmptyStringDescriptionStore[result] = true; - return result; - }; - copyConstructorProperties(SymbolWrapper, NativeSymbol); - var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; - symbolPrototype.constructor = SymbolWrapper; - - var symbolToString = symbolPrototype.toString; - var native = String(NativeSymbol('test')) == 'Symbol(test)'; - var regexp = /^Symbol\((.*)\)[^)]+$/; - defineProperty(symbolPrototype, 'description', { - configurable: true, - get: function description() { - var symbol = isObject(this) ? this.valueOf() : this; - var string = symbolToString.call(symbol); - if (has(EmptyStringDescriptionStore, symbol)) return ''; - var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1'); - return desc === '' ? undefined : desc; - } - }); - - $({ global: true, forced: true }, { - Symbol: SymbolWrapper - }); -} - -},{"../internals/copy-constructor-properties":225,"../internals/descriptors":234,"../internals/export":242,"../internals/global":248,"../internals/has":249,"../internals/is-object":262,"../internals/object-define-property":278}],366:[function(require,module,exports){ -'use strict'; -var $ = require('../internals/export'); -var global = require('../internals/global'); -var getBuiltIn = require('../internals/get-built-in'); -var IS_PURE = require('../internals/is-pure'); -var DESCRIPTORS = require('../internals/descriptors'); -var NATIVE_SYMBOL = require('../internals/native-symbol'); -var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); -var fails = require('../internals/fails'); -var has = require('../internals/has'); -var isArray = require('../internals/is-array'); -var isObject = require('../internals/is-object'); -var anObject = require('../internals/an-object'); -var toObject = require('../internals/to-object'); -var toIndexedObject = require('../internals/to-indexed-object'); -var toPrimitive = require('../internals/to-primitive'); -var createPropertyDescriptor = require('../internals/create-property-descriptor'); -var nativeObjectCreate = require('../internals/object-create'); -var objectKeys = require('../internals/object-keys'); -var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); -var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); -var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); -var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); -var definePropertyModule = require('../internals/object-define-property'); -var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var redefine = require('../internals/redefine'); -var shared = require('../internals/shared'); -var sharedKey = require('../internals/shared-key'); -var hiddenKeys = require('../internals/hidden-keys'); -var uid = require('../internals/uid'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); -var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); -var setToStringTag = require('../internals/set-to-string-tag'); -var InternalStateModule = require('../internals/internal-state'); -var $forEach = require('../internals/array-iteration').forEach; - -var HIDDEN = sharedKey('hidden'); -var SYMBOL = 'Symbol'; -var PROTOTYPE = 'prototype'; -var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); -var setInternalState = InternalStateModule.set; -var getInternalState = InternalStateModule.getterFor(SYMBOL); -var ObjectPrototype = Object[PROTOTYPE]; -var $Symbol = global.Symbol; -var $stringify = getBuiltIn('JSON', 'stringify'); -var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; -var nativeDefineProperty = definePropertyModule.f; -var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; -var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; -var AllSymbols = shared('symbols'); -var ObjectPrototypeSymbols = shared('op-symbols'); -var StringToSymbolRegistry = shared('string-to-symbol-registry'); -var SymbolToStringRegistry = shared('symbol-to-string-registry'); -var WellKnownSymbolsStore = shared('wks'); -var QObject = global.QObject; -// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 -var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - -// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDescriptor = DESCRIPTORS && fails(function () { - return nativeObjectCreate(nativeDefineProperty({}, 'a', { - get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } - })).a != 7; -}) ? function (O, P, Attributes) { - var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); - if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; - nativeDefineProperty(O, P, Attributes); - if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { - nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); - } -} : nativeDefineProperty; - -var wrap = function (tag, description) { - var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]); - setInternalState(symbol, { - type: SYMBOL, - tag: tag, - description: description - }); - if (!DESCRIPTORS) symbol.description = description; - return symbol; -}; - -var isSymbol = USE_SYMBOL_AS_UID ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return Object(it) instanceof $Symbol; -}; - -var $defineProperty = function defineProperty(O, P, Attributes) { - if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); - anObject(O); - var key = toPrimitive(P, true); - anObject(Attributes); - if (has(AllSymbols, key)) { - if (!Attributes.enumerable) { - if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); - O[HIDDEN][key] = true; - } else { - if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; - Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); - } return setSymbolDescriptor(O, key, Attributes); - } return nativeDefineProperty(O, key, Attributes); -}; - -var $defineProperties = function defineProperties(O, Properties) { - anObject(O); - var properties = toIndexedObject(Properties); - var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); - $forEach(keys, function (key) { - if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); - }); - return O; -}; - -var $create = function create(O, Properties) { - return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); -}; - -var $propertyIsEnumerable = function propertyIsEnumerable(V) { - var P = toPrimitive(V, true); - var enumerable = nativePropertyIsEnumerable.call(this, P); - if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; - return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; -}; - -var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { - var it = toIndexedObject(O); - var key = toPrimitive(P, true); - if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; - var descriptor = nativeGetOwnPropertyDescriptor(it, key); - if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { - descriptor.enumerable = true; - } - return descriptor; -}; - -var $getOwnPropertyNames = function getOwnPropertyNames(O) { - var names = nativeGetOwnPropertyNames(toIndexedObject(O)); - var result = []; - $forEach(names, function (key) { - if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); - }); - return result; -}; - -var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { - var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; - var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); - var result = []; - $forEach(names, function (key) { - if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) { - result.push(AllSymbols[key]); - } - }); - return result; -}; - -// `Symbol` constructor -// https://tc39.github.io/ecma262/#sec-symbol-constructor -if (!NATIVE_SYMBOL) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); - var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); - var tag = uid(description); - var setter = function (value) { - if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); - }; - if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); - return wrap(tag, description); - }; - - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return getInternalState(this).tag; - }); - - redefine($Symbol, 'withoutSetter', function (description) { - return wrap(uid(description), description); - }); - - propertyIsEnumerableModule.f = $propertyIsEnumerable; - definePropertyModule.f = $defineProperty; - getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; - getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; - getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; - - wrappedWellKnownSymbolModule.f = function (name) { - return wrap(wellKnownSymbol(name), name); - }; - - if (DESCRIPTORS) { - // https://github.com/tc39/proposal-Symbol-description - nativeDefineProperty($Symbol[PROTOTYPE], 'description', { - configurable: true, - get: function description() { - return getInternalState(this).description; - } - }); - if (!IS_PURE) { - redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); - } - } -} - -$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { - Symbol: $Symbol -}); - -$forEach(objectKeys(WellKnownSymbolsStore), function (name) { - defineWellKnownSymbol(name); -}); - -$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { - // `Symbol.for` method - // https://tc39.github.io/ecma262/#sec-symbol.for - 'for': function (key) { - var string = String(key); - if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; - var symbol = $Symbol(string); - StringToSymbolRegistry[string] = symbol; - SymbolToStringRegistry[symbol] = string; - return symbol; - }, - // `Symbol.keyFor` method - // https://tc39.github.io/ecma262/#sec-symbol.keyfor - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); - if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; - }, - useSetter: function () { USE_SETTER = true; }, - useSimple: function () { USE_SETTER = false; } -}); - -$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { - // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create - create: $create, - // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty - defineProperty: $defineProperty, - // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties - defineProperties: $defineProperties, - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors - getOwnPropertyDescriptor: $getOwnPropertyDescriptor -}); - -$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - getOwnPropertyNames: $getOwnPropertyNames, - // `Object.getOwnPropertySymbols` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols - getOwnPropertySymbols: $getOwnPropertySymbols -}); - -// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives -// https://bugs.chromium.org/p/v8/issues/detail?id=3443 -$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - return getOwnPropertySymbolsModule.f(toObject(it)); - } -}); - -// `JSON.stringify` method behavior with symbols -// https://tc39.github.io/ecma262/#sec-json.stringify -if ($stringify) { - var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () { - var symbol = $Symbol(); - // MS Edge converts symbol values to JSON as {} - return $stringify([symbol]) != '[null]' - // WebKit converts symbol values to JSON as null - || $stringify({ a: symbol }) != '{}' - // V8 throws on boxed symbols - || $stringify(Object(symbol)) != '{}'; - }); - - $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, { - // eslint-disable-next-line no-unused-vars - stringify: function stringify(it, replacer, space) { - var args = [it]; - var index = 1; - var $replacer; - while (arguments.length > index) args.push(arguments[index++]); - $replacer = replacer; - 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(null, args); - } - }); -} - -// `Symbol.prototype[@@toPrimitive]` method -// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive -if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { - createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); -} -// `Symbol.prototype[@@toStringTag]` property -// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag -setToStringTag($Symbol, SYMBOL); - -hiddenKeys[HIDDEN] = true; - -},{"../internals/an-object":205,"../internals/array-iteration":214,"../internals/create-non-enumerable-property":229,"../internals/create-property-descriptor":230,"../internals/define-well-known-symbol":233,"../internals/descriptors":234,"../internals/export":242,"../internals/fails":243,"../internals/get-built-in":246,"../internals/global":248,"../internals/has":249,"../internals/hidden-keys":250,"../internals/internal-state":258,"../internals/is-array":260,"../internals/is-object":262,"../internals/is-pure":263,"../internals/native-symbol":271,"../internals/object-create":276,"../internals/object-define-property":278,"../internals/object-get-own-property-descriptor":279,"../internals/object-get-own-property-names":281,"../internals/object-get-own-property-names-external":280,"../internals/object-get-own-property-symbols":282,"../internals/object-keys":285,"../internals/object-property-is-enumerable":286,"../internals/redefine":295,"../internals/set-to-string-tag":304,"../internals/shared":307,"../internals/shared-key":305,"../internals/to-indexed-object":315,"../internals/to-object":318,"../internals/to-primitive":321,"../internals/uid":326,"../internals/use-symbol-as-uid":327,"../internals/well-known-symbol":329,"../internals/well-known-symbol-wrapped":328}],367:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $copyWithin = require('../internals/array-copy-within'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.copyWithin` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin -exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) { - return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-copy-within":209}],368:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $every = require('../internals/array-iteration').every; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.every` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every -exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) { - return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214}],369:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $fill = require('../internals/array-fill'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.fill` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill -// eslint-disable-next-line no-unused-vars -exportTypedArrayMethod('fill', function fill(value /* , start, end */) { - return $fill.apply(aTypedArray(this), arguments); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-fill":210}],370:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $filter = require('../internals/array-iteration').filter; -var speciesConstructor = require('../internals/species-constructor'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.filter` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter -exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) { - var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - var C = speciesConstructor(this, this.constructor); - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C))(length); - while (length > index) result[index] = list[index++]; - return result; -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214,"../internals/species-constructor":308}],371:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $findIndex = require('../internals/array-iteration').findIndex; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.findIndex` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex -exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) { - return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214}],372:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $find = require('../internals/array-iteration').find; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.find` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find -exportTypedArrayMethod('find', function find(predicate /* , thisArg */) { - return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214}],373:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $forEach = require('../internals/array-iteration').forEach; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.forEach` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach -exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) { - $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214}],374:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $includes = require('../internals/array-includes').includes; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.includes` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes -exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) { - return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-includes":213}],375:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $indexOf = require('../internals/array-includes').indexOf; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.indexOf` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof -exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) { - return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-includes":213}],376:[function(require,module,exports){ -'use strict'; -var global = require('../internals/global'); -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var ArrayIterators = require('../modules/es.array.iterator'); -var wellKnownSymbol = require('../internals/well-known-symbol'); - -var ITERATOR = wellKnownSymbol('iterator'); -var Uint8Array = global.Uint8Array; -var arrayValues = ArrayIterators.values; -var arrayKeys = ArrayIterators.keys; -var arrayEntries = ArrayIterators.entries; -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR]; - -var CORRECT_ITER_NAME = !!nativeTypedArrayIterator - && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined); - -var typedArrayValues = function values() { - return arrayValues.call(aTypedArray(this)); -}; - -// `%TypedArray%.prototype.entries` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries -exportTypedArrayMethod('entries', function entries() { - return arrayEntries.call(aTypedArray(this)); -}); -// `%TypedArray%.prototype.keys` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys -exportTypedArrayMethod('keys', function keys() { - return arrayKeys.call(aTypedArray(this)); -}); -// `%TypedArray%.prototype.values` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values -exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME); -// `%TypedArray%.prototype[@@iterator]` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator -exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME); - -},{"../internals/array-buffer-view-core":207,"../internals/global":248,"../internals/well-known-symbol":329,"../modules/es.array.iterator":340}],377:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var $join = [].join; - -// `%TypedArray%.prototype.join` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join -// eslint-disable-next-line no-unused-vars -exportTypedArrayMethod('join', function join(separator) { - return $join.apply(aTypedArray(this), arguments); -}); - -},{"../internals/array-buffer-view-core":207}],378:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $lastIndexOf = require('../internals/array-last-index-of'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.lastIndexOf` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof -// eslint-disable-next-line no-unused-vars -exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { - return $lastIndexOf.apply(aTypedArray(this), arguments); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-last-index-of":215}],379:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $map = require('../internals/array-iteration').map; -var speciesConstructor = require('../internals/species-constructor'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.map` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map -exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) { - return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { - return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length); - }); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214,"../internals/species-constructor":308}],380:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $reduceRight = require('../internals/array-reduce').right; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.reduceRicht` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright -exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) { - return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-reduce":219}],381:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $reduce = require('../internals/array-reduce').left; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.reduce` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce -exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) { - return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-reduce":219}],382:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var floor = Math.floor; - -// `%TypedArray%.prototype.reverse` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse -exportTypedArrayMethod('reverse', function reverse() { - var that = this; - var length = aTypedArray(that).length; - var middle = floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; -}); - -},{"../internals/array-buffer-view-core":207}],383:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var toLength = require('../internals/to-length'); -var toOffset = require('../internals/to-offset'); -var toObject = require('../internals/to-object'); -var fails = require('../internals/fails'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -var FORCED = fails(function () { - // eslint-disable-next-line no-undef - new Int8Array(1).set({}); -}); - -// `%TypedArray%.prototype.set` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set -exportTypedArrayMethod('set', function set(arrayLike /* , offset */) { - aTypedArray(this); - var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError('Wrong length'); - while (index < len) this[offset + index] = src[index++]; -}, FORCED); - -},{"../internals/array-buffer-view-core":207,"../internals/fails":243,"../internals/to-length":317,"../internals/to-object":318,"../internals/to-offset":319}],384:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var speciesConstructor = require('../internals/species-constructor'); -var fails = require('../internals/fails'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var $slice = [].slice; - -var FORCED = fails(function () { - // eslint-disable-next-line no-undef - new Int8Array(1).slice(); -}); - -// `%TypedArray%.prototype.slice` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice -exportTypedArrayMethod('slice', function slice(start, end) { - var list = $slice.call(aTypedArray(this), start, end); - var C = speciesConstructor(this, this.constructor); - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C))(length); - while (length > index) result[index] = list[index++]; - return result; -}, FORCED); - -},{"../internals/array-buffer-view-core":207,"../internals/fails":243,"../internals/species-constructor":308}],385:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var $some = require('../internals/array-iteration').some; - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.some` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some -exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) { - return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/array-iteration":214}],386:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var $sort = [].sort; - -// `%TypedArray%.prototype.sort` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort -exportTypedArrayMethod('sort', function sort(comparefn) { - return $sort.call(aTypedArray(this), comparefn); -}); - -},{"../internals/array-buffer-view-core":207}],387:[function(require,module,exports){ -'use strict'; -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var toLength = require('../internals/to-length'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var speciesConstructor = require('../internals/species-constructor'); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - -// `%TypedArray%.prototype.subarray` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray -exportTypedArrayMethod('subarray', function subarray(begin, end) { - var O = aTypedArray(this); - var length = O.length; - var beginIndex = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O.constructor))( - O.buffer, - O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) - ); -}); - -},{"../internals/array-buffer-view-core":207,"../internals/species-constructor":308,"../internals/to-absolute-index":313,"../internals/to-length":317}],388:[function(require,module,exports){ -'use strict'; -var global = require('../internals/global'); -var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var fails = require('../internals/fails'); - -var Int8Array = global.Int8Array; -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var $toLocaleString = [].toLocaleString; -var $slice = [].slice; - -// iOS Safari 6.x fails here -var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { - $toLocaleString.call(new Int8Array(1)); -}); - -var FORCED = fails(function () { - return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString(); -}) || !fails(function () { - Int8Array.prototype.toLocaleString.call([1, 2]); -}); - -// `%TypedArray%.prototype.toLocaleString` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring -exportTypedArrayMethod('toLocaleString', function toLocaleString() { - return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments); -}, FORCED); - -},{"../internals/array-buffer-view-core":207,"../internals/fails":243,"../internals/global":248}],389:[function(require,module,exports){ -'use strict'; -var exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod; -var fails = require('../internals/fails'); -var global = require('../internals/global'); - -var Uint8Array = global.Uint8Array; -var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; -var arrayToString = [].toString; -var arrayJoin = [].join; - -if (fails(function () { arrayToString.call({}); })) { - arrayToString = function toString() { - return arrayJoin.call(this); - }; -} - -var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; - -// `%TypedArray%.prototype.toString` method -// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring -exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); - -},{"../internals/array-buffer-view-core":207,"../internals/fails":243,"../internals/global":248}],390:[function(require,module,exports){ -var createTypedArrayConstructor = require('../internals/typed-array-constructor'); - -// `Uint8Array` constructor -// https://tc39.github.io/ecma262/#sec-typedarray-objects -createTypedArrayConstructor('Uint8', function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"../internals/typed-array-constructor":323}],391:[function(require,module,exports){ -var global = require('../internals/global'); -var DOMIterables = require('../internals/dom-iterables'); -var forEach = require('../internals/array-for-each'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); - -for (var COLLECTION_NAME in DOMIterables) { - var Collection = global[COLLECTION_NAME]; - var CollectionPrototype = Collection && Collection.prototype; - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { - createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); - } catch (error) { - CollectionPrototype.forEach = forEach; - } -} - -},{"../internals/array-for-each":211,"../internals/create-non-enumerable-property":229,"../internals/dom-iterables":236,"../internals/global":248}],392:[function(require,module,exports){ -(function (Buffer){ -// 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 === '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 === '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 === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; +exports.isBuffer = require('buffer').Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } -}).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":406}],393:[function(require,module,exports){ +},{"buffer":183}],446:[function(require,module,exports){ /* * Date Format 1.2.3 * (c) 2007-2009 Steven Levithan @@ -25823,7 +23394,7 @@ function kindOf(val) { } })(this); -},{}],394:[function(require,module,exports){ +},{}],447:[function(require,module,exports){ /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk @@ -25903,7 +23474,7 @@ function escapeHtml(string) { : html; } -},{}],395:[function(require,module,exports){ +},{}],448:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25925,16 +23496,8 @@ function escapeHtml(string) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var objectCreate = Object.create || objectCreatePolyfill -var objectKeys = Object.keys || objectKeysPolyfill -var bind = Function.prototype.bind || functionBindPolyfill - function EventEmitter() { - if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { - this._events = objectCreate(null); - this._eventsCount = 0; - } - + this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; @@ -25947,521 +23510,291 @@ 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. -var defaultMaxListeners = 10; - -var hasDefineProperty; -try { - var o = {}; - if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 }); - hasDefineProperty = o.x === 0; -} catch (err) { hasDefineProperty = false } -if (hasDefineProperty) { - Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - // check whether the input is a positive number (whose value is zero or - // greater and not a NaN). - if (typeof arg !== 'number' || arg < 0 || arg !== arg) - throw new TypeError('"defaultMaxListeners" must be a positive number'); - defaultMaxListeners = arg; - } - }); -} else { - EventEmitter.defaultMaxListeners = defaultMaxListeners; -} +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 setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || isNaN(n)) - throw new TypeError('"n" argument must be a positive number'); +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; }; -function $getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} - -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return $getMaxListeners(this); -}; - -// These standalone emit* functions are used to optimize calling of event -// handlers for fast cases because emit() itself often has a variable number of -// arguments and can be deoptimized because of that. These functions always have -// the same number of arguments and thus do not get deoptimized, so the code -// inside them can execute faster. -function emitNone(handler, isFn, self) { - if (isFn) - handler.call(self); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self); - } -} -function emitOne(handler, isFn, self, arg1) { - if (isFn) - handler.call(self, arg1); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1); - } -} -function emitTwo(handler, isFn, self, arg1, arg2) { - if (isFn) - handler.call(self, arg1, arg2); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2); - } -} -function emitThree(handler, isFn, self, arg1, arg2, arg3) { - if (isFn) - handler.call(self, arg1, arg2, arg3); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2, arg3); - } -} - -function emitMany(handler, isFn, self, args) { - if (isFn) - handler.apply(self, args); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].apply(self, args); - } -} - -EventEmitter.prototype.emit = function emit(type) { - var er, handler, len, args, i, events; - var doError = (type === 'error'); +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; - events = this._events; - if (events) - doError = (doError && events.error == null); - else if (!doError) - return false; + if (!this._events) + this._events = {}; // If there is no 'error' event listener then throw. - if (doError) { - if (arguments.length > 1) + 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('Unhandled "error" event. (' + er + ')'); - err.context = er; - throw err; + 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; + } } - return false; } - handler = events[type]; + handler = this._events[type]; - if (!handler) + if (isUndefined(handler)) return false; - var isFn = typeof handler === 'function'; - len = arguments.length; - switch (len) { + if (isFunction(handler)) { + switch (arguments.length) { // fast cases - case 1: - emitNone(handler, isFn, this); - break; - case 2: - emitOne(handler, isFn, this, arguments[1]); - break; - case 3: - emitTwo(handler, isFn, this, arguments[1], arguments[2]); - break; - case 4: - emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); - break; + 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 = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - emitMany(handler, isFn, this, args); + 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; }; -function _addListener(target, type, listener, prepend) { +EventEmitter.prototype.addListener = function(type, listener) { var m; - var events; - var existing; - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); + if (!isFunction(listener)) + throw TypeError('listener must be a function'); - events = target._events; - if (!events) { - events = target._events = objectCreate(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); + if (!this._events) + this._events = {}; - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } + // 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 (!existing) { + if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; + 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 { - // If we've already got an array, just append. - if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - } - - // Check for listener leak - if (!existing.warned) { - m = $getMaxListeners(target); - if (m && m > 0 && existing.length > m) { - existing.warned = true; - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' "' + String(type) + '" listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit.'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - if (typeof console === 'object' && console.warn) { - console.warn('%s: %s', w.name, w.message); - } + 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 target; -} - -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); + return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - switch (arguments.length) { - case 0: - return this.listener.call(this.target); - case 1: - return this.listener.call(this.target, arguments[0]); - case 2: - return this.listener.call(this.target, arguments[0], arguments[1]); - case 3: - return this.listener.call(this.target, arguments[0], arguments[1], - arguments[2]); - default: - var args = new Array(arguments.length); - for (var i = 0; i < args.length; ++i) - args[i] = arguments[i]; - this.listener.apply(this.target, args); + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); } } -} -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = bind.call(onceWrapper, state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} + g.listener = listener; + this.on(type, g); -EventEmitter.prototype.once = function once(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.on(type, _onceWrap(this, type, listener)); return this; }; -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = this._events; - if (!events) - return this; - - list = events[type]; - if (!list) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = objectCreate(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; - if (position === 0) - list.shift(); - else - spliceOne(list, position); + if (!isFunction(listener)) + throw TypeError('listener must be a function'); - if (list.length === 1) - events[type] = list[0]; + if (!this._events || !this._events[type]) + return this; - if (events.removeListener) - this.emit('removeListener', type, originalListener || listener); + 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; - }; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (!events) - return this; - - // not listening for removeListener, no need to emit - if (!events.removeListener) { - if (arguments.length === 0) { - this._events = objectCreate(null); - this._eventsCount = 0; - } else if (events[type]) { - if (--this._eventsCount === 0) - this._events = objectCreate(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = objectKeys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = objectCreate(null); - this._eventsCount = 0; - return this; - } - listeners = events[type]; + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } - return this; - }; + return this; +}; -function _listeners(target, type, unwrap) { - var events = target._events; +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; - if (!events) - return []; + if (!this._events) + return this; - var evlistener = events[type]; - if (!evlistener) - return []; + // 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; + } - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + // 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; + } - return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} + listeners = this._events[type]; -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; + 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]; -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); + return this; }; -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } +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 = listenerCount; -function listenerCount(type) { - var events = this._events; +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; - if (events) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { + if (isFunction(evlistener)) return 1; - } else if (evlistener) { + else if (evlistener) return evlistener.length; - } } - return 0; -} +}; -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); }; -// About 1.5x faster than the two-arg version of Array#splice(). -function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) - list[i] = list[k]; - list.pop(); +function isFunction(arg) { + return typeof arg === 'function'; } -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; +function isNumber(arg) { + return typeof arg === 'number'; } -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; +function isObject(arg) { + return typeof arg === 'object' && arg !== null; } -function objectCreatePolyfill(proto) { - var F = function() {}; - F.prototype = proto; - return new F; -} -function objectKeysPolyfill(obj) { - var keys = []; - for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) { - keys.push(k); - } - return k; -} -function functionBindPolyfill(context) { - var fn = this; - return function () { - return fn.apply(context, arguments); - }; +function isUndefined(arg) { + return arg === void 0; } -},{}],396:[function(require,module,exports){ -var http = require('http') -var url = require('url') +},{}],449:[function(require,module,exports){ +var http = require('http'); -var https = module.exports +var https = module.exports; for (var key in http) { - if (http.hasOwnProperty(key)) https[key] = http[key] -} + if (http.hasOwnProperty(key)) https[key] = http[key]; +}; https.request = function (params, cb) { - params = validateParams(params) - return http.request.call(this, params, cb) -} - -https.get = function (params, cb) { - params = validateParams(params) - return http.get.call(this, params, cb) + if (!params) params = {}; + params.scheme = 'https'; + params.protocol = 'https:'; + return http.request.call(this, params, cb); } -function validateParams (params) { - if (typeof params === 'string') { - params = url.parse(params) - } - if (!params.protocol) { - params.protocol = 'https:' - } - if (params.protocol !== 'https:') { - throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"') - } - return params -} - -},{"http":177,"url":452}],397:[function(require,module,exports){ +},{"http":490}],450:[function(require,module,exports){ /*! * humanize-ms - index.js * Copyright(c) 2014 dead_horse @@ -26487,7 +23820,8 @@ module.exports = function (t) { return r; }; -},{"ms":413,"util":442}],398:[function(require,module,exports){ +},{"ms":466,"util":499}],451:[function(require,module,exports){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -26573,7 +23907,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],399:[function(require,module,exports){ +},{}],452:[function(require,module,exports){ 'use strict'; var types = [ require('./nextTick'), @@ -26672,8 +24006,8 @@ function immediate(task) { } } -},{"./messageChannel":400,"./mutation.js":401,"./nextTick":176,"./queueMicrotask":402,"./stateChange":403,"./timeout":404}],400:[function(require,module,exports){ -(function (global){ +},{"./messageChannel":453,"./mutation.js":454,"./nextTick":182,"./queueMicrotask":455,"./stateChange":456,"./timeout":457}],453:[function(require,module,exports){ +(function (global){(function (){ 'use strict'; exports.test = function () { @@ -26692,9 +24026,9 @@ exports.install = function (func) { channel.port2.postMessage(0); }; }; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],401:[function(require,module,exports){ -(function (global){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],454:[function(require,module,exports){ +(function (global){(function (){ 'use strict'; //based off rsvp https://github.com/tildeio/rsvp.js //license https://github.com/tildeio/rsvp.js/blob/master/LICENSE @@ -26717,9 +24051,9 @@ exports.install = function (handle) { element.data = (called = ++called % 2); }; }; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],402:[function(require,module,exports){ -(function (global){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],455:[function(require,module,exports){ +(function (global){(function (){ 'use strict'; exports.test = function () { return typeof global.queueMicrotask === 'function'; @@ -26731,9 +24065,9 @@ exports.install = function (func) { }; }; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],403:[function(require,module,exports){ -(function (global){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],456:[function(require,module,exports){ +(function (global){(function (){ 'use strict'; exports.test = function () { @@ -26758,8 +24092,8 @@ exports.install = function (handle) { return handle; }; }; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],404:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],457:[function(require,module,exports){ 'use strict'; exports.test = function () { return true; @@ -26770,7 +24104,7 @@ exports.install = function (t) { setTimeout(t, 0); }; }; -},{}],405:[function(require,module,exports){ +},{}],458:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -26799,7 +24133,7 @@ if (typeof Object.create === 'function') { } } -},{}],406:[function(require,module,exports){ +},{}],459:[function(require,module,exports){ /*! * Determine if an object is a Buffer * @@ -26822,15 +24156,15 @@ function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -},{}],407:[function(require,module,exports){ +},{}],460:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],408:[function(require,module,exports){ -(function (global){ +},{}],461:[function(require,module,exports){ +(function (global){(function (){ /* * base64.js * @@ -26855,7 +24189,7 @@ module.exports = Array.isArray || function (arr) { // existing version for noConflict() global = global || {}; var _Base64 = global.Base64; - var version = "2.6.3"; + var version = "2.6.4"; // constants var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; @@ -27062,8 +24396,8 @@ module.exports = Array.isArray || function (arr) { return {Base64: global.Base64} })); -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],409:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],462:[function(require,module,exports){ /*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong @@ -27125,7 +24459,7 @@ function merge(dest, src, redefine) { return dest } -},{}],410:[function(require,module,exports){ +},{}],463:[function(require,module,exports){ 'use strict'; /** @@ -27136,7 +24470,7 @@ function Mime() { this._types = Object.create(null); this._extensions = Object.create(null); - for (var i = 0; i < arguments.length; i++) { + for (let i = 0; i < arguments.length; i++) { this.define(arguments[i]); } @@ -27165,16 +24499,18 @@ function Mime() { * @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()}); + for (let type in typeMap) { + let extensions = typeMap[type].map(function(t) { + return t.toLowerCase(); + }); type = type.toLowerCase(); - for (var i = 0; i < extensions.length; i++) { - var ext = extensions[i]; + for (let i = 0; i < extensions.length; i++) { + const ext = extensions[i]; // '*' prefix = not the preferred type for this extension. So fixup the // extension, and skip it. - if (ext[0] == '*') { + if (ext[0] === '*') { continue; } @@ -27192,8 +24528,8 @@ Mime.prototype.define = function(typeMap, force) { // Use first extension as default if (force || !this._extensions[type]) { - var ext = extensions[0]; - this._extensions[type] = (ext[0] != '*') ? ext : ext.substr(1) + const ext = extensions[0]; + this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1); } } }; @@ -27203,11 +24539,11 @@ Mime.prototype.define = function(typeMap, force) { */ Mime.prototype.getType = function(path) { path = String(path); - var last = path.replace(/^.*[/\\]/, '').toLowerCase(); - var ext = last.replace(/^.*\./, '').toLowerCase(); + let last = path.replace(/^.*[/\\]/, '').toLowerCase(); + let ext = last.replace(/^.*\./, '').toLowerCase(); - var hasPath = last.length < path.length; - var hasDot = ext.length < last.length - 1; + let hasPath = last.length < path.length; + let hasDot = ext.length < last.length - 1; return (hasDot || !hasPath) && this._types[ext] || null; }; @@ -27222,15 +24558,15 @@ Mime.prototype.getExtension = function(type) { module.exports = Mime; -},{}],411:[function(require,module,exports){ +},{}],464:[function(require,module,exports){ 'use strict'; -var Mime = require('./Mime'); +let Mime = require('./Mime'); module.exports = new Mime(require('./types/standard')); -},{"./Mime":410,"./types/standard":412}],412:[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"]}; -},{}],413:[function(require,module,exports){ +},{"./Mime":463,"./types/standard":465}],465:[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":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"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/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/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"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-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":["*xsl","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/amr":["amr"],"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","opus"],"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/avif":["avif"],"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/ktx2":["ktx2"],"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/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"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/spdx":["spdx"],"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/iso.segment":["m4s"],"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"]}; +},{}],466:[function(require,module,exports){ /** * Helpers. */ @@ -27239,7 +24575,6 @@ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; -var w = d * 7; var y = d * 365.25; /** @@ -27261,7 +24596,7 @@ module.exports = function(val, options) { var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); - } else if (type === 'number' && isFinite(val)) { + } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( @@ -27283,7 +24618,7 @@ function parse(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( + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { @@ -27298,10 +24633,6 @@ function parse(str) { case 'yr': case 'y': return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; case 'days': case 'day': case 'd': @@ -27344,17 +24675,16 @@ function parse(str) { */ function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { + if (ms >= d) { return Math.round(ms / d) + 'd'; } - if (msAbs >= h) { + if (ms >= h) { return Math.round(ms / h) + 'h'; } - if (msAbs >= m) { + if (ms >= m) { return Math.round(ms / m) + 'm'; } - if (msAbs >= s) { + if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; @@ -27369,33 +24699,29 @@ function fmtShort(ms) { */ 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'; + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; } /** * Pluralization helper. */ -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],414:[function(require,module,exports){ -(function (process){ +},{}],467:[function(require,module,exports){ +(function (process){(function (){ // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, // backported and transplited with Babel, with backwards-compat fixes @@ -27699,9 +25025,9 @@ var substr = 'ab'.substr(-1) === 'b' } ; -}).call(this,require('_process')) -},{"_process":451}],415:[function(require,module,exports){ -(function (process){ +}).call(this)}).call(this,require('_process')) +},{"_process":508}],468:[function(require,module,exports){ +(function (process){(function (){ 'use strict'; if (typeof process === 'undefined' || @@ -27748,8 +25074,8 @@ function nextTick(fn, arg1, arg2, arg3) { } -}).call(this,require('_process')) -},{"_process":451}],416:[function(require,module,exports){ +}).call(this)}).call(this,require('_process')) +},{"_process":508}],469:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -27935,8 +25261,8 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],417:[function(require,module,exports){ -(function (global){ +},{}],470:[function(require,module,exports){ +(function (global){(function (){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { @@ -28471,8 +25797,8 @@ process.umask = function() { return 0; }; }(this)); -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],418:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],471:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -28558,7 +25884,7 @@ var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; -},{}],419:[function(require,module,exports){ +},{}],472:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -28645,16 +25971,16 @@ var objectKeys = Object.keys || function (obj) { return res; }; -},{}],420:[function(require,module,exports){ +},{}],473:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); -},{"./decode":418,"./encode":419}],421:[function(require,module,exports){ +},{"./decode":471,"./encode":472}],474:[function(require,module,exports){ module.exports = require('./lib/_stream_duplex.js'); -},{"./lib/_stream_duplex.js":422}],422:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":475}],475:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -28786,7 +26112,7 @@ Duplex.prototype._destroy = function (err, cb) { pna.nextTick(cb, err); }; -},{"./_stream_readable":424,"./_stream_writable":426,"core-util-is":392,"inherits":405,"process-nextick-args":415}],423:[function(require,module,exports){ +},{"./_stream_readable":477,"./_stream_writable":479,"core-util-is":445,"inherits":458,"process-nextick-args":468}],476:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -28834,8 +26160,8 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":425,"core-util-is":392,"inherits":405}],424:[function(require,module,exports){ -(function (process,global){ +},{"./_stream_transform":478,"core-util-is":445,"inherits":458}],477:[function(require,module,exports){ +(function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -29855,8 +27181,8 @@ function indexOf(xs, x) { } return -1; } -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./_stream_duplex":422,"./internal/streams/BufferList":427,"./internal/streams/destroy":428,"./internal/streams/stream":429,"_process":451,"core-util-is":392,"events":395,"inherits":405,"isarray":407,"process-nextick-args":415,"safe-buffer":435,"string_decoder/":437,"util":176}],425:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./_stream_duplex":475,"./internal/streams/BufferList":480,"./internal/streams/destroy":481,"./internal/streams/stream":482,"_process":508,"core-util-is":445,"events":448,"inherits":458,"isarray":460,"process-nextick-args":468,"safe-buffer":483,"string_decoder/":484,"util":182}],478:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -30071,8 +27397,8 @@ function done(stream, er, data) { return stream.push(null); } -},{"./_stream_duplex":422,"core-util-is":392,"inherits":405}],426:[function(require,module,exports){ -(function (process,global,setImmediate){ +},{"./_stream_duplex":475,"core-util-is":445,"inherits":458}],479:[function(require,module,exports){ +(function (process,global,setImmediate){(function (){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -30760,8 +28086,8 @@ 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 : {},require("timers").setImmediate) -},{"./_stream_duplex":422,"./internal/streams/destroy":428,"./internal/streams/stream":429,"_process":451,"core-util-is":392,"inherits":405,"process-nextick-args":415,"safe-buffer":435,"timers":438,"util-deprecate":439}],427:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) +},{"./_stream_duplex":475,"./internal/streams/destroy":481,"./internal/streams/stream":482,"_process":508,"core-util-is":445,"inherits":458,"process-nextick-args":468,"safe-buffer":483,"timers":494,"util-deprecate":496}],480:[function(require,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -30841,7 +28167,7 @@ if (util && util.inspect && util.inspect.custom) { return this.constructor.name + ' ' + obj; }; } -},{"safe-buffer":435,"util":176}],428:[function(require,module,exports){ +},{"safe-buffer":483,"util":182}],481:[function(require,module,exports){ 'use strict'; /**/ @@ -30908,1255 +28234,1252 @@ function undestroy() { } } -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; +},{"process-nextick-args":468}],482:[function(require,module,exports){ +module.exports = require('events').EventEmitter; + +},{"events":448}],483:[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":183}],484:[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 Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + 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 _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; }; -},{"process-nextick-args":415}],429:[function(require,module,exports){ -arguments[4][194][0].apply(exports,arguments) -},{"dup":194,"events":395}],430:[function(require,module,exports){ -module.exports = require('./readable').PassThrough - -},{"./readable":431}],431:[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":422,"./lib/_stream_passthrough.js":423,"./lib/_stream_readable.js":424,"./lib/_stream_transform.js":425,"./lib/_stream_writable.js":426}],432:[function(require,module,exports){ -module.exports = require('./readable').Transform -},{"./readable":431}],433:[function(require,module,exports){ -module.exports = require('./lib/_stream_writable.js'); - -},{"./lib/_stream_writable.js":426}],434:[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. - */ +StringDecoder.prototype.end = utf8End; -!(function(global) { - "use strict"; +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; - 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; +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; - // 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 : {}; +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} - 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 }; +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } + return nb; } + return 0; +} - 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); - }; - }); +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; } - - 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"; - } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; } - 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); + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; } } + } +} - 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; +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} - 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; - } - } +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} - context.dispatchException(context.arg); +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} +},{"safe-buffer":483}],485:[function(require,module,exports){ +module.exports = require('./readable').PassThrough - state = GenStateExecuting; +},{"./readable":486}],486:[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'); - 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; +},{"./lib/_stream_duplex.js":475,"./lib/_stream_passthrough.js":476,"./lib/_stream_readable.js":477,"./lib/_stream_transform.js":478,"./lib/_stream_writable.js":479}],487:[function(require,module,exports){ +module.exports = require('./readable').Transform - if (record.arg === ContinueSentinel) { - continue; - } +},{"./readable":486}],488:[function(require,module,exports){ +module.exports = require('./lib/_stream_writable.js'); - 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; - } - } - }; - } +},{"./lib/_stream_writable.js":479}],489:[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. - // 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; - } - } +module.exports = Stream; - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } +var EE = require('events').EventEmitter; +var inherits = require('inherits'); - return ContinueSentinel; - } +inherits(Stream, EE); +Stream.Readable = require('readable-stream/readable.js'); +Stream.Writable = require('readable-stream/writable.js'); +Stream.Duplex = require('readable-stream/duplex.js'); +Stream.Transform = require('readable-stream/transform.js'); +Stream.PassThrough = require('readable-stream/passthrough.js'); - var record = tryCatch(method, delegate.iterator, context.arg); +// Backwards-compat with node 0.4.x +Stream.Stream = Stream; - 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; - } +// old-style streams. Note that the pipe method (the only relevant +// part of this class) is overridden in the Readable class. - 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; +function Stream() { + EE.call(this); +} - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; +Stream.prototype.pipe = function(dest, options) { + var source = this; - // 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; + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); } - - } 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] }; + source.on('data', ondata); - if (1 in locs) { - entry.catchLoc = locs[1]; + function ondrain() { + if (source.readable && source.resume) { + source.resume(); } + } - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } + dest.on('drain', ondrain); - this.tryEntries.push(entry); + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend); + source.on('close', onclose); } - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + + dest.end(); } - 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); + + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + + if (typeof dest.destroy === 'function') dest.destroy(); } - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); + // don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, 'error') === 0) { + throw er; // Unhandled stream error in pipe. } - 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; - } - } + source.on('error', onerror); + dest.on('error', onerror); - // 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; - }; - }; + // remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata); + dest.removeListener('drain', ondrain); - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } + source.removeListener('end', onend); + source.removeListener('close', onclose); - if (typeof iterable.next === "function") { - return iterable; - } + source.removeListener('error', onerror); + dest.removeListener('error', onerror); - 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; - } - } + source.removeListener('end', cleanup); + source.removeListener('close', cleanup); - next.value = undefined; - next.done = true; + dest.removeListener('close', cleanup); + } - return next; - }; + source.on('end', cleanup); + source.on('close', cleanup); - return next.next = next; - } - } + dest.on('close', cleanup); - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; + dest.emit('pipe', source); - function doneResult() { - return { value: undefined, done: true }; - } + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest; +}; - Context.prototype = { - constructor: Context, +},{"events":448,"inherits":458,"readable-stream/duplex.js":474,"readable-stream/passthrough.js":485,"readable-stream/readable.js":486,"readable-stream/transform.js":487,"readable-stream/writable.js":488}],490:[function(require,module,exports){ +(function (global){(function (){ +var ClientRequest = require('./lib/request') +var response = require('./lib/response') +var extend = require('xtend') +var statusCodes = require('builtin-status-codes') +var url = require('url') - 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; - } - } - } - }, +var http = exports - stop: function() { - this.done = true; +http.request = function (opts, cb) { + if (typeof opts === 'string') + opts = url.parse(opts) + else + opts = extend(opts) - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } + // Normally, the page is loaded from http or https, so not specifying a protocol + // will result in a (valid) protocol-relative url. However, this won't work if + // the protocol is something else, like 'file:' + var defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : '' - return this.rval; - }, + var protocol = opts.protocol || defaultProtocol + var host = opts.hostname || opts.host + var port = opts.port + var path = opts.path || '/' - dispatchException: function(exception) { - if (this.done) { - throw exception; - } + // Necessary for IPv6 addresses + if (host && host.indexOf(':') !== -1) + host = '[' + host + ']' - 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; - } + // This may be a relative url. The browser should always be able to interpret it correctly. + opts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path + opts.method = (opts.method || 'GET').toUpperCase() + opts.headers = opts.headers || {} - return !! caught; - } + // Also valid opts.auth, opts.mode - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; + var req = new ClientRequest(opts) + if (cb) + req.on('response', cb) + return req +} - 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"); - } +http.get = function get (opts, cb) { + var req = http.request(opts, cb) + req.end() + return req +} - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); +http.ClientRequest = ClientRequest +http.IncomingMessage = response.IncomingMessage - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +http.Agent = function () {} +http.Agent.defaultMaxSockets = 4 - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } +http.globalAgent = new http.Agent() - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +http.STATUS_CODES = statusCodes - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, +http.METHODS = [ + 'CHECKOUT', + 'CONNECT', + 'COPY', + 'DELETE', + 'GET', + 'HEAD', + 'LOCK', + 'M-SEARCH', + 'MERGE', + 'MKACTIVITY', + 'MKCOL', + 'MOVE', + 'NOTIFY', + 'OPTIONS', + 'PATCH', + 'POST', + 'PROPFIND', + 'PROPPATCH', + 'PURGE', + 'PUT', + 'REPORT', + 'SEARCH', + 'SUBSCRIBE', + 'TRACE', + 'UNLOCK', + 'UNSUBSCRIBE' +] +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./lib/request":492,"./lib/response":493,"builtin-status-codes":184,"url":509,"xtend":500}],491:[function(require,module,exports){ +(function (global){(function (){ +exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream) - 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; - } - } +exports.writableStream = isFunction(global.WritableStream) - 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; - } +exports.abortController = isFunction(global.AbortController) - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; +exports.blobConstructor = false +try { + new Blob([new ArrayBuffer(1)]) + exports.blobConstructor = true +} catch (e) {} - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } +// The xhr request to example.com may violate some restrictive CSP configurations, +// so if we're running in a browser that supports `fetch`, avoid calling getXHR() +// and assume support for certain features below. +var xhr +function getXHR () { + // Cache the xhr value + if (xhr !== undefined) return xhr - return this.complete(record); - }, + if (global.XMLHttpRequest) { + xhr = new global.XMLHttpRequest() + // If XDomainRequest is available (ie only, where xhr might not work + // cross domain), use the page location. Otherwise use example.com + // Note: this doesn't actually make an http request. + try { + xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com') + } catch(e) { + xhr = null + } + } else { + // Service workers don't have XHR + xhr = null + } + return xhr +} - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } +function checkTypeSupport (type) { + var xhr = getXHR() + if (!xhr) return false + try { + xhr.responseType = type + return xhr.responseType === type + } catch (e) {} + return false +} - 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; - } +// For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'. +// Safari 7.1 appears to have fixed this bug. +var haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined' +var haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice) - return ContinueSentinel; - }, +// If fetch is supported, then arraybuffer will be supported too. Skip calling +// checkTypeSupport(), since that calls getXHR(). +exports.arraybuffer = exports.fetch || (haveArrayBuffer && checkTypeSupport('arraybuffer')) - 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; - } - } - }, +// These next two tests unavoidably show warnings in Chrome. Since fetch will always +// be used if it's available, just return false for these to avoid the warnings. +exports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream') +exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer && + checkTypeSupport('moz-chunked-arraybuffer') - "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; - } - } +// If fetch is supported, then overrideMimeType will be supported too. Skip calling +// getXHR(). +exports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false) - // 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"); - }, +exports.vbArray = isFunction(global.VBArray) - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; +function isFunction (value) { + return typeof value === 'function' +} - 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; - } +xhr = null // Help gc - 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")() -); - -},{}],435:[function(require,module,exports){ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],492:[function(require,module,exports){ +(function (process,global,Buffer){(function (){ +var capability = require('./capability') +var inherits = require('inherits') +var response = require('./response') +var stream = require('readable-stream') +var toArrayBuffer = require('to-arraybuffer') -// 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 -} +var IncomingMessage = response.IncomingMessage +var rStates = response.readyStates -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) +function decideMode (preferBinary, useFetch) { + if (capability.fetch && useFetch) { + return 'fetch' + } else if (capability.mozchunkedarraybuffer) { + return 'moz-chunked-arraybuffer' + } else if (capability.msstream) { + return 'ms-stream' + } else if (capability.arraybuffer && preferBinary) { + return 'arraybuffer' + } else if (capability.vbArray && preferBinary) { + return 'text:vbarray' + } else { + return 'text' + } } -// 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) -} +var ClientRequest = module.exports = function (opts) { + var self = this + stream.Writable.call(self) -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 -} + self._opts = opts + self._body = [] + self._headers = {} + if (opts.auth) + self.setHeader('Authorization', 'Basic ' + new Buffer(opts.auth).toString('base64')) + Object.keys(opts.headers).forEach(function (name) { + self.setHeader(name, opts.headers[name]) + }) -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} + var preferBinary + var useFetch = true + if (opts.mode === 'disable-fetch' || ('requestTimeout' in opts && !capability.abortController)) { + // If the use of XHR should be preferred. Not typically needed. + useFetch = false + preferBinary = true + } else if (opts.mode === 'prefer-streaming') { + // If streaming is a high priority but binary compatibility and + // the accuracy of the 'content-type' header aren't + preferBinary = false + } else if (opts.mode === 'allow-wrong-content-type') { + // If streaming is more important than preserving the 'content-type' header + preferBinary = !capability.overrideMimeType + } else if (!opts.mode || opts.mode === 'default' || opts.mode === 'prefer-fast') { + // Use binary if text streaming may corrupt data or the content-type header, or for speed + preferBinary = true + } else { + throw new Error('Invalid value for opts.mode') + } + self._mode = decideMode(preferBinary, useFetch) + self._fetchTimer = null -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) + self.on('finish', function () { + self._onFinish() + }) } -},{"buffer":196}],436:[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. +inherits(ClientRequest, stream.Writable) -module.exports = Stream; +ClientRequest.prototype.setHeader = function (name, value) { + var self = this + var lowerName = name.toLowerCase() + // This check is not necessary, but it prevents warnings from browsers about setting unsafe + // headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but + // http-browserify did it, so I will too. + if (unsafeHeaders.indexOf(lowerName) !== -1) + return -var EE = require('events').EventEmitter; -var inherits = require('inherits'); + self._headers[lowerName] = { + name: name, + value: value + } +} -inherits(Stream, EE); -Stream.Readable = require('readable-stream/readable.js'); -Stream.Writable = require('readable-stream/writable.js'); -Stream.Duplex = require('readable-stream/duplex.js'); -Stream.Transform = require('readable-stream/transform.js'); -Stream.PassThrough = require('readable-stream/passthrough.js'); +ClientRequest.prototype.getHeader = function (name) { + var header = this._headers[name.toLowerCase()] + if (header) + return header.value + return null +} -// Backwards-compat with node 0.4.x -Stream.Stream = Stream; +ClientRequest.prototype.removeHeader = function (name) { + var self = this + delete self._headers[name.toLowerCase()] +} +ClientRequest.prototype._onFinish = function () { + var self = this + if (self._destroyed) + return + var opts = self._opts -// old-style streams. Note that the pipe method (the only relevant -// part of this class) is overridden in the Readable class. + var headersObj = self._headers + var body = null + if (opts.method !== 'GET' && opts.method !== 'HEAD') { + if (capability.arraybuffer) { + body = toArrayBuffer(Buffer.concat(self._body)) + } else if (capability.blobConstructor) { + body = new global.Blob(self._body.map(function (buffer) { + return toArrayBuffer(buffer) + }), { + type: (headersObj['content-type'] || {}).value || '' + }) + } else { + // get utf8 string + body = Buffer.concat(self._body).toString() + } + } -function Stream() { - EE.call(this); -} + // create flattened list of headers + var headersList = [] + Object.keys(headersObj).forEach(function (keyName) { + var name = headersObj[keyName].name + var value = headersObj[keyName].value + if (Array.isArray(value)) { + value.forEach(function (v) { + headersList.push([name, v]) + }) + } else { + headersList.push([name, value]) + } + }) -Stream.prototype.pipe = function(dest, options) { - var source = this; + if (self._mode === 'fetch') { + var signal = null + var fetchTimer = null + if (capability.abortController) { + var controller = new AbortController() + signal = controller.signal + self._fetchAbortController = controller - function ondata(chunk) { - if (dest.writable) { - if (false === dest.write(chunk) && source.pause) { - source.pause(); - } - } - } + if ('requestTimeout' in opts && opts.requestTimeout !== 0) { + self._fetchTimer = global.setTimeout(function () { + self.emit('requestTimeout') + if (self._fetchAbortController) + self._fetchAbortController.abort() + }, opts.requestTimeout) + } + } - source.on('data', ondata); + global.fetch(self._opts.url, { + method: self._opts.method, + headers: headersList, + body: body || undefined, + mode: 'cors', + credentials: opts.withCredentials ? 'include' : 'same-origin', + signal: signal + }).then(function (response) { + self._fetchResponse = response + self._connect() + }, function (reason) { + global.clearTimeout(self._fetchTimer) + if (!self._destroyed) + self.emit('error', reason) + }) + } else { + var xhr = self._xhr = new global.XMLHttpRequest() + try { + xhr.open(self._opts.method, self._opts.url, true) + } catch (err) { + process.nextTick(function () { + self.emit('error', err) + }) + return + } - function ondrain() { - if (source.readable && source.resume) { - source.resume(); - } - } + // Can't set responseType on really old browsers + if ('responseType' in xhr) + xhr.responseType = self._mode.split(':')[0] - dest.on('drain', ondrain); + if ('withCredentials' in xhr) + xhr.withCredentials = !!opts.withCredentials - // If the 'end' option is not supplied, dest.end() will be called when - // source gets the 'end' or 'close' events. Only dest.end() once. - if (!dest._isStdio && (!options || options.end !== false)) { - source.on('end', onend); - source.on('close', onclose); - } + if (self._mode === 'text' && 'overrideMimeType' in xhr) + xhr.overrideMimeType('text/plain; charset=x-user-defined') - var didOnEnd = false; - function onend() { - if (didOnEnd) return; - didOnEnd = true; + if ('requestTimeout' in opts) { + xhr.timeout = opts.requestTimeout + xhr.ontimeout = function () { + self.emit('requestTimeout') + } + } - dest.end(); - } + headersList.forEach(function (header) { + xhr.setRequestHeader(header[0], header[1]) + }) + self._response = null + xhr.onreadystatechange = function () { + switch (xhr.readyState) { + case rStates.LOADING: + case rStates.DONE: + self._onXHRProgress() + break + } + } + // Necessary for streaming in Firefox, since xhr.response is ONLY defined + // in onprogress, not in onreadystatechange with xhr.readyState = 3 + if (self._mode === 'moz-chunked-arraybuffer') { + xhr.onprogress = function () { + self._onXHRProgress() + } + } - function onclose() { - if (didOnEnd) return; - didOnEnd = true; + xhr.onerror = function () { + if (self._destroyed) + return + self.emit('error', new Error('XHR error')) + } - if (typeof dest.destroy === 'function') dest.destroy(); - } + try { + xhr.send(body) + } catch (err) { + process.nextTick(function () { + self.emit('error', err) + }) + return + } + } +} - // don't leave dangling pipes when there are errors. - function onerror(er) { - cleanup(); - if (EE.listenerCount(this, 'error') === 0) { - throw er; // Unhandled stream error in pipe. - } - } +/** + * Checks if xhr.status is readable and non-zero, indicating no error. + * Even though the spec says it should be available in readyState 3, + * accessing it throws an exception in IE8 + */ +function statusValid (xhr) { + try { + var status = xhr.status + return (status !== null && status !== 0) + } catch (e) { + return false + } +} - source.on('error', onerror); - dest.on('error', onerror); +ClientRequest.prototype._onXHRProgress = function () { + var self = this - // remove all the event listeners that were added. - function cleanup() { - source.removeListener('data', ondata); - dest.removeListener('drain', ondrain); + if (!statusValid(self._xhr) || self._destroyed) + return - source.removeListener('end', onend); - source.removeListener('close', onclose); + if (!self._response) + self._connect() - source.removeListener('error', onerror); - dest.removeListener('error', onerror); + self._response._onXHRProgress() +} - source.removeListener('end', cleanup); - source.removeListener('close', cleanup); +ClientRequest.prototype._connect = function () { + var self = this - dest.removeListener('close', cleanup); - } + if (self._destroyed) + return - source.on('end', cleanup); - source.on('close', cleanup); + self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer) + self._response.on('error', function(err) { + self.emit('error', err) + }) - dest.on('close', cleanup); + self.emit('response', self._response) +} - dest.emit('pipe', source); +ClientRequest.prototype._write = function (chunk, encoding, cb) { + var self = this - // Allow for unix-like usage: A.pipe(B).pipe(C) - return dest; -}; + self._body.push(chunk) + cb() +} -},{"events":395,"inherits":405,"readable-stream/duplex.js":421,"readable-stream/passthrough.js":430,"readable-stream/readable.js":431,"readable-stream/transform.js":432,"readable-stream/writable.js":433}],437:[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. +ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () { + var self = this + self._destroyed = true + global.clearTimeout(self._fetchTimer) + if (self._response) + self._response._destroyed = true + if (self._xhr) + self._xhr.abort() + else if (self._fetchAbortController) + self._fetchAbortController.abort() +} -'use strict'; +ClientRequest.prototype.end = function (data, encoding, cb) { + var self = this + if (typeof data === 'function') { + cb = data + data = undefined + } -/**/ + stream.Writable.prototype.end.call(self, data, encoding, cb) +} -var Buffer = require('safe-buffer').Buffer; -/**/ +ClientRequest.prototype.flushHeaders = function () {} +ClientRequest.prototype.setTimeout = function () {} +ClientRequest.prototype.setNoDelay = function () {} +ClientRequest.prototype.setSocketKeepAlive = function () {} -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + 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; - } -}; +// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method +var unsafeHeaders = [ + 'accept-charset', + 'accept-encoding', + 'access-control-request-headers', + 'access-control-request-method', + 'connection', + 'content-length', + 'cookie', + 'cookie2', + 'date', + 'dnt', + 'expect', + 'host', + 'keep-alive', + 'origin', + 'referer', + 'te', + 'trailer', + 'transfer-encoding', + 'upgrade', + 'user-agent', + 'via' +] -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"./capability":491,"./response":493,"_process":508,"buffer":183,"inherits":458,"readable-stream":486,"to-arraybuffer":495}],493:[function(require,module,exports){ +(function (process,global,Buffer){(function (){ +var capability = require('./capability') +var inherits = require('inherits') +var stream = require('readable-stream') -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; +var rStates = exports.readyStates = { + UNSENT: 0, + OPENED: 1, + HEADERS_RECEIVED: 2, + LOADING: 3, + DONE: 4 } -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} +var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) { + var self = this + stream.Readable.call(self) -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; + self._mode = mode + self.headers = {} + self.rawHeaders = [] + self.trailers = {} + self.rawTrailers = [] -StringDecoder.prototype.end = utf8End; + // Fake the 'close' event, but only once 'end' fires + self.on('end', function () { + // The nextTick is necessary to prevent the 'request' module from causing an infinite loop + process.nextTick(function () { + self.emit('close') + }) + }) -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; + if (mode === 'fetch') { + self._fetchResponse = response -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; + self.url = response.url + self.statusCode = response.status + self.statusMessage = response.statusText + + response.headers.forEach(function (header, key){ + self.headers[key.toLowerCase()] = header + self.rawHeaders.push(key, header) + }) -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} + if (capability.writableStream) { + var writable = new WritableStream({ + write: function (chunk) { + return new Promise(function (resolve, reject) { + if (self._destroyed) { + reject() + } else if(self.push(new Buffer(chunk))) { + resolve() + } else { + self._resumeFetch = resolve + } + }) + }, + close: function () { + global.clearTimeout(fetchTimer) + if (!self._destroyed) + self.push(null) + }, + abort: function (err) { + if (!self._destroyed) + self.emit('error', err) + } + }) -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} + try { + response.body.pipeTo(writable).catch(function (err) { + global.clearTimeout(fetchTimer) + if (!self._destroyed) + self.emit('error', err) + }) + return + } catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this + } + // fallback for when writableStream or pipeTo aren't available + var reader = response.body.getReader() + function read () { + reader.read().then(function (result) { + if (self._destroyed) + return + if (result.done) { + global.clearTimeout(fetchTimer) + self.push(null) + return + } + self.push(new Buffer(result.value)) + read() + }).catch(function (err) { + global.clearTimeout(fetchTimer) + if (!self._destroyed) + self.emit('error', err) + }) + } + read() + } else { + self._xhr = xhr + self._pos = 0 + + self.url = xhr.responseURL + self.statusCode = xhr.status + self.statusMessage = xhr.statusText + var headers = xhr.getAllResponseHeaders().split(/\r?\n/) + headers.forEach(function (header) { + var matches = header.match(/^([^:]+):\s*(.*)/) + if (matches) { + var key = matches[1].toLowerCase() + if (key === 'set-cookie') { + if (self.headers[key] === undefined) { + self.headers[key] = [] + } + self.headers[key].push(matches[2]) + } else if (self.headers[key] !== undefined) { + self.headers[key] += ', ' + matches[2] + } else { + self.headers[key] = matches[2] + } + self.rawHeaders.push(matches[1], matches[2]) + } + }) -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } + self._charset = 'x-user-defined' + if (!capability.overrideMimeType) { + var mimeType = self.rawHeaders['mime-type'] + if (mimeType) { + var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/) + if (charsetMatch) { + self._charset = charsetMatch[1].toLowerCase() + } + } + if (!self._charset) + self._charset = 'utf-8' // best guess + } + } } -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} +inherits(IncomingMessage, stream.Readable) -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} +IncomingMessage.prototype._read = function () { + var self = this -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; + var resolve = self._resumeFetch + if (resolve) { + self._resumeFetch = null + resolve() + } } -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} +IncomingMessage.prototype._onXHRProgress = function () { + var self = this -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} + var xhr = self._xhr -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} + var response = null + switch (self._mode) { + case 'text:vbarray': // For IE9 + if (xhr.readyState !== rStates.DONE) + break + try { + // This fails in IE8 + response = new global.VBArray(xhr.responseBody).toArray() + } catch (e) {} + if (response !== null) { + self.push(new Buffer(response)) + break + } + // Falls through in IE8 + case 'text': + try { // This will fail when readyState = 3 in IE9. Switch mode and wait for readyState = 4 + response = xhr.responseText + } catch (e) { + self._mode = 'text:vbarray' + break + } + if (response.length > self._pos) { + var newData = response.substr(self._pos) + if (self._charset === 'x-user-defined') { + var buffer = new Buffer(newData.length) + for (var i = 0; i < newData.length; i++) + buffer[i] = newData.charCodeAt(i) & 0xff -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} + self.push(buffer) + } else { + self.push(newData, self._charset) + } + self._pos = response.length + } + break + case 'arraybuffer': + if (xhr.readyState !== rStates.DONE || !xhr.response) + break + response = xhr.response + self.push(new Buffer(new Uint8Array(response))) + break + case 'moz-chunked-arraybuffer': // take whole + response = xhr.response + if (xhr.readyState !== rStates.LOADING || !response) + break + self.push(new Buffer(new Uint8Array(response))) + break + case 'ms-stream': + response = xhr.response + if (xhr.readyState !== rStates.LOADING) + break + var reader = new global.MSStreamReader() + reader.onprogress = function () { + if (reader.result.byteLength > self._pos) { + self.push(new Buffer(new Uint8Array(reader.result.slice(self._pos)))) + self._pos = reader.result.byteLength + } + } + reader.onload = function () { + self.push(null) + } + // reader.onerror = ??? // TODO: this + reader.readAsArrayBuffer(response) + break + } -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); + // The ms-stream case handles end separately in reader.onload() + if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') { + self.push(null) + } } -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} -},{"safe-buffer":435}],438:[function(require,module,exports){ -(function (setImmediate,clearImmediate){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"./capability":491,"_process":508,"buffer":183,"inherits":458,"readable-stream":486}],494:[function(require,module,exports){ +(function (setImmediate,clearImmediate){(function (){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; var slice = Array.prototype.slice; @@ -32233,9 +29556,38 @@ exports.setImmediate = typeof setImmediate === "function" ? setImmediate : funct exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { delete immediateIds[id]; }; -}).call(this,require("timers").setImmediate,require("timers").clearImmediate) -},{"process/browser.js":416,"timers":438}],439:[function(require,module,exports){ -(function (global){ +}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate) +},{"process/browser.js":469,"timers":494}],495:[function(require,module,exports){ +var Buffer = require('buffer').Buffer + +module.exports = function (buf) { + // If the buffer is backed by a Uint8Array, a faster version will work + if (buf instanceof Uint8Array) { + // If the buffer isn't a subarray, return the underlying ArrayBuffer + if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) { + return buf.buffer + } else if (typeof buf.buffer.slice === 'function') { + // Otherwise we need to get a proper copy + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength) + } + } + + if (Buffer.isBuffer(buf)) { + // This is the slow version that will work with any Buffer + // implementation (even in old browsers) + var arrayCopy = new Uint8Array(buf.length) + var len = buf.length + for (var i = 0; i < len; i++) { + arrayCopy[i] = buf[i] + } + return arrayCopy.buffer + } else { + throw new Error('Argument must be a Buffer') + } +} + +},{"buffer":183}],496:[function(require,module,exports){ +(function (global){(function (){ /** * Module exports. @@ -32304,8 +29656,8 @@ function config (name) { return String(val).toLowerCase() === 'true'; } -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],440:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],497:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -32330,15 +29682,15 @@ if (typeof Object.create === 'function') { } } -},{}],441:[function(require,module,exports){ +},{}],498:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],442:[function(require,module,exports){ -(function (process,global){ +},{}],499:[function(require,module,exports){ +(function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -32926,8 +30278,8 @@ function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":441,"_process":451,"inherits":440}],443:[function(require,module,exports){ +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":498,"_process":508,"inherits":497}],500:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -32948,20 +30300,20 @@ function extend() { return target } -},{}],444:[function(require,module,exports){ +},{}],501:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.fill.js"); -require("core-js/modules/es.array.fill"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.array.join"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.array.slice"); +require("core-js/modules/es.regexp.to-string.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.array.join.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.array.slice.js"); var Buffer = require('buffer').Buffer; @@ -33070,12 +30422,12 @@ exports.pbkdf2 = function () { error('sorry,pbkdf2 is not implemented yet'); }; -},{"./md5":446,"./sha":447,"buffer":196,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.fill":333,"core-js/modules/es.array.join":341,"core-js/modules/es.array.slice":344,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],445:[function(require,module,exports){ +},{"./md5":503,"./sha":504,"buffer":183,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.fill.js":375,"core-js/modules/es.array.join.js":381,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.regexp.to-string.js":404}],502:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.array.concat"); +require("core-js/modules/es.array.fill.js"); -require("core-js/modules/es.array.fill"); +require("core-js/modules/es.array.concat.js"); var Buffer = require('buffer').Buffer; @@ -33121,7 +30473,7 @@ module.exports = { hash: hash }; -},{"buffer":196,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.fill":333}],446:[function(require,module,exports){ +},{"buffer":183,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.fill.js":375}],503:[function(require,module,exports){ "use strict"; /* @@ -33280,7 +30632,7 @@ module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; -},{"./helpers":445}],447:[function(require,module,exports){ +},{"./helpers":502}],504:[function(require,module,exports){ "use strict"; /* @@ -33378,15 +30730,15 @@ module.exports = function sha1(buf) { return helpers.hash(buf, core_sha1, 20, true); }; -},{"./helpers":445}],448:[function(require,module,exports){ +},{"./helpers":502}],505:[function(require,module,exports){ "use strict"; module.exports = function () { return function () {}; }; -},{}],449:[function(require,module,exports){ -(function (Buffer){ +},{}],506:[function(require,module,exports){ +(function (Buffer){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); @@ -33414,20 +30766,20 @@ module.exports.writableStream = function isWritableStream(obj) { return isStream(obj) && typeof obj._write === 'function' && (0, _typeof2.default)(obj._writableState) === 'object'; }; -}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")}) -},{"../lib/common/utils/isArray":142,"../node_modules/is-buffer/index.js":406,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"stream":436}],450:[function(require,module,exports){ -(function (global){ +}).call(this)}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")}) +},{"../lib/common/utils/isArray":144,"../node_modules/is-buffer/index.js":459,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"stream":489}],507:[function(require,module,exports){ +(function (global){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.regexp.constructor"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.regexp.to-string"); +require("core-js/modules/es.regexp.constructor.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.regexp.to-string.js"); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); @@ -33571,8 +30923,8 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); } }).call(void 0); -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.regexp.constructor":354,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.replace":360}],451:[function(require,module,exports){ +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"core-js/modules/es.regexp.constructor.js":402,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.regexp.to-string.js":404,"core-js/modules/es.string.replace.js":408}],508:[function(require,module,exports){ "use strict"; var immediate = require('immediate'); @@ -33619,7 +30971,7 @@ process.umask = function () { return 0; }; -},{"immediate":399}],452:[function(require,module,exports){ +},{"immediate":452}],509:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -33644,33 +30996,29 @@ process.umask = function () { var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); - -require("core-js/modules/es.array.index-of"); - -require("core-js/modules/es.array.join"); +var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); -require("core-js/modules/es.array.last-index-of"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.array.slice"); +require("core-js/modules/es.string.search.js"); -require("core-js/modules/es.array.splice"); +require("core-js/modules/es.array.concat.js"); -require("core-js/modules/es.object.keys"); +require("core-js/modules/es.string.split.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.match"); +require("core-js/modules/es.array.join.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.trim.js"); -require("core-js/modules/es.string.search"); +require("core-js/modules/es.string.match.js"); -require("core-js/modules/es.string.split"); +require("core-js/modules/es.array.slice.js"); -require("core-js/modules/es.string.trim"); +require("core-js/modules/es.object.keys.js"); -var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); +require("core-js/modules/es.array.splice.js"); var punycode = require('punycode'); @@ -34380,7 +31728,7 @@ Url.prototype.parseHost = function () { if (host) this.hostname = host; }; -},{"./util":453,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.join":341,"core-js/modules/es.array.last-index-of":342,"core-js/modules/es.array.slice":344,"core-js/modules/es.array.splice":346,"core-js/modules/es.object.keys":351,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.match":359,"core-js/modules/es.string.replace":360,"core-js/modules/es.string.search":361,"core-js/modules/es.string.split":362,"core-js/modules/es.string.trim":364,"punycode":417,"querystring":420}],453:[function(require,module,exports){ +},{"./util":510,"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.array.join.js":381,"core-js/modules/es.array.slice.js":383,"core-js/modules/es.array.splice.js":385,"core-js/modules/es.object.keys.js":392,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.match.js":407,"core-js/modules/es.string.replace.js":408,"core-js/modules/es.string.search.js":409,"core-js/modules/es.string.split.js":410,"core-js/modules/es.string.trim.js":412,"punycode":470,"querystring":473}],510:[function(require,module,exports){ 'use strict'; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); @@ -34402,10 +31750,10 @@ module.exports = { } }; -},{"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170}],454:[function(require,module,exports){ +},{"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177}],511:[function(require,module,exports){ "use strict"; -require("core-js/modules/es.number.constructor"); +require("core-js/modules/es.number.constructor.js"); // copy from https://github.com/node-modules/utility for browser exports.encodeURIComponent = function (text) { @@ -34436,25 +31784,25 @@ exports.timestamp = function timestamp(t) { return Math.round(Date.now() / 1000); }; -},{"core-js/modules/es.number.constructor":348,"escape-html":394}],455:[function(require,module,exports){ -(function (process,Buffer){ +},{"core-js/modules/es.number.constructor.js":388,"escape-html":447}],512:[function(require,module,exports){ +(function (process,Buffer){(function (){ 'use strict'; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -require("core-js/modules/es.array.concat"); +var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); -require("core-js/modules/es.array.index-of"); +require("core-js/modules/es.string.trim.js"); -require("core-js/modules/es.array.join"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.function.name"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.function.name.js"); -var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); +require("core-js/modules/es.array.concat.js"); var util = require('util'); @@ -34476,6 +31824,14 @@ function getAgent(agent, defaultAgent) { return agent === undefined ? defaultAgent : agent; } +function parseContentType(str) { + if (!str) { + return ''; + } + + return str.split(';')[0].trim().toLowerCase(); +} + function makeCallback(resolve, reject) { return function (err, data, res) { if (err) { @@ -34551,7 +31907,7 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) if (typeof url === 'string') { if (!PROTO_RE.test(url)) { // Support `request('www.server.com')` - url = 'http://' + url; + url = 'https://' + url; } parsedUrl = urlutil.parse(url); @@ -34597,22 +31953,28 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) options.requestTimeout = args.timeout[args.timeout.length - 1]; } else if (typeof args.timeout !== 'undefined') { options.requestTimeout = args.timeout; - } - - var sslNames = ['pfx', 'key', 'passphrase', 'cert', 'ca', 'ciphers', 'rejectUnauthorized', 'secureProtocol', 'secureOptions']; - - for (var i = 0; i < sslNames.length; i++) { - var name = sslNames[i]; - - if (args.hasOwnProperty(name)) { - options[name] = args[name]; - } - } // don't check ssl - + } // var sslNames = [ + // 'pfx', + // 'key', + // 'passphrase', + // 'cert', + // 'ca', + // 'ciphers', + // 'rejectUnauthorized', + // 'secureProtocol', + // 'secureOptions', + // ]; + // for (var i = 0; i < sslNames.length; i++) { + // var name = sslNames[i]; + // if (args.hasOwnProperty(name)) { + // options[name] = args[name]; + // } + // } + // // don't check ssl + // if (options.rejectUnauthorized === false && !options.hasOwnProperty('secureOptions')) { + // options.secureOptions = require('constants').SSL_OP_NO_TLSv1_2; + // } - if (options.rejectUnauthorized === false && !options.hasOwnProperty('secureOptions')) { - options.secureOptions = require('constants').SSL_OP_NO_TLSv1_2; - } var auth = args.auth || parsedUrl.auth; @@ -34641,7 +32003,7 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) options.headers['Content-Type'] = contentType; } - if (parseContentType(contentType).type === 'application/json') { + if (parseContentType(contentType) === 'application/json') { body = JSON.stringify(body); } else { // 'application/x-www-form-urlencoded' @@ -34743,25 +32105,22 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) statusCode = res.statusCode; headers = res.headers; } // handle digest auth + // if (statusCode === 401 && headers['www-authenticate'] + // && (!args.headers || !args.headers.Authorization) && args.digestAuth) { + // var authenticate = headers['www-authenticate']; + // if (authenticate.indexOf('Digest ') >= 0) { + // debug('Request#%d %s: got digest auth header WWW-Authenticate: %s', reqId, url, authenticate); + // args.headers = args.headers || {}; + // args.headers.Authorization = digestAuthHeader(options.method, options.path, authenticate, args.digestAuth); + // debug('Request#%d %s: auth with digest header: %s', reqId, url, args.headers.Authorization); + // if (res.headers['set-cookie']) { + // args.headers.Cookie = res.headers['set-cookie'].join(';'); + // } + // return exports.requestWithCallback(url, args, cb); + // } + // } - if (statusCode === 401 && headers['www-authenticate'] && (!args.headers || !args.headers.Authorization) && args.digestAuth) { - var authenticate = headers['www-authenticate']; - - if (authenticate.indexOf('Digest ') >= 0) { - debug('Request#%d %s: got digest auth header WWW-Authenticate: %s', reqId, url, authenticate); - args.headers = args.headers || {}; - args.headers.Authorization = digestAuthHeader(options.method, options.path, authenticate, args.digestAuth); - debug('Request#%d %s: auth with digest header: %s', reqId, url, args.headers.Authorization); - - if (res.headers['set-cookie']) { - args.headers.Cookie = res.headers['set-cookie'].join(';'); - } - - return exports.requestWithCallback(url, args, cb); - } - } - var requestUseTime = Date.now() - requestStartTime; if (timing) { @@ -34931,18 +32290,18 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // - https://github.com/TBEDP/urllib/commit/959ac3365821e0e028c231a5e8efca6af410eabb // - http://nodejs.org/api/stream.html#stream_event_end // - http://nodejs.org/api/stream.html#stream_event_close_1 - var result = handleRedirect(res); + var _result = handleRedirect(res); - if (result.redirect) { + if (_result.redirect) { res.resume(); return; } - if (result.error) { + if (_result.error) { res.resume(); // end ths stream first writeStream.end(); - return done(result.error, null, res); + return done(_result.error, null, res); } // you can set consumeWriteStream false that only wait response end @@ -34950,12 +32309,15 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) res.on('end', done.bind(null, null, null, res)); } else { // node 0.10, 0.12: only emit res aborted, writeStream close not fired - if (isNode010 || isNode012) { - first([[writeStream, 'close'], [res, 'aborted']], function (_, stream, event) { - debug('Request#%d %s: writeStream or res %s event emitted', reqId, url, event); - done(__err || null, null, res); - }); - } else { + // if (isNode010 || isNode012) { + // first([ + // [ writeStream, 'close' ], + // [ res, 'aborted' ], + // ], function(_, stream, event) { + // debug('Request#%d %s: writeStream or res %s event emitted', reqId, url, event); + // done(__err || null, null, res); + // }); + if (false) {} else { writeStream.on('close', function () { debug('Request#%d %s: writeStream close event emitted', reqId, url); done(__err || null, null, res); @@ -35150,12 +32512,11 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) } // https://github.com/nodejs/node/blob/master/lib/net.js#L377 // https://github.com/nodejs/node/blob/v0.10.40-release/lib/net.js#L352 // should use socket.socket on 0.10.x + // if (isNode010 && socket.socket) { + // socket = socket.socket; + // } - if (isNode010 && socket.socket) { - socket = socket.socket; - } - var readyState = socket.readyState; if (readyState === 'opening') { @@ -35240,7 +32601,7 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) return req; }; -}).call(this,require('_process'),require("buffer").Buffer) -},{"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"_process":451,"buffer":196,"constants":198,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.join":341,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"debug":448,"http":177,"https":396,"humanize-ms":397,"url":452,"util":442}]},{},[3])(3) +}).call(this)}).call(this,require('_process'),require("buffer").Buffer) +},{"@babel/runtime/helpers/interopRequireDefault":173,"@babel/runtime/helpers/typeof":177,"_process":508,"buffer":183,"core-js/modules/es.array.concat.js":374,"core-js/modules/es.function.name.js":386,"core-js/modules/es.object.to-string.js":393,"core-js/modules/es.promise.js":397,"core-js/modules/es.regexp.exec.js":403,"core-js/modules/es.string.trim.js":412,"debug":505,"http":490,"https":449,"humanize-ms":450,"url":509,"util":499}]},{},[3])(3) }); diff --git a/dist/aliyun-oss-sdk.min.js b/dist/aliyun-oss-sdk.min.js index 8656a9ded..81159bccb 100644 --- a/dist/aliyun-oss-sdk.min.js +++ b/dist/aliyun-oss-sdk.min.js @@ -1,20 +1,4 @@ // Aliyun OSS SDK for JavaScript v7.0.0-beta.1 // Copyright Aliyun.com, Inc. or its affiliates. All Rights Reserved. // License at https://github.com/ali-sdk/ali-oss/blob/master/LICENSE -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.OSS=e()}}(function(){var e;return function(){function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){return i(t[s][1][e]||e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s2&&void 0!==_[2]?_[2]:{},this.resetCancelFlag(),!n.checkpoint||!n.checkpoint.uploadId){e.next=6;break}return e.next=5,p.resumeMultipart.call(this,n.checkpoint,n);case 5:return e.abrupt("return",e.sent);case 6:return i=102400,n.mime||(h.isFile(r)?n.mime=l.default.getType(c.default.extname(r.name)):m.isBlob(r)?n.mime=r.type:v.isBuffer(r)?n.mime="":n.mime=l.default.getType(c.default.extname(r))),n.headers=n.headers||{},y.convertMetaToHeaders(n.meta,n.headers),e.next=12,g.getFileSize(r);case 12:if(!((o=e.sent)2&&void 0!==_[2]?_[2]:{},t=h.objectName(t),!v.isBuffer(r)){e.next=6;break}o=r,e.next=34;break;case 6:if(!p.isBlob(r)&&!d.isFile(r)){e.next=33;break}return i.mime||(d.isFile(r)?i.mime=l.default.getType(c.default.extname(r.name)):i.mime=r.type),e.next=10,this._createStream(r,0,r.size);case 10:return a=e.sent,e.next=13,g.getFileSize(r);case 13:return i.contentLength=e.sent,e.prev=14,e.next=17,f.putStream.call(this,t,a,i);case 17:return u=e.sent,e.abrupt("return",u);case 21:if(e.prev=21,e.t0=e.catch(14),"RequestTimeTooSkewed"!==e.t0.code){e.next=30;break}return this.options.amendTimeSkewed=+new Date(e.t0.serverTime)-(new Date).valueOf(),e.next=27,n.call(this,t,r,i);case 27:return e.abrupt("return",e.sent);case 30:throw e.t0;case 31:e.next=34;break;case 33:throw new TypeError("Must provide Buffer/Blob/File for put.");case 34:return i.headers=i.headers||{},y.convertMetaToHeaders(i.meta,i.headers),j=i.method||"PUT",w=this._objectRequestParams(j,t,i),m.encodeCallback(w,i),w.mime=i.mime,w.content=o,w.successStatuses=[200],e.next=44,this.request(w);case 44:return x=e.sent,k={name:t,url:b.objectUrl(t,this.options),res:x.res},w.headers&&w.headers["x-oss-callback"]&&(k.data=JSON.parse(x.data.toString())),e.abrupt("return",k);case 48:case"end":return e.stop()}},e,this,[[14,21]])})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.put=void 0;var c=u(e("path")),l=u(e("mime")),f=e("./putStream"),p=e("../../common/utils/isBlob"),d=e("../../common/utils/isFile"),h=e("../../common/utils/objectName"),m=e("../../common/utils/encodeCallback"),b=e("../../common/utils/objectUrl"),y=e("../../common/utils/convertMetaToHeaders"),g=e("../utils/getFileSize"),v=e("../../common/utils/isBuffer");r.put=n},{"../../common/utils/convertMetaToHeaders":124,"../../common/utils/encodeCallback":129,"../../common/utils/isBlob":143,"../../common/utils/isBuffer":144,"../../common/utils/isFile":145,"../../common/utils/objectName":150,"../../common/utils/objectUrl":151,"../utils/getFileSize":9,"./putStream":8,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,mime:411,path:414,"regenerator-runtime/runtime":434}],8:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,p,d=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>2&&void 0!==d[2]?d[2]:{},n.headers=n.headers||{},t=u.objectName(t),n.contentLength?n.headers["Content-Length"]=n.contentLength:n.headers["Transfer-Encoding"]="chunked",c.convertMetaToHeaders(n.meta,n.headers),i=n.method||"PUT",o=this._objectRequestParams(i,t,n),f.encodeCallback(o,n),o.mime=n.mime,r.pipe?o.stream=r:o.content=r,o.successStatuses=[200],e.next=13,this.request(o);case 13:return a=e.sent,p={name:t,url:l.objectUrl(t,this.options),res:a.res},o.headers&&o.headers["x-oss-callback"]&&(p.data=JSON.parse(a.data.toString())),e.abrupt("return",p);case 17:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putStream=void 0;var u=e("../../common/utils/objectName"),c=e("../../common/utils/convertMetaToHeaders"),l=e("../../common/utils/objectUrl"),f=e("../../common/utils/encodeCallback");r.putStream=n},{"../../common/utils/convertMetaToHeaders":124,"../../common/utils/encodeCallback":129,"../../common/utils/objectName":150,"../../common/utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"regenerator-runtime/runtime":434}],9:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!l.isBuffer(t)){e.next=4;break}return e.abrupt("return",t.length);case 4:if(!u.isBlob(t)&&!c.isFile(t)){e.next=6;break}return e.abrupt("return",t.size);case 6:throw new Error("getFileSize requires Buffer/File/Blob.");case 7:case"end":return e.stop()}},e)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getFileSize=void 0;var u=e("../../common/utils/isBlob"),c=e("../../common/utils/isFile"),l=e("../../common/utils/isBuffer");r.getFileSize=n},{"../../common/utils/isBlob":143,"../../common/utils/isBuffer":144,"../../common/utils/isFile":145,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.version=void 0,r.version="7.0.0-beta.1"},{}],11:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"worm",r),e.next=5,this.request(n);case 5:return i=e.sent,e.abrupt("return",{res:i.res,status:i.status});case 7:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.abortBucketWorm=void 0;var u=e("../utils/checkBucketName");r.abortBucketWorm=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],12:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},u.checkBucketName(t),i=this._bucketRequestParams("POST",t,{wormId:r},n),e.next=5,this.request(i);case 5:return o=e.sent,e.abrupt("return",{res:o.res,status:o.status});case 7:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.completeBucketWorm=void 0;var u=e("../utils/checkBucketName");r.completeBucketWorm=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],13:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"",r),e.next=5,this.request(n);case 5:if(i=e.sent,200!==i.status&&204!==i.status){e.next=8;break}return e.abrupt("return",{res:i.res});case 8:return e.next=10,this.requestError(i);case 10:throw e.sent;case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucket=void 0;var u=e("../utils/checkBucketName");r.deleteBucket=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],14:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"cors",r),n.successStatuses=[204],e.next=6,this.request(n);case 6:return i=e.sent,e.abrupt("return",{res:i.res});case 8:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketCORS=void 0;var u=e("../utils/checkBucketName");r.deleteBucketCORS=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],15:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"encryption",r),n.successStatuses=[204],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,e.abrupt("return",{status:i.status,res:i.res});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketEncryption=void 0;var u=e("../utils/checkBucketName");r.deleteBucketEncryption=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],16:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,c=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>2&&void 0!==c[2]?c[2]:{},i=Object.assign({inventory:"",inventoryId:r},n.subres),u.checkBucketName(t),o=this._bucketRequestParams("DELETE",t,i,n),o.successStatuses=[204],e.next=7,this.request(o);case 7:return a=e.sent,e.abrupt("return",{status:a.status,res:a.res});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketInventory=void 0;var u=e("../utils/checkBucketName");r.deleteBucketInventory=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],17:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"lifecycle",r),n.successStatuses=[204],e.next=6,this.request(n);case 6:return i=e.sent,e.abrupt("return",{res:i.res});case 8:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketLifecycle=void 0;var u=e("../utils/checkBucketName");r.deleteBucketLifecycle=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],18:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"logging",r),n.successStatuses=[204,200],e.next=6,this.request(n);case 6:return i=e.sent,e.abrupt("return",{res:i.res});case 8:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketLogging=void 0;var u=e("../utils/checkBucketName");r.deleteBucketLogging=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],19:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"policy",r),n.successStatuses=[204],e.next=6,this.request(n);case 6:return i=e.sent,e.abrupt("return",{status:i.status,res:i.res});case 8:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketPolicy=void 0;var u=e("../utils/checkBucketName");r.deleteBucketPolicy=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],20:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},u.checkBucketName(t),e.next=4,c.putBucketReferer.call(this,t,!0,null,r);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketReferer=void 0;var u=e("../utils/checkBucketName"),c=e("./putBucketReferer");r.deleteBucketReferer=n},{"../utils/checkBucketName":120,"./putBucketReferer":51,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],21:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"tagging",r),n.successStatuses=[204],e.next=6,this.request(n);case 6:return i=e.sent,e.abrupt("return",{status:i.status,res:i.res});case 8:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketTags=void 0;var u=e("../utils/checkBucketName");r.deleteBucketTags=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],22:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("DELETE",t,"website",r),n.successStatuses=[204],e.next=6,this.request(n);case 6:return i=e.sent,e.abrupt("return",{res:i.res});case 8:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteBucketWebsite=void 0;var u=e("../utils/checkBucketName");r.deleteBucketWebsite=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],23:[function(e,t,r){"use strict";function n(e,t,r){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r,n){var i,o,a,l,f=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=f.length>3&&void 0!==f[3]?f[3]:{},u.checkBucketName(t),o=this._bucketRequestParams("POST",t,{wormExtend:"",wormId:r},i),a={ExtendWormConfiguration:{RetentionPeriodInDays:n}},o.mime="xml",o.content=c.obj2xml(a,{headers:!0}),o.successStatuses=[200],e.next=9,this.request(o);case 9:return l=e.sent,e.abrupt("return",{res:l.res,status:l.status});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.extendBucketWorm=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.extendBucketWorm=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],24:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"acl",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,e.abrupt("return",{acl:i.data.AccessControlList.Grant,owner:{id:i.data.Owner.ID,displayName:i.data.Owner.DisplayName},res:i.res});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketACL=void 0;var u=e("../utils/checkBucketName");r.getBucketACL=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],25:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>1&&void 0!==l[1]?l[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"cors",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=[],i.data&&i.data.CORSRule&&(a=i.data.CORSRule,c.isArray(a)||(a=[a]),a.forEach(function(e){var t={};Object.keys(e).forEach(function(r){t[r.slice(0,1).toLowerCase()+r.slice(1,r.length)]=e[r]}),o.push(t)})),e.abrupt("return",{rules:o,res:i.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/web.dom-collections.for-each");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketCORS=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/isArray");r.getBucketCORS=n},{"../utils/checkBucketName":120,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.slice":344,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],26:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"encryption",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=i.data.ApplyServerSideEncryptionByDefault,e.abrupt("return",{encryption:o,status:i.status,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketEncryption=void 0;var u=e("../utils/checkBucketName");r.getBucketEncryption=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],27:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),t=t||this.options.bucket,n=this._bucketRequestParams("GET",t,"bucketInfo",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=8,this.request(n);case 8:return i=e.sent,e.abrupt("return",{bucket:i.data.Bucket,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketInfo=void 0;var u=e("../utils/checkBucketName");r.getBucketInfo=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161, -"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],28:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:{},i=Object.assign({inventory:"",inventoryId:r},n.subres),u.checkBucketName(t),o=this._bucketRequestParams("GET",t,i,n),o.successStatuses=[200],o.xmlResponse=!0,e.next=8,this.request(o);case 8:return a=e.sent,e.abrupt("return",{status:a.status,res:a.res,inventory:c.formatInventoryConfig(a.data)});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketInventory=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/formatInventoryConfig");r.getBucketInventory=n},{"../utils/checkBucketName":120,"../utils/formatInventoryConfig":132,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],29:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"lifecycle",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=i.data.Rule||null,o&&(c.isArray(o)||(o=[o]),o=o.map(function(e){return e.ID&&(e.id=e.ID,delete e.ID),e.Tag&&!c.isArray(e.Tag)&&(e.Tag=[e.Tag]),l.formatObjKey(e,"firstLowerCase")})),e.abrupt("return",{rules:o,res:i.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketLifecycle=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/isArray"),l=e("../utils/formatObjKey");r.getBucketLifecycle=n},{"../utils/checkBucketName":120,"../utils/formatObjKey":133,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"regenerator-runtime/runtime":434}],30:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),t=t||this.options.bucket,n=this._bucketRequestParams("GET",t,"location",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=8,this.request(n);case 8:return i=e.sent,e.abrupt("return",{location:i.data,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketLocation=void 0;var u=e("../utils/checkBucketName");r.getBucketLocation=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],31:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"logging",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=i.data.LoggingEnabled,e.abrupt("return",{enable:!!o,prefix:o&&o.TargetPrefix||null,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketLogging=void 0;var u=e("../utils/checkBucketName");r.getBucketLogging=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],32:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"policy",r),e.next=5,this.request(n);case 5:return i=e.sent,n.successStatuses=[200],o=null,200===i.res.status&&(o=JSON.parse(i.res.data.toString())),e.abrupt("return",{policy:o,status:i.status,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketPolicy=void 0;var u=e("../utils/checkBucketName");r.getBucketPolicy=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"regenerator-runtime/runtime":434}],33:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"referer",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=i.data.RefererList.Referer||null,o&&(c.isArray(o)||(o=[o])),e.abrupt("return",{allowEmpty:"true"===i.data.AllowEmptyReferer,referers:o,res:i.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketReferer=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/isArray");r.getBucketReferer=n},{"../utils/checkBucketName":120,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],34:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"requestPayment",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,e.abrupt("return",{status:i.status,res:i.res,payer:i.data.Payer});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketRequestPayment=void 0;var u=e("../utils/checkBucketName");r.getBucketRequestPayment=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],35:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"tagging",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=i.data,e.abrupt("return",{status:i.status,res:i.res,tag:c.formatTag(o)});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketTags=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/formatTag");r.getBucketTags=n},{"../utils/checkBucketName":120,"../utils/formatTag":135,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],36:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"versioning",r),n.xmlResponse=!0,n.successStatuses=[200],e.next=7,this.request(n);case 7:return i=e.sent,o=i.data.Status,e.abrupt("return",{status:i.status,versionStatus:o,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketVersioning=void 0;var u=e("../utils/checkBucketName");r.getBucketVersioning=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],37:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"website",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,o=[],i.data.RoutingRules&&i.data.RoutingRules.RoutingRule&&(o=c.isObject(i.data.RoutingRules.RoutingRule)?[i.data.RoutingRules.RoutingRule]:i.data.RoutingRules.RoutingRule),e.abrupt("return",{index:i.data.IndexDocument&&i.data.IndexDocument.Suffix||"",supportSubDir:i.data.IndexDocument&&i.data.IndexDocument.SupportSubDir||"false",type:i.data.IndexDocument&&i.data.IndexDocument.Type,routingRules:o,error:i.data.ErrorDocument&&i.data.ErrorDocument.Key||null,res:i.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketWebsite=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/isObject");r.getBucketWebsite=n},{"../utils/checkBucketName":120,"../utils/isObject":147,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],38:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},u.checkBucketName(t),n=this._bucketRequestParams("GET",t,"worm",r),n.successStatuses=[200],n.xmlResponse=!0,e.next=7,this.request(n);case 7:return i=e.sent,c.dataFix(i.data,{lowerFirst:!0,rename:{RetentionPeriodInDays:"days"}}),e.abrupt("return",Object.assign(Object.assign({},i.data),{res:i.res,status:i.status}));case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketWorm=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/dataFix");r.getBucketWorm=n},{"../utils/checkBucketName":120,"../utils/dataFix":125,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],39:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./abortBucketWorm"),i=e("./completeBucketWorm"),o=e("./deleteBucket"),s=e("./deleteBucketCORS"),a=e("./deleteBucketEncryption"),u=e("./deleteBucketInventory"),c=e("./deleteBucketLifecycle"),l=e("./deleteBucketLogging"),f=e("./deleteBucketPolicy"),p=e("./deleteBucketReferer"),d=e("./deleteBucketTags"),h=e("./deleteBucketWebsite"),m=e("./extendBucketWorm"),b=e("./getBucketACL"),y=e("./getBucketCORS"),g=e("./getBucketEncryption"),v=e("./getBucketInfo"),j=e("./getBucketInventory"),w=e("./getBucketLifecycle"),x=e("./getBucketLocation"),k=e("./getBucketLogging"),_=e("./getBucketPolicy"),S=e("./getBucketReferer"),E=e("./getBucketRequestPayment"),O=e("./getBucketTags"),T=e("./getBucketVersioning"),R=e("./getBucketWebsite"),A=e("./getBucketWorm"),P=e("./initiateBucketWorm"),B=e("./listBucketInventory"),M=e("./listBuckets"),C=e("./putBucket"),N=e("./putBucketACL"),q=e("./putBucketCORS"),I=e("./putBucketEncryption"),L=e("./putBucketInventory"),D=e("./putBucketLifecycle"),U=e("./putBucketLogging"),G=e("./putBucketPolicy"),F=e("./putBucketReferer"),W=e("./putBucketRequestPayment"),H=e("./putBucketTags"),z=e("./putBucketVersioning"),V=e("./putBucketWebsite");r.default={abortBucketWorm:n.abortBucketWorm,completeBucketWorm:i.completeBucketWorm,deleteBucket:o.deleteBucket,deleteBucketCORS:s.deleteBucketCORS,deleteBucketEncryption:a.deleteBucketEncryption,deleteBucketInventory:u.deleteBucketInventory,deleteBucketLifecycle:c.deleteBucketLifecycle,deleteBucketLogging:l.deleteBucketLogging,deleteBucketPolicy:f.deleteBucketPolicy,deleteBucketReferer:p.deleteBucketReferer,deleteBucketTags:d.deleteBucketTags,deleteBucketWebsite:h.deleteBucketWebsite,extendBucketWorm:m.extendBucketWorm,getBucketACL:b.getBucketACL,getBucketCORS:y.getBucketCORS,getBucketEncryption:g.getBucketEncryption,getBucketInfo:v.getBucketInfo,getBucketInventory:j.getBucketInventory,getBucketLifecycle:w.getBucketLifecycle,getBucketLocation:x.getBucketLocation,getBucketLogging:k.getBucketLogging,getBucketPolicy:_.getBucketPolicy,getBucketReferer:S.getBucketReferer,getBucketRequestPayment:E.getBucketRequestPayment,getBucketTags:O.getBucketTags,getBucketVersioning:T.getBucketVersioning,getBucketWebsite:R.getBucketWebsite,getBucketWorm:A.getBucketWorm,initiateBucketWorm:P.initiateBucketWorm,listBucketInventory:B.listBucketInventory,listBuckets:M.listBuckets,putBucket:C.putBucket,putBucketACL:N.putBucketACL,putBucketCORS:q.putBucketCORS,putBucketEncryption:I.putBucketEncryption,putBucketInventory:L.putBucketInventory,putBucketLifecycle:D.putBucketLifecycle,putBucketLogging:U.putBucketLogging,putBucketPolicy:G.putBucketPolicy,putBucketReferer:F.putBucketReferer,putBucketRequestPayment:W.putBucketRequestPayment,putBucketTags:H.putBucketTags,putBucketVersioning:z.putBucketVersioning,putBucketWebsite:V.putBucketWebsite}},{"./abortBucketWorm":11,"./completeBucketWorm":12,"./deleteBucket":13,"./deleteBucketCORS":14,"./deleteBucketEncryption":15,"./deleteBucketInventory":16,"./deleteBucketLifecycle":17,"./deleteBucketLogging":18,"./deleteBucketPolicy":19,"./deleteBucketReferer":20,"./deleteBucketTags":21,"./deleteBucketWebsite":22,"./extendBucketWorm":23,"./getBucketACL":24,"./getBucketCORS":25,"./getBucketEncryption":26,"./getBucketInfo":27,"./getBucketInventory":28,"./getBucketLifecycle":29,"./getBucketLocation":30,"./getBucketLogging":31,"./getBucketPolicy":32,"./getBucketReferer":33,"./getBucketRequestPayment":34,"./getBucketTags":35,"./getBucketVersioning":36,"./getBucketWebsite":37,"./getBucketWorm":38,"./initiateBucketWorm":40,"./listBucketInventory":41,"./listBuckets":42,"./putBucket":43,"./putBucketACL":44,"./putBucketCORS":45,"./putBucketEncryption":46,"./putBucketInventory":47,"./putBucketLifecycle":48,"./putBucketLogging":49,"./putBucketPolicy":50,"./putBucketReferer":51,"./putBucketRequestPayment":52,"./putBucketTags":53,"./putBucketVersioning":54,"./putBucketWebsite":55}],40:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:{},c.checkBucketName(t),i=this._bucketRequestParams("POST",t,"worm",n),o={InitiateWormConfiguration:{RetentionPeriodInDays:r}},i.mime="xml",i.content=u.obj2xml(o,{headers:!0}),i.successStatuses=[200],e.next=9,this.request(i);case 9:return a=e.sent,e.abrupt("return",{res:a.res,wormId:a.res.headers["x-oss-worm-id"],status:a.status});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.initiateBucketWorm=void 0;var u=e("../utils/obj2xml"),c=e("../utils/checkBucketName");r.initiateBucketWorm=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],41:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,l,f,p,d=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>1&&void 0!==d[1]?d[1]:{},n=r.continuationToken,i=Object.assign({inventory:""},n&&{"continuation-token":n},r.subres),u.checkBucketName(t),o=this._bucketRequestParams("GET",t,i,r),o.successStatuses=[200],o.xmlResponse=!0,e.next=9,this.request(o);case 9:return a=e.sent,l=a.data,f=a.res,p=a.status,e.abrupt("return",{isTruncated:"true"===l.IsTruncated,nextContinuationToken:l.NextContinuationToken,inventoryList:c.formatInventoryConfig(l.InventoryConfiguration,!0),status:p,res:f});case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.listBucketInventory=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/formatInventoryConfig");r.listBucketInventory=n},{"../utils/checkBucketName":120,"../utils/formatInventoryConfig":132,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],42:[function(e,t,r){"use strict";function n(){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(){var t,r,n,i,o,a,l,f,p,d,h=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=h.length>0&&void 0!==h[0]?h[0]:{},r=h.length>1&&void 0!==h[1]?h[1]:{},n=t.subres,i=void 0===n?{}:n,o={};for(a in t)"subres"!==a&&(o[a]=t[a]);return l=this._bucketRequestParams("GET","",Object.assign(i,r.subres),r),l.xmlResponse=!0,l.query=o||{},e.next=10,this.request(l);case 10:if(f=e.sent,200!==f.status){e.next=16;break}return p=f.data,d=p.Buckets||null,d&&(d.Bucket&&(d=d.Bucket),u.isArray(d)||(d=[d]),d=d.map(function(e){return{name:e.Name,region:e.Location,creationDate:e.CreationDate,StorageClass:e.StorageClass,tag:c.formatTag(e)}})),e.abrupt("return",{buckets:d,owner:{id:p.Owner.ID,displayName:p.Owner.DisplayName},isTruncated:"true"===p.IsTruncated,nextMarker:p.NextMarker||null,res:f.res});case 16:return e.next=18,this.requestError(f);case 18:throw e.sent;case 19:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map"),e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.listBuckets=void 0;var u=e("../utils/isArray"),c=e("../utils/formatTag");r.listBuckets=n},{"../utils/formatTag":135,"../utils/isArray":142,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],43:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,l,f,p,d,h,m,b=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:{},u.checkBucketName(t,!0),r=r||{},n=this._bucketRequestParams("PUT",t,"",r),i={},o={CreateBucketConfiguration:i},a=r.StorageClass||r.storageClass,l=r.DataRedundancyType||r.dataRedundancyType,(a||l)&&(a&&(i.StorageClass=a),l&&(i.DataRedundancyType=l),n.mime="xml",n.content=c.obj2xml(o,{headers:!0})),f=r,p=f.acl,d=f.headers,h=void 0===d?{}:d,p&&(h["x-oss-acl"]=p),n.headers=h,n.successStatuses=[200],e.next=15,this.request(n);case 15:return m=e.sent,e.abrupt("return",{bucket:m.headers.location&&m.headers.location.substring(1)||null,res:m.res});case 17:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucket=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.putBucket=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],44:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},u.checkBucketName(t),i=this._bucketRequestParams("PUT",t,"acl",n),i.headers={"x-oss-acl":r},i.successStatuses=[200],e.next=7,this.request(i);case 7:return o=e.sent,e.abrupt("return",{bucket:o.headers.location&&o.headers.location.substring(1)||null,res:o.res});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketACL=void 0;var u=e("../utils/checkBucketName");r.putBucketACL=n},{"../utils/checkBucketName":120,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],45:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,l,f=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:[],n=f.length>2&&void 0!==f[2]?f[2]:{},u.checkBucketName(t),r.length){e.next=5;break}throw new Error("rules is required");case 5:return r.forEach(function(e){if(!e.allowedOrigin)throw new Error("allowedOrigin is required");if(!e.allowedMethod)throw new Error("allowedMethod is required")}),i=this._bucketRequestParams("PUT",t,"cors",n),o=r.map(function(e){var t={AllowedOrigin:e.allowedOrigin,AllowedMethod:e.allowedMethod,AllowedHeader:e.allowedHeader||"",ExposeHeader:e.exposeHeader||""};return e.maxAgeSeconds&&(t.MaxAgeSeconds=e.maxAgeSeconds),t}),a={CORSConfiguration:{CORSRule:o}},i.content=c.obj2xml(a,{headers:!0}),i.mime="xml",i.successStatuses=[200],e.next=14,this.request(i);case 14:return l=e.sent,e.abrupt("return",{res:l.res});case 16:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.map"),e("core-js/modules/web.dom-collections.for-each");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketCORS=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.putBucketCORS=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.map":343,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],46:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.checkBucketName(t),n=this._bucketRequestParams("PUT",t,"encryption",r),n.successStatuses=[200],i={ServerSideEncryptionRule:{ApplyServerSideEncryptionByDefault:{SSEAlgorithm:r.SSEAlgorithm}}},void 0!==r.KMSMasterKeyID&&(i.ServerSideEncryptionRule.ApplyServerSideEncryptionByDefault.KMSMasterKeyID=r.KMSMasterKeyID),o=c.obj2xml(i,{headers:!0}),n.mime="xml",n.content=o,e.next=10,this.request(n);case 10:return a=e.sent,e.abrupt("return",{status:a.status,res:a.res});case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketEncryption=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.putBucketEncryption=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],47:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,l,f,p,d,h,m,b,y=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=y.length>2&&void 0!==y[2]?y[2]:{},i=Object.assign({inventory:"",inventoryId:r.id},n.subres),u.checkBucketName(t),o=r.OSSBucketDestination,a=r.optionalFields,l=r.includedObjectVersions,f="acs:oss:::",p="acs:ram::".concat(o.accountId,":role/"),d={InventoryConfiguration:{Id:r.id,IsEnabled:r.isEnabled,Filter:{Prefix:r.prefix||""},Destination:{OSSBucketDestination:{Format:o.format,AccountId:o.accountId,RoleArn:"".concat(p).concat(o.rolename),Bucket:"".concat(f).concat(o.bucket),Prefix:o.prefix||"",Encryption:o.encryption||""}},Schedule:{Frequency:r.frequency},IncludedObjectVersions:l,OptionalFields:{Field:(null===a||void 0===a?void 0:a.field)||[]}}},h=c.obj2xml(d,{headers:!0,firstUpperCase:!0}),m=this._bucketRequestParams("PUT",t,i,n),m.successStatuses=[200],m.mime="xml",m.content=h,e.next=14,this.request(m);case 14:return b=e.sent,e.abrupt("return",{status:b.status,res:b.res});case 16:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketInventory=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.putBucketInventory=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],48:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,f.default)(l.default.mark(function e(t,r){var n,i,s,a,c,f,m=arguments;return l.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>2&&void 0!==m[2]?m[2]:{},p.checkBucketName(t),d.isArray(r)){e.next=4;break}throw new Error("rules must be Array");case 4:return i=this._bucketRequestParams("PUT",t,"lifecycle",n),s=[],a={LifecycleConfiguration:{Rule:s}},r.forEach(function(e){o(e),u(e);var t=h.deepCopy(e);t.id&&(t.ID=t.id,delete t.id),s.push(t)}),c=b.obj2xml(a,{headers:!0,firstUpperCase:!0}),i.content=c,i.mime="xml",i.successStatuses=[200],e.next=14,this.request(i);case 14:return f=e.sent,e.abrupt("return",{res:f.res});case 16:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}function o(e){e.days&&(e.expiration={days:e.days}),e.date&&(e.expiration={createdBeforeDate:e.date})}function s(e,t){var r=e.days,n=e.createdBeforeDate;if(!r&&!n)throw new Error("".concat(t," must includes days or createdBeforeDate"));if(r&&!/^[1-9][0-9]*$/.test(r))throw new Error("days must be a positive integer");if(n&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(n))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function a(e){if(!d.isArray(e)&&!m.isObject(e))throw new Error("tag must be Object or Array");e=m.isObject(e)?[e]:e;var t={};h.deepCopy(e).forEach(function(e){t[e.key]=e.value}),y.checkObjectTag(t)}function u(e){if(e.id&&g.getStrBytesCount(e.id)>255)throw new Error("ID is composed of 255 bytes at most");if(void 0===e.prefix)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(e.status))throw new Error("Status must be Enabled or Disabled");if(e.transition){if(!["IA","Archive"].includes(e.transition.storageClass))throw new Error("StorageClass must be IA or Archive");s(e.transition,"Transition")}if(e.expiration)if(e.expiration.expiredObjectDeleteMarker){ -if(e.expiration.days||e.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}else s(e.expiration,"Expiration");if(e.abortMultipartUpload&&s(e.abortMultipartUpload,"AbortMultipartUpload"),!(e.expiration||e.abortMultipartUpload||e.transition||e.noncurrentVersionTransition))throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(e.tag){if(e.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");a(e.tag)}}var c=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/web.dom-collections.for-each");var l=c(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var f=c(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketLifecycle=void 0;var p=e("../utils/checkBucketName"),d=e("../utils/isArray"),h=e("../utils/deepCopy"),m=e("../utils/isObject"),b=e("../utils/obj2xml"),y=e("../utils/checkObjectTag"),g=e("../utils/getStrBytesCount");r.putBucketLifecycle=n},{"../utils/checkBucketName":120,"../utils/checkObjectTag":122,"../utils/deepCopy":126,"../utils/getStrBytesCount":140,"../utils/isArray":142,"../utils/isObject":147,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],49:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>1&&void 0!==l[1]?l[1]:"",n=l.length>2&&void 0!==l[2]?l[2]:{},u.checkBucketName(t),i=this._bucketRequestParams("PUT",t,"logging",n),o={BucketLoggingStatus:{LoggingEnabled:{TargetBucket:t,TargetPrefix:r}}},i.content=c.obj2xml(o,{headers:!0}),i.mime="xml",i.successStatuses=[200],e.next=10,this.request(i);case 10:return a=e.sent,e.abrupt("return",{res:a.res});case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketLogging=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.putBucketLogging=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],50:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>2&&void 0!==a[2]?a[2]:{},u.checkBucketName(t),l.isObject(r)){e.next=4;break}throw new Error("policy is not Object");case 4:return i=this._bucketRequestParams("PUT",t,"policy",n),i.content=c.policy2Str(r),i.successStatuses=[200],e.next=9,this.request(i);case 9:return o=e.sent,e.abrupt("return",{status:o.status,res:o.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketPolicy=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/policy2Str"),l=e("../utils/isObject");r.putBucketPolicy=n},{"../utils/checkBucketName":120,"../utils/isObject":147,"../utils/policy2Str":153,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],51:[function(e,t,r){"use strict";function n(e,t,r){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r,n){var i,o,a,l,f=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=f.length>3&&void 0!==f[3]?f[3]:{},u.checkBucketName(t),o=this._bucketRequestParams("PUT",t,"referer",i),a={RefererConfiguration:{AllowEmptyReferer:r?"true":"false",RefererList:n&&n.length>0?{Referer:n}:""}},o.content=c.obj2xml(a),o.mime="xml",o.successStatuses=[200],e.next=9,this.request(o);case 9:return l=e.sent,e.abrupt("return",{res:l.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketReferer=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml");r.putBucketReferer=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],52:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,f,p=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>2&&void 0!==p[2]?p[2]:{},r&&!(l.indexOf(r)<0)){e.next=3;break}throw new Error("payer must be BucketOwner or Requester");case 3:return u.checkBucketName(t),i=this._bucketRequestParams("PUT",t,"requestPayment",n),i.successStatuses=[200],o={RequestPaymentConfiguration:{Payer:r}},a=c.obj2xml(o,{headers:!0}),i.mime="xml",i.content=a,e.next=12,this.request(i);case 12:return f=e.sent,e.abrupt("return",{status:f.status,res:f.res});case 14:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.index-of");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketRequestPayment=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml"),l=["BucketOwner","Requester"];r.putBucketRequestPayment=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.index-of":339,"regenerator-runtime/runtime":434}],53:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,f=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>2&&void 0!==f[2]?f[2]:{},u.checkBucketName(t),l.checkBucketTag(r),i=this._bucketRequestParams("PUT",t,"tagging",n),i.successStatuses=[200],r=Object.keys(r).map(function(e){return{Key:e,Value:r[e]}}),o={Tagging:{TagSet:{Tag:r}}},i.mime="xml",i.content=c.obj2xml(o),e.next=11,this.request(i);case 11:return a=e.sent,e.abrupt("return",{res:a.res,status:a.status});case 13:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map"),e("core-js/modules/es.object.keys");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketTags=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml"),l=e("../utils/checkBucketTag");r.putBucketTags=n},{"../utils/checkBucketName":120,"../utils/checkBucketTag":121,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.object.keys":351,"regenerator-runtime/runtime":434}],54:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.length>2&&void 0!==l[2]?l[2]:{},c.checkBucketName(t),["Enabled","Suspended"].includes(r)){e.next=4;break}throw new Error("status must be Enabled or Suspended");case 4:return i=this._bucketRequestParams("PUT",t,"versioning",n),o={VersioningConfiguration:{Status:r}},i.mime="xml",i.content=u.obj2xml(o,{headers:!0}),e.next=10,this.request(i);case 10:return a=e.sent,e.abrupt("return",{res:a.res,status:a.status});case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.includes");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketVersioning=void 0;var u=e("../utils/obj2xml"),c=e("../utils/checkBucketName");r.putBucketVersioning=n},{"../utils/checkBucketName":120,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.includes":338,"regenerator-runtime/runtime":434}],55:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,f,p,d=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=d.length>1&&void 0!==d[1]?d[1]:{index:"index.html"},n=d.length>2&&void 0!==d[2]?d[2]:{},u.checkBucketName(t),i=this._bucketRequestParams("PUT",t,"website",n),o={Suffix:r.index||"index.html"},a={IndexDocument:o},f={WebsiteConfiguration:a},r.supportSubDir&&(o.SupportSubDir=r.supportSubDir),r.type&&(o.Type=r.type),r.error&&(a.ErrorDocument={Key:r.error}),void 0===r.routingRules){e.next=14;break}if(l.isArray(r.routingRules)){e.next=13;break}throw new Error("RoutingRules must be Array");case 13:a.RoutingRules={RoutingRule:r.routingRules};case 14:return f=c.obj2xml(f),i.content=f,i.mime="xml",i.successStatuses=[200],e.next=20,this.request(i);case 20:return p=e.sent,e.abrupt("return",{res:p.res});case 22:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putBucketWebsite=void 0;var u=e("../utils/checkBucketName"),c=e("../utils/obj2xml"),l=e("../utils/isArray");r.putBucketWebsite=n},{"../utils/checkBucketName":120,"../utils/isArray":142,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],56:[function(e,t,r){"use strict";function n(e,t,r,n){return{method:e,bucket:t,subres:r,timeout:n&&n.timeout,ctx:n&&n.ctx}}Object.defineProperty(r,"__esModule",{value:!0}),r._bucketRequestParams=void 0,r._bucketRequestParams=n},{}],57:[function(e,t,r){"use strict";function n(e){return e.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")}e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r._checkUserAgent=void 0,r._checkUserAgent=n},{"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],58:[function(e,t,r){(function(t){"use strict";function n(e,t){return e[t]||e[t.toLowerCase()]}function i(e,t){delete e[t],delete e[t.toLowerCase()]}function o(e){var r=new Date;this.options.amendTimeSkewed&&(r=+new Date+this.options.amendTimeSkewed);var o={"x-oss-date":c.default(r,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(o["User-Agent"]=this.userAgent),this.options.isRequestPay&&Object.assign(o,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(o["x-oss-security-token"]=this.options.stsToken),l.default(e.headers).to(o),n(o,"Content-Type")||(e.mime&&e.mime.indexOf("/")>0?o["Content-Type"]=e.mime:o["Content-Type"]=u.default.getType(e.mime||f.default.extname(e.object||""))),n(o,"Content-Type")||i(o,"Content-Type"),e.content&&(o["Content-Md5"]||(o["Content-Md5"]=a.default.createHash("md5").update(t.from(e.content,"utf8")).digest("base64")),o["Content-Length"]||(o["Content-Length"]=e.content.length));var s=Object.prototype.hasOwnProperty;for(var p in o)o[p]&&s.call(o,p)&&(o[p]=b.encoder(String(o[p]),this.options.headerEncoding));var j=d.getResource(e,this.options.headerEncoding);o.authorization=h.authorization(e.method,j,e.subres,o,this.options,this.options.headerEncoding);var w=m.getReqUrl(e,this.options);if(y.isIP(this.options.endpoint.hostname)){var x=this.options,k=x.region,_=x.internal,S=x.secure,E=g.setRegion(k,_,S);o.host="".concat(e.bucket,".").concat(E.host)}v("request %s %s, with headers %j, !!stream: %s",e.method,w,o,!!e.stream);var O=e.timeout||this.options.timeout,T={method:e.method,content:e.content,stream:e.stream,headers:o,timeout:O,writeStream:e.writeStream,customResponse:e.customResponse,ctx:e.ctx||this.ctx};return this.agent&&(T.agent=this.agent),this.httpsAgent&&(T.httpsAgent=this.httpsAgent),T.enableProxy=!!this.options.enableProxy,T.proxy=this.options.proxy?this.options.proxy:null,{url:w,params:T}}e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.string.includes");var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r._createRequest=void 0;var a=s(e("./../../../shims/crypto/crypto.js")),u=s(e("mime")),c=s(e("dateformat")),l=s(e("copy-to")),f=s(e("path")),p=s(e("debug")),d=e("../utils/getResource"),h=e("../utils/authorization"),m=e("../utils/getReqUrl"),b=e("../utils/encoder"),y=e("../utils/isIP"),g=e("./initOptions"),v=p.default("ali-oss");r._createRequest=o}).call(this,e("buffer").Buffer)},{"../utils/authorization":118,"../utils/encoder":130,"../utils/getReqUrl":137,"../utils/getResource":138,"../utils/isIP":146,"./../../../shims/crypto/crypto.js":444,"./initOptions":66,buffer:196,"copy-to":199,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.includes":338,"core-js/modules/es.array.index-of":339,"core-js/modules/es.object.assign":349,"core-js/modules/es.string.includes":357,dateformat:393,debug:448,mime:411,path:414}],59:[function(e,t,r){"use strict";function n(e){var t=this._escape||f.escapeName,r={};l.checkValidEndpoint(this.options.endpoint),s.default(this.options.endpoint).to(r);var n=c.isIP(r.hostname),i=this.options.cname;!e.bucket||i||n||this.options.sldEnable||(r.host="".concat(e.bucket,".").concat(r.host));var p="/";e.bucket&&this.options.sldEnable&&(p+="".concat(e.bucket,"/")),e.object&&(p+=t(e.object).replace(/\+/g,"%2B")),r.pathname=p;var d={};if(e.query&&a.default(d,e.query),e.subres){var h={};u.default.string(e.subres)?h[e.subres]="":u.default.array(e.subres)?e.subres.forEach(function(e){h[e]=""}):h=e.subres,a.default(d,h)}return r.query=d,o.default.format(r)}e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.for-each");var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r._getReqUrl=void 0;var o=i(e("url")),s=i(e("copy-to")),a=i(e("merge-descriptors")),u=i(e("is-type-of")),c=e("../utils/isIP"),l=e("../utils/checkValid"),f=e("../utils/escapeName");r._getReqUrl=n},{"../utils/checkValid":123,"../utils/escapeName":131,"../utils/isIP":146,"copy-to":199,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391,"is-type-of":449,"merge-descriptors":409,url:452}],60:[function(e,t,r){(function(t){"use strict";function n(){var e=t&&t.browser?"js":"nodejs",r="aliyun-sdk-".concat(e,"/").concat(s.version),n=o.default.description;return!n&&t&&(n="Node.js ".concat(t.version.slice(1)," on ").concat(t.platform," ").concat(t.arch)),a._checkUserAgent("".concat(r," ").concat(n))}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice");var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r._getUserAgent=void 0;var o=i(e("platform")),s=e("../../browser/version"),a=e("./_checkUserAgent");r._getUserAgent=n}).call(this,e("_process"))},{"../../browser/version":10,"./_checkUserAgent":57,_process:451,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.slice":344,"core-js/modules/es.symbol":366,"core-js/modules/es.symbol.description":365,platform:450}],61:[function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.options.bucket;if(!n)throw new Error("Please create a bucket first");t=s.objectName(t);var i={object:t,bucket:n,method:e,subres:r&&r.subres,timeout:r&&r.timeout,ctx:r&&r.ctx};return r.headers&&(i.headers={},o.default(r.headers).to(i.headers)),i}var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r._objectRequestParams=void 0;var o=i(e("copy-to")),s=e("../utils/objectName");r._objectRequestParams=n},{"../utils/objectName":150,"copy-to":199}],62:[function(e,t,r){"use strict";function n(){this.options.cancelFlag=!0}Object.defineProperty(r,"__esModule",{value:!0}),r._stop=void 0,r._stop=n},{}],63:[function(e,t,r){"use strict";function n(e){this.options.cancelFlag=!0,o.isArray(this.multipartUploadStreams)&&this.multipartUploadStreams.forEach(function(e){if(!1===e.destroyed){var t={name:"cancel",message:"multipartUpload cancel"};e.destroy(t)}}),this.multipartUploadStreams=[],e&&i.abortMultipartUpload.call(this,e.name,e.uploadId,e.options)}e("core-js/modules/es.array.for-each"),e("core-js/modules/es.function.name"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.cancel=void 0;var i=e("../multipart/abortMultipartUpload"),o=e("../utils/isArray");r.cancel=n},{"../multipart/abortMultipartUpload":76,"../utils/isArray":142,"core-js/modules/es.array.for-each":336,"core-js/modules/es.function.name":347,"core-js/modules/web.dom-collections.for-each":391}],64:[function(e,t,r){"use strict";function n(){return this.options.bucket}Object.defineProperty(r,"__esModule",{value:!0}),r.getBucket=void 0,r.getBucket=n},{}],65:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./_bucketRequestParams"),i=e("./_checkUserAgent"),o=e("./_createRequest"),s=e("./_getReqUrl"),a=e("./_getUserAgent"),u=e("./_objectRequestParams"),c=e("./_stop"),l=e("./cancel"),f=e("./getBucket"),p=e("./isCancel"),d=e("./request"),h=e("./requestError"),m=e("./resetCancelFlag"),b=e("./setBucket"),y=e("./setSLDEnabled"),g=e("./signature");r.default={_bucketRequestParams:n._bucketRequestParams,_checkUserAgent:i._checkUserAgent,_createRequest:o._createRequest,_getReqUrl:s._getReqUrl,_getUserAgent:a._getUserAgent,_objectRequestParams:u._objectRequestParams,_stop:c._stop,cancel:l.cancel,getBucket:f.getBucket,isCancel:p.isCancel,request:d.request,requestError:h.requestError,resetCancelFlag:m.resetCancelFlag,setBucket:b.setBucket,useBucket:b.setBucket,setSLDEnabled:y.setSLDEnabled,signature:g.signature}},{"./_bucketRequestParams":56,"./_checkUserAgent":57,"./_createRequest":58,"./_getReqUrl":59,"./_getUserAgent":60,"./_objectRequestParams":61,"./_stop":62,"./cancel":63,"./getBucket":64,"./isCancel":67,"./request":68,"./requestError":69,"./resetCancelFlag":70,"./setBucket":71,"./setSLDEnabled":72,"./signature":73}],66:[function(e,t,r){"use strict";function n(e,t){f.checkValidEndpoint(e);var r=c.default.parse(e);if(r.protocol||(r=c.default.parse("http".concat(t?"s":"","://").concat(e))),"http:"!==r.protocol&&"https:"!==r.protocol)throw new Error("Endpoint protocol must be http or https.");return r}function i(e,t,r){f.checkValidRegion(e);var n=r?"https://":"http://",i=t?"-internal.aliyuncs.com":".aliyuncs.com";return"vpc100-oss-cn-"===e.substr(0,"vpc100-oss-cn-".length)&&(i=".aliyuncs.com"),c.default.parse(n+e+i)}function o(){var e=!1;try{e=location&&"https:"===location.protocol}catch(e){}return e}function s(e){if(!e||!e.accessKeyId||!e.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");e.bucket&&l.checkBucketName(e.bucket);var t=Object.assign({region:"oss-cn-hangzhou",internal:!1,secure:o(),timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1,useFetch:!1,headerEncoding:"utf-8",amendTimeSkewed:0,refreshSTSToken:null,enableProxy:!1,proxy:null},e);if(t.accessKeyId=t.accessKeyId.trim(),t.accessKeySecret=t.accessKeySecret.trim(),t.timeout&&(t.timeout=u.default(t.timeout)),t.endpoint)t.endpoint=n(t.endpoint,t.secure);else{if(!t.region)throw new Error("require options.endpoint or options.region");t.endpoint=i(t.region,t.internal,t.secure)}return t.inited=!0,t}e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.string.trim");var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.initOptions=r.setRegion=void 0;var u=a(e("humanize-ms")),c=a(e("url")),l=e("../utils/checkBucketName"),f=e("../utils/checkValid");r.setRegion=i,r.initOptions=s},{"../utils/checkBucketName":120,"../utils/checkValid":123,"core-js/modules/es.array.concat":332,"core-js/modules/es.object.assign":349,"core-js/modules/es.string.trim":364,"humanize-ms":397,url:452}],67:[function(e,t,r){"use strict";function n(){return this.options.cancelFlag}Object.defineProperty(r,"__esModule",{value:!0}),r.isCancel=void 0,r.isCancel=n},{}],68:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,c.default)(u.default.mark(function e(t){var r,n,i,o,s,a;return u.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._createRequest(t),n=this._getUserAgent().includes("nodejs"),n||this.options.useFetch||(r.params.mode="disable-fetch"),s=!!t.stream,e.prev=4,e.next=7,this.urllib.request(r.url,r.params);case 7:i=e.sent,m("response %s %s, got %s, headers: %j",t.method,r.url,i.status,i.headers),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),o=e.t0;case 14:if(!i||!t.successStatuses||-1!==t.successStatuses.indexOf(i.status)){e.next=26;break}return e.next=17,this.requestError(i);case 17:if(a=e.sent,"RequestTimeTooSkewed"!==a.code||s||n){e.next=23;break}return this.options.amendTimeSkewed=+new Date(a.serverTime)-(new Date).valueOf(),e.next=22,this.request(t);case 22:return e.abrupt("return",e.sent);case 23:a.params=t,e.next=30;break;case 26:if(!o){e.next=30;break}return e.next=29,this.requestError(o);case 29:a=e.sent;case 30:if(!a){e.next=42;break}if(!(this.sendToWormhole&&t.customResponse&&i&&i.res)){e.next=34;break}return e.next=34,this.sendToWormhole(i.res);case 34:if(403!==a.status||"InvalidAccessKeyId"!==a.code||!this.options.accessKeyId.startsWith("STS.")||"function"!=typeof this.options.refreshSTSToken){e.next=40;break}if(this._setOptions&&!(Date.now()-this._setOptions>1e4)){e.next=40;break}return this._setOptions=Date.now(),e.next=39,h.setSTSToken.call(this);case 39:return e.abrupt("return",this.request(t));case 40:throw"ResponseTimeoutError"===a.name&&(a.message="".concat(a.message.split(",")[0],", please increase the timeout or use multipartDownload.")),a;case 42:if(!t.xmlResponse){e.next=46;break}return e.next=45,p.parseXML(i.data);case 45:i.data=e.sent;case 46:return e.abrupt("return",i);case 47:case"end":return e.stop()}},e,this,[[4,11]])})),i.apply(this,arguments)}function o(e){return s.apply(this,arguments)}function s(){return s=(0,c.default)(u.default.mark(function e(t){var r,i,o=this;return u.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!t.stream||t.stream.readable,!this.options.retryMax||!r){e.next=8;break}return i=d.retry(n.bind(this),this.options.retryMax,{errorHandler:function(e){return!!function(e){var t=[-1,-2].includes(e.status),r=o.options.requestErrorRetryHandle||function(){return!0};return t&&r(e)}(e)}}),e.next=5,i(t);case 5:return e.abrupt("return",e.sent);case 8:return e.next=10,n.bind(this)(t);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e,this)})),s.apply(this,arguments)}var a=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.function.name"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.starts-with");var u=a(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var c=a(e("@babel/runtime/helpers/asyncToGenerator")),l=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.request=r._request=void 0;var f=l(e("debug")),p=e("../utils/parseXML"),d=e("../utils/retry"),h=e("../utils/setSTSToken"),m=f.default("ali-oss");r._request=n,r.request=o},{"../utils/parseXML":152,"../utils/retry":154,"../utils/setSTSToken":155,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.includes":338,"core-js/modules/es.array.index-of":339,"core-js/modules/es.function.name":347,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.includes":357,"core-js/modules/es.string.split":362,"core-js/modules/es.string.starts-with":363,debug:448,"regenerator-runtime/runtime":434}],69:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,"ResponseTimeoutError"!==t.name){e.next=6;break}r=new Error(t.message),r.name=t.name,e.next=37;break;case 6:if(t.data&&t.data.length){e.next=10;break}-1===t.status||-2===t.status?(r=new Error(t.message),r.name=t.name,r.status=t.status,r.code=t.name):(404===t.status?(r=new Error("Object not exists"),r.name="NoSuchKeyError",r.status=404,r.code="NoSuchKey"):412===t.status?(r=new Error("Pre condition failed"),r.name="PreconditionFailedError",r.status=412,r.code="PreconditionFailed"):(r=new Error("Unknow error, status: ".concat(t.status)),r.name="UnknowError",r.status=t.status),r.requestId=t.headers["x-oss-request-id"],r.host=""),e.next=37;break;case 10:return n=String(t.data),f("request response error data: %s",n),e.prev=12,e.next=15,l.parseXML(n);case 15:if(e.t0=e.sent,e.t0){e.next=18;break}e.t0={};case 18:i=e.t0,e.next=28;break;case 21:return e.prev=21,e.t1=e.catch(12),f(n),e.t1.message+="\nraw xml: ".concat(n),e.t1.status=t.status,e.t1.requestId=t.headers["x-oss-request-id"],e.abrupt("return",e.t1);case 28:o=i.Message||"unknow request error, status: ".concat(t.status),i.Condition&&(o+=" (condition: ".concat(i.Condition,")")),r=new Error(o),r.name=i.Code?"".concat(i.Code,"Error"):"UnknowError",r.status=t.status,r.code=i.Code,r.requestId=i.RequestId,r.hostId=i.HostId,r.serverTime=i.ServerTime;case 37:return f("generate error %j",r),e.abrupt("return",r);case 39:case"end":return e.stop()}},e,null,[[12,21]])})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.function.name");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.requestError=void 0;var c=u(e("debug")),l=e("../utils/parseXML"),f=c.default("ali-oss");r.requestError=n},{"../utils/parseXML":152,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.function.name":347,debug:448,"regenerator-runtime/runtime":434}],70:[function(e,t,r){"use strict";function n(){this.options.cancelFlag=!1}Object.defineProperty(r,"__esModule",{value:!0}),r.resetCancelFlag=void 0,r.resetCancelFlag=n},{}],71:[function(e,t,r){"use strict";function n(e){return i.checkBucketName(e),this.options.bucket=e,this}Object.defineProperty(r,"__esModule",{value:!0}),r.setBucket=void 0;var i=e("../utils/checkBucketName");r.setBucket=n},{"../utils/checkBucketName":120}],72:[function(e,t,r){"use strict";function n(e){return this.options.sldEnable=!!e,this}Object.defineProperty(r,"__esModule",{value:!0}),r.setSLDEnabled=void 0,r.setSLDEnabled=n},{}],73:[function(e,t,r){"use strict";function n(e){return i.computeSignature(this.options.accessKeySecret,e,this.options.headerEncoding)}Object.defineProperty(r,"__esModule",{value:!0}),r.signature=void 0;var i=e("../utils/signUtils");r.signature=n},{"../utils/signUtils":156}],74:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./processObjectSave");r.default={processObjectSave:n.processObjectSave}},{"./processObjectSave":75}],75:[function(e,t,r){"use strict";function n(e,t,r,n){return i.apply(this,arguments)}function i(){return i=(0,u.default)(a.default.mark(function e(t,r,n,i){var s,u,c,h;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o(t,"sourceObject"),o(r,"targetObject"),o(n,"process"),r=d.objectName(r),i&&p.checkBucketName(i),s=this._objectRequestParams("POST",t,{subres:"x-oss-process"}),u=i?",b_".concat(f.Base64.encode(i)):"",r=f.Base64.encode(r),c={"x-oss-process":"".concat(n,"|sys/saveas,o_").concat(r).concat(u)},s.content=l.default.stringify(c),e.next=12,this.request(s);case 12:return h=e.sent,e.abrupt("return",{res:h.res,status:h.res.status});case 14:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}function o(e,t){if(!e)throw new Error("".concat(t," is required"));if("string"!=typeof e)throw new Error("".concat(t," must be String"))}var s=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.concat");var a=s(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var u=s(e("@babel/runtime/helpers/asyncToGenerator")),c=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.processObjectSave=void 0;var l=c(e("querystring")),f=e("js-base64"),p=e("../utils/checkBucketName"),d=e("../utils/objectName");r.processObjectSave=n},{"../utils/checkBucketName":120,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"js-base64":408,querystring:420,"regenerator-runtime/runtime":434}],76:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,u=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>2&&void 0!==u[2]?u[2]:{},l._stop.call(this),i={},c.default(n).to(i),i.subres={uploadId:r},o=this._objectRequestParams("DELETE",t,i),o.successStatuses=[204],e.next=9,this.request(o);case 9:return a=e.sent,e.abrupt("return",{res:a.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)} -var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.abortMultipartUpload=void 0;var c=u(e("copy-to")),l=e("../client/_stop");r.abortMultipartUpload=n},{"../client/_stop":62,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],77:[function(e,t,r){"use strict";function n(e,t,r){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r,n){var i,o,a,f,p,d,h,m=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=m.length>3&&void 0!==m[3]?m[3]:{},o=n.concat().sort(function(e,t){return e.number-t.number}).filter(function(e,t,r){return!t||e.number!==r[t-1].number}),a={CompleteMultipartUpload:{Part:o.map(function(e){return{PartNumber:e.number,ETag:e.etag}})}},f=u.deepCopy(i),f.headers&&delete f.headers["x-oss-server-side-encryption"],f.subres={uploadId:r},p=this._objectRequestParams("POST",t,f),c.encodeCallback(p,f),p.mime="xml",p.content=l.obj2xml(a,{headers:!0}),p.headers&&p.headers["x-oss-callback"]||(p.xmlResponse=!0),p.successStatuses=[200],e.next=14,this.request(p);case 14:return d=e.sent,h={res:d.res,bucket:p.bucket,name:t,etag:d.res.headers.etag},p.headers&&p.headers["x-oss-callback"]&&(h.data=JSON.parse(d.data.toString())),e.abrupt("return",h);case 18:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.sort"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.completeMultipartUpload=void 0;var u=e("../utils/deepCopy"),c=e("../utils/encodeCallback"),l=e("../utils/obj2xml");r.completeMultipartUpload=n},{"../utils/deepCopy":126,"../utils/encodeCallback":129,"../utils/obj2xml":149,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.map":343,"core-js/modules/es.array.sort":345,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"regenerator-runtime/runtime":434}],78:[function(e,t,r){"use strict";function n(e,t,r,n){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r,n,i){var o,a,u,f,p=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=p.length>4&&void 0!==p[4]?p[4]:{},a={},c.default(o,!1).to(a),a.headers=a.headers||{},a.headers["Content-Length"]=i.size,delete a.headers["x-oss-server-side-encryption"],a.subres={partNumber:n,uploadId:r},u=this._objectRequestParams("PUT",t,a),u.mime=a.mime,l(i.stream)?u.stream=i.stream:u.content=i.stream,u.successStatuses=[200],e.next=13,this.request(u);case 13:if(f=e.sent,f.res.headers.etag){e.next=16;break}throw new Error("Please set the etag of expose-headers in OSS \n https://help.aliyun.com/document_detail/32069.html");case 16:return i.stream=null,u.stream=null,e.abrupt("return",{name:t,etag:f.res.headers.etag,res:f.res});case 19:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.handleUploadPart=void 0;var c=u(e("copy-to")),l=function(e){return e&&e.pipe};r.handleUploadPart=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],79:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./completeMultipartUpload"),i=e("./initMultipartUpload"),o=e("./listUploads"),s=e("./listParts"),a=e("./abortMultipartUpload"),u=e("./uploadPart"),c=e("./handleUploadPart"),l=e("./resumeMultipart"),f=e("./multipartUploadCopy"),p=e("./uploadPartCopy");r.default={completeMultipartUpload:n.completeMultipartUpload,initMultipartUpload:i.initMultipartUpload,listUploads:o.listUploads,listParts:s.listParts,abortMultipartUpload:a.abortMultipartUpload,uploadPart:u.uploadPart,handleUploadPart:c.handleUploadPart,resumeMultipart:l.resumeMultipart,multipartUploadCopy:f.multipartUploadCopy,uploadPartCopy:p.uploadPartCopy}},{"./abortMultipartUpload":76,"./completeMultipartUpload":77,"./handleUploadPart":78,"./initMultipartUpload":80,"./listParts":81,"./listUploads":82,"./multipartUploadCopy":83,"./resumeMultipart":84,"./uploadPart":85,"./uploadPartCopy":86}],80:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},n={},c.default(r).to(n),n.headers=n.headers||{},l.convertMetaToHeaders(r.meta,n.headers),n.subres="uploads",i=this._objectRequestParams("POST",t,n),i.mime=r.mime,i.xmlResponse=!0,i.successStatuses=[200],e.next=12,this.request(i);case 12:return o=e.sent,e.abrupt("return",{res:o.res,bucket:o.data.Bucket,name:o.data.Key,uploadId:o.data.UploadId});case 14:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.initMultipartUpload=void 0;var c=u(e("copy-to")),l=e("../utils/convertMetaToHeaders");r.initMultipartUpload=n},{"../utils/convertMetaToHeaders":124,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],81:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,u,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:{},i=l.length>3&&void 0!==l[3]?l[3]:{},o={},c.default(i).to(o),o.subres={uploadId:r},a=this._objectRequestParams("GET",t,o),a.query=n,a.xmlResponse=!0,a.successStatuses=[200],e.next=11,this.request(a);case 11:return u=e.sent,e.abrupt("return",{res:u.res,uploadId:u.data.UploadId,bucket:u.data.Bucket,name:u.data.Key,partNumberMarker:u.data.PartNumberMarker,nextPartNumberMarker:u.data.NextPartNumberMarker,maxParts:u.data.MaxParts,isTruncated:u.data.IsTruncated,parts:u.data.Part||[]});case 13:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.listParts=void 0;var c=u(e("copy-to"));r.listParts=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"regenerator-runtime/runtime":434}],82:[function(e,t,r){"use strict";function n(){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(){var t,r,n,i,o,a,u=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},r=u.length>1&&void 0!==u[1]?u[1]:{},n={},c.default(r).to(n),n.subres="uploads",i=this._objectRequestParams("GET","",n),i.query=t,i.xmlResponse=!0,i.successStatuses=[200],e.next=11,this.request(i);case 11:return o=e.sent,a=o.data.Upload||[],Array.isArray(a)||(a=[a]),a=a.map(function(e){return{name:e.Key,uploadId:e.UploadId,initiated:e.Initiated}}),e.abrupt("return",{res:o.res,uploads:a,bucket:o.data.Bucket,nextKeyMarker:o.data.NextKeyMarker,nextUploadIdMarker:o.data.NextUploadIdMarker,isTruncated:"true"===o.data.IsTruncated});case 16:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.listUploads=void 0;var c=u(e("copy-to"));r.listUploads=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"copy-to":199,"core-js/modules/es.array.map":343,"regenerator-runtime/runtime":434}],83:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,l.default)(c.default.mark(function e(t,r){var n,i,s,a,u,l,f,p,d,y,g,v,j=arguments;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=j.length>2&&void 0!==j[2]?j[2]:{},this.resetCancelFlag(),i=n.versionId,s=void 0===i?null:i,a={versionId:s},e.next=6,h._getObjectMeta.call(this,r.sourceBucketName,r.sourceKey,a);case 6:if(u=e.sent,l=u.res.headers["content-length"],r.startOffset=r.startOffset||0,r.endOffset=r.endOffset||l,!n.checkpoint||!n.checkpoint.uploadId){e.next=14;break}return e.next=13,o.call(this,n.checkpoint,r,n);case 13:return e.abrupt("return",e.sent);case 14:if(f=102400,!((p=r.endOffset-r.startOffset)0)){e.next=37;break}throw M=B[0],M.message="Failed to copy some parts with error: ".concat(M.toString()," part_num: ").concat(M.partNum),M;case 37:return e.next=39,w.completeMultipartUpload.call(this,m,d,h,n);case 39:return e.abrupt("return",e.sent);case 40:case"end":return e.stop()}},e,this)})),s.apply(this,arguments)}function a(e,t,r){for(var n=Math.ceil(e/t),i=[],o=0;o1&&void 0!==R[1]?R[1]:{},!this.isCancel()){e.next=3;break}throw f._makeCancelEvent();case 3:if(n=t.file,i=t.fileSize,o=t.partSize,h=t.uploadId,m=t.doneParts,b=t.name,y=u.divideParts(i,o),g=y.length,v=function(e){return new Promise(function(){var i=(0,a.default)(s.default.mark(function i(o,a){var u,c,f,d,v,j;return s.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!(u=t.doneParts.find(function(t){return t.number===e}))){i.next=4;break}return o(u),i.abrupt("return");case 4:if(i.prev=4,T.isCancel()){i.next=33;break}return c=y[e-1],i.next=9,T._createStream(n,c.start,c.end);case 9:return f=i.sent,d={stream:f,size:c.end-c.start},f&&f.pipe&&(Array.isArray(T.multipartUploadStreams)?T.multipartUploadStreams.push(d.stream):T.multipartUploadStreams=[d.stream],v=function(){if(f.destroyed||f.destroy(),Array.isArray(T.multipartUploadStreams)){var e=T.multipartUploadStreams.indexOf(f);-1!==e&&T.multipartUploadStreams.splice(e,1)}},f.on("close",v),f.on("error",v)),i.prev=12,i.next=15,l.handleUploadPart.call(T,b,h,e,d,r);case 15:j=i.sent,i.next=22;break;case 18:throw i.prev=18,i.t0=i.catch(12),"function"==typeof f.destroy&&f.destroy(),i.t0;case 22:if(!(u=t.doneParts.find(function(t){return t.number===e}))){i.next=26;break}return o(u),i.abrupt("return");case 26:if(T.isCancel()){i.next=33;break}if(m.push({number:e,etag:j.res.headers.etag}),t.doneParts=m,!r.progress){i.next=32;break}return i.next=32,r.progress(m.length/g,t,j.res);case 32:o({number:e,etag:j.res.headers.etag});case 33:o(),i.next=41;break;case 36:i.prev=36,i.t1=i.catch(4),i.t1.partNum=e,404===i.t1.status&&a(p._makeAbortEvent()),a(i.t1);case 41:case"end":return i.stop()}},i,null,[[4,36],[12,18]])}));return function(e,t){return i.apply(this,arguments)}}())},j=Array.from(new Array(g),function(e,t){return t+1}),w=m.map(function(e){return e.number}),x=j.filter(function(e){return w.indexOf(e)<0}),k=5,_=r.parallel||k,!this.checkBrowserAndVersion("Internet Explorer","10")&&1!==_){e.next=24;break}S=0;case 14:if(!(S0)){e.next=36;break}if(!(O=E.find(function(e){return"abort"===e.name}))){e.next=34;break}throw O;case 34:throw E[0].message="Failed to upload some parts with error: ".concat(E[0].toString()," part_num: ").concat(E[0].partNum),E[0];case 36:return e.next=38,c.completeMultipartUpload.call(this,b,h,m,r);case 38:return e.abrupt("return",e.sent);case 39:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.find"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.resumeMultipart=void 0;var u=e("../../common/utils/divideParts"),c=e("./completeMultipartUpload"),l=e("./handleUploadPart"),f=e("../utils/_makeCancelEvent"),p=e("../utils/_makeAbortEvent"),d=e("../utils/_parallel");r.resumeMultipart=n},{"../../common/utils/divideParts":128,"../utils/_makeAbortEvent":114,"../utils/_makeCancelEvent":115,"../utils/_parallel":116,"./completeMultipartUpload":77,"./handleUploadPart":78,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.find":335,"core-js/modules/es.array.from":337,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.map":343,"core-js/modules/es.array.splice":346,"core-js/modules/es.function.name":347,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.iterator":358,"regenerator-runtime/runtime":434}],85:[function(e,t,r){"use strict";function n(e,t,r,n,o,s){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r,n,i,o,a){var c,l,f=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=f.length>6&&void 0!==f[6]?f[6]:{},e.next=3,this._createStream(i,o,a,!0);case 3:return e.t0=e.sent,e.t1=a-o,l={stream:e.t0,size:e.t1},e.next=8,u.handleUploadPart.call(this,t,r,n,l,c);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.uploadPart=void 0;var u=e("./handleUploadPart");r.uploadPart=n},{"./handleUploadPart":78,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],86:[function(e,t,r){"use strict";function n(e,t,r,n,o){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r,n,i,o){var a,c,l,f,p,d,h=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=h.length>5&&void 0!==h[5]?h[5]:{},c=u.deepCopy(a),c.headers=c.headers||{},l=c.versionId||c.subres&&c.subres.versionId||null,f=l?"/".concat(o.sourceBucketName,"/").concat(encodeURIComponent(o.sourceKey),"?versionId=").concat(l):"/".concat(o.sourceBucketName,"/").concat(encodeURIComponent(o.sourceKey)),c.headers["x-oss-copy-source"]=f,i&&(c.headers["x-oss-copy-source-range"]="bytes=".concat(i)),c.headers&&delete c.headers["x-oss-server-side-encryption"],c.subres={partNumber:n,uploadId:r},p=this._objectRequestParams("PUT",t,c),p.mime=c.mime,p.successStatuses=[200],e.next=14,this.request(p);case 14:return d=e.sent,e.abrupt("return",{name:t,etag:d.res.headers.etag,res:d.res});case 16:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.concat");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.uploadPartCopy=void 0;var u=e("../utils/deepCopy");r.uploadPartCopy=n},{"../utils/deepCopy":126,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"regenerator-runtime/runtime":434}],87:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,u=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:{},i=n.put,o=void 0===i?this.put:i,"function"==typeof o){e.next=4;break}throw"please set put in options, put path is browser/object/put";case 4:return void 0===n.position&&(n.position="0"),n.subres={append:"",position:n.position},n.method="POST",e.next=9,o.call(this,t,r,n);case 9:return a=e.sent,a.nextAppendPosition=a.res.headers["x-oss-next-append-position"],e.abrupt("return",a);case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.append=void 0,r.append=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],88:[function(e,t,r){(function(t){"use strict";function n(e){if(!s.isObject(e)&&"string"!=typeof e)throw new Error("policy must be JSON string or Object");if(!s.isObject(e))try{JSON.stringify(JSON.parse(e))}catch(e){throw new Error("policy must be JSON string or Object")}e=t.from(i.policy2Str(e),"utf8").toString("base64");var r=o.computeSignature(this.options.accessKeySecret,e);return{OSSAccessKeyId:this.options.accessKeyId,Signature:r,policy:e}}e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.calculatePostSignature=void 0;var i=e("../utils/policy2Str"),o=e("../utils/signUtils"),s=e("../utils/isObject");r.calculatePostSignature=n}).call(this,e("buffer").Buffer)},{"../utils/isObject":147,"../utils/policy2Str":153,"../utils/signUtils":156,buffer:196,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],89:[function(e,t,r){"use strict";function n(e,t,r,n){return i.apply(this,arguments)}function i(){return i=(0,u.default)(s.default.mark(function e(t,r,n,i){var o,u,p;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===(0,a.default)(n)&&(i=n),i=i||{},i.headers=i.headers||{},Object.keys(i.headers).forEach(function(e){i.headers["x-oss-copy-source-".concat(e.toLowerCase())]=i.headers[e]}),(i.meta||Object.keys(i.headers).find(function(e){return f.includes(e.toLowerCase())}))&&(i.headers["x-oss-metadata-directive"]="REPLACE"),l.convertMetaToHeaders(i.meta,i.headers),r=c.getSourceName(r,n,this.options.bucket),i.versionId&&(r="".concat(r,"?versionId=").concat(i.versionId)),i.headers["x-oss-copy-source"]=r,o=this._objectRequestParams("PUT",t,i),o.xmlResponse=!0,o.successStatuses=[200,304],e.next=14,this.request(o);case 14:return u=e.sent,p=u.data,p&&(p={etag:p.ETag,lastModified:p.LastModified}),e.abrupt("return",{data:p,res:u.res});case 18:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.find"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.object.keys"),e("core-js/modules/web.dom-collections.for-each");var s=o(e("@babel/runtime/regenerator")),a=o(e("@babel/runtime/helpers/typeof"));e("regenerator-runtime/runtime");var u=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.copy=void 0;var c=e("../utils/getSourceName"),l=e("../utils/convertMetaToHeaders"),f=["content-type","content-encoding","content-language","content-disposition","cache-control","expires"];r.copy=n},{"../utils/convertMetaToHeaders":124,"../utils/getSourceName":139,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"@babel/runtime/regenerator":172,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.find":335,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],90:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},r.subres=Object.assign({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),n=this._objectRequestParams("DELETE",t,r),n.successStatuses=[204],e.next=7,this.request(n);case 7:return i=e.sent,e.abrupt("return",{res:i.res});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteObject=void 0,r.deleteObject=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],91:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,u,p,d,h,m,b,y,g,v=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=v.length>1&&void 0!==v[1]?v[1]:{},n=[],t&&t.length){e.next=4;break}throw new Error("names is required");case 4:for(i=0;i1&&void 0!==o[1]?o[1]:{},r.subres=Object.assign({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=u.objectName(t),n=this._objectRequestParams("DELETE",t,r),n.successStatuses=[204],e.next=8,this.request(n);case 8:return i=e.sent,e.abrupt("return",{status:i.status,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.deleteObjectTagging=void 0;var u=e("../utils/objectName");r.deleteObjectTagging=n},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],93:[function(e,t,r){"use strict";function n(e,t){if(t)"/"!==t[t.length-1]&&(t+="/");else{t=this.options.endpoint.format();var r=o.default.parse(t),n=this.options.bucket;r.hostname="".concat(n,".").concat(r.hostname),r.host="".concat(n,".").concat(r.host),t=r.format()}return t+a.escapeName(s.objectName(e))}e("core-js/modules/es.array.concat");var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.generateObjectUrl=void 0;var o=i(e("url")),s=e("../utils/objectName"),a=e("../utils/escapeName");r.generateObjectUrl=n},{"../utils/escapeName":131,"../utils/objectName":150,"core-js/modules/es.array.concat":332,url:452}],94:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,u,d=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>2&&void 0!==d[2]?d[2]:{},i=null,o=!1,l.default.writableStream(r)?i=r:l.default.string(r)?(i=c.default.createWriteStream(r),o=!0):p.isObject(r)&&(n=r),n.subres=Object.assign({},n.subres), -n.versionId&&(n.subres.versionId=n.versionId),n.process&&(n.subres["x-oss-process"]=n.process),e.prev=7,u=this._objectRequestParams("GET",t,n),u.writeStream=i,u.successStatuses=[200,206,304],e.next=13,this.request(u);case 13:a=e.sent,o&&i.destroy(),e.next=24;break;case 17:if(e.prev=17,e.t0=e.catch(7),!o){e.next=23;break}return i.destroy(),e.next=23,f.deleteFileSafe(r);case 23:throw e.t0;case 24:return e.abrupt("return",{res:a.res,content:a.data});case 25:case"end":return e.stop()}},e,this,[[7,17]])})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator")),u=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.get=void 0;var c=u(e("fs")),l=u(e("is-type-of")),f=e("../utils/deleteFileSafe"),p=e("../utils/isObject");r.get=n},{"../utils/deleteFileSafe":127,"../utils/isObject":147,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,fs:176,"is-type-of":449,"regenerator-runtime/runtime":434}],95:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},r.subres=Object.assign({acl:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=u.objectName(t),n=this._objectRequestParams("GET",t,r),n.successStatuses=[200],n.xmlResponse=!0,e.next=9,this.request(n);case 9:return i=e.sent,e.abrupt("return",{acl:i.data.AccessControlList.Grant,owner:{id:i.data.Owner.ID,displayName:i.data.Owner.DisplayName},res:i.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getACL=void 0;var u=e("../utils/objectName");r.getACL=n},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],96:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},r.subres=Object.assign({asyncFetch:""},r.subres),r.headers=r.headers||{},n=this._objectRequestParams("GET","",r),n.headers["x-oss-task-id"]=t,n.successStatuses=[200],n.xmlResponse=!0,e.next=9,this.request(n);case 9:return i=e.sent,o=u.formatObjKey(i.data.TaskInfo,"firstLowerCase"),e.abrupt("return",{res:i.res,status:i.status,state:i.data.State,taskInfo:o});case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getAsyncFetch=void 0;var u=e("../utils/formatObjKey");r.getAsyncFetch=n},{"../utils/formatObjKey":133,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],97:[function(e,t,r){"use strict";function n(){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(){var t,r,n,i,o,a,f,p=this,d=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:{},r=d.length>1&&void 0!==d[1]?d[1]:{},!t.versionIdMarker||void 0!==t.keyMarker){e.next=4;break}throw new Error("A version-id marker cannot be specified without a key marker");case 4:return r.subres=Object.assign({versions:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),n=this._objectRequestParams("GET","",r),n.xmlResponse=!0,n.successStatuses=[200],n.query=u.formatQuery(t),e.next=12,this.request(n);case 12:return i=e.sent,o=i.data.Version||[],a=i.data.DeleteMarker||[],o&&(Array.isArray(o)||(o=[o]),o=o.map(function(e){return{name:e.Key,url:l.objectUrl(e.Key,p.options),lastModified:e.LastModified,isLatest:"true"===e.IsLatest,versionId:e.VersionId,etag:e.ETag,type:e.Type,size:Number(e.Size),storageClass:e.StorageClass,owner:{id:e.Owner.ID,displayName:e.Owner.DisplayName}}})),a&&(c.isArray(a)||(a=[a]),a=a.map(function(e){return{name:e.Key,lastModified:e.LastModified,versionId:e.VersionId,owner:{id:e.Owner.ID,displayName:e.Owner.DisplayName}}})),f=i.data.CommonPrefixes||null,f&&(c.isArray(f)||(f=[f]),f=f.map(function(e){return e.Prefix})),e.abrupt("return",{res:i.res,objects:o,deleteMarker:a,prefixes:f,nextMarker:i.data.NextMarker||null,NextVersionIdMarker:i.data.NextVersionIdMarker||null,nextKeyMarker:i.data.NextKeyMarker||null,nextVersionIdMarker:i.data.NextVersionIdMarker||null,isTruncated:"true"===i.data.IsTruncated});case 20:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getBucketVersions=void 0;var u=e("../utils/formatQuery"),c=e("../utils/isArray"),l=e("../utils/objectUrl");r.getBucketVersions=n},{"../utils/formatQuery":134,"../utils/isArray":142,"../utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.number.constructor":348,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],98:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},t=u.objectName(t),r.subres=Object.assign({objectMeta:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),n=this._objectRequestParams("HEAD",t,r),n.successStatuses=[200],e.next=8,this.request(n);case 8:return i=e.sent,e.abrupt("return",{status:i.status,res:i.res});case 10:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getObjectMeta=void 0;var u=e("../utils/objectName");r.getObjectMeta=n},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],99:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},r.subres=Object.assign({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=u.objectName(t),n=this._objectRequestParams("GET",t,r),n.successStatuses=[200],e.next=8,this.request(n);case 8:return i=e.sent,e.next=11,l.parseXML(i.data);case 11:return o=e.sent,e.abrupt("return",{status:i.status,res:i.res,tag:c.formatTag(o)});case 13:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getObjectTagging=void 0;var u=e("../utils/objectName"),c=e("../utils/formatTag"),l=e("../utils/parseXML");r.getObjectTagging=n},{"../utils/formatTag":135,"../utils/objectName":150,"../utils/parseXML":152,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],100:[function(e,t,r){"use strict";function n(e,t){return t?"/"!==t[t.length-1]&&(t+="/"):t=this.options.endpoint.format(),t+o.escapeName(i.objectName(e))}Object.defineProperty(r,"__esModule",{value:!0}),r.getObjectUrl=void 0;var i=e("../utils/objectName"),o=e("../utils/escapeName");r.getObjectUrl=n},{"../utils/escapeName":131,"../utils/objectName":150}],101:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},r.subres=Object.assign({symlink:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),t=u.objectName(t),n=this._objectRequestParams("GET",t,r),n.successStatuses=[200],e.next=8,this.request(n);case 8:return i=e.sent,o=i.res.headers["x-oss-symlink-target"],e.abrupt("return",{targetName:decodeURIComponent(o),res:i.res});case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.getSymlink=void 0;var u=e("../utils/objectName");r.getSymlink=n},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],102:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},r.subres=Object.assign({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),n=this._objectRequestParams("HEAD",t,r),n.successStatuses=[200,304],e.next=7,this.request(n);case 7:return i=e.sent,o={meta:null,res:i.res,status:i.status},200===i.status&&Object.keys(i.headers).forEach(function(e){0===e.indexOf("x-oss-meta-")&&(o.meta||(o.meta={}),o.meta[e.substring(11)]=i.headers[e])}),e.abrupt("return",o);case 11:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/web.dom-collections.for-each");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.head=void 0,r.head=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.index-of":339,"core-js/modules/es.object.assign":349,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391,"regenerator-runtime/runtime":434}],103:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./append"),i=e("./calculatePostSignature"),o=e("./copy"),s=e("./delete"),a=e("./deleteMulti"),u=e("./deleteObjectTagging"),c=e("./generateObjectUrl"),l=e("./get"),f=e("./getACL"),p=e("./getAsyncFetch"),d=e("./getBucketVersions"),h=e("./getObjectMeta"),m=e("./getObjectTagging"),b=e("./getObjectUrl"),y=e("./getSymlink"),g=e("./head"),v=e("./list"),j=e("./listV2"),w=e("./postAsyncFetch"),x=e("./putACL"),k=e("./putMeta"),_=e("./putObjectTagging"),S=e("./putSymlink"),E=e("./restore"),O=e("./signatureUrl");r.default={append:n.append,calculatePostSignature:i.calculatePostSignature,copy:o.copy,delete:s.deleteObject,deleteObject:s.deleteObject,deleteMulti:a.deleteMulti,deleteObjectTagging:u.deleteObjectTagging,generateObjectUrl:c.generateObjectUrl,get:l.get,getACL:f.getACL,getAsyncFetch:p.getAsyncFetch,getBucketVersions:d.getBucketVersions,listObjectVersions:d.getBucketVersions,getObjectMeta:h.getObjectMeta,getObjectTagging:m.getObjectTagging,getObjectUrl:b.getObjectUrl,getSymlink:y.getSymlink,head:g.head,list:v.list,listV2:j.listV2,postAsyncFetch:w.postAsyncFetch,putACL:x.putACL,putMeta:k.putMeta,putObjectTagging:_.putObjectTagging,putSymlink:S.putSymlink,restore:E.restore,signatureUrl:O.signatureUrl}},{"./append":87,"./calculatePostSignature":88,"./copy":89,"./delete":90,"./deleteMulti":91,"./deleteObjectTagging":92,"./generateObjectUrl":93,"./get":94,"./getACL":95,"./getAsyncFetch":96,"./getBucketVersions":97,"./getObjectMeta":98,"./getObjectTagging":99,"./getObjectUrl":100,"./getSymlink":101,"./head":102,"./list":104,"./listV2":105,"./postAsyncFetch":106,"./putACL":107,"./putMeta":108,"./putObjectTagging":109,"./putSymlink":110,"./restore":111,"./signatureUrl":112}],104:[function(e,t,r){"use strict";function n(){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(){var t,r,n,i,o,a,c=this,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=l.length>1&&void 0!==l[1]?l[1]:{},n=this._objectRequestParams("GET","",r),n.query=t,n.xmlResponse=!0,n.successStatuses=[200],e.next=8,this.request(n);case 8:return i=e.sent,o=i.data.Contents,o&&(Array.isArray(o)||(o=[o]),o=o.map(function(e){return{name:e.Key,url:u.objectUrl(e.Key,c.options),lastModified:e.LastModified,etag:e.ETag,type:e.Type,size:Number(e.Size),storageClass:e.StorageClass,owner:{id:e.Owner.ID,displayName:e.Owner.DisplayName}}})),a=i.data.CommonPrefixes||null,a&&(Array.isArray(a)||(a=[a]),a=a.map(function(e){return e.Prefix})),e.abrupt("return",{res:i.res,objects:o,prefixes:a,nextMarker:i.data.NextMarker||null,isTruncated:"true"===i.data.IsTruncated});case 14:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.list=void 0;var u=e("../utils/objectUrl");r.list=n},{"../utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.number.constructor":348,"regenerator-runtime/runtime":434}],105:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o,a,c=this,l=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>1&&void 0!==l[1]?l[1]:{},n=this._objectRequestParams("GET","",r),n.query=Object.assign({"list-type":2},t),n.xmlResponse=!0,n.successStatuses=[200],e.next=7,this.request(n);case 7:return i=e.sent,o=i.data.Contents,o&&(Array.isArray(o)||(o=[o]),o=o.map(function(e){return{name:e.Key,url:u.objectUrl(e.Key,c.options),lastModified:e.LastModified,etag:e.ETag,type:e.Type,size:Number(e.Size),storageClass:e.StorageClass,owner:e.Owner?{id:e.Owner.ID,displayName:e.Owner.DisplayName}:null}})),a=i.data.CommonPrefixes||null,a&&(Array.isArray(a)||(a=[a]),a=a.map(function(e){return e.Prefix})),e.abrupt("return",{res:i.res,objects:o,prefixes:a,isTruncated:"true"===i.data.IsTruncated,keyCount:i.data.KeyCount,continuationToken:i.data.ContinuationToken||null,nextContinuationToken:i.data.NextContinuationToken||null});case 13:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.listV2=void 0;var u=e("../utils/objectUrl");r.listV2=n},{"../utils/objectUrl":151,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.number.constructor":348,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],106:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,l,f,p,d,h,m,b,y,g,v,j=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=j.length>2&&void 0!==j[2]?j[2]:{},n.subres=Object.assign({asyncFetch:""},n.subres),n.headers=n.headers||{},t=c.objectName(t),i=n.host,o=void 0===i?"":i,a=n.contentMD5,l=void 0===a?"":a,f=n.callback,p=void 0===f?"":f,d=n.storageClass,h=void 0===d?"":d,m=n.ignoreSameKey,b=void 0===m||m,y={AsyncFetchTaskConfiguration:{Url:r,Object:t,Host:o,ContentMD5:l,Callback:p,StorageClass:h,IgnoreSameKey:b}},g=this._objectRequestParams("POST","",n),g.mime="xml",g.xmlResponse=!0,g.successStatuses=[200],g.content=u.obj2xml(y),e.next=13,this.request(g);case 13:return v=e.sent,e.abrupt("return",{res:v.res,status:v.status,taskId:v.data.TaskId});case 15:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.postAsyncFetch=void 0;var u=e("../utils/obj2xml"),c=e("../utils/objectName");r.postAsyncFetch=n},{"../utils/obj2xml":149,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],107:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},n.subres=Object.assign({acl:""},n.subres),n.versionId&&(n.subres.versionId=n.versionId),n.headers=n.headers||{},n.headers["x-oss-object-acl"]=r,t=u.objectName(t),i=this._objectRequestParams("PUT",t,n),i.successStatuses=[200],e.next=10,this.request(i);case 10:return o=e.sent,e.abrupt("return",{res:o.res});case 12:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putACL=void 0;var u=e("../utils/objectName");r.putACL=n},{"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],108:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:{},e.next=3,u.copy.call(this,t,t,{meta:r||{},timeout:n&&n.timeout,ctx:n&&n.ctx});case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putMeta=void 0;var u=e("./copy");r.putMeta=n},{"./copy":89,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],109:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a,f=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>2&&void 0!==f[2]?f[2]:{},c.checkObjectTag(r),n.subres=Object.assign({tagging:""},n.subres),n.versionId&&(n.subres.versionId=n.versionId),t=l.objectName(t),i=this._objectRequestParams("PUT",t,n),i.successStatuses=[200],r=Object.keys(r).map(function(e){return{Key:e,Value:r[e]}}),o={Tagging:{TagSet:{Tag:r}}},i.mime="xml",i.content=u.obj2xml(o),e.next=13,this.request(i);case 13:return a=e.sent,e.abrupt("return",{res:a.res,status:a.status});case 15:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putObjectTagging=void 0;var u=e("../utils/obj2xml"),c=e("../utils/checkObjectTag"),l=e("../utils/objectName");r.putObjectTagging=n},{"../utils/checkObjectTag":122,"../utils/obj2xml":149,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.array.map":343,"core-js/modules/es.object.assign":349,"core-js/modules/es.object.keys":351,"regenerator-runtime/runtime":434}],110:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},n.headers=n.headers||{},r=l.escapeName(u.objectName(r)),c.convertMetaToHeaders(n.meta,n.headers),n.headers["x-oss-symlink-target"]=r,n.subres=Object.assign({symlink:""},n.subres),n.versionId&&(n.subres.versionId=n.versionId),n.storageClass&&(n.headers["x-oss-storage-class"]=n.storageClass),t=u.objectName(t),i=this._objectRequestParams("PUT",t,n),i.successStatuses=[200],e.next=13,this.request(i);case 13:return o=e.sent,e.abrupt("return",{res:o.res});case 15:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.putSymlink=void 0;var u=e("../utils/objectName"),c=e("../utils/convertMetaToHeaders"),l=e("../utils/escapeName");r.putSymlink=n},{"../utils/convertMetaToHeaders":124,"../utils/escapeName":131,"../utils/objectName":150,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],111:[function(e,t,r){"use strict";function n(e){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t){var r,n,i,o=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},r.subres=Object.assign({restore:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),n=this._objectRequestParams("POST",t,r),n.successStatuses=[202],e.next=7,this.request(n);case 7:return i=e.sent,e.abrupt("return",{res:i.res});case 9:case"end":return e.stop()}},e,this)})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.object.assign");var s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r.restore=void 0,r.restore=n},{"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"core-js/modules/es.object.assign":349,"regenerator-runtime/runtime":434}],112:[function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=u.objectName(e),t.method=t.method||"GET";var r=o.default.timestamp()+(t.expires||1800),n={bucket:this.options.bucket,object:e},i=c.getResource(n,this.options.headerEncoding);this.options.stsToken&&(t["security-token"]=this.options.stsToken);var p=l._signatureForURL(this.options.accessKeySecret,t,i,r),d=a.default.parse(f.getReqUrl(n,this.options));return d.query={OSSAccessKeyId:this.options.accessKeyId,Expires:r,Signature:p.Signature},s.default(p.subResource).to(d.query),d.format()}var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.signatureUrl=void 0;var o=i(e("utility")),s=i(e("copy-to")),a=i(e("url")),u=e("../../common/utils/objectName"),c=e("../../common/utils/getResource"),l=e("../../common/utils/signUtils"),f=e("../../common/utils/getReqUrl");r.signatureUrl=n},{"../../common/utils/getReqUrl":137,"../../common/utils/getResource":138,"../../common/utils/objectName":150,"../../common/utils/signUtils":156,"copy-to":199,url:452,utility:454}],113:[function(e,t,r){"use strict";function n(e,t){return i.apply(this,arguments)}function i(){return i=(0,a.default)(s.default.mark(function e(t,r){var n,i,o,a=arguments;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},i=this.options.bucket,this.setBucket(t),e.prev=3,e.next=6,u.head.call(this,r,n);case 6:return o=e.sent,this.setBucket(i),e.abrupt("return",o);case 11:throw e.prev=11,e.t0=e.catch(3),this.setBucket(i),e.t0;case 15:case"end":return e.stop()}},e,this,[[3,11]])})),i.apply(this,arguments)}var o=e("@babel/runtime/helpers/interopRequireDefault"),s=o(e("@babel/runtime/regenerator"));e("regenerator-runtime/runtime");var a=o(e("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(r,"__esModule",{value:!0}),r._getObjectMeta=void 0;var u=e("../object/head");r._getObjectMeta=n},{"../object/head":102,"@babel/runtime/helpers/asyncToGenerator":161,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/regenerator":172,"regenerator-runtime/runtime":434}],114:[function(e,t,r){"use strict";function n(){return{status:0,name:"abort",message:"upload task has been abort"}}Object.defineProperty(r,"__esModule",{value:!0}),r._makeAbortEvent=void 0,r._makeAbortEvent=n},{}],115:[function(e,t,r){"use strict";function n(){return{status:0,name:"cancel"}}Object.defineProperty(r,"__esModule",{value:!0}),r._makeCancelEvent=void 0,r._makeCancelEvent=n},{}],116:[function(e,t,r){"use strict";function n(e,t,r,n){var i=this;return new Promise(function(o){function s(e){if(e&&e.length&&!i.isCancel()){var t=e.pop();u.push(t),t().then(function(t){s(e)}).catch(function(t){e.length=0,a.push(t),o(a)}).then(function(){u.pop(),u.length||o()})}}for(var a=[],u=[],c=e.map(function(e){return function(){return r(e,n)}}),l=0;l1&&void 0!==arguments[1]&&arguments[1]?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/).test(e))throw new Error("The bucket must be conform to the specifications")}},{}],121:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.entries"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.checkBucketTag=void 0;var n=e("./checkValid"),i=e("./isObject"),o=[{validator:function(e){if("string"!=typeof e)throw new Error("the key and value of the tag must be String")}}],s={key:[].concat(o,[{pattern:/^.{1,64}$/,msg:"tag key can be a maximum of 64 bytes in length"},{pattern:/^(?!https*:\/\/|Aliyun)/,msg:"tag key can not startsWith: http://, https://, Aliyun"}]),value:[].concat(o,[{pattern:/^.{0,128}$/,msg:"tag value can be a maximum of 128 bytes in length"}])};r.checkBucketTag=function(e){if(!i.isObject(e))throw new Error("bucket tag must be Object");var t=Object.entries(e);if(t.length>20)throw new Error("maximum of 20 tags for a bucket");var r=["key","value"];t.forEach(function(e){e.forEach(function(e,t){n.checkValid(e,s[r[t]])})})}},{"./checkValid":123,"./isObject":147,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.entries":350,"core-js/modules/web.dom-collections.for-each":391}],122:[function(e,t,r){"use strict";function n(e){if(!o.isObject(e))throw new Error("tag must be Object");var t=Object.entries(e) -;if(t.length>10)throw new Error("maximum of 10 tags for a object");var r=["key","value"];t.forEach(function(e){e.forEach(function(e,t){i.checkValid(e,a[r[t]])})})}e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.entries"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.checkObjectTag=void 0;var i=e("./checkValid"),o=e("./isObject"),s=[{validator:function(e){if("string"!=typeof e)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 (/)"}],a={key:[].concat(s,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(s,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};r.checkObjectTag=n},{"./checkValid":123,"./isObject":147,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.entries":350,"core-js/modules/web.dom-collections.for-each":391}],123:[function(e,t,r){"use strict";function n(e,t){t.forEach(function(t){if(t.validator)t.validator(e);else if(t.pattern&&!t.pattern.test(e))throw new Error(t.msg)})}function i(e){return n(e,[{validator:function(e){var t=!0;if("string"==typeof e?t=/^[a-zA-Z0-9._:/-]+$/.test(e):e.host&&(t=/^[a-zA-Z0-9._:/-]+$/.test(e.host)),!t)throw new Error("The endpoint must be conform to the specifications")}}])}function o(e){return n(e,[{pattern:/^[a-zA-Z0-9\-_]+$/,msg:"The region must be conform to the specifications"}])}e("core-js/modules/es.array.for-each"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.checkValidRegion=r.checkValidEndpoint=r.checkValid=void 0,r.checkValid=n,r.checkValidEndpoint=i,r.checkValidRegion=o},{"core-js/modules/es.array.for-each":336,"core-js/modules/web.dom-collections.for-each":391}],124:[function(e,t,r){"use strict";function n(e,t){e&&Object.keys(e).forEach(function(r){t["x-oss-meta-".concat(r)]=e[r]})}e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.keys"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.convertMetaToHeaders=void 0,r.convertMetaToHeaders=n},{"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391}],125:[function(e,t,r){"use strict";function n(e,t,r){if(s.isObject(e)){var a=t.remove,u=void 0===a?[]:a,c=t.rename,l=void 0===c?{}:c,f=t.camel,p=void 0===f?[]:f,d=t.bool,h=void 0===d?[]:d,m=t.lowerFirst,b=void 0!==m&&m;return u.forEach(function(t){return delete e[t]}),Object.entries(l).forEach(function(t){e[t[0]]&&(e[t[1]]||(e[t[1]]=e[t[0]],delete e[t[0]]))}),p.forEach(function(t){if(e[t]){var r=t.replace(/^(.)/,function(e){return e.toLowerCase()}).replace(/-(\w)/g,function(e,t){return t.toUpperCase()});e[r]||(e[r]=e[t])}}),h.forEach(function(t){e[t]=i(e[t])}),"function"==typeof r&&r(e),o(e,b),n}}function i(e){return!!e&&(!!a.includes(e)||!u.includes(e)&&e)}function o(e,t){t&&Object.keys(e).forEach(function(t){var r=t.replace(/^\w/,function(e){return e.toLowerCase()});void 0===e[r]&&(e[r]=e[t],delete e[t])})}e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.object.entries"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.dataFix=void 0;var s=e("./isObject"),a=["true","TRUE","1",1],u=["false","FALSE","0",0];r.dataFix=n},{"./isObject":147,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.includes":338,"core-js/modules/es.object.entries":350,"core-js/modules/es.object.keys":351,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],126:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.keys"),e("core-js/modules/web.dom-collections.for-each");var i=n(e("@babel/runtime/helpers/typeof"));Object.defineProperty(r,"__esModule",{value:!0}),r.deepCopy=void 0,r.deepCopy=function(e){if(null===e||"object"!==(0,i.default)(e))return e;var t=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(n){t[n]=r.deepCopy(e[n])}),t}},{"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/web.dom-collections.for-each":391}],127:[function(e,t,r){"use strict";function n(e){return new Promise(function(t){o.default.exists(e,function(r){r?o.default.unlink(e,function(r){r&&a("unlink %j error: %s",e,r),t()}):t()})})}e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise");var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.deleteFileSafe=void 0;var o=i(e("fs")),s=i(e("debug")),a=s.default("ali-oss");r.deleteFileSafe=n},{"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,debug:448,fs:176}],128:[function(e,t,r){"use strict";function n(e,t){for(var r=Math.ceil(e/t),n=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:"utf-8")?e:t.from(e).toString("latin1")}e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.encoder=void 0,r.encoder=n}).call(this,e("buffer").Buffer)},{buffer:196,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356}],131:[function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=t.reg,n=t.str;return o.default.encodeURIComponent(e).replace(r,n)}e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace");var i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.escapeName=void 0;var o=i(e("utility")),s={reg:/%2F/g,str:"/"};r.escapeName=n},{"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,utility:454}],132:[function(e,t,r){"use strict";function n(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&s.isObject(e)&&(e=[e]),e=a.isArray(e)?e.map(i):i(e)}function i(e){return o.dataFix(e,{bool:["IsEnabled"]},function(e){var t,r;e.prefix=e.Filter.Prefix,delete e.Filter,e.OSSBucketDestination=e.Destination.OSSBucketDestination,e.OSSBucketDestination.rolename=e.OSSBucketDestination.RoleArn.replace(/.*\//,""),delete e.OSSBucketDestination.RoleArn,e.OSSBucketDestination.bucket=e.OSSBucketDestination.Bucket.replace(/.*:::/,""),delete e.OSSBucketDestination.Bucket,delete e.Destination,e.frequency=e.Schedule.Frequency,delete e.Schedule.Frequency,(null===(t=null===e||void 0===e?void 0:e.OptionalFields)||void 0===t?void 0:t.Field)&&!a.isArray(null===(r=e.OptionalFields)||void 0===r?void 0:r.Field)&&(e.OptionalFields.Field=[e.OptionalFields.Field])}),e=u.formatObjKey(e,"firstLowerCase",{exclude:["OSSBucketDestination","SSE-OSS","SSE-KMS"]})}e("core-js/modules/es.array.map"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r.formatInventoryConfig=void 0;var o=e("../utils/dataFix"),s=e("../utils/isObject"),a=e("../utils/isArray"),u=e("../utils/formatObjKey");r.formatInventoryConfig=n},{"../utils/dataFix":125,"../utils/formatObjKey":133,"../utils/isArray":142,"../utils/isObject":147,"core-js/modules/es.array.map":343,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],133:[function(e,t,r){"use strict";function n(e,t,r){if(null===e||"object"!==(0,s.default)(e))return e;var o;if(Array.isArray(e)){o=[];for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t={};return o.isObject(e)&&Object.keys(e).forEach(function(r){t[n(r)]=e[r]}),t}e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.formatQuery=void 0;var o=e("./isObject");r.formatQuery=i},{"./isObject":147,"core-js/modules/es.array.for-each":336,"core-js/modules/es.object.keys":351,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],135:[function(e,t,r){"use strict";function n(e){void 0!==e.Tagging?e=e.Tagging.TagSet.Tag:void 0!==e.TagSet?e=e.TagSet.Tag:void 0!==e.Tag&&(e=e.Tag),e=e&&i.isObject(e)?[e]:e||[];var t={};return e.forEach(function(e){t[e.Key]=e.Value}),t}e("core-js/modules/es.array.for-each"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.formatTag=void 0;var i=e("./isObject");r.formatTag=n},{"./isObject":147,"core-js/modules/es.array.for-each":336,"core-js/modules/web.dom-collections.for-each":391}],136:[function(e,t,r){"use strict";function n(e,t){var r=Math.ceil(e/1e4);return t||(t=i),t").concat(e[t],""):"object"===n(e[t])?r+="<".concat(t,">").concat(i(e[t]),""):"array"===n(e[t])?r+=e[t].map(function(e){return"<".concat(t,">").concat(i(e),"")}).join(""):r+="<".concat(t,">").concat(e[t].toString(),""))}):r+=e.toString(),r}e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.obj2xml=void 0;var o=e("./formatObjKey");r.obj2xml=i},{"./formatObjKey":133,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.join":341,"core-js/modules/es.array.map":343,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.replace":360,"core-js/modules/web.dom-collections.for-each":391}],150:[function(e,t,r){"use strict";function n(e){return e.replace(/^\/+/,"")}e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r.objectName=void 0,r.objectName=n},{"core-js/modules/es.regexp.exec":355,"core-js/modules/es.string.replace":360}],151:[function(e,t,r){"use strict";function n(e,t){return t=t||this.options,i.getReqUrl({bucket:t.bucket,object:e},t)}Object.defineProperty(r,"__esModule",{value:!0}),r.objectUrl=void 0;var i=e("./getReqUrl");r.objectUrl=n},{"./getReqUrl":137}],152:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./xml2js");Object.defineProperty(r,"parseXML",{enumerable:!0,get:function(){return n.xml2objPromise}})},{"./xml2js":158}],153:[function(e,t,r){"use strict";function n(e){var t;if(e)if("string"==typeof e)try{t=JSON.stringify(JSON.parse(e))}catch(e){throw new Error("Policy string is not a valid JSON: ".concat(e.message))}else t=JSON.stringify(e);return t}Object.defineProperty(r,"__esModule",{value:!0}),r.policy2Str=void 0,r.policy2Str=n},{}],154:[function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=0,i=r.retryDelay,o=void 0===i?500:i,s=r.errorHandler,a=void 0===s?function(){return!0}:s;return function r(){for(var i=arguments.length,s=new Array(i),u=0;ut[0]?1:e[0]2&&void 0!==arguments[2]?arguments[2]:"utf-8";return u.default.createHmac("sha1",e).update(t.from(r,n)).digest("base64")}function s(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,u={},c=r.subResource,l=void 0===c?{}:c;if(r.process){l["x-oss-process"]=r.process}if(r.trafficLimit){l["x-oss-traffic-limit"]=r.trafficLimit}if(r.response&&Object.keys(r.response).forEach(function(e){var t="response-".concat(e.toLowerCase());l[t]=r.response[e]}),Object.keys(r).forEach(function(e){var t=e.toLowerCase(),n=r[e];0===t.indexOf("x-oss-")?u[t]=n:0===t.indexOf("content-md5")?u[e]=n:0===t.indexOf("content-type")&&(u[e]=n)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(l["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var f={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(f.callbackHost=r.callback.host),r.callback.contentType&&(f.callbackBodyType=r.callback.contentType),l.callback=t.from(JSON.stringify(f)).toString("base64"),r.callback.customValue){var p={};Object.keys(r.callback.customValue).forEach(function(e){p["x:".concat(e)]=r.callback.customValue[e]}),l["callback-var"]=t.from(JSON.stringify(p)).toString("base64")}}return{Signature:o(e,i(r.method,n,{headers:u,parameters:l},s.toString()),a),subResource:l}}e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.sort"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.for-each");var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r._signatureForURL=r.computeSignature=r.buildCanonicalString=r.buildCanonicalizedResource=void 0;var u=a(e("./../../../shims/crypto/crypto.js")),c=a(e("is-type-of"));r.buildCanonicalizedResource=n,r.buildCanonicalString=i,r.computeSignature=o,r._signatureForURL=s,r.default={buildCanonicalizedResource:n,buildCanonicalString:i,computeSignature:o,_signatureForURL:s}}).call(this,e("buffer").Buffer)},{"./../../../shims/crypto/crypto.js":444,buffer:196,"core-js/modules/es.array.concat":332,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.join":341,"core-js/modules/es.array.sort":345,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.trim":364,"core-js/modules/web.dom-collections.for-each":391,"is-type-of":449}],157:[function(e,t,r){(function(t){"use strict";function n(e){var t=i();return function(){var r,n=(0,f.default)(e);if(t){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}var o=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array-buffer.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string");var s=o(e("@babel/runtime/helpers/classCallCheck")),a=o(e("@babel/runtime/helpers/createClass")),u=o(e("@babel/runtime/helpers/assertThisInitialized")),c=o(e("@babel/runtime/helpers/inherits")),l=o(e("@babel/runtime/helpers/possibleConstructorReturn")),f=o(e("@babel/runtime/helpers/getPrototypeOf"));Object.defineProperty(r,"__esModule",{value:!0}),r.WebFileReadStream=void 0;var p=e("stream"),d=function(e){function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.default)(this,r),t=i.call(this,n),(0,u.default)(t)instanceof r?(t.file=e,t.reader=new FileReader,t.start=0,t.finish=!1,t.fileBuffer=null,t):(0,l.default)(t,new r(e,n))}(0,c.default)(r,e);var i=n(r);return(0,a.default)(r,[{key:"readFileAndPush",value:function(e){if(this.fileBuffer)for(var t=!0;t&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:n,this.start=n,t=this.push(this.fileBuffer.slice(r,n))}}},{key:"_read",value:function(e){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||0===this.start&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);e=e||16384;var r=this -;this.reader.onload=function(n){r.fileBuffer=t.from(new Uint8Array(n.target.result)),r.file=null,r.readFileAndPush(e)},this.reader.onerror=function(e){var t=e.srcElement&&e.srcElement.error;if(t)throw t;throw e},0===this.start?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(e)}}]),r}(p.Readable);r.WebFileReadStream=d}).call(this,e("buffer").Buffer)},{"@babel/runtime/helpers/assertThisInitialized":160,"@babel/runtime/helpers/classCallCheck":162,"@babel/runtime/helpers/createClass":163,"@babel/runtime/helpers/getPrototypeOf":165,"@babel/runtime/helpers/inherits":166,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/possibleConstructorReturn":168,buffer:196,"core-js/modules/es.array-buffer.slice":331,"core-js/modules/es.array.iterator":340,"core-js/modules/es.array.slice":344,"core-js/modules/es.object.to-string":352,"core-js/modules/es.typed-array.copy-within":367,"core-js/modules/es.typed-array.every":368,"core-js/modules/es.typed-array.fill":369,"core-js/modules/es.typed-array.filter":370,"core-js/modules/es.typed-array.find":372,"core-js/modules/es.typed-array.find-index":371,"core-js/modules/es.typed-array.for-each":373,"core-js/modules/es.typed-array.includes":374,"core-js/modules/es.typed-array.index-of":375,"core-js/modules/es.typed-array.iterator":376,"core-js/modules/es.typed-array.join":377,"core-js/modules/es.typed-array.last-index-of":378,"core-js/modules/es.typed-array.map":379,"core-js/modules/es.typed-array.reduce":381,"core-js/modules/es.typed-array.reduce-right":380,"core-js/modules/es.typed-array.reverse":382,"core-js/modules/es.typed-array.set":383,"core-js/modules/es.typed-array.slice":384,"core-js/modules/es.typed-array.some":385,"core-js/modules/es.typed-array.sort":386,"core-js/modules/es.typed-array.subarray":387,"core-js/modules/es.typed-array.to-locale-string":388,"core-js/modules/es.typed-array.to-string":389,"core-js/modules/es.typed-array.uint8-array":390,stream:436}],158:[function(e,t,r){"use strict";function n(e){return e.replace(x,function(e){return w[e]}).replace(k,function(e){return String.fromCharCode(e.replace(/[^0-9]/g,""))})}function i(e){if(!p.isArray(e))return e;var t=[];return e.forEach(function(e){var r=t.find(function(t){return t.tag===e.tag});if(r&&r.children){r["children".concat(Object.keys(r).filter(function(e){return e.startsWith("children")}).length)]=e.children}else t.push(e)}),t}function o(e){if(null===e||"object"!==(0,f.default)(e))return e;var t={};if(d.isObject(e)){e.children&&(e.children=i(e.children));var r=Object.entries(e).filter(function(e){return e[0].startsWith("children")}).map(function(e){return e[1]});r.length>1?t[e.tag]=r.map(function(e){return o(e)}):t[e.tag]=o(r[0])}if(p.isArray(e)){if(0===e.length)return"";e.find(function(e){return!e.tag})&&(t=[]);for(var n=0;n1?t[n.tag]=s.map(function(e){return o(e)}):t[n.tag]=o(s[0])}}(n)}return t}function s(e){function t(t){h+=t,e=e.substring(t)}function r(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(null==n&&(n=h),null==i&&(i=h),r){var o=r.toLowerCase();for(t=d.length-1;t>=0&&d[t].tag.toLowerCase()!==o;t--);}else t=0;if(t>=0){for(var a=d.length-1;a>=t;a--)s();d.length=t}}function i(e){var t={tag:e,children:[]};u||(u=t),c&&c.children.push(t),c=t,p.push(t)}function s(){p.length-=1,c=p[p.length-1]}function a(e){c&&e.trim()&&(c.children=n(e))}var u,c,l,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{explicitRoot:!1,explicitArray:!1},p=[],d=[],h=0;if("string"!=typeof e&&(e=e.toString()),e=e.replace(j,""),void 0===u&&""===e)return null;for(;e;){l=e;var m=e.indexOf("<");if(0===m){var w=e.match(v);if(w){t(w[0].length),r(w[0],w[1],h,h);continue}var x=function(){var r=e.match(b);if(r){var n={tagName:r[1],start:h};t(r[0].length);e.match(g)&&(e=e.replace(g,function(e){return e.replace("/>",">"))}));var i=e.match(y);if(i)return t(i[0].length),n.end=h,n}return!1}();if(x){!function(e){var t=e.tagName;d.push({tag:t}),i(t)}(x);continue}}var k=0;if(m>0&&(k=e.substring(0,m),t(m)),m<0&&(k=e,e=""),a&&k&&a(k),e===l&&a){a(e);break}}return r(),u=o(u)||{},f.explicitRoot||(u=u[Object.keys(u)[0]]),u||{}}function a(){for(var e=arguments.length,t=new Array(e),r=0;r/,g=/^\s*\/>/,v=new RegExp("^<\\/".concat(m,"[^>]*>")),j=//,w={"<":"<",">":">",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},x=/&(?:lt|gt|quot|amp|#39);/g,k=/&#([0-9]?[0-9]?[0-9]);/g;r.xml2objPromise=a,r.parseString=u,r.default={xml2obj:s,xml2objPromise:a,parseString:u}},{"./isArray":142,"./isObject":147,"@babel/runtime/helpers/defineProperty":164,"@babel/runtime/helpers/interopRequireDefault":167,"@babel/runtime/helpers/typeof":170,"core-js/modules/es.array.filter":334,"core-js/modules/es.array.find":335,"core-js/modules/es.array.for-each":336,"core-js/modules/es.array.index-of":339,"core-js/modules/es.array.map":343,"core-js/modules/es.object.entries":350,"core-js/modules/es.object.keys":351,"core-js/modules/es.object.to-string":352,"core-js/modules/es.promise":353,"core-js/modules/es.regexp.constructor":354,"core-js/modules/es.regexp.exec":355,"core-js/modules/es.regexp.to-string":356,"core-js/modules/es.string.match":359,"core-js/modules/es.string.replace":360,"core-js/modules/es.string.starts-with":363,"core-js/modules/es.string.trim":364,"core-js/modules/web.dom-collections.for-each":391}],159:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.keys"),e("core-js/modules/web.dom-collections.for-each");var i=n(e("@babel/runtime/helpers/classCallCheck")),o=n(e("@babel/runtime/helpers/createClass")),s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Client=r.initClient=void 0;var a=s(e("urllib")),u=s(e("agentkeepalive")),c=e("./common/client/_getUserAgent"),l=e("./common/client/initOptions"),f=s(e("./common/client")),p=e("./common/utils/_unSupportBrowserTip"),d=e("./browser/client/_createStream"),h=u.default.HttpsAgent,m=new u.default,b=new h,y=function(){function e(t,r){if((0,i.default)(this,e),!(this instanceof e))return new e(t,r);p._unSupportBrowserTip(),e.prototype._createStream||(e.prototype._createStream=d._createStream),Object.keys(f.default).forEach(function(t){e.prototype[t]=f.default[t]}),this.setConfig(t,r)}return(0,o.default)(e,[{key:"setConfig",value:function(e,t){e&&e.inited?this.options=e:this.options=l.initOptions(e),this.options.urllib?this.urllib=this.options.urllib:(this.urllib=a.default,this.agent=this.options.agent||m,this.httpsAgent=this.options.httpsAgent||b),this.ctx=t,this.userAgent=c._getUserAgent()}}],[{key:"use",value:function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var s=g.call(i,"catchLoc"),a=g.call(i,"finallyLoc");if(s&&a){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&g.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),p(r),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;p(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:h(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=b),O}},e}("object"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},{}],172:[function(e,t,r){t.exports=e("regenerator-runtime")},{"regenerator-runtime":171}],173:[function(e,t,r){function n(){}t.exports=n,t.exports.HttpsAgent=n},{}],174:[function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function i(e){var t=n(e),r=t[0],i=t[1];return 3*(r+i)/4-i}function o(e,t,r){return 3*(t+r)/4-r}function s(e){var t,r,i=n(e),s=i[0],a=i[1],u=new p(o(e,s,a)),c=0,l=a>0?s-4:s;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=f[e.charCodeAt(r)]<<2|f[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=f[e.charCodeAt(r)]<<10|f[e.charCodeAt(r+1)]<<4|f[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u}function a(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function u(e,t,r){for(var n,i=[],o=t;os?s:o+16383));return 1===n?(t=e[r-1],i.push(l[t>>2]+l[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(l[t>>10]+l[t>>4&63]+l[t<<2&63]+"=")),i.join("")}r.byteLength=i,r.toByteArray=s,r.fromByteArray=c;for(var l=[],f=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,m=d.length;h1&&r[1]||""}function r(t){var r=e.match(t);return r&&r.length>1&&r[2]||""}var i,o=t(/(ipod|iphone|ipad)/i).toLowerCase(),a=/like android/i.test(e),u=!a&&/android/i.test(e),c=/nexus\s*[0-6]\s*/i.test(e),l=!c&&/nexus\s*[0-9]+/i.test(e),f=/CrOS/.test(e),p=/silk/i.test(e),d=/sailfish/i.test(e),h=/tizen/i.test(e),m=/(web|hpw)(o|0)s/i.test(e),b=/windows phone/i.test(e),y=(/SamsungBrowser/i.test(e),!b&&/windows/i.test(e)),g=!o&&!p&&/macintosh/i.test(e),v=!u&&!d&&!h&&!m&&/linux/i.test(e),j=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=t(/version\/(\d+(\.\d+)?)/i),x=/tablet/i.test(e)&&!/tablet pc/i.test(e),k=!x&&/[^-]mobi/i.test(e),_=/xbox/i.test(e);/opera/i.test(e)?i={name:"Opera",opera:s,version:w||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?i={name:"Opera",opera:s,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(e)?i={name:"Samsung Internet for Android",samsungBrowser:s,version:w||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(e)?i={name:"NAVER Whale browser",whale:s,version:t(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(e)?i={name:"MZ Browser",mzbrowser:s,version:t(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(e)?i={name:"Opera Coast",coast:s,version:w||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(e)?i={name:"Focus",focus:s,version:t(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(e)?i={name:"Yandex Browser",yandexbrowser:s,version:w||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?i={name:"UC Browser",ucbrowser:s,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?i={name:"Maxthon",maxthon:s,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?i={name:"Epiphany",epiphany:s,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?i={name:"Puffin",puffin:s,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?i={name:"Sleipnir",sleipnir:s,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?i={name:"K-Meleon",kMeleon:s,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:b?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},j?(i.msedge=s,i.version=j):(i.msie=s,i.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?i={name:"Internet Explorer",msie:s,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:f?i={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?i={name:"Microsoft Edge",msedge:s,version:j}:/vivaldi/i.test(e)?i={name:"Vivaldi",vivaldi:s,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||w}:d?i={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?i={name:"SeaMonkey",seamonkey:s,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(i={name:"Firefox",firefox:s,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(i.firefoxos=s,i.osname="Firefox OS")):p?i={name:"Amazon Silk",silk:s,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?i={name:"PhantomJS",phantom:s,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?i={name:"SlimerJS",slimer:s,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:w||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:m?(i={name:"WebOS",osname:"WebOS",webos:s,version:w||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(i.touchpad=s)):/bada/i.test(e)?i={name:"Bada",osname:"Bada",bada:s,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:h?i={name:"Tizen",osname:"Tizen",tizen:s,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(e)?i={name:"QupZilla",qupzilla:s,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(e)?i={name:"Chromium",chromium:s,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(e)?i={name:"Chrome",chrome:s,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:u?i={name:"Android",version:w}:/safari|applewebkit/i.test(e)?(i={name:"Safari",safari:s},w&&(i.version=w)):o?(i={name:"iphone"==o?"iPhone":"ipad"==o?"iPad":"iPod"},w&&(i.version=w)):i=/googlebot/i.test(e)?{name:"Googlebot",googlebot:s,version:t(/googlebot\/(\d+(\.\d+))/i)||w}:{name:t(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(i.name=i.name||"Blink",i.blink=s):(i.name=i.name||"Webkit",i.webkit=s),!i.version&&w&&(i.version=w)):!i.opera&&/gecko\//i.test(e)&&(i.name=i.name||"Gecko",i.gecko=s,i.version=i.version||t(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!u&&!i.silk?!i.windowsphone&&o?(i[o]=s,i.ios=s,i.osname="iOS"):g?(i.mac=s,i.osname="macOS"):_?(i.xbox=s,i.osname="Xbox"):y?(i.windows=s,i.osname="Windows"):v&&(i.linux=s,i.osname="Linux"):(i.android=s,i.osname="Android");var S="";i.windows?S=function(e){switch(e){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}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?S=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(S=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),S=S.replace(/[_\s]/g,".")):o?(S=t(/os (\d+([_\s]\d+)*) like mac os x/i),S=S.replace(/[_\s]/g,".")):u?S=t(/android[ \/-](\d+(\.\d+)*)/i):i.webos?S=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?S=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?S=t(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(S=t(/tizen[\/\s](\d+(\.\d+)*)/i)),S&&(i.osversion=S);var E=!i.windows&&S.split(".")[0];return x||l||"ipad"==o||u&&(3==E||E>=4&&!k)||i.silk?i.tablet=s:(k||"iphone"==o||"ipod"==o||u||c||i.blackberry||i.webos||i.bada)&&(i.mobile=s),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.whale&&1===n([i.version,"1.0"])||i.mzbrowser&&1===n([i.version,"6.0"])||i.focus&&1===n([i.version,"1.0"])||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=s:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=s:i.x=s,i}function t(e){return e.split(".").length}function r(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r=0;){if(i[0][n]>i[1][n])return 1;if(i[0][n]!==i[1][n])return-1;if(0===n)return 0}}function i(t,r,i){var o=a;"string"==typeof r&&(i=r,r=void 0),void 0===r&&(r=!1),i&&(o=e(i));var s=""+o.version;for(var u in t)if(t.hasOwnProperty(u)&&o[u]){if("string"!=typeof t[u])throw new Error("Browser version in the minVersion map should be a string: "+u+": "+String(t));return n([s,t[u]])<0}return r}function o(e,t,r){return!i(e,t,r)}var s=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;te._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var s=i.alloc(o.length),a=0;ae._pos&&(e.push(i.from(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(r)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":178,_process:451,buffer:196,inherits:405,"readable-stream":195}],181:[function(e,t,r){"use strict";function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function i(e,t,r){function i(e,r,n){return"string"==typeof t?t:t(e,r,n)}r||(r=Error);var o=function(e){function t(t,r,n){return e.call(this,i(t,r,n))||this}return n(t,e),t}(r);o.prototype.name=r.name,o.prototype.code=e,c[e]=o}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function s(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function a(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function u(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}var c={};i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;"string"==typeof t&&s(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(a(e," argument"))i="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var c=u(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(o(t,"type"))}return i+=". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=c},{}],182:[function(e,t,r){(function(r){"use strict";function n(e){if(!(this instanceof n))return new n(e);a.call(this,e),u.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",i)))}function i(){this._writableState.ended||r.nextTick(o,this)}function o(e){e.end()}var s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=n;var a=e("./_stream_readable"),u=e("./_stream_writable");e("inherits")(n,a);for(var c=s(u.prototype),l=0;l0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===M.prototype||(t=i(t)),n)s.endEmitted?Y(e,new K):l(e,s,t,!0);else if(s.ended)Y(e,new z);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?l(e,s,t,!1):y(e,s)):l(e,s,t,!1)}else n||(s.reading=!1,y(e,s))}return!s.ended&&(s.length=$?e=$:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function d(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function h(e,t){if(A("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?m(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,b(e)))}}function m(e){var t=e._readableState;A("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(A("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(b,e))}function b(e){var t=e._readableState;A("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,_(e)}function y(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(g,e,t))}function g(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function w(e){A("readable nexttick read 0"),e.read(0)}function x(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(k,e,t))}function k(e,t){A("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),_(e),t.flowing&&!t.reading&&e.read(0)}function _(e){var t=e._readableState;for(A("flow",t.flowing);t.flowing&&null!==e.read(););}function S(e,t){if(0===t.length)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function E(e){var t=e._readableState;A("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(O,t,e))}function O(e,t){if(A("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function T(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return A("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?E(this):m(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&E(this),null;var n=t.needReadable;A("need readable",n),(0===t.length||t.length-e0?S(e,t):null,null===i?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&E(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(e){Y(this,new V("_read()"))},u.prototype.pipe=function(e,t){function n(e,t){A("onunpipe"),e===p&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function i(){A("onend"),e.end()}function o(){A("cleanup"),e.removeListener("close",c),e.removeListener("finish",l),e.removeListener("drain",b),e.removeListener("error",u),e.removeListener("unpipe",n),p.removeListener("end",i),p.removeListener("end",f),p.removeListener("data",a),y=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||b()}function a(t){A("ondata");var r=e.write(t);A("dest.write",r),!1===r&&((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==T(d.pipes,e))&&!y&&(A("false write response, pause",d.awaitDrain),d.awaitDrain++),p.pause())}function u(t){A("onerror",t),f(),e.removeListener("error",u),0===P(e,"error")&&Y(e,t)}function c(){e.removeListener("finish",l),f()}function l(){A("onfinish"),e.removeListener("close",c),f()}function f(){A("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,A("pipe count=%d opts=%j",d.pipesCount,t);var h=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,m=h?i:f;d.endEmitted?r.nextTick(m):p.once("end",m),e.on("unpipe",n);var b=v(p);e.on("drain",b);var y=!1;return p.on("data",a),s(e,"error",u),e.once("close",c),e.once("finish",l),e.emit("pipe",p),d.flowing||(A("pipe resume"),p.resume()),e},u.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,A("on readable",i.length,i.reading),i.length?m(this):i.reading||r.nextTick(w,this))),n},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(e,t){var n=B.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(j,this),n},u.prototype.removeAllListeners=function(e){var t=B.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(j,this),t},u.prototype.resume=function(){var e=this._readableState;return e.flowing||(A("resume"),e.flowing=!e.readableListening,x(this,e)),e.paused=!1,this},u.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},u.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(A("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(A("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)){t.push(i)||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new W(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),c.prototype._write=function(e,t,r){r(new I("_write()"))},c.prototype._writev=null,c.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||S(this,n,r),this},Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=B.destroy,c.prototype._undestroy=B.undestroy,c.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":181,"./_stream_duplex":182,"./internal/streams/destroy":189,"./internal/streams/state":193,"./internal/streams/stream":194,_process:451,buffer:196,inherits:405,"util-deprecate":439}],187:[function(e,t,r){(function(r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){return{value:e,done:t}}function o(e){var t=e[l];if(null!==t){var r=e[b].read();null!==r&&(e[h]=null,e[l]=null,e[f]=null,t(i(r,!1)))}}function s(e){r.nextTick(o,e)}function a(e,t){return function(r,n){e.then(function(){if(t[d])return void r(i(void 0,!0));t[m](r,n)},n)}}var u,c=e("./end-of-stream"),l=Symbol("lastResolve"),f=Symbol("lastReject"),p=Symbol("error"),d=Symbol("ended"),h=Symbol("lastPromise"),m=Symbol("handlePromise"),b=Symbol("stream"),y=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((u={get stream(){return this[b]},next:function(){var e=this,t=this[p];if(null!==t)return Promise.reject(t);if(this[d])return Promise.resolve(i(void 0,!0)) -;if(this[b].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[p]?n(e[p]):t(i(void 0,!0))})});var n,o=this[h];if(o)n=new Promise(a(o,this));else{var s=this[b].read();if(null!==s)return Promise.resolve(i(s,!1));n=new Promise(this[m])}return this[h]=n,n}},n(u,Symbol.asyncIterator,function(){return this}),n(u,"return",function(){var e=this;return new Promise(function(t,r){e[b].destroy(null,function(e){if(e)return void r(e);t(i(void 0,!0))})})}),u),y),v=function(e){var t,r=Object.create(g,(t={},n(t,b,{value:e,writable:!0}),n(t,l,{value:null,writable:!0}),n(t,f,{value:null,writable:!0}),n(t,p,{value:null,writable:!0}),n(t,d,{value:e._readableState.endEmitted,writable:!0}),n(t,m,{value:function(e,t){var n=r[b].read();n?(r[h]=null,r[l]=null,r[f]=null,e(i(n,!1))):(r[l]=e,r[f]=t)},writable:!0}),t));return r[h]=null,c(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[f];return null!==t&&(r[h]=null,r[l]=null,r[f]=null,t(e)),void(r[p]=e)}var n=r[l];null!==n&&(r[h]=null,r[l]=null,r[f]=null,n(i(void 0,!0))),r[d]=!0}),e.on("readable",s.bind(null,r)),r};t.exports=v}).call(this,e("_process"))},{"./end-of-stream":190,_process:451}],188:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return f.alloc(0);for(var t=f.allocUnsafe(e>>>0),r=this.head,n=0;r;)c(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=f.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:h,value:function(e,t){return d(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:196,util:176}],189:[function(e,t,r){(function(e){"use strict";function r(t,r){var o=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(r?r(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(s,this,t)):e.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!r&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(i,o):(o._writableState.errorEmitted=!0,e.nextTick(n,o,t)):e.nextTick(n,o,t):r?(e.nextTick(i,o),r(t)):e.nextTick(i,o)}),this)}function n(e,t){s(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(e,t){e.emit("error",t)}function a(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}t.exports={destroy:r,undestroy:o,errorOrDestroy:a}}).call(this,e("_process"))},{_process:451}],190:[function(e,t,r){"use strict";function n(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0,function(e){i||(i=e),e&&o.forEach(a),u||(o.forEach(a),n(i))})});return t.reduce(u)}var f,p=e("../../../errors").codes,d=p.ERR_MISSING_ARGS,h=p.ERR_STREAM_DESTROYED;t.exports=l},{"../../../errors":181,"./end-of-stream":190}],193:[function(e,t,r){"use strict";function n(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function i(e,t,r,i){var s=n(t,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0){throw new o(i?r:"highWaterMark",s)}return Math.floor(s)}return e.objectMode?16:16384}var o=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:i}},{"../../../errors":181}],194:[function(e,t,r){t.exports=e("events").EventEmitter},{events:395}],195:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js"),r.Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":182,"./lib/_stream_passthrough.js":183,"./lib/_stream_readable.js":184,"./lib/_stream_transform.js":185,"./lib/_stream_writable.js":186,"./lib/internal/streams/end-of-stream.js":190,"./lib/internal/streams/pipeline.js":192}],196:[function(e,t,r){(function(t){"use strict";function n(e){if(e>Y)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return r.__proto__=t.prototype,r}function t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return a(e)}return i(e,t,r)}function i(e,r,n){if("string"==typeof e)return u(e,r);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return l(e,r,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return t.from(i,r,n);var o=f(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return t.from(e[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e,t,r){return o(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}function a(e){return o(e),n(e<0?0:0|p(e))}function u(e,r){if("string"==typeof r&&""!==r||(r="utf8"),!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var i=0|h(e,r),o=n(i),s=o.write(e,r);return s!==i&&(o=o.slice(0,s)),o}function c(e){for(var t=e.length<0?0:0|p(e.length),r=n(t),i=0;i=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),t.alloc(+e)}function h(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(o)return i?-1:D(e).length;r=(""+r).toLowerCase(),o=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,z(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:g(e,r,n,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):g(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}var c;if(i){var l=-1;for(c=r;ca&&(r=a-u),c=r;c>=0;c--){for(var f=!0,p=0;pi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,c,l,f;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(f=(31&o)<<6|63&u)>127&&(s=f);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(s=f);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(s=f)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return O(n)}function O(e){var t=e.length;if(t<=X)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function M(e,r,n,i,o,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||re.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return t=+t,r>>>=0,i||C(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,r,n,23,4),r+4}function q(e,t,r,n,i){return t=+t,r>>>=0,i||C(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,r,n,52,8),r+8}function I(e){if(e=e.split("=")[0],e=e.trim().replace($,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function D(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function F(e){return V.toByteArray(I(e))}function W(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!==e}var V=e("base64-js"),K=e("ieee754");r.Buffer=t,r.SlowBuffer=d,r.INSPECT_MAX_BYTES=50;var Y=2147483647;r.kMaxLength=Y,t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),t.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,r){return i(e,t,r)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,r){return s(e,t,r)},t.allocUnsafe=function(e){return a(e)},t.allocUnsafeSlow=function(e){return a(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(H(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),H(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);ot&&(e+=" ... "),""},t.prototype.compare=function(e,r,n,i,o){if(H(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=n-r,u=Math.min(s,a),c=this.slice(i,o),l=e.slice(r,n),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return j(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o=i&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},t.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),K.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),K.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),K.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),K.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){M(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){M(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return q(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return q(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),r);return o},t.prototype.fill=function(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e&&(e&=255);if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=r;s>8&255]},M=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},C=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},N=function(e){return R(e,23,4)},q=function(e){return R(e,52,8)},I=function(e,t){y(e.prototype,t,{get:function(){return w(this)[t]}})},L=function(e,t,r,n){var i=p(r),o=w(e);if(i+t>o.byteLength)throw T("Wrong index");var s=w(o.buffer).bytes,a=i+o.byteOffset,u=s.slice(a,a+t);return n?u:u.reverse()},D=function(e,t,r,n,i,o){var s=p(r),a=w(e);if(s+t>a.byteLength)throw T("Wrong index");for(var u=w(a.buffer).bytes,c=s+a.byteOffset,l=n(+i),f=0;fW;)(U=F[W++])in _||s(_,U,k[U]);G.constructor=_}m&&h(E)!==O&&m(E,O);var H=new S(new _(2)),z=E.setInt8;H.setInt8(0,2147483648),H.setInt8(1,2147483649),!H.getInt8(0)&&H.getInt8(1)||a(E,{setInt8:function(e,t){z.call(this,e,t<<24>>24)},setUint8:function(e,t){z.call(this,e,t<<24>>24)}},{unsafe:!0})}else _=function(e){c(this,_,"ArrayBuffer");var t=p(e);x(this,{bytes:g.call(new Array(t),0),byteLength:t}),i||(this.byteLength=t)},S=function(e,t,r){c(this,S,"DataView"),c(e,_,"DataView");var n=w(e).byteLength,o=l(t);if(o<0||o>n)throw T("Wrong offset");if(r=void 0===r?n-o:f(r),o+r>n)throw T("Wrong length");x(this,{buffer:e,byteLength:r,byteOffset:o}),i||(this.buffer=e,this.byteLength=r,this.byteOffset=o)},i&&(I(_,"byteLength"),I(S,"buffer"),I(S,"byteLength"),I(S,"byteOffset")),a(S.prototype,{getInt8:function(e){return L(this,1,e)[0]<<24>>24},getUint8:function(e){return L(this,1,e)[0]},getInt16:function(e){var t=L(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=L(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return C(L(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return C(L(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return A(L(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return A(L(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){D(this,1,e,P,t)},setUint8:function(e,t){D(this,1,e,P,t)},setInt16:function(e,t){D(this,2,e,B,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){D(this,2,e,B,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){D(this,4,e,M,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){D(this,4,e,M,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){D(this,4,e,N,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){D(this,8,e,q,t,arguments.length>2?arguments[2]:void 0)}});v(_,"ArrayBuffer"),v(S,"DataView"),t.exports={ArrayBuffer:_,DataView:S}},{"../internals/an-instance":204,"../internals/array-buffer-native":206,"../internals/array-fill":210,"../internals/create-non-enumerable-property":229,"../internals/descriptors":234,"../internals/fails":243,"../internals/global":248,"../internals/ieee754":254,"../internals/internal-state":258,"../internals/object-define-property":278,"../internals/object-get-own-property-names":281,"../internals/object-get-prototype-of":283,"../internals/object-set-prototype-of":287,"../internals/redefine-all":294,"../internals/set-to-string-tag":304,"../internals/to-index":314,"../internals/to-integer":316,"../internals/to-length":317}],209:[function(e,t,r){"use strict";var n=e("../internals/to-object"),i=e("../internals/to-absolute-index"),o=e("../internals/to-length"),s=Math.min;t.exports=[].copyWithin||function(e,t){var r=n(this),a=o(r.length),u=i(e,a),c=i(t,a),l=arguments.length>2?arguments[2]:void 0,f=s((void 0===l?a:i(l,a))-c,a-u),p=1;for(c0;)c in r?r[u]=r[c]:delete r[u],u+=p,c+=p;return r}},{"../internals/to-absolute-index":313,"../internals/to-length":317,"../internals/to-object":318}],210:[function(e,t,r){"use strict";var n=e("../internals/to-object"),i=e("../internals/to-absolute-index"),o=e("../internals/to-length");t.exports=function(e){for(var t=n(this),r=o(t.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,r),u=s>2?arguments[2]:void 0,c=void 0===u?r:i(u,r);c>a;)t[a++]=e;return t}},{"../internals/to-absolute-index":313,"../internals/to-length":317,"../internals/to-object":318}],211:[function(e,t,r){"use strict";var n=e("../internals/array-iteration").forEach,i=e("../internals/array-method-is-strict"),o=e("../internals/array-method-uses-to-length"),s=i("forEach"),a=o("forEach");t.exports=s&&a?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},{"../internals/array-iteration":214,"../internals/array-method-is-strict":217,"../internals/array-method-uses-to-length":218}],212:[function(e,t,r){"use strict";var n=e("../internals/function-bind-context"),i=e("../internals/to-object"),o=e("../internals/call-with-safe-iteration-closing"),s=e("../internals/is-array-iterator-method"),a=e("../internals/to-length"),u=e("../internals/create-property"),c=e("../internals/get-iterator-method");t.exports=function(e){var t,r,l,f,p,d,h=i(e),m="function"==typeof this?this:Array,b=arguments.length,y=b>1?arguments[1]:void 0,g=void 0!==y,v=c(h),j=0;if(g&&(y=n(y,b>2?arguments[2]:void 0,2)),void 0==v||m==Array&&s(v))for(t=a(h.length),r=new m(t);t>j;j++)d=g?y(h[j],j):h[j],u(r,j,d);else for(f=v.call(h),p=f.next,r=new m;!(l=p.call(f)).done;j++)d=g?o(f,y,[l.value,j],!0):l.value,u(r,j,d);return r.length=j,r}},{"../internals/call-with-safe-iteration-closing":221,"../internals/create-property":231,"../internals/function-bind-context":245,"../internals/get-iterator-method":247,"../internals/is-array-iterator-method":259,"../internals/to-length":317,"../internals/to-object":318}],213:[function(e,t,r){var n=e("../internals/to-indexed-object"),i=e("../internals/to-length"),o=e("../internals/to-absolute-index"),s=function(e){return function(t,r,s){var a,u=n(t),c=i(u.length),l=o(s,c);if(e&&r!=r){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},{"../internals/to-absolute-index":313,"../internals/to-indexed-object":315,"../internals/to-length":317}],214:[function(e,t,r){var n=e("../internals/function-bind-context"),i=e("../internals/indexed-object"),o=e("../internals/to-object"),s=e("../internals/to-length"),a=e("../internals/array-species-create"),u=[].push,c=function(e){var t=1==e,r=2==e,c=3==e,l=4==e,f=6==e,p=5==e||f;return function(d,h,m,b){for(var y,g,v=o(d),j=i(v),w=n(h,m,3),x=s(j.length),k=0,_=b||a,S=t?_(d,x):r?_(d,0):void 0;x>k;k++)if((p||k in j)&&(y=j[k],g=w(y,k,v),e))if(t)S[k]=g;else if(g)switch(e){case 3:return!0;case 5:return y;case 6:return k;case 2:u.call(S,y)}else if(l)return!1;return f?-1:c||l?l:S}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},{"../internals/array-species-create":220,"../internals/function-bind-context":245,"../internals/indexed-object":255,"../internals/to-length":317,"../internals/to-object":318}],215:[function(e,t,r){"use strict";var n=e("../internals/to-indexed-object"),i=e("../internals/to-integer"),o=e("../internals/to-length"),s=e("../internals/array-method-is-strict"),a=e("../internals/array-method-uses-to-length"),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,f=s("lastIndexOf"),p=a("indexOf",{ACCESSORS:!0,1:0}),d=l||!f||!p;t.exports=d?function(e){if(l)return c.apply(this,arguments)||0;var t=n(this),r=o(t.length),s=r-1;for(arguments.length>1&&(s=u(s,i(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:c},{"../internals/array-method-is-strict":217,"../internals/array-method-uses-to-length":218,"../internals/to-indexed-object":315,"../internals/to-integer":316,"../internals/to-length":317}],216:[function(e,t,r){var n=e("../internals/fails"),i=e("../internals/well-known-symbol"),o=e("../internals/engine-v8-version"),s=i("species");t.exports=function(e){return o>=51||!n(function(){var t=[],r=t.constructor={};return r[s]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},{"../internals/engine-v8-version":240,"../internals/fails":243,"../internals/well-known-symbol":329}],217:[function(e,t,r){"use strict";var n=e("../internals/fails");t.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){throw 1},1)})}},{"../internals/fails":243}],218:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/fails"),o=e("../internals/has"),s=Object.defineProperty,a={},u=function(e){throw e};t.exports=function(e,t){if(o(a,e))return a[e];t||(t={});var r=[][e],c=!!o(t,"ACCESSORS")&&t.ACCESSORS,l=o(t,0)?t[0]:u,f=o(t,1)?t[1]:void 0;return a[e]=!!r&&!i(function(){if(c&&!n)return!0;var e={length:-1};c?s(e,1,{enumerable:!0,get:u}):e[1]=1,r.call(e,l,f)})}},{"../internals/descriptors":234,"../internals/fails":243,"../internals/has":249}],219:[function(e,t,r){var n=e("../internals/a-function"),i=e("../internals/to-object"),o=e("../internals/indexed-object"),s=e("../internals/to-length"),a=function(e){return function(t,r,a,u){n(r);var c=i(t),l=o(c),f=s(c.length),p=e?f-1:0,d=e?-1:1;if(a<2)for(;;){if(p in l){u=l[p],p+=d;break}if(p+=d,e?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;e?p>=0:f>p;p+=d)p in l&&(u=r(u,l[p],p,c));return u}};t.exports={left:a(!1),right:a(!0)}},{"../internals/a-function":200,"../internals/indexed-object":255,"../internals/to-length":317,"../internals/to-object":318}],220:[function(e,t,r){var n=e("../internals/is-object"),i=e("../internals/is-array"),o=e("../internals/well-known-symbol"),s=o("species");t.exports=function(e,t){var r;return i(e)&&(r=e.constructor,"function"!=typeof r||r!==Array&&!i(r.prototype)?n(r)&&null===(r=r[s])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},{"../internals/is-array":260,"../internals/is-object":262,"../internals/well-known-symbol":329}],221:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/iterator-close");t.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){throw i(e),t}}},{"../internals/an-object":205,"../internals/iterator-close":266}],222:[function(e,t,r){var n=e("../internals/well-known-symbol"),i=n("iterator"),o=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){o=!0}};a[i]=function(){return this},Array.from(a,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var n={};n[i]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}},{"../internals/well-known-symbol":329}],223:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],224:[function(e,t,r){var n=e("../internals/to-string-tag-support"),i=e("../internals/classof-raw"),o=e("../internals/well-known-symbol"),s=o("toStringTag"),a="Arguments"==i(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(e){}};t.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=u(t=Object(e),s))?r:a?i(t):"Object"==(n=i(t))&&"function"==typeof t.callee?"Arguments":n}},{"../internals/classof-raw":223,"../internals/to-string-tag-support":322,"../internals/well-known-symbol":329}],225:[function(e,t,r){var n=e("../internals/has"),i=e("../internals/own-keys"),o=e("../internals/object-get-own-property-descriptor"),s=e("../internals/object-define-property");t.exports=function(e,t){for(var r=i(t),a=s.f,u=o.f,c=0;c=74)&&(n=s.match(/Chrome\/(\d+)/))&&(i=n[1]),t.exports=i&&+i},{"../internals/engine-user-agent":239,"../internals/global":248}],241:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],242:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/object-get-own-property-descriptor").f,o=e("../internals/create-non-enumerable-property"),s=e("../internals/redefine"),a=e("../internals/set-global"),u=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var r,l,f,p,d,h=e.target,m=e.global,b=e.stat;if(r=m?n:b?n[h]||a(h,{}):(n[h]||{}).prototype)for(l in t){if(p=t[l],e.noTargetGet?(d=i(r,l),f=d&&d.value):f=r[l],!c(m?l:h+(b?".":"#")+l,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(e.sham||f&&f.sham)&&o(p,"sham",!0),s(r,l,p,e)}}},{"../internals/copy-constructor-properties":225,"../internals/create-non-enumerable-property":229,"../internals/global":248,"../internals/is-forced":261,"../internals/object-get-own-property-descriptor":279,"../internals/redefine":295,"../internals/set-global":302}],243:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],244:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var n=e("../internals/redefine"),i=e("../internals/fails"),o=e("../internals/well-known-symbol"),s=e("../internals/regexp-exec"),a=e("../internals/create-non-enumerable-property"),u=o("species"),c=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),l=function(){return"$0"==="a".replace(/./,"$0")}(),f=o("replace"),p=function(){return!!/./[f]&&""===/./[f]("a","$0")}(),d=!i(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]});t.exports=function(e,t,r,f){var h=o(e),m=!i(function(){var t={};return t[h]=function(){return 7},7!=""[e](t)}),b=m&&!i(function(){var t=!1,r=/a/;return"split"===e&&(r={},r.constructor={},r.constructor[u]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return t=!0,null},r[h](""),!t});if(!m||!b||"replace"===e&&(!c||!l||p)||"split"===e&&!d){var y=/./[h],g=r(h,""[e],function(e,t,r,n,i){return t.exec===s?m&&!i?{done:!0,value:y.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}},{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),v=g[0],j=g[1];n(String.prototype,e,v),n(RegExp.prototype,h,2==t?function(e,t){return j.call(e,this,t)}:function(e){return j.call(e,this)})}f&&a(RegExp.prototype[h],"sham",!0)}},{"../internals/create-non-enumerable-property":229,"../internals/fails":243,"../internals/redefine":295,"../internals/regexp-exec":297,"../internals/well-known-symbol":329,"../modules/es.regexp.exec":355}],245:[function(e,t,r){var n=e("../internals/a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":200}],246:[function(e,t,r){var n=e("../internals/path"),i=e("../internals/global"),o=function(e){return"function"==typeof e?e:void 0};t.exports=function(e,t){return arguments.length<2?o(n[e])||o(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},{"../internals/global":248,"../internals/path":291}],247:[function(e,t,r){var n=e("../internals/classof"),i=e("../internals/iterators"),o=e("../internals/well-known-symbol"),s=o("iterator");t.exports=function(e){if(void 0!=e)return e[s]||e["@@iterator"]||i[n(e)]}},{"../internals/classof":224,"../internals/iterators":268,"../internals/well-known-symbol":329}],248:[function(e,t,r){(function(e){var r=function(e){return e&&e.Math==Math&&e};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],249:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],250:[function(e,t,r){t.exports={}},{}],251:[function(e,t,r){var n=e("../internals/global");t.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},{"../internals/global":248}],252:[function(e,t,r){var n=e("../internals/get-built-in");t.exports=n("document","documentElement")},{"../internals/get-built-in":246}],253:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/fails"),o=e("../internals/document-create-element");t.exports=!n&&!i(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},{"../internals/descriptors":234,"../internals/document-create-element":235,"../internals/fails":243}],254:[function(e,t,r){var n=Math.abs,i=Math.pow,o=Math.floor,s=Math.log,a=Math.LN2,u=function(e,t,r){var u,c,l,f=new Array(r),p=8*r-t-1,d=(1<>1,m=23===t?i(2,-24)-i(2,-77):0,b=e<0||0===e&&1/e<0?1:0,y=0;for(e=n(e),e!=e||e===1/0?(c=e!=e?1:0,u=d):(u=o(s(e)/a),e*(l=i(2,-u))<1&&(u--,l*=2),e+=u+h>=1?m/l:m*i(2,1-h),e*l>=2&&(u++,l/=2),u+h>=d?(c=0,u=d):u+h>=1?(c=(e*l-1)*i(2,t),u+=h):(c=e*i(2,h-1)*i(2,t),u=0));t>=8;f[y++]=255&c,c/=256,t-=8);for(u=u<0;f[y++]=255&u,u/=256,p-=8);return f[--y]|=128*b,f},c=function(e,t){var r,n=e.length,o=8*n-t-1,s=(1<>1,u=o-7,c=n-1,l=e[c--],f=127&l;for(l>>=7;u>0;f=256*f+e[c],c--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=t;u>0;r=256*r+e[c],c--,u-=8);if(0===f)f=1-a;else{if(f===s)return r?NaN:l?-1/0:1/0;r+=i(2,t),f-=a}return(l?-1:1)*r*i(2,f-t)};t.exports={pack:u,unpack:c}},{}],255:[function(e,t,r){var n=e("../internals/fails"),i=e("../internals/classof-raw"),o="".split;t.exports=n(function(){return!Object("z").propertyIsEnumerable(0) -})?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},{"../internals/classof-raw":223,"../internals/fails":243}],256:[function(e,t,r){var n=e("../internals/is-object"),i=e("../internals/object-set-prototype-of");t.exports=function(e,t,r){var o,s;return i&&"function"==typeof(o=t.constructor)&&o!==r&&n(s=o.prototype)&&s!==r.prototype&&i(e,s),e}},{"../internals/is-object":262,"../internals/object-set-prototype-of":287}],257:[function(e,t,r){var n=e("../internals/shared-store"),i=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return i.call(e)}),t.exports=n.inspectSource},{"../internals/shared-store":306}],258:[function(e,t,r){var n,i,o,s=e("../internals/native-weak-map"),a=e("../internals/global"),u=e("../internals/is-object"),c=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),f=e("../internals/shared-store"),p=e("../internals/shared-key"),d=e("../internals/hidden-keys"),h=a.WeakMap,m=function(e){return o(e)?i(e):n(e,{})},b=function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if(s){var y=f.state||(f.state=new h),g=y.get,v=y.has,j=y.set;n=function(e,t){return t.facade=e,j.call(y,e,t),t},i=function(e){return g.call(y,e)||{}},o=function(e){return v.call(y,e)}}else{var w=p("state");d[w]=!0,n=function(e,t){return t.facade=e,c(e,w,t),t},i=function(e){return l(e,w)?e[w]:{}},o=function(e){return l(e,w)}}t.exports={set:n,get:i,has:o,enforce:m,getterFor:b}},{"../internals/create-non-enumerable-property":229,"../internals/global":248,"../internals/has":249,"../internals/hidden-keys":250,"../internals/is-object":262,"../internals/native-weak-map":272,"../internals/shared-key":305,"../internals/shared-store":306}],259:[function(e,t,r){var n=e("../internals/well-known-symbol"),i=e("../internals/iterators"),o=n("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||s[o]===e)}},{"../internals/iterators":268,"../internals/well-known-symbol":329}],260:[function(e,t,r){var n=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"../internals/classof-raw":223}],261:[function(e,t,r){var n=e("../internals/fails"),i=/#|\.prototype\./,o=function(e,t){var r=a[s(e)];return r==c||r!=u&&("function"==typeof t?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},{"../internals/fails":243}],262:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],263:[function(e,t,r){t.exports=!1},{}],264:[function(e,t,r){var n=e("../internals/is-object"),i=e("../internals/classof-raw"),o=e("../internals/well-known-symbol"),s=o("match");t.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==i(e))}},{"../internals/classof-raw":223,"../internals/is-object":262,"../internals/well-known-symbol":329}],265:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/is-array-iterator-method"),o=e("../internals/to-length"),s=e("../internals/function-bind-context"),a=e("../internals/get-iterator-method"),u=e("../internals/iterator-close"),c=function(e,t){this.stopped=e,this.result=t};t.exports=function(e,t,r){var l,f,p,d,h,m,b,y=r&&r.that,g=!(!r||!r.AS_ENTRIES),v=!(!r||!r.IS_ITERATOR),j=!(!r||!r.INTERRUPTED),w=s(t,y,1+g+j),x=function(e){return l&&u(l),new c(!0,e)},k=function(e){return g?(n(e),j?w(e[0],e[1],x):w(e[0],e[1])):j?w(e,x):w(e)};if(v)l=e;else{if("function"!=typeof(f=a(e)))throw TypeError("Target is not iterable");if(i(f)){for(p=0,d=o(e.length);d>p;p++)if((h=k(e[p]))&&h instanceof c)return h;return new c(!1)}l=f.call(e)}for(m=l.next;!(b=m.call(l)).done;){try{h=k(b.value)}catch(e){throw u(l),e}if("object"==typeof h&&h&&h instanceof c)return h}return new c(!1)}},{"../internals/an-object":205,"../internals/function-bind-context":245,"../internals/get-iterator-method":247,"../internals/is-array-iterator-method":259,"../internals/iterator-close":266,"../internals/to-length":317}],266:[function(e,t,r){var n=e("../internals/an-object");t.exports=function(e){var t=e.return;if(void 0!==t)return n(t.call(e)).value}},{"../internals/an-object":205}],267:[function(e,t,r){"use strict";var n,i,o,s=e("../internals/object-get-prototype-of"),a=e("../internals/create-non-enumerable-property"),u=e("../internals/has"),c=e("../internals/well-known-symbol"),l=e("../internals/is-pure"),f=c("iterator"),p=!1,d=function(){return this};[].keys&&(o=[].keys(),"next"in o?(i=s(s(o)))!==Object.prototype&&(n=i):p=!0),void 0==n&&(n={}),l||u(n,f)||a(n,f,d),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},{"../internals/create-non-enumerable-property":229,"../internals/has":249,"../internals/is-pure":263,"../internals/object-get-prototype-of":283,"../internals/well-known-symbol":329}],268:[function(e,t,r){arguments[4][250][0].apply(r,arguments)},{dup:250}],269:[function(e,t,r){var n,i,o,s,a,u,c,l,f=e("../internals/global"),p=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/task").set,h=e("../internals/engine-is-ios"),m=e("../internals/engine-is-node"),b=f.MutationObserver||f.WebKitMutationObserver,y=f.document,g=f.process,v=f.Promise,j=p(f,"queueMicrotask"),w=j&&j.value;w||(n=function(){var e,t;for(m&&(e=g.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?s():o=void 0,e}}o=void 0,e&&e.enter()},!h&&!m&&b&&y?(a=!0,u=y.createTextNode(""),new b(n).observe(u,{characterData:!0}),s=function(){u.data=a=!a}):v&&v.resolve?(c=v.resolve(void 0),l=c.then,s=function(){l.call(c,n)}):s=m?function(){g.nextTick(n)}:function(){d.call(f,n)}),t.exports=w||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,s()),o=t}},{"../internals/engine-is-ios":237,"../internals/engine-is-node":238,"../internals/global":248,"../internals/object-get-own-property-descriptor":279,"../internals/task":312}],270:[function(e,t,r){var n=e("../internals/global");t.exports=n.Promise},{"../internals/global":248}],271:[function(e,t,r){var n=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!n(function(){return!String(Symbol())})},{"../internals/fails":243}],272:[function(e,t,r){var n=e("../internals/global"),i=e("../internals/inspect-source"),o=n.WeakMap;t.exports="function"==typeof o&&/native code/.test(i(o))},{"../internals/global":248,"../internals/inspect-source":257}],273:[function(e,t,r){"use strict";var n=e("../internals/a-function"),i=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};t.exports.f=function(e){return new i(e)}},{"../internals/a-function":200}],274:[function(e,t,r){var n=e("../internals/is-regexp");t.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},{"../internals/is-regexp":264}],275:[function(e,t,r){"use strict";var n=e("../internals/descriptors"),i=e("../internals/fails"),o=e("../internals/object-keys"),s=e("../internals/object-get-own-property-symbols"),a=e("../internals/object-property-is-enumerable"),u=e("../internals/to-object"),c=e("../internals/indexed-object"),l=Object.assign,f=Object.defineProperty;t.exports=!l||i(function(){if(n&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach(function(e){t[e]=e}),7!=l({},e)[r]||o(l({},t)).join("")!=i})?function(e,t){for(var r=u(e),i=arguments.length,l=1,f=s.f,p=a.f;i>l;)for(var d,h=c(arguments[l++]),m=f?o(h).concat(f(h)):o(h),b=m.length,y=0;b>y;)d=m[y++],n&&!p.call(h,d)||(r[d]=h[d]);return r}:l},{"../internals/descriptors":234,"../internals/fails":243,"../internals/indexed-object":255,"../internals/object-get-own-property-symbols":282,"../internals/object-keys":285,"../internals/object-property-is-enumerable":286,"../internals/to-object":318}],276:[function(e,t,r){var n,i=e("../internals/an-object"),o=e("../internals/object-define-properties"),s=e("../internals/enum-bug-keys"),a=e("../internals/hidden-keys"),u=e("../internals/html"),c=e("../internals/document-create-element"),l=e("../internals/shared-key"),f=l("IE_PROTO"),p=function(){},d=function(e){return"