From ccffa6614f004644fd179ed8dd268787b924e395 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 19 Jan 2024 10:04:54 +0000 Subject: [PATCH] chore(release): 6.20.0 [skip ci] # [6.20.0](https://github.com/ali-sdk/ali-oss/compare/v6.19.0...v6.20.0) (2024-01-19) ### Bug Fixes * fix merge proto and add change log ([#1278](https://github.com/ali-sdk/ali-oss/issues/1278)) ([8e7be93](https://github.com/ali-sdk/ali-oss/commit/8e7be93ca59b3f723c236582c5875dd28f6eb129)) ### Features * add strict object name validation ([#1265](https://github.com/ali-sdk/ali-oss/issues/1265)) ([830e36e](https://github.com/ali-sdk/ali-oss/commit/830e36ea143b57e09e42d0634bc0c4d07474a2a5)) * support signature v4 ([#1277](https://github.com/ali-sdk/ali-oss/issues/1277)) ([8bbe9b1](https://github.com/ali-sdk/ali-oss/commit/8bbe9b1ac8aa34c1564a1ad11549b67fc1db7f3a)) --- dist/aliyun-oss-sdk.js | 17732 +++++++++++++++++++---------------- dist/aliyun-oss-sdk.min.js | 4 +- lib/browser/version.js | 2 +- package.json | 2 +- 4 files changed, 9569 insertions(+), 8171 deletions(-) diff --git a/dist/aliyun-oss-sdk.js b/dist/aliyun-oss-sdk.js index 6329d1d5..77ebe84b 100644 --- a/dist/aliyun-oss-sdk.js +++ b/dist/aliyun-oss-sdk.js @@ -1,53 +1,44 @@ -// Aliyun OSS SDK for JavaScript v6.19.0 +// Aliyun OSS SDK for JavaScript v6.20.0 // Copyright Aliyun.com, Inc. or its affiliates. All Rights Reserved. // License at https://github.com/ali-sdk/ali-oss/blob/master/LICENSE (function(global){(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\n"); - - if (prefix) { - xml += "".concat(prefix, "\n"); - } - - xml += '\n'; - params.content = xml; - params.mime = 'xml'; - params.successStatuses = [200]; - _context4.next = 9; - return this.request(params); - - case 9: - result = _context4.sent; - return _context4.abrupt("return", { - res: result.res - }); - - case 11: - case "end": - return _context4.stop(); - } + while (1) switch (_context4.prev = _context4.next) { + case 0: + params = this._bucketRequestParams('PUT', name, 'logging', options); + xml = '\n\n\n'.concat(name, "\n"); + if (prefix) { + xml += "".concat(prefix, "\n"); + } + xml += '\n'; + params.content = xml; + params.mime = 'xml'; + params.successStatuses = [200]; + _context4.next = 9; + return this.request(params); + case 9: + result = _context4.sent; + return _context4.abrupt("return", { + res: result.res + }); + case 11: + case "end": + return _context4.stop(); } }, _callee4, this); })); - function putBucketLogging(_x8, _x9, _x10) { return _putBucketLogging.apply(this, arguments); } - return putBucketLogging; }(); - proto.getBucketLogging = /*#__PURE__*/function () { var _getBucketLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(name, options) { var params, result, enable; return _regenerator.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - params = this._bucketRequestParams('GET', name, 'logging', options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context5.next = 5; - return this.request(params); - - case 5: - result = _context5.sent; - enable = result.data.LoggingEnabled; - return _context5.abrupt("return", { - enable: !!enable, - prefix: enable && enable.TargetPrefix || null, - res: result.res - }); - - case 8: - case "end": - return _context5.stop(); - } + while (1) switch (_context5.prev = _context5.next) { + case 0: + params = this._bucketRequestParams('GET', name, 'logging', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context5.next = 5; + return this.request(params); + case 5: + result = _context5.sent; + enable = result.data.LoggingEnabled; + return _context5.abrupt("return", { + enable: !!enable, + prefix: enable && enable.TargetPrefix || null, + res: result.res + }); + case 8: + case "end": + return _context5.stop(); } }, _callee5, this); })); - function getBucketLogging(_x11, _x12) { return _getBucketLogging.apply(this, arguments); } - return getBucketLogging; }(); - proto.deleteBucketLogging = /*#__PURE__*/function () { var _deleteBucketLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(name, options) { var params, result; return _regenerator.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - params = this._bucketRequestParams('DELETE', name, 'logging', options); - params.successStatuses = [204, 200]; - _context6.next = 4; - return this.request(params); - - case 4: - result = _context6.sent; - return _context6.abrupt("return", { - res: result.res - }); - - case 6: - case "end": - return _context6.stop(); - } + while (1) switch (_context6.prev = _context6.next) { + case 0: + params = this._bucketRequestParams('DELETE', name, 'logging', options); + params.successStatuses = [204, 200]; + _context6.next = 4; + return this.request(params); + case 4: + result = _context6.sent; + return _context6.abrupt("return", { + res: result.res + }); + case 6: + case "end": + return _context6.stop(); } }, _callee6, this); })); - function deleteBucketLogging(_x13, _x14) { return _deleteBucketLogging.apply(this, arguments); } - return deleteBucketLogging; }(); - proto.putBucketCORS = /*#__PURE__*/function () { var _putBucketCORS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(name, rules, options) { var params, xml, parseOrigin, parseMethod, parseHeader, parseExposeHeader, i, l, rule, result; return _regenerator.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - rules = rules || []; - assert(rules.length, 'rules is required'); - rules.forEach(function (rule) { - assert(rule.allowedOrigin, 'allowedOrigin is required'); - assert(rule.allowedMethod, 'allowedMethod is required'); - }); - params = this._bucketRequestParams('PUT', name, 'cors', options); - xml = '\n'; - - parseOrigin = function parseOrigin(val) { - xml += "".concat(val, ""); - }; - - parseMethod = function parseMethod(val) { - xml += "".concat(val, ""); - }; - - parseHeader = function parseHeader(val) { - xml += "".concat(val, ""); - }; - - parseExposeHeader = function parseExposeHeader(val) { - xml += "".concat(val, ""); - }; - - for (i = 0, l = rules.length; i < l; i++) { - rule = rules[i]; - xml += ''; - toArray(rule.allowedOrigin).forEach(parseOrigin); - toArray(rule.allowedMethod).forEach(parseMethod); - toArray(rule.allowedHeader).forEach(parseHeader); - toArray(rule.exposeHeader).forEach(parseExposeHeader); - - if (rule.maxAgeSeconds) { - xml += "".concat(rule.maxAgeSeconds, ""); - } - - xml += ''; + while (1) switch (_context7.prev = _context7.next) { + case 0: + rules = rules || []; + assert(rules.length, 'rules is required'); + rules.forEach(function (rule) { + assert(rule.allowedOrigin, 'allowedOrigin is required'); + assert(rule.allowedMethod, 'allowedMethod is required'); + }); + params = this._bucketRequestParams('PUT', name, 'cors', options); + xml = '\n'; + parseOrigin = function parseOrigin(val) { + xml += "".concat(val, ""); + }; + parseMethod = function parseMethod(val) { + xml += "".concat(val, ""); + }; + parseHeader = function parseHeader(val) { + xml += "".concat(val, ""); + }; + parseExposeHeader = function parseExposeHeader(val) { + xml += "".concat(val, ""); + }; + for (i = 0, l = rules.length; i < l; i++) { + rule = rules[i]; + xml += ''; + toArray(rule.allowedOrigin).forEach(parseOrigin); + toArray(rule.allowedMethod).forEach(parseMethod); + toArray(rule.allowedHeader).forEach(parseHeader); + toArray(rule.exposeHeader).forEach(parseExposeHeader); + if (rule.maxAgeSeconds) { + xml += "".concat(rule.maxAgeSeconds, ""); } - - xml += ''; - params.content = xml; - params.mime = 'xml'; - params.successStatuses = [200]; - _context7.next = 16; - return this.request(params); - - case 16: - result = _context7.sent; - return _context7.abrupt("return", { - res: result.res - }); - - case 18: - case "end": - return _context7.stop(); - } + xml += ''; + } + xml += ''; + params.content = xml; + params.mime = 'xml'; + params.successStatuses = [200]; + _context7.next = 16; + return this.request(params); + case 16: + result = _context7.sent; + return _context7.abrupt("return", { + res: result.res + }); + case 18: + case "end": + return _context7.stop(); } }, _callee7, this); })); - function putBucketCORS(_x15, _x16, _x17) { return _putBucketCORS.apply(this, arguments); } - return putBucketCORS; }(); - proto.getBucketCORS = /*#__PURE__*/function () { var _getBucketCORS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(name, options) { var params, result, rules, CORSRule; return _regenerator.default.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - params = this._bucketRequestParams('GET', name, 'cors', options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context8.next = 5; - return this.request(params); - - case 5: - result = _context8.sent; - rules = []; - - if (result.data && result.data.CORSRule) { - CORSRule = result.data.CORSRule; - if (!isArray(CORSRule)) CORSRule = [CORSRule]; - CORSRule.forEach(function (rule) { - var r = {}; - Object.keys(rule).forEach(function (key) { - r[key.slice(0, 1).toLowerCase() + key.slice(1, key.length)] = rule[key]; - }); - rules.push(r); + while (1) switch (_context8.prev = _context8.next) { + case 0: + params = this._bucketRequestParams('GET', name, 'cors', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context8.next = 5; + return this.request(params); + case 5: + result = _context8.sent; + rules = []; + if (result.data && result.data.CORSRule) { + CORSRule = result.data.CORSRule; + if (!isArray(CORSRule)) CORSRule = [CORSRule]; + CORSRule.forEach(function (rule) { + var r = {}; + Object.keys(rule).forEach(function (key) { + r[key.slice(0, 1).toLowerCase() + key.slice(1, key.length)] = rule[key]; }); - } - - return _context8.abrupt("return", { - rules: rules, - res: result.res + rules.push(r); }); - - case 9: - case "end": - return _context8.stop(); - } + } + return _context8.abrupt("return", { + rules: rules, + res: result.res + }); + case 9: + case "end": + return _context8.stop(); } }, _callee8, this); })); - function getBucketCORS(_x18, _x19) { return _getBucketCORS.apply(this, arguments); } - return getBucketCORS; }(); - proto.deleteBucketCORS = /*#__PURE__*/function () { var _deleteBucketCORS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(name, options) { var params, result; return _regenerator.default.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - params = this._bucketRequestParams('DELETE', name, 'cors', options); - params.successStatuses = [204]; - _context9.next = 4; - return this.request(params); - - case 4: - result = _context9.sent; - return _context9.abrupt("return", { - res: result.res - }); - - case 6: - case "end": - return _context9.stop(); - } + while (1) switch (_context9.prev = _context9.next) { + case 0: + params = this._bucketRequestParams('DELETE', name, 'cors', options); + params.successStatuses = [204]; + _context9.next = 4; + return this.request(params); + case 4: + result = _context9.sent; + return _context9.abrupt("return", { + res: result.res + }); + case 6: + case "end": + return _context9.stop(); } }, _callee9, this); })); - function deleteBucketCORS(_x20, _x21) { return _deleteBucketCORS.apply(this, arguments); } - return deleteBucketCORS; -}(); // referer +}(); +// referer proto.putBucketReferer = /*#__PURE__*/function () { var _putBucketReferer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(name, allowEmpty, referers, options) { var params, xml, i, result; return _regenerator.default.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - params = this._bucketRequestParams('PUT', name, 'referer', options); - xml = '\n\n'; - xml += " ".concat(allowEmpty ? 'true' : 'false', "\n"); - - if (referers && referers.length > 0) { - xml += ' \n'; - - for (i = 0; i < referers.length; i++) { - xml += " ".concat(referers[i], "\n"); - } - - xml += ' \n'; - } else { - xml += ' \n'; + while (1) switch (_context10.prev = _context10.next) { + case 0: + params = this._bucketRequestParams('PUT', name, 'referer', options); + xml = '\n\n'; + xml += " ".concat(allowEmpty ? 'true' : 'false', "\n"); + if (referers && referers.length > 0) { + xml += ' \n'; + for (i = 0; i < referers.length; i++) { + xml += " ".concat(referers[i], "\n"); } - - xml += ''; - params.content = xml; - params.mime = 'xml'; - params.successStatuses = [200]; - _context10.next = 10; - return this.request(params); - - case 10: - result = _context10.sent; - return _context10.abrupt("return", { - res: result.res - }); - - case 12: - case "end": - return _context10.stop(); - } + xml += ' \n'; + } else { + xml += ' \n'; + } + xml += ''; + params.content = xml; + params.mime = 'xml'; + params.successStatuses = [200]; + _context10.next = 10; + return this.request(params); + case 10: + result = _context10.sent; + return _context10.abrupt("return", { + res: result.res + }); + case 12: + case "end": + return _context10.stop(); } }, _callee10, this); })); - function putBucketReferer(_x22, _x23, _x24, _x25) { return _putBucketReferer.apply(this, arguments); } - return putBucketReferer; }(); - proto.getBucketReferer = /*#__PURE__*/function () { var _getBucketReferer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(name, options) { var params, result, referers; return _regenerator.default.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - params = this._bucketRequestParams('GET', name, 'referer', options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context11.next = 5; - return this.request(params); - - case 5: - result = _context11.sent; - referers = result.data.RefererList.Referer || null; - - if (referers) { - if (!isArray(referers)) { - referers = [referers]; - } + while (1) switch (_context11.prev = _context11.next) { + case 0: + params = this._bucketRequestParams('GET', name, 'referer', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context11.next = 5; + return this.request(params); + case 5: + result = _context11.sent; + referers = result.data.RefererList.Referer || null; + if (referers) { + if (!isArray(referers)) { + referers = [referers]; } - - return _context11.abrupt("return", { - allowEmpty: result.data.AllowEmptyReferer === 'true', - referers: referers, - res: result.res - }); - - case 9: - case "end": - return _context11.stop(); - } + } + return _context11.abrupt("return", { + allowEmpty: result.data.AllowEmptyReferer === 'true', + referers: referers, + res: result.res + }); + case 9: + case "end": + return _context11.stop(); } }, _callee11, this); })); - function getBucketReferer(_x26, _x27) { return _getBucketReferer.apply(this, arguments); } - return getBucketReferer; }(); - proto.deleteBucketReferer = /*#__PURE__*/function () { var _deleteBucketReferer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(name, options) { return _regenerator.default.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - _context12.next = 2; - return this.putBucketReferer(name, true, null, options); - - case 2: - return _context12.abrupt("return", _context12.sent); - - case 3: - case "end": - return _context12.stop(); - } + while (1) switch (_context12.prev = _context12.next) { + case 0: + _context12.next = 2; + return this.putBucketReferer(name, true, null, options); + case 2: + return _context12.abrupt("return", _context12.sent); + case 3: + case "end": + return _context12.stop(); } }, _callee12, this); })); - function deleteBucketReferer(_x28, _x29) { return _deleteBucketReferer.apply(this, arguments); } - return deleteBucketReferer; -}(); // private apis +}(); +// private apis proto._bucketRequestParams = function _bucketRequestParams(method, bucket, subres, options) { return { method: method, bucket: bucket, subres: subres, + additionalHeaders: options && options.additionalHeaders, timeout: options && options.timeout, ctx: options && options.ctx }; }; -},{"../common/utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"assert":82,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],3:[function(require,module,exports){ +},{"../common/utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"assert":95,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/web.dom-collections.for-each.js":382}],3:[function(require,module,exports){ (function (Buffer,process){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - require("core-js/modules/es.function.name.js"); - -require("core-js/modules/es.regexp.exec.js"); - -require("core-js/modules/es.string.split.js"); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.array.includes.js"); - +require("core-js/modules/es.regexp.exec.js"); require("core-js/modules/es.string.replace.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.symbol.js"); - require("core-js/modules/es.symbol.description.js"); - require("core-js/modules/es.array.slice.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.promise.js"); - require("core-js/modules/es.regexp.to-string.js"); - var debug = require('debug')('ali-oss'); - var xml = require('xml2js'); - var AgentKeepalive = require('agentkeepalive'); - var merge = require('merge-descriptors'); - var platform = require('platform'); - var utility = require('utility'); - var urllib = require('urllib'); - var pkg = require('./version'); - var bowser = require('bowser'); - var signUtils = require('../common/signUtils'); - var _initOptions = require('../common/client/initOptions'); - var _require = require('../common/utils/createRequest'), - createRequest = _require.createRequest; - + createRequest = _require.createRequest; var _require2 = require('../common/utils/encoder'), - encoder = _require2.encoder; - + encoder = _require2.encoder; var _require3 = require('../common/client/getReqUrl'), - getReqUrl = _require3.getReqUrl; - + getReqUrl = _require3.getReqUrl; var _require4 = require('../common/utils/setSTSToken'), - setSTSToken = _require4.setSTSToken; - + setSTSToken = _require4.setSTSToken; var _require5 = require('../common/utils/retry'), - retry = _require5.retry; - + retry = _require5.retry; var _require6 = require('../common/utils/isFunction'), - isFunction = _require6.isFunction; - + isFunction = _require6.isFunction; +var _require7 = require('../common/utils/getStandardRegion'), + getStandardRegion = _require7.getStandardRegion; var globalHttpAgent = new AgentKeepalive(); - function _unSupportBrowserTip() { var name = platform.name, - version = platform.version; - + version = platform.version; if (name && name.toLowerCase && name.toLowerCase() === 'ie' && version.split('.')[0] < 10) { // eslint-disable-next-line no-console console.warn('ali-oss does not support the current browser'); } -} // check local web protocol,if https secure default set true , if http secure default set false - - +} +// check local web protocol,if https secure default set true , if http secure default set false function isHttpsWebProtocol() { // for web worker not use window.location. // eslint-disable-next-line no-restricted-globals return location && location.protocol === 'https:'; } - function Client(options, ctx) { _unSupportBrowserTip(); - if (!(this instanceof Client)) { return new Client(options, ctx); } - if (options && options.inited) { this.options = options; } else { this.options = Client.initOptions(options); } - this.options.cancelFlag = false; // cancel flag: if true need to be cancelled, default false - // support custom agent and urllib client + // support custom agent and urllib client if (this.options.urllib) { this.urllib = this.options.urllib; } else { this.urllib = urllib; this.agent = this.options.agent || globalHttpAgent; } - this.ctx = ctx; this.userAgent = this._getUserAgent(); - this.stsTokenFreshTime = new Date(); // record the time difference between client and server + this.stsTokenFreshTime = new Date(); + // record the time difference between client and server this.options.amendTimeSkewed = 0; } + /** * Expose `Client` */ - module.exports = Client; - Client.initOptions = function initOptions(options) { if (!options.stsToken) { console.warn('Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html'); } - var opts = Object.assign({ secure: isHttpsWebProtocol(), // for browser compatibility disable fetch. @@ -779,74 +626,77 @@ Client.initOptions = function initOptions(options) { }, options); return _initOptions(opts); }; + /** * prototype */ +var proto = Client.prototype; -var proto = Client.prototype; // mount debug on proto - +// mount debug on proto proto.debug = debug; + /** * Object operations */ - merge(proto, require('./object')); /** * Bucket operations */ - merge(proto, require('./bucket')); merge(proto, require('../common/bucket/getBucketWebsite')); merge(proto, require('../common/bucket/putBucketWebsite')); -merge(proto, require('../common/bucket/deleteBucketWebsite')); // lifecycle +merge(proto, require('../common/bucket/deleteBucketWebsite')); +// lifecycle merge(proto, require('../common/bucket/getBucketLifecycle')); merge(proto, require('../common/bucket/putBucketLifecycle')); -merge(proto, require('../common/bucket/deleteBucketLifecycle')); // multiversion +merge(proto, require('../common/bucket/deleteBucketLifecycle')); +// multiversion merge(proto, require('../common/bucket/putBucketVersioning')); -merge(proto, require('../common/bucket/getBucketVersioning')); // inventory +merge(proto, require('../common/bucket/getBucketVersioning')); +// inventory merge(proto, require('../common/bucket/getBucketInventory')); merge(proto, require('../common/bucket/deleteBucketInventory')); merge(proto, require('../common/bucket/listBucketInventory')); -merge(proto, require('../common/bucket/putBucketInventory')); // worm +merge(proto, require('../common/bucket/putBucketInventory')); +// worm merge(proto, require('../common/bucket/abortBucketWorm')); merge(proto, require('../common/bucket/completeBucketWorm')); merge(proto, require('../common/bucket/extendBucketWorm')); merge(proto, require('../common/bucket/getBucketWorm')); -merge(proto, require('../common/bucket/initiateBucketWorm')); // multipart upload +merge(proto, require('../common/bucket/initiateBucketWorm')); +// multipart upload merge(proto, require('./managed-upload')); /** * common multipart-copy support node and browser */ - merge(proto, require('../common/multipart-copy')); /** * Multipart operations */ - merge(proto, require('../common/multipart')); + /** * Common module parallel */ - merge(proto, require('../common/parallel')); + /** * get OSS signature * @param {String} stringToSign * @return {String} the signature */ - proto.signature = function signature(stringToSign) { this.debug('authorization stringToSign: %s', stringToSign, 'info'); return signUtils.computeSignature(this.options.accessKeySecret, stringToSign, this.options.headerEncoding); }; - proto._getReqUrl = getReqUrl; + /** * get author header * @@ -875,6 +725,25 @@ proto.authorization = function authorization(method, resource, subres, headers) }); return signUtils.authorization(this.options.accessKeyId, this.options.accessKeySecret, stringToSign, this.options.headerEncoding); }; + +/** + * get authorization header v4 + * + * @param {string} method + * @param {Object} requestParams + * @param {Object} requestParams.headers + * @param {(string|string[]|Object)} [requestParams.queries] + * @param {string} [bucketName] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] + * @return {string} + * + * @api private + */ +proto.authorizationV4 = function authorizationV4(method, requestParams, bucketName, objectName, additionalHeaders) { + return signUtils.authorizationV4(this.options.accessKeyId, this.options.accessKeySecret, getStandardRegion(this.options.region), method, requestParams, bucketName, objectName, additionalHeaders, this.options.headerEncoding); +}; + /** * request oss server * @param {Object} params @@ -894,185 +763,145 @@ proto.authorization = function authorization(method, resource, subres, headers) * @api private */ - proto.request = /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) { var _this = this; - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (!this.options.retryMax) { - _context.next = 6; - break; - } - - _context.next = 3; - return retry(request.bind(this), this.options.retryMax, { - errorHandler: function errorHandler(err) { - var _errHandle = function _errHandle(_err) { - if (params.stream) return false; - var statusErr = [-1, -2].includes(_err.status); - - var requestErrorRetryHandle = _this.options.requestErrorRetryHandle || function () { - return true; - }; - - return statusErr && requestErrorRetryHandle(_err); + while (1) switch (_context.prev = _context.next) { + case 0: + if (!this.options.retryMax) { + _context.next = 6; + break; + } + _context.next = 3; + return retry(request.bind(this), this.options.retryMax, { + errorHandler: function errorHandler(err) { + var _errHandle = function _errHandle(_err) { + if (params.stream) return false; + var statusErr = [-1, -2].includes(_err.status); + var requestErrorRetryHandle = _this.options.requestErrorRetryHandle || function () { + return true; }; - - if (_errHandle(err)) return true; - return false; - } - })(params); - - case 3: - return _context.abrupt("return", _context.sent); - - case 6: - return _context.abrupt("return", request.call(this, params)); - - case 7: - case "end": - return _context.stop(); - } + return statusErr && requestErrorRetryHandle(_err); + }; + if (_errHandle(err)) return true; + return false; + } + })(params); + case 3: + return _context.abrupt("return", _context.sent); + case 6: + return _context.abrupt("return", request.call(this, params)); + case 7: + case "end": + return _context.stop(); } }, _callee, this); })); - return function (_x) { return _ref.apply(this, arguments); }; }(); - function request(_x2) { return _request.apply(this, arguments); } - function _request() { _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(params) { var reqParams, result, reqErr, useStream, err, parseData; return _regenerator.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { - _context3.next = 3; - break; - } - + while (1) switch (_context3.prev = _context3.next) { + case 0: + if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { _context3.next = 3; - return setSTSToken.call(this); - - case 3: - reqParams = createRequest.call(this, params); - - if (!this.options.useFetch) { - reqParams.params.mode = 'disable-fetch'; - } - - useStream = !!params.stream; - _context3.prev = 6; - _context3.next = 9; - return this.urllib.request(reqParams.url, reqParams.params); - - case 9: - result = _context3.sent; - this.debug('response %s %s, got %s, headers: %j', params.method, reqParams.url, result.status, result.headers, 'info'); - _context3.next = 16; break; - - case 13: - _context3.prev = 13; - _context3.t0 = _context3["catch"](6); - reqErr = _context3.t0; - - case 16: - if (!(result && params.successStatuses && params.successStatuses.indexOf(result.status) === -1)) { - _context3.next = 28; - break; - } - - _context3.next = 19; - return this.requestError(result); - - case 19: - err = _context3.sent; - - if (!(err.code === 'RequestTimeTooSkewed' && !useStream)) { - _context3.next = 25; - break; - } - - this.options.amendTimeSkewed = +new Date(err.serverTime) - new Date(); - _context3.next = 24; - return this.request(params); - - case 24: - return _context3.abrupt("return", _context3.sent); - - case 25: - err.params = params; + } + _context3.next = 3; + return setSTSToken.call(this); + case 3: + reqParams = createRequest.call(this, params); + if (!this.options.useFetch) { + reqParams.params.mode = 'disable-fetch'; + } + useStream = !!params.stream; + _context3.prev = 6; + _context3.next = 9; + return this.urllib.request(reqParams.url, reqParams.params); + case 9: + result = _context3.sent; + this.debug('response %s %s, got %s, headers: %j', params.method, reqParams.url, result.status, result.headers, 'info'); + _context3.next = 16; + break; + case 13: + _context3.prev = 13; + _context3.t0 = _context3["catch"](6); + reqErr = _context3.t0; + case 16: + if (!(result && params.successStatuses && params.successStatuses.indexOf(result.status) === -1)) { + _context3.next = 28; + break; + } + _context3.next = 19; + return this.requestError(result); + case 19: + err = _context3.sent; + if (!(err.code === 'RequestTimeTooSkewed' && !useStream)) { + _context3.next = 25; + break; + } + this.options.amendTimeSkewed = +new Date(err.serverTime) - new Date(); + _context3.next = 24; + return this.request(params); + case 24: + return _context3.abrupt("return", _context3.sent); + case 25: + err.params = params; + _context3.next = 32; + break; + case 28: + if (!reqErr) { _context3.next = 32; break; - - case 28: - if (!reqErr) { - _context3.next = 32; - break; - } - - _context3.next = 31; - return this.requestError(reqErr); - - case 31: - err = _context3.sent; - - case 32: - if (!err) { - _context3.next = 34; - break; - } - - throw err; - - case 34: - if (!params.xmlResponse) { - _context3.next = 39; - break; - } - - _context3.next = 37; - return this.parseXML(result.data); - - case 37: - parseData = _context3.sent; - result.data = parseData; - - case 39: - return _context3.abrupt("return", result); - - case 40: - case "end": - return _context3.stop(); - } + } + _context3.next = 31; + return this.requestError(reqErr); + case 31: + err = _context3.sent; + case 32: + if (!err) { + _context3.next = 34; + break; + } + throw err; + case 34: + if (!params.xmlResponse) { + _context3.next = 39; + break; + } + _context3.next = 37; + return this.parseXML(result.data); + case 37: + parseData = _context3.sent; + result.data = parseData; + case 39: + return _context3.abrupt("return", result); + case 40: + case "end": + return _context3.stop(); } }, _callee3, this, [[6, 13]]); })); return _request.apply(this, arguments); } - proto._getResource = function _getResource(params) { var resource = '/'; if (params.bucket) resource += "".concat(params.bucket, "/"); if (params.object) resource += encoder(params.object, this.options.headerEncoding); return resource; }; - proto._escape = function _escape(name) { return utility.encodeURIComponent(name).replace(/%2F/g, '/'); }; + /* * Get User-Agent for browser & node.js * @example @@ -1081,23 +910,20 @@ proto._escape = function _escape(name) { * aliyun-sdk-js/4.1.2 Chrome 43.0.2357.134 32-bit on Windows Server 2008 R2 / 7 64-bit */ - proto._getUserAgent = function _getUserAgent() { var agent = process && process.browser ? 'js' : 'nodejs'; var sdk = "aliyun-sdk-".concat(agent, "/").concat(pkg.version); var plat = platform.description; - if (!plat && process) { plat = "Node.js ".concat(process.version.slice(1), " on ").concat(process.platform, " ").concat(process.arch); } - return this._checkUserAgent("".concat(sdk, " ").concat(plat)); }; - proto._checkUserAgent = function _checkUserAgent(ua) { var userAgent = ua.replace(/\u03b1/, 'alpha').replace(/\u03b2/, 'beta'); return userAgent; }; + /* * Check Browser And Version * @param {String} [name] browser name: like IE, Chrome, Firefox @@ -1106,10 +932,10 @@ proto._checkUserAgent = function _checkUserAgent(ua) { * @api private */ - proto.checkBrowserAndVersion = function checkBrowserAndVersion(name, version) { return bowser.name === name && bowser.version.split('.')[0] === version; }; + /** * thunkify xml.parseString * @param {String|Buffer} str @@ -1117,13 +943,11 @@ proto.checkBrowserAndVersion = function checkBrowserAndVersion(name, version) { * @api private */ - proto.parseXML = function parseXMLThunk(str) { return new Promise(function (resolve, reject) { if (Buffer.isBuffer(str)) { str = str.toString(); } - xml.parseString(str, { explicitRoot: false, explicitArray: false @@ -1136,6 +960,7 @@ proto.parseXML = function parseXMLThunk(str) { }); }); }; + /** * generater a request error with request response * @param {Object} result @@ -1143,221 +968,155 @@ proto.parseXML = function parseXMLThunk(str) { * @api private */ - proto.requestError = /*#__PURE__*/function () { var _requestError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(result) { var err, message, info, msg; return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - err = null; - - if (!(!result.data || !result.data.length)) { - _context2.next = 5; - break; - } - - if (result.status === -1 || result.status === -2) { - // -1 is net error , -2 is timeout - err = new Error(result.message); - err.name = result.name; - err.status = result.status; - err.code = result.name; - } else { - // HEAD not exists resource - if (result.status === 404) { - err = new Error('Object not exists'); - err.name = 'NoSuchKeyError'; - err.status = 404; - err.code = 'NoSuchKey'; - } else if (result.status === 412) { - err = new Error('Pre condition failed'); - err.name = 'PreconditionFailedError'; - err.status = 412; - err.code = 'PreconditionFailed'; - } else { - err = new Error("Unknow error, status: ".concat(result.status)); - err.name = 'UnknownError'; - err.status = result.status; - } - - err.requestId = result.headers['x-oss-request-id']; - err.host = ''; - } - - _context2.next = 32; + while (1) switch (_context2.prev = _context2.next) { + case 0: + err = null; + if (!(!result.data || !result.data.length)) { + _context2.next = 5; break; - - case 5: - message = String(result.data); - this.debug('request response error data: %s', message, 'error'); - _context2.prev = 7; - _context2.next = 10; - return this.parseXML(message); - - case 10: - _context2.t0 = _context2.sent; - - if (_context2.t0) { - _context2.next = 13; - break; + } + if (result.status === -1 || result.status === -2) { + // -1 is net error , -2 is timeout + err = new Error(result.message); + err.name = result.name; + err.status = result.status; + err.code = result.name; + } else { + // HEAD not exists resource + if (result.status === 404) { + err = new Error('Object not exists'); + err.name = 'NoSuchKeyError'; + err.status = 404; + err.code = 'NoSuchKey'; + } else if (result.status === 412) { + err = new Error('Pre condition failed'); + err.name = 'PreconditionFailedError'; + err.status = 412; + err.code = 'PreconditionFailed'; + } else { + err = new Error("Unknow error, status: ".concat(result.status)); + err.name = 'UnknownError'; + err.status = result.status; } - - _context2.t0 = {}; - - case 13: - info = _context2.t0; - _context2.next = 23; + err.requestId = result.headers['x-oss-request-id']; + err.host = ''; + } + _context2.next = 32; + break; + case 5: + message = String(result.data); + this.debug('request response error data: %s', message, 'error'); + _context2.prev = 7; + _context2.next = 10; + return this.parseXML(message); + case 10: + _context2.t0 = _context2.sent; + if (_context2.t0) { + _context2.next = 13; break; - - case 16: - _context2.prev = 16; - _context2.t1 = _context2["catch"](7); - this.debug(message, 'error'); - _context2.t1.message += "\nraw xml: ".concat(message); - _context2.t1.status = result.status; - _context2.t1.requestId = result.headers['x-oss-request-id']; - return _context2.abrupt("return", _context2.t1); - - case 23: - msg = info.Message || "unknow request error, status: ".concat(result.status); - - if (info.Condition) { - msg += " (condition: ".concat(info.Condition, ")"); - } - - err = new Error(msg); - err.name = info.Code ? "".concat(info.Code, "Error") : 'UnknownError'; - err.status = result.status; - err.code = info.Code; - err.requestId = info.RequestId; - err.hostId = info.HostId; - err.serverTime = info.ServerTime; - - case 32: - this.debug('generate error %j', err, 'error'); - return _context2.abrupt("return", err); - - case 34: - case "end": - return _context2.stop(); - } + } + _context2.t0 = {}; + case 13: + info = _context2.t0; + _context2.next = 23; + break; + case 16: + _context2.prev = 16; + _context2.t1 = _context2["catch"](7); + this.debug(message, 'error'); + _context2.t1.message += "\nraw xml: ".concat(message); + _context2.t1.status = result.status; + _context2.t1.requestId = result.headers['x-oss-request-id']; + return _context2.abrupt("return", _context2.t1); + case 23: + msg = info.Message || "unknow request error, status: ".concat(result.status); + if (info.Condition) { + msg += " (condition: ".concat(info.Condition, ")"); + } + err = new Error(msg); + err.name = info.Code ? "".concat(info.Code, "Error") : 'UnknownError'; + err.status = result.status; + err.code = info.Code; + err.requestId = info.RequestId; + err.hostId = info.HostId; + err.serverTime = info.ServerTime; + case 32: + this.debug('generate error %j', err, 'error'); + return _context2.abrupt("return", err); + case 34: + case "end": + return _context2.stop(); } }, _callee2, this, [[7, 16]]); })); - function requestError(_x3) { return _requestError.apply(this, arguments); } - return requestError; }(); }).call(this)}).call(this,{"isBuffer":require("../../node_modules/is-buffer/index.js")},require('_process')) -},{"../../node_modules/is-buffer/index.js":366,"../common/bucket/abortBucketWorm":7,"../common/bucket/completeBucketWorm":8,"../common/bucket/deleteBucketInventory":9,"../common/bucket/deleteBucketLifecycle":10,"../common/bucket/deleteBucketWebsite":11,"../common/bucket/extendBucketWorm":12,"../common/bucket/getBucketInventory":13,"../common/bucket/getBucketLifecycle":14,"../common/bucket/getBucketVersioning":15,"../common/bucket/getBucketWebsite":16,"../common/bucket/getBucketWorm":17,"../common/bucket/initiateBucketWorm":18,"../common/bucket/listBucketInventory":19,"../common/bucket/putBucketInventory":20,"../common/bucket/putBucketLifecycle":21,"../common/bucket/putBucketVersioning":22,"../common/bucket/putBucketWebsite":23,"../common/client/getReqUrl":25,"../common/client/initOptions":26,"../common/multipart":30,"../common/multipart-copy":29,"../common/parallel":49,"../common/signUtils":50,"../common/utils/createRequest":56,"../common/utils/encoder":59,"../common/utils/isFunction":68,"../common/utils/retry":74,"../common/utils/setSTSToken":76,"./bucket":2,"./managed-upload":4,"./object":5,"./version":6,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"_process":467,"agentkeepalive":81,"bowser":88,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/es.string.split.js":307,"core-js/modules/es.symbol.description.js":310,"core-js/modules/es.symbol.js":313,"debug":465,"merge-descriptors":372,"platform":379,"urllib":475,"utility":474,"xml2js":426}],4:[function(require,module,exports){ +},{"../../node_modules/is-buffer/index.js":411,"../common/bucket/abortBucketWorm":7,"../common/bucket/completeBucketWorm":8,"../common/bucket/deleteBucketInventory":9,"../common/bucket/deleteBucketLifecycle":10,"../common/bucket/deleteBucketWebsite":11,"../common/bucket/extendBucketWorm":12,"../common/bucket/getBucketInventory":13,"../common/bucket/getBucketLifecycle":14,"../common/bucket/getBucketVersioning":15,"../common/bucket/getBucketWebsite":16,"../common/bucket/getBucketWorm":17,"../common/bucket/initiateBucketWorm":18,"../common/bucket/listBucketInventory":19,"../common/bucket/putBucketInventory":20,"../common/bucket/putBucketLifecycle":21,"../common/bucket/putBucketVersioning":22,"../common/bucket/putBucketWebsite":23,"../common/client/getReqUrl":25,"../common/client/initOptions":26,"../common/multipart":30,"../common/multipart-copy":29,"../common/parallel":50,"../common/signUtils":51,"../common/utils/createRequest":57,"../common/utils/encoder":61,"../common/utils/getStandardRegion":64,"../common/utils/isFunction":71,"../common/utils/retry":77,"../common/utils/setSTSToken":79,"./bucket":2,"./managed-upload":4,"./object":5,"./version":6,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"_process":540,"agentkeepalive":94,"bowser":101,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347,"core-js/modules/es.symbol.description.js":353,"core-js/modules/es.symbol.js":356,"debug":538,"merge-descriptors":430,"platform":442,"urllib":548,"utility":547,"xml2js":498}],4:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.function.name.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.promise.js"); - require("core-js/modules/es.array.from.js"); - require("core-js/modules/es.string.iterator.js"); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.array.filter.js"); - require("core-js/modules/es.array.find.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.regexp.to-string.js"); - require("core-js/modules/es.array.slice.js"); - require("core-js/modules/es.array.iterator.js"); - require("core-js/modules/es.array-buffer.slice.js"); - require("core-js/modules/es.typed-array.uint8-array.js"); - require("core-js/modules/es.typed-array.copy-within.js"); - require("core-js/modules/es.typed-array.every.js"); - require("core-js/modules/es.typed-array.fill.js"); - require("core-js/modules/es.typed-array.filter.js"); - require("core-js/modules/es.typed-array.find.js"); - require("core-js/modules/es.typed-array.find-index.js"); - require("core-js/modules/es.typed-array.for-each.js"); - require("core-js/modules/es.typed-array.includes.js"); - require("core-js/modules/es.typed-array.index-of.js"); - require("core-js/modules/es.typed-array.iterator.js"); - require("core-js/modules/es.typed-array.join.js"); - require("core-js/modules/es.typed-array.last-index-of.js"); - require("core-js/modules/es.typed-array.map.js"); - require("core-js/modules/es.typed-array.reduce.js"); - require("core-js/modules/es.typed-array.reduce-right.js"); - require("core-js/modules/es.typed-array.reverse.js"); - require("core-js/modules/es.typed-array.set.js"); - require("core-js/modules/es.typed-array.slice.js"); - require("core-js/modules/es.typed-array.some.js"); - require("core-js/modules/es.typed-array.sort.js"); - require("core-js/modules/es.typed-array.subarray.js"); - require("core-js/modules/es.typed-array.to-locale-string.js"); - require("core-js/modules/es.typed-array.to-string.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - // var debug = require('debug')('ali-oss:multipart'); var util = require('util'); - var path = require('path'); - var mime = require('mime'); - var copy = require('copy-to'); - var _require = require('../common/utils/isBlob'), - isBlob = _require.isBlob; - + isBlob = _require.isBlob; var _require2 = require('../common/utils/isFile'), - isFile = _require2.isFile; - + isFile = _require2.isFile; var _require3 = require('../common/utils/isBuffer'), - isBuffer = _require3.isBuffer; - + isBuffer = _require3.isBuffer; var proto = exports; + /** * Multipart operations */ @@ -1378,447 +1137,355 @@ var proto = exports; * key2: 'value2' * } */ - proto.multipartUpload = /*#__PURE__*/function () { var _multipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, file) { var options, - minPartSize, - fileSize, - result, - ret, - initResult, - uploadId, - partSize, - checkpoint, - _args = arguments; + minPartSize, + fileSize, + result, + ret, + initResult, + uploadId, + partSize, + checkpoint, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - this.resetCancelFlag(); - options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; - - if (!(options.checkpoint && options.checkpoint.uploadId)) { - _context.next = 8; - break; - } - - if (file && isFile(file)) options.checkpoint.file = file; - _context.next = 7; - return this._resumeMultipart(options.checkpoint, options); - - case 7: - return _context.abrupt("return", _context.sent); - - case 8: - minPartSize = 100 * 1024; - - if (!options.mime) { - if (isFile(file)) { - options.mime = mime.getType(path.extname(file.name)); - } else if (isBlob(file)) { - options.mime = file.type; - } else if (isBuffer(file)) { - options.mime = ''; - } else { - options.mime = mime.getType(path.extname(file)); - } - } - - options.headers = options.headers || {}; - - this._convertMetaToHeaders(options.meta, options.headers); - - _context.next = 14; - return this._getFileSize(file); - - case 14: - fileSize = _context.sent; - - if (!(fileSize < minPartSize)) { - _context.next = 26; - break; - } - - options.contentLength = fileSize; - _context.next = 19; - return this.put(name, file, options); - - case 19: - result = _context.sent; - - if (!(options && options.progress)) { - _context.next = 23; - break; + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + this.resetCancelFlag(); + options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; + if (!(options.checkpoint && options.checkpoint.uploadId)) { + _context.next = 8; + break; + } + if (file && isFile(file)) options.checkpoint.file = file; + _context.next = 7; + return this._resumeMultipart(options.checkpoint, options); + case 7: + return _context.abrupt("return", _context.sent); + case 8: + minPartSize = 100 * 1024; + if (!options.mime) { + if (isFile(file)) { + options.mime = mime.getType(path.extname(file.name)); + } else if (isBlob(file)) { + options.mime = file.type; + } else if (isBuffer(file)) { + options.mime = ''; + } else { + options.mime = mime.getType(path.extname(file)); } - + } + options.headers = options.headers || {}; + this._convertMetaToHeaders(options.meta, options.headers); + _context.next = 14; + return this._getFileSize(file); + case 14: + fileSize = _context.sent; + if (!(fileSize < minPartSize)) { + _context.next = 26; + break; + } + options.contentLength = fileSize; + _context.next = 19; + return this.put(name, file, options); + case 19: + result = _context.sent; + if (!(options && options.progress)) { _context.next = 23; - return options.progress(1); - - case 23: - ret = { - res: result.res, - bucket: this.options.bucket, - name: name, - etag: result.res.headers.etag - }; - - if (options.headers && options.headers['x-oss-callback'] || options.callback) { - ret.data = result.data; - } - - return _context.abrupt("return", ret); - - case 26: - if (!(options.partSize && !(parseInt(options.partSize, 10) === options.partSize))) { - _context.next = 28; - break; - } - - throw new Error('partSize must be int number'); - - case 28: - if (!(options.partSize && options.partSize < minPartSize)) { - _context.next = 30; - break; - } - - throw new Error("partSize must not be smaller than ".concat(minPartSize)); - - case 30: - _context.next = 32; - return this.initMultipartUpload(name, options); - - case 32: - initResult = _context.sent; - uploadId = initResult.uploadId; - partSize = this._getPartSize(fileSize, options.partSize); - checkpoint = { - file: file, - name: name, - fileSize: fileSize, - partSize: partSize, - uploadId: uploadId, - doneParts: [] - }; - - if (!(options && options.progress)) { - _context.next = 39; - break; - } - + break; + } + _context.next = 23; + return options.progress(1); + case 23: + ret = { + res: result.res, + bucket: this.options.bucket, + name: name, + etag: result.res.headers.etag + }; + if (options.headers && options.headers['x-oss-callback'] || options.callback) { + ret.data = result.data; + } + return _context.abrupt("return", ret); + case 26: + if (!(options.partSize && !(parseInt(options.partSize, 10) === options.partSize))) { + _context.next = 28; + break; + } + throw new Error('partSize must be int number'); + case 28: + if (!(options.partSize && options.partSize < minPartSize)) { + _context.next = 30; + break; + } + throw new Error("partSize must not be smaller than ".concat(minPartSize)); + case 30: + _context.next = 32; + return this.initMultipartUpload(name, options); + case 32: + initResult = _context.sent; + uploadId = initResult.uploadId; + partSize = this._getPartSize(fileSize, options.partSize); + checkpoint = { + file: file, + name: name, + fileSize: fileSize, + partSize: partSize, + uploadId: uploadId, + doneParts: [] + }; + if (!(options && options.progress)) { _context.next = 39; - return options.progress(0, checkpoint, initResult.res); - - case 39: - _context.next = 41; - return this._resumeMultipart(checkpoint, options); - - case 41: - return _context.abrupt("return", _context.sent); - - case 42: - case "end": - return _context.stop(); - } + break; + } + _context.next = 39; + return options.progress(0, checkpoint, initResult.res); + case 39: + _context.next = 41; + return this._resumeMultipart(checkpoint, options); + case 41: + return _context.abrupt("return", _context.sent); + case 42: + case "end": + return _context.stop(); } }, _callee, this); })); - function multipartUpload(_x, _x2) { return _multipartUpload.apply(this, arguments); } - return multipartUpload; }(); + /* * Resume multipart upload from checkpoint. The checkpoint will be * updated after each successful part upload. * @param {Object} checkpoint the checkpoint * @param {Object} options */ - - proto._resumeMultipart = /*#__PURE__*/function () { var _resumeMultipart2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(checkpoint, options) { var that, file, fileSize, partSize, uploadId, doneParts, name, internalDoneParts, partOffs, numParts, multipartFinish, uploadPartJob, all, done, todo, defaultParallel, parallel, jobErr, abortEvent; return _regenerator.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - that = this; - - if (!this.isCancel()) { - _context3.next = 3; - break; - } - - throw this._makeCancelEvent(); - - case 3: - file = checkpoint.file, fileSize = checkpoint.fileSize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name; - internalDoneParts = []; - - if (doneParts.length > 0) { - copy(doneParts).to(internalDoneParts); - } - - partOffs = this._divideParts(fileSize, partSize); - numParts = partOffs.length; - multipartFinish = false; - - uploadPartJob = function uploadPartJob(self, partNo) { - // eslint-disable-next-line no-async-promise-executor - return new Promise( /*#__PURE__*/function () { - var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) { - var pi, content, data, result, tempErr; - return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.prev = 0; - - if (self.isCancel()) { - _context2.next = 29; - break; - } - - pi = partOffs[partNo - 1]; - _context2.next = 5; - return self._createBuffer(file, pi.start, pi.end); - - case 5: - content = _context2.sent; - data = { - content: content, - size: pi.end - pi.start - }; - _context2.prev = 7; - _context2.next = 10; - return self._uploadPart(name, uploadId, partNo, data, options); - - case 10: - result = _context2.sent; - _context2.next = 18; - break; - - case 13: - _context2.prev = 13; - _context2.t0 = _context2["catch"](7); - - if (!(_context2.t0.status === 404)) { - _context2.next = 17; - break; - } - - throw self._makeAbortEvent(); - - case 17: - throw _context2.t0; - - case 18: - if (!(!self.isCancel() && !multipartFinish)) { - _context2.next = 26; - break; - } - - checkpoint.doneParts.push({ - number: partNo, - etag: result.res.headers.etag - }); - - if (!options.progress) { - _context2.next = 23; - break; - } - - _context2.next = 23; - return options.progress(doneParts.length / (numParts + 1), checkpoint, result.res); - - case 23: - resolve({ - number: partNo, - etag: result.res.headers.etag - }); - _context2.next = 27; - break; - - case 26: - resolve(); - - case 27: - _context2.next = 30; - break; - - case 29: - resolve(); - - case 30: - _context2.next = 41; - break; - - case 32: - _context2.prev = 32; - _context2.t1 = _context2["catch"](0); - tempErr = new Error(); - tempErr.name = _context2.t1.name; - tempErr.message = _context2.t1.message; - tempErr.stack = _context2.t1.stack; - tempErr.partNum = partNo; - copy(_context2.t1).to(tempErr); - reject(tempErr); - - case 41: - case "end": - return _context2.stop(); + while (1) switch (_context3.prev = _context3.next) { + case 0: + that = this; + if (!this.isCancel()) { + _context3.next = 3; + break; + } + throw this._makeCancelEvent(); + case 3: + file = checkpoint.file, fileSize = checkpoint.fileSize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name; + internalDoneParts = []; + if (doneParts.length > 0) { + copy(doneParts).to(internalDoneParts); + } + partOffs = this._divideParts(fileSize, partSize); + numParts = partOffs.length; + multipartFinish = false; + uploadPartJob = function uploadPartJob(self, partNo) { + // eslint-disable-next-line no-async-promise-executor + return new Promise( /*#__PURE__*/function () { + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) { + var pi, content, data, result, tempErr; + return _regenerator.default.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + if (self.isCancel()) { + _context2.next = 29; + break; } - } - }, _callee2, null, [[0, 32], [7, 13]]); - })); - - return function (_x5, _x6) { - return _ref.apply(this, arguments); - }; - }()); - }; - - all = Array.from(new Array(numParts), function (x, i) { - return i + 1; - }); - done = internalDoneParts.map(function (p) { - return p.number; - }); - todo = all.filter(function (p) { - return done.indexOf(p) < 0; - }); - defaultParallel = 5; - parallel = options.parallel || defaultParallel; // upload in parallel - - _context3.next = 17; - return this._parallel(todo, parallel, function (value) { - return new Promise(function (resolve, reject) { - uploadPartJob(that, value).then(function (result) { - if (result) { - internalDoneParts.push(result); + pi = partOffs[partNo - 1]; + _context2.next = 5; + return self._createBuffer(file, pi.start, pi.end); + case 5: + content = _context2.sent; + data = { + content: content, + size: pi.end - pi.start + }; + _context2.prev = 7; + _context2.next = 10; + return self._uploadPart(name, uploadId, partNo, data, options); + case 10: + result = _context2.sent; + _context2.next = 18; + break; + case 13: + _context2.prev = 13; + _context2.t0 = _context2["catch"](7); + if (!(_context2.t0.status === 404)) { + _context2.next = 17; + break; + } + throw self._makeAbortEvent(); + case 17: + throw _context2.t0; + case 18: + if (!(!self.isCancel() && !multipartFinish)) { + _context2.next = 26; + break; + } + checkpoint.doneParts.push({ + number: partNo, + etag: result.res.headers.etag + }); + if (!options.progress) { + _context2.next = 23; + break; + } + _context2.next = 23; + return options.progress(doneParts.length / (numParts + 1), checkpoint, result.res); + case 23: + resolve({ + number: partNo, + etag: result.res.headers.etag + }); + _context2.next = 27; + break; + case 26: + resolve(); + case 27: + _context2.next = 30; + break; + case 29: + resolve(); + case 30: + _context2.next = 41; + break; + case 32: + _context2.prev = 32; + _context2.t1 = _context2["catch"](0); + tempErr = new Error(); + tempErr.name = _context2.t1.name; + tempErr.message = _context2.t1.message; + tempErr.stack = _context2.t1.stack; + tempErr.partNum = partNo; + copy(_context2.t1).to(tempErr); + reject(tempErr); + case 41: + case "end": + return _context2.stop(); } - - resolve(); - }).catch(function (err) { - reject(err); - }); - }); - }); - - case 17: - jobErr = _context3.sent; - multipartFinish = true; - abortEvent = jobErr.find(function (err) { - return err.name === 'abort'; + }, _callee2, null, [[0, 32], [7, 13]]); + })); + return function (_x5, _x6) { + return _ref.apply(this, arguments); + }; + }()); + }; + all = Array.from(new Array(numParts), function (x, i) { + return i + 1; + }); + done = internalDoneParts.map(function (p) { + return p.number; + }); + todo = all.filter(function (p) { + return done.indexOf(p) < 0; + }); + defaultParallel = 5; + parallel = options.parallel || defaultParallel; // upload in parallel + _context3.next = 17; + return this._parallel(todo, parallel, function (value) { + return new Promise(function (resolve, reject) { + uploadPartJob(that, value).then(function (result) { + if (result) { + internalDoneParts.push(result); + } + resolve(); + }).catch(function (err) { + reject(err); + }); }); - - if (!abortEvent) { - _context3.next = 22; - break; - } - - throw abortEvent; - - case 22: - if (!this.isCancel()) { - _context3.next = 25; - break; - } - - uploadPartJob = null; - throw this._makeCancelEvent(); - - case 25: - if (!(jobErr && jobErr.length > 0)) { - _context3.next = 28; - break; - } - - jobErr[0].message = "Failed to upload some parts with error: ".concat(jobErr[0].toString(), " part_num: ").concat(jobErr[0].partNum); - throw jobErr[0]; - - case 28: - _context3.next = 30; - return this.completeMultipartUpload(name, uploadId, internalDoneParts, options); - - case 30: - return _context3.abrupt("return", _context3.sent); - - case 31: - case "end": - return _context3.stop(); - } + }); + case 17: + jobErr = _context3.sent; + multipartFinish = true; + abortEvent = jobErr.find(function (err) { + return err.name === 'abort'; + }); + if (!abortEvent) { + _context3.next = 22; + break; + } + throw abortEvent; + case 22: + if (!this.isCancel()) { + _context3.next = 25; + break; + } + uploadPartJob = null; + throw this._makeCancelEvent(); + case 25: + if (!(jobErr && jobErr.length > 0)) { + _context3.next = 28; + break; + } + jobErr[0].message = "Failed to upload some parts with error: ".concat(jobErr[0].toString(), " part_num: ").concat(jobErr[0].partNum); + throw jobErr[0]; + case 28: + _context3.next = 30; + return this.completeMultipartUpload(name, uploadId, internalDoneParts, options); + case 30: + return _context3.abrupt("return", _context3.sent); + case 31: + case "end": + return _context3.stop(); } }, _callee3, this); })); - function _resumeMultipart(_x3, _x4) { return _resumeMultipart2.apply(this, arguments); } - return _resumeMultipart; }(); + /** * Get file size */ - - proto._getFileSize = /*#__PURE__*/function () { var _getFileSize2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(file) { return _regenerator.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - if (!isBuffer(file)) { - _context4.next = 4; - break; - } - - return _context4.abrupt("return", file.length); - - case 4: - if (!(isBlob(file) || isFile(file))) { - _context4.next = 6; - break; - } - - return _context4.abrupt("return", file.size); - - case 6: - throw new Error('_getFileSize requires Buffer/File/Blob.'); - - case 7: - case "end": - return _context4.stop(); - } + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!isBuffer(file)) { + _context4.next = 4; + break; + } + return _context4.abrupt("return", file.length); + case 4: + if (!(isBlob(file) || isFile(file))) { + _context4.next = 6; + break; + } + return _context4.abrupt("return", file.size); + case 6: + throw new Error('_getFileSize requires Buffer/File/Blob.'); + case 7: + case "end": + return _context4.stop(); } }, _callee4); })); - function _getFileSize(_x7) { return _getFileSize2.apply(this, arguments); } - return _getFileSize; }(); + /* * Readable stream for Web File */ - - var _require4 = require('stream'), - Readable = _require4.Readable; - + Readable = _require4.Readable; function WebFileReadStream(file, options) { if (!(this instanceof WebFileReadStream)) { return new WebFileReadStream(file, options); } - Readable.call(this, options); this.file = file; this.reader = new FileReader(); @@ -1826,13 +1493,10 @@ function WebFileReadStream(file, options) { this.finish = false; this.fileBuffer = null; } - util.inherits(WebFileReadStream, Readable); - WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) { if (this.fileBuffer) { var pushRet = true; - while (pushRet && this.fileBuffer && this.start < this.fileBuffer.length) { var start = this.start; var end = start + size; @@ -1842,118 +1506,92 @@ WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) { } } }; - WebFileReadStream.prototype._read = function _read(size) { if (this.file && this.start >= this.file.size || this.fileBuffer && this.start >= this.fileBuffer.length || this.finish || this.start === 0 && !this.file) { if (!this.finish) { this.fileBuffer = null; this.finish = true; } - this.push(null); return; } - var defaultReadSize = 16 * 1024; size = size || defaultReadSize; var that = this; - this.reader.onload = function onload(e) { that.fileBuffer = Buffer.from(new Uint8Array(e.target.result)); that.file = null; that.readFileAndPush(size); }; - if (this.start === 0) { this.reader.readAsArrayBuffer(this.file); } else { this.readFileAndPush(size); } }; - function getBuffer(file) { // Some browsers do not support Blob.prototype.arrayBuffer, such as IE if (file.arrayBuffer) return file.arrayBuffer(); return new Promise(function (resolve, reject) { var reader = new FileReader(); - reader.onload = function (e) { resolve(e.target.result); }; - reader.onerror = function (e) { reject(e); }; - reader.readAsArrayBuffer(file); }); } - proto._createBuffer = /*#__PURE__*/function () { var _createBuffer2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(file, start, end) { var _file, fileContent; - return _regenerator.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - if (!(isBlob(file) || isFile(file))) { - _context5.next = 8; - break; - } - - _file = file.slice(start, end); - _context5.next = 4; - return getBuffer(_file); - - case 4: - fileContent = _context5.sent; - return _context5.abrupt("return", Buffer.from(fileContent)); - - case 8: - if (!isBuffer(file)) { - _context5.next = 12; - break; - } - - return _context5.abrupt("return", file.subarray(start, end)); - - case 12: - throw new Error('_createBuffer requires File/Blob/Buffer.'); - - case 13: - case "end": - return _context5.stop(); - } + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (!(isBlob(file) || isFile(file))) { + _context5.next = 8; + break; + } + _file = file.slice(start, end); + _context5.next = 4; + return getBuffer(_file); + case 4: + fileContent = _context5.sent; + return _context5.abrupt("return", Buffer.from(fileContent)); + case 8: + if (!isBuffer(file)) { + _context5.next = 12; + break; + } + return _context5.abrupt("return", file.subarray(start, end)); + case 12: + throw new Error('_createBuffer requires File/Blob/Buffer.'); + case 13: + case "end": + return _context5.stop(); } }, _callee5); })); - function _createBuffer(_x8, _x9, _x10) { return _createBuffer2.apply(this, arguments); } - return _createBuffer; }(); - proto._getPartSize = function _getPartSize(fileSize, partSize) { var maxNumParts = 10 * 1000; var defaultPartSize = 1 * 1024 * 1024; if (!partSize) partSize = defaultPartSize; var safeSize = Math.ceil(fileSize / maxNumParts); - if (partSize < safeSize) { partSize = safeSize; console.warn("partSize has been set to ".concat(partSize, ", because the partSize you provided causes partNumber to be greater than 10,000")); } - return partSize; }; - proto._divideParts = function _divideParts(fileSize, partSize) { var numParts = Math.ceil(fileSize / partSize); var partOffs = []; - for (var i = 0; i < numParts; i++) { var start = partSize * i; var end = Math.min(start + partSize, fileSize); @@ -1962,69 +1600,47 @@ proto._divideParts = function _divideParts(fileSize, partSize) { end: end }); } - return partOffs; }; }).call(this)}).call(this,require("buffer").Buffer) -},{"../common/utils/isBlob":64,"../common/utils/isBuffer":65,"../common/utils/isFile":67,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"buffer":90,"copy-to":94,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.find.js":275,"core-js/modules/es.array.from.js":276,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.map.js":280,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.iterator.js":303,"core-js/modules/es.typed-array.copy-within.js":315,"core-js/modules/es.typed-array.every.js":316,"core-js/modules/es.typed-array.fill.js":317,"core-js/modules/es.typed-array.filter.js":318,"core-js/modules/es.typed-array.find-index.js":319,"core-js/modules/es.typed-array.find.js":320,"core-js/modules/es.typed-array.for-each.js":321,"core-js/modules/es.typed-array.includes.js":322,"core-js/modules/es.typed-array.index-of.js":323,"core-js/modules/es.typed-array.iterator.js":324,"core-js/modules/es.typed-array.join.js":325,"core-js/modules/es.typed-array.last-index-of.js":326,"core-js/modules/es.typed-array.map.js":327,"core-js/modules/es.typed-array.reduce-right.js":328,"core-js/modules/es.typed-array.reduce.js":329,"core-js/modules/es.typed-array.reverse.js":330,"core-js/modules/es.typed-array.set.js":331,"core-js/modules/es.typed-array.slice.js":332,"core-js/modules/es.typed-array.some.js":333,"core-js/modules/es.typed-array.sort.js":334,"core-js/modules/es.typed-array.subarray.js":335,"core-js/modules/es.typed-array.to-locale-string.js":336,"core-js/modules/es.typed-array.to-string.js":337,"core-js/modules/es.typed-array.uint8-array.js":338,"mime":374,"path":378,"stream":398,"util":419}],5:[function(require,module,exports){ +},{"../common/utils/isBlob":67,"../common/utils/isBuffer":68,"../common/utils/isFile":70,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"buffer":103,"copy-to":107,"core-js/modules/es.array-buffer.slice.js":309,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.find.js":313,"core-js/modules/es.array.from.js":314,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.iterator.js":345,"core-js/modules/es.typed-array.copy-within.js":358,"core-js/modules/es.typed-array.every.js":359,"core-js/modules/es.typed-array.fill.js":360,"core-js/modules/es.typed-array.filter.js":361,"core-js/modules/es.typed-array.find-index.js":362,"core-js/modules/es.typed-array.find.js":363,"core-js/modules/es.typed-array.for-each.js":364,"core-js/modules/es.typed-array.includes.js":365,"core-js/modules/es.typed-array.index-of.js":366,"core-js/modules/es.typed-array.iterator.js":367,"core-js/modules/es.typed-array.join.js":368,"core-js/modules/es.typed-array.last-index-of.js":369,"core-js/modules/es.typed-array.map.js":370,"core-js/modules/es.typed-array.reduce-right.js":371,"core-js/modules/es.typed-array.reduce.js":372,"core-js/modules/es.typed-array.reverse.js":373,"core-js/modules/es.typed-array.set.js":374,"core-js/modules/es.typed-array.slice.js":375,"core-js/modules/es.typed-array.some.js":376,"core-js/modules/es.typed-array.sort.js":377,"core-js/modules/es.typed-array.subarray.js":378,"core-js/modules/es.typed-array.to-locale-string.js":379,"core-js/modules/es.typed-array.to-string.js":380,"core-js/modules/es.typed-array.uint8-array.js":381,"mime":432,"path":441,"stream":470,"util":491}],5:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - require("core-js/modules/es.function.name.js"); - +require("core-js/modules/es.object.keys.js"); require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.regexp.to-string.js"); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.number.constructor.js"); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - -require("core-js/modules/es.object.keys.js"); - require("core-js/modules/es.promise.js"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - // const debug = require('debug')('ali-oss:object'); var fs = require('fs'); - var copy = require('copy-to'); - var path = require('path'); - var mime = require('mime'); - var callback = require('../common/callback'); - var merge = require('merge-descriptors'); - var _require = require('../common/utils/isBlob'), - isBlob = _require.isBlob; - + isBlob = _require.isBlob; var _require2 = require('../common/utils/isFile'), - isFile = _require2.isFile; - + isFile = _require2.isFile; var _require3 = require('../common/utils/isBuffer'), - isBuffer = _require3.isBuffer; - + isBuffer = _require3.isBuffer; var _require4 = require('../common/utils/obj2xml'), - obj2xml = _require4.obj2xml; // var assert = require('assert'); + obj2xml = _require4.obj2xml; +// var assert = require('assert'); var proto = exports; + /** * Object operations */ @@ -2036,43 +1652,37 @@ var proto = exports; * @param {Object} options * @return {Object} */ - proto.append = /*#__PURE__*/function () { var _append = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, file, options) { var result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = options || {}; - if (options.position === undefined) options.position = '0'; - options.subres = { - append: '', - position: options.position - }; - options.method = 'POST'; - _context.next = 6; - return this.put(name, file, options); - - case 6: - result = _context.sent; - result.nextAppendPosition = result.res.headers['x-oss-next-append-position']; - return _context.abrupt("return", result); - - case 9: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + if (options.position === undefined) options.position = '0'; + options.subres = { + append: '', + position: options.position + }; + options.method = 'POST'; + _context.next = 6; + return this.put(name, file, options); + case 6: + result = _context.sent; + result.nextAppendPosition = result.res.headers['x-oss-next-append-position']; + return _context.abrupt("return", result); + case 9: + case "end": + return _context.stop(); } }, _callee, this); })); - function append(_x, _x2, _x3) { return _append.apply(this, arguments); } - return append; }(); + /** * put an object from String(file path)/Buffer/ReadableStream * @param {String} name the object key @@ -2090,100 +1700,81 @@ proto.append = /*#__PURE__*/function () { * } * @return {Object} */ - - proto.put = /*#__PURE__*/function () { var _put = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name, file, options) { var content, method, params, result, ret; return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - options = options || {}; - options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; - options.headers = options.headers || {}; - name = this._objectName(name); - - if (!isBuffer(file)) { - _context2.next = 8; - break; - } - - content = file; - _context2.next = 19; + while (1) switch (_context2.prev = _context2.next) { + case 0: + options = options || {}; + options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; + options.headers = options.headers || {}; + name = this._objectName(name); + if (!isBuffer(file)) { + _context2.next = 8; break; - - case 8: - if (!(isBlob(file) || isFile(file))) { - _context2.next = 18; - break; - } - - if (!options.mime) { - if (isFile(file)) { - options.mime = mime.getType(path.extname(file.name)); - } else { - options.mime = file.type; - } - } - - _context2.next = 12; - return this._createBuffer(file, 0, file.size); - - case 12: - content = _context2.sent; - _context2.next = 15; - return this._getFileSize(file); - - case 15: - options.contentLength = _context2.sent; - _context2.next = 19; + } + content = file; + _context2.next = 19; + break; + case 8: + if (!(isBlob(file) || isFile(file))) { + _context2.next = 18; break; - - case 18: - throw new TypeError('Must provide Buffer/Blob/File for put.'); - - case 19: - this._convertMetaToHeaders(options.meta, options.headers); - - method = options.method || 'PUT'; - params = this._objectRequestParams(method, name, options); - callback.encodeCallback(params, options); - params.mime = options.mime; - params.disabledMD5 = options.disabledMD5; - params.content = content; - params.successStatuses = [200]; - _context2.next = 29; - return this.request(params); - - case 29: - result = _context2.sent; - ret = { - name: name, - url: this._objectUrl(name), - res: result.res - }; - - if (params.headers && params.headers['x-oss-callback']) { - ret.data = JSON.parse(result.data.toString()); + } + if (!options.mime) { + if (isFile(file)) { + options.mime = mime.getType(path.extname(file.name)); + } else { + options.mime = file.type; } - - return _context2.abrupt("return", ret); - - case 33: - case "end": - return _context2.stop(); - } + } + _context2.next = 12; + return this._createBuffer(file, 0, file.size); + case 12: + content = _context2.sent; + _context2.next = 15; + return this._getFileSize(file); + case 15: + options.contentLength = _context2.sent; + _context2.next = 19; + break; + case 18: + throw new TypeError('Must provide Buffer/Blob/File for put.'); + case 19: + this._convertMetaToHeaders(options.meta, options.headers); + method = options.method || 'PUT'; + params = this._objectRequestParams(method, name, options); + callback.encodeCallback(params, options); + params.mime = options.mime; + params.disabledMD5 = options.disabledMD5; + params.content = content; + params.successStatuses = [200]; + _context2.next = 29; + return this.request(params); + case 29: + result = _context2.sent; + ret = { + name: name, + url: this._objectUrl(name), + res: result.res + }; + if (params.headers && params.headers['x-oss-callback']) { + ret.data = JSON.parse(result.data.toString()); + } + return _context2.abrupt("return", ret); + case 33: + case "end": + return _context2.stop(); } }, _callee2, this); })); - function put(_x4, _x5, _x6) { return _put.apply(this, arguments); } - return put; }(); + /** * put an object from ReadableStream. If `options.contentLength` is * not provided, chunked encoding is used. @@ -2192,65 +1783,51 @@ proto.put = /*#__PURE__*/function () { * @param {Object} options * @return {Object} */ - - proto.putStream = /*#__PURE__*/function () { var _putStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(name, stream, options) { var method, params, result, ret; return _regenerator.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - options = options || {}; - options.headers = options.headers || {}; - name = this._objectName(name); - - if (options.contentLength) { - options.headers['Content-Length'] = options.contentLength; - } else { - options.headers['Transfer-Encoding'] = 'chunked'; - } - - this._convertMetaToHeaders(options.meta, options.headers); - - method = options.method || 'PUT'; - params = this._objectRequestParams(method, name, options); - callback.encodeCallback(params, options); - params.mime = options.mime; - params.stream = stream; - params.successStatuses = [200]; - _context3.next = 13; - return this.request(params); - - case 13: - result = _context3.sent; - ret = { - name: name, - url: this._objectUrl(name), - res: result.res - }; - - if (params.headers && params.headers['x-oss-callback']) { - ret.data = JSON.parse(result.data.toString()); - } - - return _context3.abrupt("return", ret); - - case 17: - case "end": - return _context3.stop(); - } + while (1) switch (_context3.prev = _context3.next) { + case 0: + options = options || {}; + options.headers = options.headers || {}; + name = this._objectName(name); + if (options.contentLength) { + options.headers['Content-Length'] = options.contentLength; + } else { + options.headers['Transfer-Encoding'] = 'chunked'; + } + this._convertMetaToHeaders(options.meta, options.headers); + method = options.method || 'PUT'; + params = this._objectRequestParams(method, name, options); + callback.encodeCallback(params, options); + params.mime = options.mime; + params.stream = stream; + params.successStatuses = [200]; + _context3.next = 13; + return this.request(params); + case 13: + result = _context3.sent; + ret = { + name: name, + url: this._objectUrl(name), + res: result.res + }; + if (params.headers && params.headers['x-oss-callback']) { + ret.data = JSON.parse(result.data.toString()); + } + return _context3.abrupt("return", ret); + case 17: + case "end": + return _context3.stop(); } }, _callee3, this); })); - function putStream(_x7, _x8, _x9) { return _putStream.apply(this, arguments); } - return putStream; }(); - merge(proto, require('../common/object/copyObject')); merge(proto, require('../common/object/getObjectTagging')); merge(proto, require('../common/object/putObjectTagging')); @@ -2270,299 +1847,252 @@ merge(proto, require('../common/object/getObjectUrl')); merge(proto, require('../common/object/generateObjectUrl')); merge(proto, require('../common/object/signatureUrl')); merge(proto, require('../common/object/asyncSignatureUrl')); - +merge(proto, require('../common/object/signatureUrlV4')); proto.putMeta = /*#__PURE__*/function () { var _putMeta = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(name, meta, options) { var copyResult; return _regenerator.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return this.copy(name, name, { - meta: meta || {}, - timeout: options && options.timeout, - ctx: options && options.ctx - }); - - case 2: - copyResult = _context4.sent; - return _context4.abrupt("return", copyResult); - - case 4: - case "end": - return _context4.stop(); - } + while (1) switch (_context4.prev = _context4.next) { + case 0: + _context4.next = 2; + return this.copy(name, name, { + meta: meta || {}, + timeout: options && options.timeout, + ctx: options && options.ctx + }); + case 2: + copyResult = _context4.sent; + return _context4.abrupt("return", copyResult); + case 4: + case "end": + return _context4.stop(); } }, _callee4, this); })); - function putMeta(_x10, _x11, _x12) { return _putMeta.apply(this, arguments); } - return putMeta; }(); - proto.list = /*#__PURE__*/function () { var _list = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(query, options) { var params, result, objects, that, prefixes; return _regenerator.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - // prefix, marker, max-keys, delimiter - params = this._objectRequestParams('GET', '', options); - params.query = query; - params.xmlResponse = true; - params.successStatuses = [200]; - _context5.next = 6; - return this.request(params); - - case 6: - result = _context5.sent; - objects = result.data.Contents || []; - that = this; - - if (objects) { - if (!Array.isArray(objects)) { - objects = [objects]; - } - - objects = objects.map(function (obj) { - return { - name: obj.Key, - url: that._objectUrl(obj.Key), - lastModified: obj.LastModified, - etag: obj.ETag, - type: obj.Type, - size: Number(obj.Size), - storageClass: obj.StorageClass, - owner: { - id: obj.Owner.ID, - displayName: obj.Owner.DisplayName - } - }; - }); + while (1) switch (_context5.prev = _context5.next) { + case 0: + // prefix, marker, max-keys, delimiter + params = this._objectRequestParams('GET', '', options); + params.query = query; + params.xmlResponse = true; + params.successStatuses = [200]; + _context5.next = 6; + return this.request(params); + case 6: + result = _context5.sent; + objects = result.data.Contents || []; + that = this; + if (objects) { + if (!Array.isArray(objects)) { + objects = [objects]; } - - prefixes = result.data.CommonPrefixes || null; - - if (prefixes) { - if (!Array.isArray(prefixes)) { - prefixes = [prefixes]; - } - - prefixes = prefixes.map(function (item) { - return item.Prefix; - }); + objects = objects.map(function (obj) { + return { + name: obj.Key, + url: that._objectUrl(obj.Key), + lastModified: obj.LastModified, + etag: obj.ETag, + type: obj.Type, + size: Number(obj.Size), + storageClass: obj.StorageClass, + owner: { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + } + }; + }); + } + prefixes = result.data.CommonPrefixes || null; + if (prefixes) { + if (!Array.isArray(prefixes)) { + prefixes = [prefixes]; } - - return _context5.abrupt("return", { - res: result.res, - objects: objects, - prefixes: prefixes, - nextMarker: result.data.NextMarker || null, - isTruncated: result.data.IsTruncated === 'true' + prefixes = prefixes.map(function (item) { + return item.Prefix; }); - - case 13: - case "end": - return _context5.stop(); - } + } + return _context5.abrupt("return", { + res: result.res, + objects: objects, + prefixes: prefixes, + nextMarker: result.data.NextMarker || null, + isTruncated: result.data.IsTruncated === 'true' + }); + case 13: + case "end": + return _context5.stop(); } }, _callee5, this); })); - function list(_x13, _x14) { return _list.apply(this, arguments); } - return list; }(); - proto.listV2 = /*#__PURE__*/function () { var _listV = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(query) { var options, - continuation_token, - params, - result, - objects, - that, - prefixes, - _args6 = arguments; + continuation_token, + params, + result, + objects, + that, + prefixes, + _args6 = arguments; return _regenerator.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {}; - continuation_token = query['continuation-token'] || query.continuationToken; - - if (continuation_token) { - options.subres = Object.assign({ - 'continuation-token': continuation_token - }, options.subres); + while (1) switch (_context6.prev = _context6.next) { + case 0: + options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {}; + continuation_token = query['continuation-token'] || query.continuationToken; + 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); + delete params.query['continuation-token']; + delete params.query.continuationToken; + params.xmlResponse = true; + params.successStatuses = [200]; + _context6.next = 11; + return this.request(params); + case 11: + result = _context6.sent; + objects = result.data.Contents || []; + that = this; + if (objects) { + if (!Array.isArray(objects)) { + objects = [objects]; } - - params = this._objectRequestParams('GET', '', options); - params.query = Object.assign({ - 'list-type': 2 - }, query); - delete params.query['continuation-token']; - delete params.query.continuationToken; - params.xmlResponse = true; - params.successStatuses = [200]; - _context6.next = 11; - return this.request(params); - - case 11: - result = _context6.sent; - objects = result.data.Contents || []; - that = this; - - if (objects) { - if (!Array.isArray(objects)) { - objects = [objects]; - } - - objects = objects.map(function (obj) { - var owner = null; - - if (obj.Owner) { - owner = { - id: obj.Owner.ID, - displayName: obj.Owner.DisplayName - }; - } - - return { - name: obj.Key, - url: that._objectUrl(obj.Key), - lastModified: obj.LastModified, - etag: obj.ETag, - type: obj.Type, - size: Number(obj.Size), - storageClass: obj.StorageClass, - owner: owner + objects = objects.map(function (obj) { + var owner = null; + if (obj.Owner) { + owner = { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName }; - }); - } - - prefixes = result.data.CommonPrefixes || null; - - if (prefixes) { - if (!Array.isArray(prefixes)) { - prefixes = [prefixes]; } - - prefixes = prefixes.map(function (item) { - return item.Prefix; - }); + return { + name: obj.Key, + url: that._objectUrl(obj.Key), + lastModified: obj.LastModified, + etag: obj.ETag, + type: obj.Type, + size: Number(obj.Size), + storageClass: obj.StorageClass, + owner: owner + }; + }); + } + prefixes = result.data.CommonPrefixes || null; + if (prefixes) { + if (!Array.isArray(prefixes)) { + prefixes = [prefixes]; } - - return _context6.abrupt("return", { - res: result.res, - objects: objects, - prefixes: prefixes, - isTruncated: result.data.IsTruncated === 'true', - keyCount: +result.data.KeyCount, - continuationToken: result.data.ContinuationToken || null, - nextContinuationToken: result.data.NextContinuationToken || null + prefixes = prefixes.map(function (item) { + return item.Prefix; }); - - case 18: - case "end": - return _context6.stop(); - } + } + return _context6.abrupt("return", { + res: result.res, + objects: objects, + prefixes: prefixes, + isTruncated: result.data.IsTruncated === 'true', + keyCount: +result.data.KeyCount, + continuationToken: result.data.ContinuationToken || null, + nextContinuationToken: result.data.NextContinuationToken || null + }); + case 18: + case "end": + return _context6.stop(); } }, _callee6, this); })); - function listV2(_x15) { return _listV.apply(this, arguments); } - return listV2; }(); + /** * Restore Object * @param {String} name the object key * @param {Object} options * @returns {{res}} */ - - proto.restore = /*#__PURE__*/function () { var _restore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(name) { var options, - params, - paramsXMLObj, - result, - _args7 = arguments; + params, + paramsXMLObj, + result, + _args7 = arguments; return _regenerator.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : { - type: 'Archive' - }; - options = options || {}; - options.subres = Object.assign({ - restore: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - 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' - } + while (1) switch (_context7.prev = _context7.next) { + case 0: + options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : { + type: 'Archive' + }; + options = options || {}; + options.subres = Object.assign({ + restore: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + 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(paramsXMLObj, { - headers: true - }); - params.mime = 'xml'; - } - - params.successStatuses = [202]; - _context7.next = 9; - return this.request(params); - - case 9: - result = _context7.sent; - return _context7.abrupt("return", { - res: result.res + } + }; + params.content = obj2xml(paramsXMLObj, { + headers: true }); - - case 11: - case "end": - return _context7.stop(); - } + params.mime = 'xml'; + } + params.successStatuses = [202]; + _context7.next = 9; + return this.request(params); + case 9: + result = _context7.sent; + return _context7.abrupt("return", { + res: result.res + }); + case 11: + case "end": + return _context7.stop(); } }, _callee7, this); })); - function restore(_x16) { return _restore.apply(this, arguments); } - return restore; }(); - proto._objectUrl = function _objectUrl(name) { return this._getReqUrl({ bucket: this.options.bucket, object: name }); }; + /** * generator request params * @return {Object} params @@ -2570,12 +2100,10 @@ proto._objectUrl = function _objectUrl(name) { * @api private */ - proto._objectRequestParams = function _objectRequestParams(method, name, options) { if (!this.options.bucket && !this.options.cname) { throw new Error('Please create a bucket first'); } - options = options || {}; name = this._objectName(name); var params = { @@ -2583,35 +2111,29 @@ proto._objectRequestParams = function _objectRequestParams(method, name, options bucket: this.options.bucket, method: method, subres: options && options.subres, + additionalHeaders: options && options.additionalHeaders, timeout: options && options.timeout, ctx: options && options.ctx }; - if (options.headers) { params.headers = {}; copy(options.headers).to(params.headers); } - return params; }; - proto._objectName = function _objectName(name) { return name.replace(/^\/+/, ''); }; - proto._convertMetaToHeaders = function _convertMetaToHeaders(meta, headers) { if (!meta) { return; } - Object.keys(meta).forEach(function (k) { headers["x-oss-meta-".concat(k)] = meta[k]; }); }; - proto._deleteFileSafe = function _deleteFileSafe(filepath) { var _this = this; - return new Promise(function (resolve) { fs.exists(filepath, function (exists) { if (!exists) { @@ -2621,7 +2143,6 @@ proto._deleteFileSafe = function _deleteFileSafe(filepath) { if (err) { _this.debug('unlink %j error: %s', filepath, err, 'error'); } - resolve(); }); } @@ -2629,131 +2150,104 @@ proto._deleteFileSafe = function _deleteFileSafe(filepath) { }); }; -},{"../common/callback":24,"../common/image":27,"../common/object/asyncSignatureUrl":31,"../common/object/copyObject":32,"../common/object/delete":33,"../common/object/deleteMulti":34,"../common/object/deleteObjectTagging":35,"../common/object/generateObjectUrl":36,"../common/object/get":37,"../common/object/getACL":38,"../common/object/getBucketVersions":39,"../common/object/getObjectMeta":40,"../common/object/getObjectTagging":41,"../common/object/getObjectUrl":42,"../common/object/getSymlink":43,"../common/object/head":44,"../common/object/putACL":45,"../common/object/putObjectTagging":46,"../common/object/putSymlink":47,"../common/object/signatureUrl":48,"../common/utils/isBlob":64,"../common/utils/isBuffer":65,"../common/utils/isFile":67,"../common/utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"copy-to":94,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.number.constructor.js":286,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339,"fs":89,"merge-descriptors":372,"mime":374,"path":378}],6:[function(require,module,exports){ +},{"../common/callback":24,"../common/image":27,"../common/object/asyncSignatureUrl":31,"../common/object/copyObject":32,"../common/object/delete":33,"../common/object/deleteMulti":34,"../common/object/deleteObjectTagging":35,"../common/object/generateObjectUrl":36,"../common/object/get":37,"../common/object/getACL":38,"../common/object/getBucketVersions":39,"../common/object/getObjectMeta":40,"../common/object/getObjectTagging":41,"../common/object/getObjectUrl":42,"../common/object/getSymlink":43,"../common/object/head":44,"../common/object/putACL":45,"../common/object/putObjectTagging":46,"../common/object/putSymlink":47,"../common/object/signatureUrl":48,"../common/object/signatureUrlV4":49,"../common/utils/isBlob":67,"../common/utils/isBuffer":68,"../common/utils/isFile":70,"../common/utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"copy-to":107,"core-js/modules/es.array.map.js":318,"core-js/modules/es.function.name.js":322,"core-js/modules/es.number.constructor.js":324,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382,"fs":102,"merge-descriptors":430,"mime":432,"path":441}],6:[function(require,module,exports){ "use strict"; -exports.version = '6.19.0'; +exports.version = '6.20.0'; },{}],7:[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")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.abortBucketWorm = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - function abortBucketWorm(_x, _x2) { return _abortBucketWorm.apply(this, arguments); } - function _abortBucketWorm() { _abortBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - checkBucketName_1.checkBucketName(name); - params = this._bucketRequestParams('DELETE', name, 'worm', options); - _context.next = 4; - return this.request(params); - - case 4: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - status: result.status - }); - - case 6: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('DELETE', name, 'worm', options); + _context.next = 4; + return this.request(params); + case 4: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 6: + case "end": + return _context.stop(); } }, _callee, this); })); return _abortBucketWorm.apply(this, arguments); } - exports.abortBucketWorm = abortBucketWorm; -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],8:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],8:[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")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.completeBucketWorm = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - function completeBucketWorm(_x, _x2, _x3) { return _completeBucketWorm.apply(this, arguments); } - function _completeBucketWorm() { _completeBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, wormId, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - checkBucketName_1.checkBucketName(name); - params = this._bucketRequestParams('POST', name, { - wormId: wormId - }, options); - _context.next = 4; - return this.request(params); - - case 4: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - status: result.status - }); - - case 6: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('POST', name, { + wormId: wormId + }, options); + _context.next = 4; + return this.request(params); + case 4: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 6: + case "end": + return _context.stop(); } }, _callee, this); })); return _completeBucketWorm.apply(this, arguments); } - exports.completeBucketWorm = completeBucketWorm; -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],9:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],9:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.deleteBucketInventory = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); /** * deleteBucketInventory @@ -2761,235 +2255,185 @@ var checkBucketName_1 = require("../utils/checkBucketName"); * @param {String} inventoryId * @param {Object} options */ - - function deleteBucketInventory(_x, _x2) { return _deleteBucketInventory.apply(this, arguments); } - function _deleteBucketInventory() { _deleteBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, inventoryId) { var options, - subres, - params, - result, - _args = arguments; + subres, + params, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - subres = Object.assign({ - inventory: '', - inventoryId: inventoryId - }, options.subres); - checkBucketName_1.checkBucketName(bucketName); - params = this._bucketRequestParams('DELETE', bucketName, subres, options); - params.successStatuses = [204]; - _context.next = 7; - return this.request(params); - - case 7: - result = _context.sent; - return _context.abrupt("return", { - status: result.status, - res: result.res - }); - - case 9: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + subres = Object.assign({ + inventory: '', + inventoryId: inventoryId + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + params = this._bucketRequestParams('DELETE', bucketName, subres, options); + params.successStatuses = [204]; + _context.next = 7; + return this.request(params); + case 7: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 9: + case "end": + return _context.stop(); } }, _callee, this); })); return _deleteBucketInventory.apply(this, arguments); } - exports.deleteBucketInventory = deleteBucketInventory; -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],10:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],10:[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 _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var proto = exports; - proto.deleteBucketLifecycle = /*#__PURE__*/function () { var _deleteBucketLifecycle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _checkBucketName(name); - - params = this._bucketRequestParams('DELETE', name, 'lifecycle', options); - params.successStatuses = [204]; - _context.next = 5; - return this.request(params); - - case 5: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 7: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('DELETE', name, 'lifecycle', options); + params.successStatuses = [204]; + _context.next = 5; + return this.request(params); + case 5: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 7: + case "end": + return _context.stop(); } }, _callee, this); })); - function deleteBucketLifecycle(_x, _x2) { return _deleteBucketLifecycle.apply(this, arguments); } - return deleteBucketLifecycle; }(); -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],11:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],11:[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 _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var proto = exports; - proto.deleteBucketWebsite = /*#__PURE__*/function () { var _deleteBucketWebsite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _checkBucketName(name); - - params = this._bucketRequestParams('DELETE', name, 'website', options); - params.successStatuses = [204]; - _context.next = 5; - return this.request(params); - - case 5: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 7: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('DELETE', name, 'website', options); + params.successStatuses = [204]; + _context.next = 5; + return this.request(params); + case 5: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 7: + case "end": + return _context.stop(); } }, _callee, this); })); - function deleteBucketWebsite(_x, _x2) { return _deleteBucketWebsite.apply(this, arguments); } - return deleteBucketWebsite; }(); -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],12:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],12:[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")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.extendBucketWorm = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - var obj2xml_1 = require("../utils/obj2xml"); - function extendBucketWorm(_x, _x2, _x3, _x4) { return _extendBucketWorm.apply(this, arguments); } - function _extendBucketWorm() { _extendBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, wormId, days, options) { var params, paramlXMLObJ, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - checkBucketName_1.checkBucketName(name); - params = this._bucketRequestParams('POST', name, { - wormExtend: '', - wormId: wormId - }, options); - paramlXMLObJ = { - ExtendWormConfiguration: { - RetentionPeriodInDays: days - } - }; - params.mime = 'xml'; - params.content = obj2xml_1.obj2xml(paramlXMLObJ, { - headers: true - }); - params.successStatuses = [200]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - status: result.status - }); - - case 10: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('POST', name, { + wormExtend: '', + wormId: wormId + }, options); + paramlXMLObJ = { + ExtendWormConfiguration: { + RetentionPeriodInDays: days + } + }; + params.mime = 'xml'; + params.content = obj2xml_1.obj2xml(paramlXMLObJ, { + headers: true + }); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); return _extendBucketWorm.apply(this, arguments); } - exports.extendBucketWorm = extendBucketWorm; -},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],13:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],13:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.getBucketInventory = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - var formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); /** * getBucketInventory @@ -2997,147 +2441,115 @@ var formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); * @param {String} inventoryId * @param {Object} options */ - - function getBucketInventory(_x, _x2) { return _getBucketInventory.apply(this, arguments); } - function _getBucketInventory() { _getBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, inventoryId) { var options, - subres, - params, - result, - _args = arguments; + subres, + params, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - subres = Object.assign({ - inventory: '', - inventoryId: inventoryId - }, options.subres); - checkBucketName_1.checkBucketName(bucketName); - params = this._bucketRequestParams('GET', bucketName, subres, options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - return _context.abrupt("return", { - status: result.status, - res: result.res, - inventory: formatInventoryConfig_1.formatInventoryConfig(result.data) - }); - - case 10: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + subres = Object.assign({ + inventory: '', + inventoryId: inventoryId + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + params = this._bucketRequestParams('GET', bucketName, subres, options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res, + inventory: formatInventoryConfig_1.formatInventoryConfig(result.data) + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); return _getBucketInventory.apply(this, arguments); } - exports.getBucketInventory = getBucketInventory; -},{"../utils/checkBucketName":51,"../utils/formatInventoryConfig":60,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],14:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/formatInventoryConfig":62,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],14:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.array.map.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/isArray'), - isArray = _require2.isArray; - + isArray = _require2.isArray; var _require3 = require('../utils/formatObjKey'), - formatObjKey = _require3.formatObjKey; - + formatObjKey = _require3.formatObjKey; var proto = exports; - proto.getBucketLifecycle = /*#__PURE__*/function () { var _getBucketLifecycle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result, rules; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _checkBucketName(name); - - params = this._bucketRequestParams('GET', name, 'lifecycle', options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context.next = 6; - return this.request(params); - - case 6: - result = _context.sent; - rules = result.data.Rule || null; - - if (rules) { - if (!isArray(rules)) { - rules = [rules]; - } - - rules = rules.map(function (_) { - if (_.ID) { - _.id = _.ID; - delete _.ID; - } - - if (_.Tag && !isArray(_.Tag)) { - _.Tag = [_.Tag]; - } - - return formatObjKey(_, 'firstLowerCase'); - }); + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'lifecycle', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + rules = result.data.Rule || null; + if (rules) { + if (!isArray(rules)) { + rules = [rules]; } - - return _context.abrupt("return", { - rules: rules, - res: result.res + rules = rules.map(function (_) { + if (_.ID) { + _.id = _.ID; + delete _.ID; + } + if (_.Tag && !isArray(_.Tag)) { + _.Tag = [_.Tag]; + } + return formatObjKey(_, 'firstLowerCase'); }); - - case 10: - case "end": - return _context.stop(); - } + } + return _context.abrupt("return", { + rules: rules, + res: result.res + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); - function getBucketLifecycle(_x, _x2) { return _getBucketLifecycle.apply(this, arguments); } - return getBucketLifecycle; }(); -},{"../utils/checkBucketName":51,"../utils/formatObjKey":61,"../utils/isArray":63,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.map.js":280}],15:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/formatObjKey":63,"../utils/isArray":66,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.map.js":318}],15:[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 _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var proto = exports; /** * getBucketVersioning @@ -3148,254 +2560,201 @@ proto.getBucketVersioning = /*#__PURE__*/function () { var _getBucketVersioning = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, options) { var params, result, versionStatus; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _checkBucketName(bucketName); - - params = this._bucketRequestParams('GET', bucketName, 'versioning', options); - params.xmlResponse = true; - params.successStatuses = [200]; - _context.next = 6; - return this.request(params); - - case 6: - result = _context.sent; - versionStatus = result.data.Status; - return _context.abrupt("return", { - status: result.status, - versionStatus: versionStatus, - res: result.res - }); - - case 9: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(bucketName); + params = this._bucketRequestParams('GET', bucketName, 'versioning', options); + params.xmlResponse = true; + params.successStatuses = [200]; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + versionStatus = result.data.Status; + return _context.abrupt("return", { + status: result.status, + versionStatus: versionStatus, + res: result.res + }); + case 9: + case "end": + return _context.stop(); } }, _callee, this); })); - function getBucketVersioning(_x, _x2) { return _getBucketVersioning.apply(this, arguments); } - return getBucketVersioning; }(); -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],16:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],16:[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 _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/isObject'), - isObject = _require2.isObject; - + isObject = _require2.isObject; var proto = exports; - proto.getBucketWebsite = /*#__PURE__*/function () { var _getBucketWebsite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result, routingRules; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _checkBucketName(name); - - params = this._bucketRequestParams('GET', name, 'website', options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context.next = 6; - return this.request(params); - - case 6: - result = _context.sent; - routingRules = []; - - if (result.data.RoutingRules && result.data.RoutingRules.RoutingRule) { - if (isObject(result.data.RoutingRules.RoutingRule)) { - routingRules = [result.data.RoutingRules.RoutingRule]; - } else { - routingRules = result.data.RoutingRules.RoutingRule; - } + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'website', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + routingRules = []; + if (result.data.RoutingRules && result.data.RoutingRules.RoutingRule) { + if (isObject(result.data.RoutingRules.RoutingRule)) { + routingRules = [result.data.RoutingRules.RoutingRule]; + } else { + routingRules = result.data.RoutingRules.RoutingRule; } - - return _context.abrupt("return", { - index: result.data.IndexDocument && result.data.IndexDocument.Suffix || '', - supportSubDir: result.data.IndexDocument && result.data.IndexDocument.SupportSubDir || 'false', - type: result.data.IndexDocument && result.data.IndexDocument.Type, - routingRules: routingRules, - error: result.data.ErrorDocument && result.data.ErrorDocument.Key || null, - res: result.res - }); - - case 10: - case "end": - return _context.stop(); - } + } + return _context.abrupt("return", { + index: result.data.IndexDocument && result.data.IndexDocument.Suffix || '', + supportSubDir: result.data.IndexDocument && result.data.IndexDocument.SupportSubDir || 'false', + type: result.data.IndexDocument && result.data.IndexDocument.Type, + routingRules: routingRules, + error: result.data.ErrorDocument && result.data.ErrorDocument.Key || null, + res: result.res + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); - function getBucketWebsite(_x, _x2) { return _getBucketWebsite.apply(this, arguments); } - return getBucketWebsite; }(); -},{"../utils/checkBucketName":51,"../utils/isObject":70,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],17:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/isObject":73,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],17:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.getBucketWorm = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - var dataFix_1 = require("../utils/dataFix"); - function getBucketWorm(_x, _x2) { return _getBucketWorm.apply(this, arguments); } - function _getBucketWorm() { _getBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - checkBucketName_1.checkBucketName(name); - params = this._bucketRequestParams('GET', name, 'worm', options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context.next = 6; - return this.request(params); - - case 6: - result = _context.sent; - dataFix_1.dataFix(result.data, { - lowerFirst: true, - rename: { - RetentionPeriodInDays: 'days' - } - }); - return _context.abrupt("return", Object.assign(Object.assign({}, result.data), { - res: result.res, - status: result.status - })); - - case 9: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'worm', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + dataFix_1.dataFix(result.data, { + lowerFirst: true, + rename: { + RetentionPeriodInDays: 'days' + } + }); + return _context.abrupt("return", Object.assign(Object.assign({}, result.data), { + res: result.res, + status: result.status + })); + case 9: + case "end": + return _context.stop(); } }, _callee, this); })); return _getBucketWorm.apply(this, arguments); } - exports.getBucketWorm = getBucketWorm; -},{"../utils/checkBucketName":51,"../utils/dataFix":57,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],18:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/dataFix":58,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],18:[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")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.initiateBucketWorm = void 0; - var obj2xml_1 = require("../utils/obj2xml"); - var checkBucketName_1 = require("../utils/checkBucketName"); - function initiateBucketWorm(_x, _x2, _x3) { return _initiateBucketWorm.apply(this, arguments); } - function _initiateBucketWorm() { _initiateBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, days, options) { var params, paramlXMLObJ, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - checkBucketName_1.checkBucketName(name); - params = this._bucketRequestParams('POST', name, 'worm', options); - paramlXMLObJ = { - InitiateWormConfiguration: { - RetentionPeriodInDays: days - } - }; - params.mime = 'xml'; - params.content = obj2xml_1.obj2xml(paramlXMLObJ, { - headers: true - }); - params.successStatuses = [200]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - wormId: result.res.headers['x-oss-worm-id'], - status: result.status - }); - - case 10: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('POST', name, 'worm', options); + paramlXMLObJ = { + InitiateWormConfiguration: { + RetentionPeriodInDays: days + } + }; + params.mime = 'xml'; + params.content = obj2xml_1.obj2xml(paramlXMLObJ, { + headers: true + }); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + wormId: result.res.headers['x-oss-worm-id'], + status: result.status + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); return _initiateBucketWorm.apply(this, arguments); } - exports.initiateBucketWorm = initiateBucketWorm; -},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],19:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],19:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.listBucketInventory = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - var formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); /** * listBucketInventory @@ -3403,84 +2762,69 @@ var formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); * @param {String} inventoryId * @param {Object} options */ - - function listBucketInventory(_x) { return _listBucketInventory.apply(this, arguments); } - function _listBucketInventory() { _listBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName) { var options, - continuationToken, - subres, - params, - result, - data, - res, - status, - _args = arguments; + continuationToken, + subres, + params, + result, + data, + res, + status, + _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] : {}; - continuationToken = options.continuationToken; - subres = Object.assign({ - inventory: '' - }, continuationToken && { - 'continuation-token': continuationToken - }, options.subres); - checkBucketName_1.checkBucketName(bucketName); - params = this._bucketRequestParams('GET', bucketName, subres, options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context.next = 9; - return this.request(params); - - case 9: - result = _context.sent; - data = result.data, res = result.res, status = result.status; - return _context.abrupt("return", { - isTruncated: data.IsTruncated === 'true', - nextContinuationToken: data.NextContinuationToken, - inventoryList: formatInventoryConfig_1.formatInventoryConfig(data.InventoryConfiguration, true), - status: status, - res: res - }); - - case 12: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + continuationToken = options.continuationToken; + subres = Object.assign({ + inventory: '' + }, continuationToken && { + 'continuation-token': continuationToken + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + params = this._bucketRequestParams('GET', bucketName, subres, options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 9; + return this.request(params); + case 9: + result = _context.sent; + data = result.data, res = result.res, status = result.status; + return _context.abrupt("return", { + isTruncated: data.IsTruncated === 'true', + nextContinuationToken: data.NextContinuationToken, + inventoryList: formatInventoryConfig_1.formatInventoryConfig(data.InventoryConfiguration, true), + status: status, + res: res + }); + case 12: + case "end": + return _context.stop(); } }, _callee, this); })); return _listBucketInventory.apply(this, arguments); } - exports.listBucketInventory = listBucketInventory; -},{"../utils/checkBucketName":51,"../utils/formatInventoryConfig":60,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],20:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/formatInventoryConfig":62,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],20:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.array.concat.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.putBucketInventory = void 0; - var checkBucketName_1 = require("../utils/checkBucketName"); - var obj2xml_1 = require("../utils/obj2xml"); /** * putBucketInventory @@ -3488,222 +2832,184 @@ var obj2xml_1 = require("../utils/obj2xml"); * @param {Inventory} inventory * @param {Object} options */ - - function putBucketInventory(_x, _x2) { return _putBucketInventory.apply(this, arguments); } - function _putBucketInventory() { _putBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, inventory) { var options, - subres, - OSSBucketDestination, - optionalFields, - includedObjectVersions, - destinationBucketPrefix, - rolePrefix, - paramXMLObj, - paramXML, - params, - result, - _args = arguments; + subres, + OSSBucketDestination, + optionalFields, + includedObjectVersions, + destinationBucketPrefix, + rolePrefix, + paramXMLObj, + paramXML, + params, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - subres = Object.assign({ - inventory: '', - inventoryId: inventory.id - }, options.subres); - checkBucketName_1.checkBucketName(bucketName); - OSSBucketDestination = inventory.OSSBucketDestination, optionalFields = inventory.optionalFields, includedObjectVersions = inventory.includedObjectVersions; - destinationBucketPrefix = 'acs:oss:::'; - rolePrefix = "acs:ram::".concat(OSSBucketDestination.accountId, ":role/"); - paramXMLObj = { - InventoryConfiguration: { - Id: inventory.id, - IsEnabled: inventory.isEnabled, - Filter: { - Prefix: inventory.prefix || '' - }, - Destination: { - OSSBucketDestination: { - Format: OSSBucketDestination.format, - AccountId: OSSBucketDestination.accountId, - RoleArn: "".concat(rolePrefix).concat(OSSBucketDestination.rolename), - Bucket: "".concat(destinationBucketPrefix).concat(OSSBucketDestination.bucket), - Prefix: OSSBucketDestination.prefix || '', - Encryption: OSSBucketDestination.encryption || '' - } - }, - Schedule: { - Frequency: inventory.frequency - }, - IncludedObjectVersions: includedObjectVersions, - OptionalFields: { - Field: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.field) || [] + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + subres = Object.assign({ + inventory: '', + inventoryId: inventory.id + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + OSSBucketDestination = inventory.OSSBucketDestination, optionalFields = inventory.optionalFields, includedObjectVersions = inventory.includedObjectVersions; + destinationBucketPrefix = 'acs:oss:::'; + rolePrefix = "acs:ram::".concat(OSSBucketDestination.accountId, ":role/"); + paramXMLObj = { + InventoryConfiguration: { + Id: inventory.id, + IsEnabled: inventory.isEnabled, + Filter: { + Prefix: inventory.prefix || '' + }, + Destination: { + OSSBucketDestination: { + Format: OSSBucketDestination.format, + AccountId: OSSBucketDestination.accountId, + RoleArn: "".concat(rolePrefix).concat(OSSBucketDestination.rolename), + Bucket: "".concat(destinationBucketPrefix).concat(OSSBucketDestination.bucket), + Prefix: OSSBucketDestination.prefix || '', + Encryption: OSSBucketDestination.encryption || '' } + }, + Schedule: { + Frequency: inventory.frequency + }, + IncludedObjectVersions: includedObjectVersions, + OptionalFields: { + Field: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.field) || [] } - }; - paramXML = obj2xml_1.obj2xml(paramXMLObj, { - headers: true, - firstUpperCase: true - }); - params = this._bucketRequestParams('PUT', bucketName, subres, options); - params.successStatuses = [200]; - params.mime = 'xml'; - params.content = paramXML; - _context.next = 14; - return this.request(params); - - case 14: - result = _context.sent; - return _context.abrupt("return", { - status: result.status, - res: result.res - }); - - case 16: - case "end": - return _context.stop(); - } + } + }; + paramXML = obj2xml_1.obj2xml(paramXMLObj, { + headers: true, + firstUpperCase: true + }); + params = this._bucketRequestParams('PUT', bucketName, subres, options); + params.successStatuses = [200]; + params.mime = 'xml'; + params.content = paramXML; + _context.next = 14; + return this.request(params); + case 14: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 16: + case "end": + return _context.stop(); } }, _callee, this); })); return _putBucketInventory.apply(this, arguments); } - exports.putBucketInventory = putBucketInventory; -},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.assign.js":287}],21:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.assign.js":325}],21:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.array.includes.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - /* eslint-disable no-use-before-define */ var _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/isArray'), - isArray = _require2.isArray; - + isArray = _require2.isArray; var _require3 = require('../utils/deepCopy'), - deepCopy = _require3.deepCopy; - + deepCopy = _require3.deepCopy; var _require4 = require('../utils/isObject'), - isObject = _require4.isObject; - + isObject = _require4.isObject; var _require5 = require('../utils/obj2xml'), - obj2xml = _require5.obj2xml; - + obj2xml = _require5.obj2xml; var _require6 = require('../utils/checkObjectTag'), - checkObjectTag = _require6.checkObjectTag; - + checkObjectTag = _require6.checkObjectTag; var _require7 = require('../utils/getStrBytesCount'), - getStrBytesCount = _require7.getStrBytesCount; - + getStrBytesCount = _require7.getStrBytesCount; var proto = exports; - proto.putBucketLifecycle = /*#__PURE__*/function () { var _putBucketLifecycle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, rules, options) { var params, Rule, paramXMLObj, paramXML, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _checkBucketName(name); - - if (isArray(rules)) { - _context.next = 3; - break; + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + if (isArray(rules)) { + _context.next = 3; + break; + } + throw new Error('rules must be Array'); + case 3: + params = this._bucketRequestParams('PUT', name, 'lifecycle', options); + Rule = []; + paramXMLObj = { + LifecycleConfiguration: { + Rule: Rule } - - throw new Error('rules must be Array'); - - case 3: - params = this._bucketRequestParams('PUT', name, 'lifecycle', options); - Rule = []; - paramXMLObj = { - LifecycleConfiguration: { - Rule: Rule - } - }; - rules.forEach(function (_) { - defaultDaysAndDate2Expiration(_); // todo delete, 兼容旧版本 - - checkRule(_); - - if (_.id) { - _.ID = _.id; - delete _.id; - } - - Rule.push(_); - }); - paramXML = obj2xml(paramXMLObj, { - headers: true, - firstUpperCase: true - }); - params.content = paramXML; - params.mime = 'xml'; - params.successStatuses = [200]; - _context.next = 13; - return this.request(params); - - case 13: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 15: - case "end": - return _context.stop(); - } + }; + rules.forEach(function (_) { + defaultDaysAndDate2Expiration(_); // todo delete, 兼容旧版本 + checkRule(_); + if (_.id) { + _.ID = _.id; + delete _.id; + } + Rule.push(_); + }); + paramXML = obj2xml(paramXMLObj, { + headers: true, + firstUpperCase: true + }); + params.content = paramXML; + params.mime = 'xml'; + params.successStatuses = [200]; + _context.next = 13; + return this.request(params); + case 13: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 15: + case "end": + return _context.stop(); } }, _callee, this); })); - function putBucketLifecycle(_x, _x2, _x3) { return _putBucketLifecycle.apply(this, arguments); } - return putBucketLifecycle; -}(); // todo delete, 兼容旧版本 - +}(); +// todo delete, 兼容旧版本 function defaultDaysAndDate2Expiration(obj) { if (obj.days) { obj.expiration = { days: obj.days }; } - if (obj.date) { obj.expiration = { createdBeforeDate: obj.date }; } } - function checkDaysAndDate(obj, key) { var days = obj.days, - createdBeforeDate = obj.createdBeforeDate; - + createdBeforeDate = obj.createdBeforeDate; if (!days && !createdBeforeDate) { throw new Error("".concat(key, " must includes days or createdBeforeDate")); } else if (days && !/^[1-9][0-9]*$/.test(days)) { @@ -3712,12 +3018,10 @@ function checkDaysAndDate(obj, key) { throw new Error('createdBeforeDate must be date and conform to iso8601 format'); } } - function handleCheckTag(tag) { if (!isArray(tag) && !isObject(tag)) { throw new Error('tag must be Object or Array'); } - tag = isObject(tag) ? [tag] : tag; var tagObj = {}; var tagClone = deepCopy(tag); @@ -3726,17 +3030,14 @@ function handleCheckTag(tag) { }); checkObjectTag(tagObj); } - function checkRule(rule) { if (rule.id && getStrBytesCount(rule.id) > 255) throw new Error('ID is composed of 255 bytes at most'); if (rule.prefix === undefined) throw new Error('Rule must includes prefix'); if (!['Enabled', 'Disabled'].includes(rule.status)) throw new Error('Status must be Enabled or Disabled'); - if (rule.transition) { if (!['IA', 'Archive'].includes(rule.transition.storageClass)) throw new Error('StorageClass must be IA or Archive'); checkDaysAndDate(rule.transition, 'Transition'); } - if (rule.expiration) { if (!rule.expiration.expiredObjectDeleteMarker) { checkDaysAndDate(rule.expiration, 'Expiration'); @@ -3744,41 +3045,31 @@ function checkRule(rule) { throw new Error('expiredObjectDeleteMarker cannot be used with days or createdBeforeDate'); } } - if (rule.abortMultipartUpload) { checkDaysAndDate(rule.abortMultipartUpload, 'AbortMultipartUpload'); } - if (!rule.expiration && !rule.abortMultipartUpload && !rule.transition && !rule.noncurrentVersionTransition) { throw new Error('Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition'); } - if (rule.tag) { if (rule.abortMultipartUpload) { throw new Error('Tag cannot be used with abortMultipartUpload'); } - handleCheckTag(rule.tag); } } -},{"../utils/checkBucketName":51,"../utils/checkObjectTag":54,"../utils/deepCopy":58,"../utils/getStrBytesCount":62,"../utils/isArray":63,"../utils/isObject":70,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/web.dom-collections.for-each.js":339}],22:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/checkObjectTag":55,"../utils/deepCopy":59,"../utils/getStrBytesCount":65,"../utils/isArray":66,"../utils/isObject":73,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/web.dom-collections.for-each.js":382}],22:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.array.includes.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/obj2xml'), - obj2xml = _require2.obj2xml; - + obj2xml = _require2.obj2xml; var proto = exports; /** * putBucketVersioning @@ -3790,204 +3081,162 @@ var proto = exports; proto.putBucketVersioning = /*#__PURE__*/function () { var _putBucketVersioning = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, status) { var options, - params, - paramXMLObj, - result, - _args = arguments; + params, + paramXMLObj, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - - _checkBucketName(name); - - if (['Enabled', 'Suspended'].includes(status)) { - _context.next = 4; - break; + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + _checkBucketName(name); + if (['Enabled', 'Suspended'].includes(status)) { + _context.next = 4; + break; + } + throw new Error('status must be Enabled or Suspended'); + case 4: + params = this._bucketRequestParams('PUT', name, 'versioning', options); + paramXMLObj = { + VersioningConfiguration: { + Status: status } - - throw new Error('status must be Enabled or Suspended'); - - case 4: - params = this._bucketRequestParams('PUT', name, 'versioning', options); - paramXMLObj = { - VersioningConfiguration: { - Status: status - } - }; - params.mime = 'xml'; - params.content = obj2xml(paramXMLObj, { - headers: true - }); - _context.next = 10; - return this.request(params); - - case 10: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - status: result.status - }); - - case 12: - case "end": - return _context.stop(); - } + }; + params.mime = 'xml'; + params.content = obj2xml(paramXMLObj, { + headers: true + }); + _context.next = 10; + return this.request(params); + case 10: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 12: + case "end": + return _context.stop(); } }, _callee, this); })); - function putBucketVersioning(_x, _x2) { return _putBucketVersioning.apply(this, arguments); } - return putBucketVersioning; }(); -},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.includes.js":277}],23:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.includes.js":315}],23:[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 _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/obj2xml'), - obj2xml = _require2.obj2xml; - + obj2xml = _require2.obj2xml; var _require3 = require('../utils/isArray'), - isArray = _require3.isArray; - + isArray = _require3.isArray; var proto = exports; - proto.putBucketWebsite = /*#__PURE__*/function () { var _putBucketWebsite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var config, - options, - params, - IndexDocument, - WebsiteConfiguration, - website, - result, - _args = arguments; + options, + params, + IndexDocument, + WebsiteConfiguration, + website, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - config = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; - options = _args.length > 2 ? _args[2] : undefined; - - _checkBucketName(name); - - params = this._bucketRequestParams('PUT', name, 'website', options); - IndexDocument = { - Suffix: config.index || 'index.html' - }; - WebsiteConfiguration = { - IndexDocument: IndexDocument - }; - website = { - WebsiteConfiguration: WebsiteConfiguration - }; - - if (config.supportSubDir) { - IndexDocument.SupportSubDir = config.supportSubDir; - } - - if (config.type) { - IndexDocument.Type = config.type; - } - - if (config.error) { - WebsiteConfiguration.ErrorDocument = { - Key: config.error - }; - } - - if (!(config.routingRules !== undefined)) { - _context.next = 14; - break; - } - - if (isArray(config.routingRules)) { - _context.next = 13; - break; - } - - throw new Error('RoutingRules must be Array'); - - case 13: - WebsiteConfiguration.RoutingRules = { - RoutingRule: config.routingRules + while (1) switch (_context.prev = _context.next) { + case 0: + config = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options = _args.length > 2 ? _args[2] : undefined; + _checkBucketName(name); + params = this._bucketRequestParams('PUT', name, 'website', options); + IndexDocument = { + Suffix: config.index || 'index.html' + }; + WebsiteConfiguration = { + IndexDocument: IndexDocument + }; + website = { + WebsiteConfiguration: WebsiteConfiguration + }; + if (config.supportSubDir) { + IndexDocument.SupportSubDir = config.supportSubDir; + } + if (config.type) { + IndexDocument.Type = config.type; + } + if (config.error) { + WebsiteConfiguration.ErrorDocument = { + Key: config.error }; - - case 14: - website = obj2xml(website); - params.content = website; - params.mime = 'xml'; - params.successStatuses = [200]; - _context.next = 20; - return this.request(params); - - case 20: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 22: - case "end": - return _context.stop(); - } + } + if (!(config.routingRules !== undefined)) { + _context.next = 14; + break; + } + if (isArray(config.routingRules)) { + _context.next = 13; + break; + } + throw new Error('RoutingRules must be Array'); + case 13: + WebsiteConfiguration.RoutingRules = { + RoutingRule: config.routingRules + }; + case 14: + website = obj2xml(website); + params.content = website; + params.mime = 'xml'; + params.successStatuses = [200]; + _context.next = 20; + return this.request(params); + case 20: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 22: + case "end": + return _context.stop(); } }, _callee, this); })); - function putBucketWebsite(_x) { return _putBucketWebsite.apply(this, arguments); } - return putBucketWebsite; }(); -},{"../utils/checkBucketName":51,"../utils/isArray":63,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],24:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/isArray":66,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93}],24:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.regexp.to-string.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - require("core-js/modules/es.object.keys.js"); - exports.encodeCallback = function encodeCallback(reqParams, options) { reqParams.headers = reqParams.headers || {}; - if (!Object.prototype.hasOwnProperty.call(reqParams.headers, 'x-oss-callback')) { if (options.callback) { var json = { callbackUrl: encodeURI(options.callback.url), callbackBody: options.callback.body }; - if (options.callback.host) { json.callbackHost = options.callback.host; } - if (options.callback.contentType) { json.callbackBodyType = options.callback.contentType; } - var callback = Buffer.from(JSON.stringify(json)).toString('base64'); reqParams.headers['x-oss-callback'] = callback; - if (options.callback.customValue) { var callbackVar = {}; Object.keys(options.callback.customValue).forEach(function (key) { @@ -4000,73 +3249,52 @@ exports.encodeCallback = function encodeCallback(reqParams, options) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":90,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/web.dom-collections.for-each.js":339}],25:[function(require,module,exports){ +},{"buffer":103,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/web.dom-collections.for-each.js":382}],25:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; - Object.defineProperty(exports, "__esModule", { value: true }); exports.getReqUrl = void 0; - var copy_to_1 = __importDefault(require("copy-to")); - var url_1 = __importDefault(require("url")); - var merge_descriptors_1 = __importDefault(require("merge-descriptors")); - var is_type_of_1 = __importDefault(require("is-type-of")); - var isIP_1 = require("../utils/isIP"); - var checkConfigValid_1 = require("../utils/checkConfigValid"); - function getReqUrl(params) { var ep = {}; var isCname = this.options.cname; checkConfigValid_1.checkConfigValid(this.options.endpoint, 'endpoint'); copy_to_1.default(this.options.endpoint, false).to(ep); - if (params.bucket && !isCname && !isIP_1.isIP(ep.hostname) && !this.options.sldEnable) { ep.host = "".concat(params.bucket, ".").concat(ep.host); } - var resourcePath = '/'; - if (params.bucket && this.options.sldEnable) { resourcePath += "".concat(params.bucket, "/"); } - if (params.object) { // Preserve '/' in result url resourcePath += this._escape(params.object).replace(/\+/g, '%2B'); } - ep.pathname = resourcePath; var query = {}; - if (params.query) { merge_descriptors_1.default(query, params.query); } - if (params.subres) { var subresAsQuery = {}; - if (is_type_of_1.default.string(params.subres)) { subresAsQuery[params.subres] = ''; } else if (is_type_of_1.default.array(params.subres)) { @@ -4076,66 +3304,48 @@ function getReqUrl(params) { } else { subresAsQuery = params.subres; } - merge_descriptors_1.default(query, subresAsQuery); } - ep.query = query; return url_1.default.format(ep); } - exports.getReqUrl = getReqUrl; -},{"../utils/checkConfigValid":52,"../utils/isIP":69,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339,"is-type-of":466,"merge-descriptors":372,"url":472}],26:[function(require,module,exports){ +},{"../utils/checkConfigValid":53,"../utils/isIP":72,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382,"is-type-of":539,"merge-descriptors":430,"url":545}],26:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.string.trim.js"); - var ms = require('humanize-ms'); - var urlutil = require('url'); - var _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var _require2 = require('../utils/setRegion'), - setRegion = _require2.setRegion; - + setRegion = _require2.setRegion; var _require3 = require('../utils/checkConfigValid'), - checkConfigValid = _require3.checkConfigValid; - + checkConfigValid = _require3.checkConfigValid; function setEndpoint(endpoint, secure) { checkConfigValid(endpoint, 'endpoint'); var url = urlutil.parse(endpoint); - if (!url.protocol) { url = urlutil.parse("http".concat(secure ? 's' : '', "://").concat(endpoint)); } - if (url.protocol !== 'http:' && url.protocol !== 'https:') { throw new Error('Endpoint protocol must be http or https.'); } - return url; } - module.exports = function (options) { if (!options || !options.accessKeyId || !options.accessKeySecret) { 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 token has expired'); } - if (options.bucket) { _checkBucketName(options.bucket); } - var opts = Object.assign({ region: 'oss-cn-hangzhou', internal: false, @@ -4149,15 +3359,14 @@ module.exports = function (options) { headerEncoding: 'utf-8', refreshSTSToken: null, refreshSTSTokenInterval: 60000 * 5, - retryMax: 0 + retryMax: 0, + authorizationV4: false // 启用v4签名,默认关闭 }, options); opts.accessKeyId = opts.accessKeyId.trim(); opts.accessKeySecret = opts.accessKeySecret.trim(); - if (opts.timeout) { opts.timeout = ms(opts.timeout); } - if (opts.endpoint) { opts.endpoint = setEndpoint(opts.endpoint, opts.secure); } else if (opts.region) { @@ -4165,136 +3374,103 @@ module.exports = function (options) { } else { throw new Error('require options.endpoint or options.region'); } - opts.inited = true; return opts; }; -},{"../utils/checkBucketName":51,"../utils/checkConfigValid":52,"../utils/setRegion":75,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.string.trim.js":308,"humanize-ms":356,"url":472}],27:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"../utils/checkConfigValid":53,"../utils/setRegion":78,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.string.trim.js":351,"humanize-ms":401,"url":545}],27:[function(require,module,exports){ "use strict"; var merge = require('merge-descriptors'); - var proto = exports; merge(proto, require('./processObjectSave')); -},{"./processObjectSave":28,"merge-descriptors":372}],28:[function(require,module,exports){ +},{"./processObjectSave":28,"merge-descriptors":430}],28:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.array.concat.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - /* eslint-disable no-use-before-define */ var _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var querystring = require('querystring'); - var _require2 = require('js-base64'), - str2Base64 = _require2.Base64.encode; - + str2Base64 = _require2.Base64.encode; var proto = exports; - proto.processObjectSave = /*#__PURE__*/function () { var _processObjectSave = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(sourceObject, targetObject, process, targetBucket) { var params, bucketParam, content, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - checkArgs(sourceObject, 'sourceObject'); - checkArgs(targetObject, 'targetObject'); - checkArgs(process, 'process'); - targetObject = this._objectName(targetObject); - - if (targetBucket) { - _checkBucketName(targetBucket); - } - - params = this._objectRequestParams('POST', sourceObject, { - subres: 'x-oss-process' - }); - bucketParam = targetBucket ? ",b_".concat(str2Base64(targetBucket)) : ''; - targetObject = str2Base64(targetObject); - content = { - 'x-oss-process': "".concat(process, "|sys/saveas,o_").concat(targetObject).concat(bucketParam) - }; - params.content = querystring.stringify(content); - _context.next = 12; - return this.request(params); - - case 12: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - status: result.res.status - }); - - case 14: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + checkArgs(sourceObject, 'sourceObject'); + checkArgs(targetObject, 'targetObject'); + checkArgs(process, 'process'); + targetObject = this._objectName(targetObject); + if (targetBucket) { + _checkBucketName(targetBucket); + } + params = this._objectRequestParams('POST', sourceObject, { + subres: 'x-oss-process' + }); + bucketParam = targetBucket ? ",b_".concat(str2Base64(targetBucket)) : ''; + targetObject = str2Base64(targetObject); + content = { + 'x-oss-process': "".concat(process, "|sys/saveas,o_").concat(targetObject).concat(bucketParam) + }; + params.content = querystring.stringify(content); + _context.next = 12; + return this.request(params); + case 12: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.res.status + }); + case 14: + case "end": + return _context.stop(); } }, _callee, this); })); - function processObjectSave(_x, _x2, _x3, _x4) { return _processObjectSave.apply(this, arguments); } - return processObjectSave; }(); - function checkArgs(name, key) { if (!name) { throw new Error("".concat(key, " is required")); } - if (typeof name !== 'string') { throw new Error("".concat(key, " must be String")); } } -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.concat.js":272,"js-base64":371,"querystring":385}],29:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"js-base64":415,"querystring":453}],29:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.function.name.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.promise.js"); - require("core-js/modules/es.array.from.js"); - require("core-js/modules/es.string.iterator.js"); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.array.filter.js"); - require("core-js/modules/es.array.find.js"); - require("core-js/modules/es.regexp.to-string.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - /* eslint-disable no-async-promise-executor */ -var debug = require('debug')('ali-oss:multipart-copy'); +var debug = require('debug')('ali-oss:multipart-copy'); var copy = require('copy-to'); - var proto = exports; + /** * Upload a part copy in a multipart from the source bucket/object * used with initMultipartUpload and completeMultipartUpload. @@ -4307,69 +3483,58 @@ var proto = exports; * {String} sourceData.sourceBucketName the source bucket name * @param {Object} options */ - /* eslint max-len: [0] */ - proto.uploadPartCopy = /*#__PURE__*/function () { var _uploadPartCopy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, uploadId, partNo, range, sourceData) { var options, - versionId, - copySource, - params, - result, - _args = arguments; + versionId, + copySource, + params, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 5 && _args[5] !== undefined ? _args[5] : {}; - options.headers = options.headers || {}; - versionId = options.versionId || options.subres && options.subres.versionId || null; - - if (versionId) { - copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey), "?versionId=").concat(versionId); - } else { - copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey)); - } - - options.headers['x-oss-copy-source'] = copySource; - - if (range) { - options.headers['x-oss-copy-source-range'] = "bytes=".concat(range); - } - - options.subres = { - partNumber: partNo, - uploadId: uploadId - }; - params = this._objectRequestParams('PUT', name, options); - params.mime = options.mime; - params.successStatuses = [200]; - _context.next = 12; - return this.request(params); - - case 12: - result = _context.sent; - return _context.abrupt("return", { - name: name, - etag: result.res.headers.etag, - res: result.res - }); - - case 14: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 5 && _args[5] !== undefined ? _args[5] : {}; + options.headers = options.headers || {}; + versionId = options.versionId || options.subres && options.subres.versionId || null; + if (versionId) { + copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey), "?versionId=").concat(versionId); + } else { + copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey)); + } + options.headers['x-oss-copy-source'] = copySource; + if (range) { + options.headers['x-oss-copy-source-range'] = "bytes=".concat(range); + } + options.subres = { + partNumber: partNo, + uploadId: uploadId + }; + params = this._objectRequestParams('PUT', name, options); + params.mime = options.mime; + params.successStatuses = [200]; + _context.next = 12; + return this.request(params); + case 12: + result = _context.sent; + return _context.abrupt("return", { + name: name, + etag: result.res.headers.etag, + res: result.res + }); + case 14: + case "end": + return _context.stop(); } }, _callee, this); })); - function uploadPartCopy(_x, _x2, _x3, _x4, _x5) { return _uploadPartCopy.apply(this, arguments); } - return uploadPartCopy; }(); + /** * @param {String} name copy object name * @param {Object} sourceData @@ -4380,353 +3545,280 @@ proto.uploadPartCopy = /*#__PURE__*/function () { * @param {Object} options * {Number} options.partSize */ - - proto.multipartUploadCopy = /*#__PURE__*/function () { var _multipartUploadCopy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name, sourceData) { var options, - _options$versionId, - versionId, - metaOpt, - objectMeta, - fileSize, - minPartSize, - copySize, - init, - uploadId, - partSize, - checkpoint, - _args2 = arguments; - + _options$versionId, + versionId, + metaOpt, + objectMeta, + fileSize, + minPartSize, + copySize, + init, + uploadId, + partSize, + checkpoint, + _args2 = arguments; return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {}; - this.resetCancelFlag(); - _options$versionId = options.versionId, versionId = _options$versionId === void 0 ? null : _options$versionId; - metaOpt = { - versionId: versionId - }; - _context2.next = 6; - return this._getObjectMeta(sourceData.sourceBucketName, sourceData.sourceKey, metaOpt); - - case 6: - objectMeta = _context2.sent; - fileSize = objectMeta.res.headers['content-length']; - sourceData.startOffset = sourceData.startOffset || 0; - sourceData.endOffset = sourceData.endOffset || fileSize; - - if (!(options.checkpoint && options.checkpoint.uploadId)) { - _context2.next = 14; - break; - } - - _context2.next = 13; - return this._resumeMultipartCopy(options.checkpoint, sourceData, options); - - case 13: - return _context2.abrupt("return", _context2.sent); - - case 14: - minPartSize = 100 * 1024; - copySize = sourceData.endOffset - sourceData.startOffset; - - if (!(copySize < minPartSize)) { - _context2.next = 18; - break; - } - - throw new Error("copySize must not be smaller than ".concat(minPartSize)); - - case 18: - if (!(options.partSize && options.partSize < minPartSize)) { - _context2.next = 20; - break; - } - - throw new Error("partSize must not be smaller than ".concat(minPartSize)); - - case 20: - _context2.next = 22; - return this.initMultipartUpload(name, options); - - case 22: - init = _context2.sent; - uploadId = init.uploadId; - partSize = this._getPartSize(copySize, options.partSize); - checkpoint = { - name: name, - copySize: copySize, - partSize: partSize, - uploadId: uploadId, - doneParts: [] - }; - - if (!(options && options.progress)) { - _context2.next = 29; - break; - } - + while (1) switch (_context2.prev = _context2.next) { + case 0: + options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {}; + this.resetCancelFlag(); + _options$versionId = options.versionId, versionId = _options$versionId === void 0 ? null : _options$versionId; + metaOpt = { + versionId: versionId + }; + _context2.next = 6; + return this._getObjectMeta(sourceData.sourceBucketName, sourceData.sourceKey, metaOpt); + case 6: + objectMeta = _context2.sent; + fileSize = objectMeta.res.headers['content-length']; + sourceData.startOffset = sourceData.startOffset || 0; + sourceData.endOffset = sourceData.endOffset || fileSize; + if (!(options.checkpoint && options.checkpoint.uploadId)) { + _context2.next = 14; + break; + } + _context2.next = 13; + return this._resumeMultipartCopy(options.checkpoint, sourceData, options); + case 13: + return _context2.abrupt("return", _context2.sent); + case 14: + minPartSize = 100 * 1024; + copySize = sourceData.endOffset - sourceData.startOffset; + if (!(copySize < minPartSize)) { + _context2.next = 18; + break; + } + throw new Error("copySize must not be smaller than ".concat(minPartSize)); + case 18: + if (!(options.partSize && options.partSize < minPartSize)) { + _context2.next = 20; + break; + } + throw new Error("partSize must not be smaller than ".concat(minPartSize)); + case 20: + _context2.next = 22; + return this.initMultipartUpload(name, options); + case 22: + init = _context2.sent; + uploadId = init.uploadId; + partSize = this._getPartSize(copySize, options.partSize); + checkpoint = { + name: name, + copySize: copySize, + partSize: partSize, + uploadId: uploadId, + doneParts: [] + }; + if (!(options && options.progress)) { _context2.next = 29; - return options.progress(0, checkpoint, init.res); - - case 29: - _context2.next = 31; - return this._resumeMultipartCopy(checkpoint, sourceData, options); - - case 31: - return _context2.abrupt("return", _context2.sent); - - case 32: - case "end": - return _context2.stop(); - } + break; + } + _context2.next = 29; + return options.progress(0, checkpoint, init.res); + case 29: + _context2.next = 31; + return this._resumeMultipartCopy(checkpoint, sourceData, options); + case 31: + return _context2.abrupt("return", _context2.sent); + case 32: + case "end": + return _context2.stop(); } }, _callee2, this); })); - function multipartUploadCopy(_x6, _x7) { return _multipartUploadCopy.apply(this, arguments); } - return multipartUploadCopy; }(); + /* * Resume multipart copy from checkpoint. The checkpoint will be * updated after each successful part copy. * @param {Object} checkpoint the checkpoint * @param {Object} options */ - - proto._resumeMultipartCopy = /*#__PURE__*/function () { var _resumeMultipartCopy2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(checkpoint, sourceData, options) { var _options$versionId2, versionId, metaOpt, copySize, partSize, uploadId, doneParts, name, partOffs, numParts, uploadPartCopyOptions, uploadPartJob, all, done, todo, defaultParallel, parallel, i, errors, abortEvent, err; - return _regenerator.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - if (!this.isCancel()) { - _context4.next = 2; - break; - } - - throw this._makeCancelEvent(); - - case 2: - _options$versionId2 = options.versionId, versionId = _options$versionId2 === void 0 ? null : _options$versionId2; - metaOpt = { - versionId: versionId - }; - copySize = checkpoint.copySize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name; - partOffs = this._divideMultipartCopyParts(copySize, partSize, sourceData.startOffset); - numParts = partOffs.length; - uploadPartCopyOptions = { - headers: {} - }; - - if (options.copyheaders) { - copy(options.copyheaders).to(uploadPartCopyOptions.headers); - } - - if (versionId) { - copy(metaOpt).to(uploadPartCopyOptions); - } - - uploadPartJob = function uploadPartJob(self, partNo, source) { - return new Promise( /*#__PURE__*/function () { - var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) { - var pi, range, result; - return _regenerator.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.prev = 0; - - if (self.isCancel()) { - _context3.next = 22; - break; - } - - pi = partOffs[partNo - 1]; - range = "".concat(pi.start, "-").concat(pi.end - 1); - _context3.prev = 4; - _context3.next = 7; - return self.uploadPartCopy(name, uploadId, partNo, range, source, uploadPartCopyOptions); - - case 7: - result = _context3.sent; - _context3.next = 15; - break; - - case 10: - _context3.prev = 10; - _context3.t0 = _context3["catch"](4); - - if (!(_context3.t0.status === 404)) { - _context3.next = 14; - break; - } - - throw self._makeAbortEvent(); - - case 14: - throw _context3.t0; - - case 15: - if (self.isCancel()) { - _context3.next = 22; - break; - } - - debug("content-range ".concat(result.res.headers['content-range'])); - doneParts.push({ - number: partNo, - etag: result.res.headers.etag - }); - checkpoint.doneParts = doneParts; - - if (!(options && options.progress)) { - _context3.next = 22; - break; - } - - _context3.next = 22; - return options.progress(doneParts.length / numParts, checkpoint, result.res); - - case 22: - resolve(); - _context3.next = 29; - break; - - case 25: - _context3.prev = 25; - _context3.t1 = _context3["catch"](0); - _context3.t1.partNum = partNo; - reject(_context3.t1); - - case 29: - case "end": - return _context3.stop(); + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!this.isCancel()) { + _context4.next = 2; + break; + } + throw this._makeCancelEvent(); + case 2: + _options$versionId2 = options.versionId, versionId = _options$versionId2 === void 0 ? null : _options$versionId2; + metaOpt = { + versionId: versionId + }; + copySize = checkpoint.copySize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name; + partOffs = this._divideMultipartCopyParts(copySize, partSize, sourceData.startOffset); + numParts = partOffs.length; + uploadPartCopyOptions = { + headers: {} + }; + if (options.copyheaders) { + copy(options.copyheaders).to(uploadPartCopyOptions.headers); + } + if (versionId) { + copy(metaOpt).to(uploadPartCopyOptions); + } + uploadPartJob = function uploadPartJob(self, partNo, source) { + return new Promise( /*#__PURE__*/function () { + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) { + var pi, range, result; + return _regenerator.default.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + if (self.isCancel()) { + _context3.next = 22; + break; } - } - }, _callee3, null, [[0, 25], [4, 10]]); - })); - - return function (_x11, _x12) { - return _ref.apply(this, arguments); - }; - }()); - }; - - all = Array.from(new Array(numParts), function (x, i) { - return i + 1; - }); - done = doneParts.map(function (p) { - return p.number; - }); - todo = all.filter(function (p) { - return done.indexOf(p) < 0; - }); - defaultParallel = 5; - parallel = options.parallel || defaultParallel; - - if (!(this.checkBrowserAndVersion('Internet Explorer', '10') || parallel === 1)) { - _context4.next = 28; - break; - } - - i = 0; - - case 18: - if (!(i < todo.length)) { - _context4.next = 26; - break; - } - - if (!this.isCancel()) { - _context4.next = 21; - break; - } - - throw this._makeCancelEvent(); - - case 21: - _context4.next = 23; - return uploadPartJob(this, todo[i], sourceData); - - case 23: - i++; - _context4.next = 18; + pi = partOffs[partNo - 1]; + range = "".concat(pi.start, "-").concat(pi.end - 1); + _context3.prev = 4; + _context3.next = 7; + return self.uploadPartCopy(name, uploadId, partNo, range, source, uploadPartCopyOptions); + case 7: + result = _context3.sent; + _context3.next = 15; + break; + case 10: + _context3.prev = 10; + _context3.t0 = _context3["catch"](4); + if (!(_context3.t0.status === 404)) { + _context3.next = 14; + break; + } + throw self._makeAbortEvent(); + case 14: + throw _context3.t0; + case 15: + if (self.isCancel()) { + _context3.next = 22; + break; + } + debug("content-range ".concat(result.res.headers['content-range'])); + doneParts.push({ + number: partNo, + etag: result.res.headers.etag + }); + checkpoint.doneParts = doneParts; + if (!(options && options.progress)) { + _context3.next = 22; + break; + } + _context3.next = 22; + return options.progress(doneParts.length / numParts, checkpoint, result.res); + case 22: + resolve(); + _context3.next = 29; + break; + case 25: + _context3.prev = 25; + _context3.t1 = _context3["catch"](0); + _context3.t1.partNum = partNo; + reject(_context3.t1); + case 29: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[0, 25], [4, 10]]); + })); + return function (_x11, _x12) { + return _ref.apply(this, arguments); + }; + }()); + }; + all = Array.from(new Array(numParts), function (x, i) { + return i + 1; + }); + done = doneParts.map(function (p) { + return p.number; + }); + todo = all.filter(function (p) { + return done.indexOf(p) < 0; + }); + defaultParallel = 5; + parallel = options.parallel || defaultParallel; + if (!(this.checkBrowserAndVersion('Internet Explorer', '10') || parallel === 1)) { + _context4.next = 28; break; - - case 26: + } + i = 0; + case 18: + if (!(i < todo.length)) { + _context4.next = 26; + break; + } + if (!this.isCancel()) { + _context4.next = 21; + break; + } + throw this._makeCancelEvent(); + case 21: + _context4.next = 23; + return uploadPartJob(this, todo[i], sourceData); + case 23: + i++; + _context4.next = 18; + break; + case 26: + _context4.next = 40; + break; + case 28: + _context4.next = 30; + return this._parallelNode(todo, parallel, uploadPartJob, sourceData); + case 30: + errors = _context4.sent; + abortEvent = errors.find(function (err) { + return err.name === 'abort'; + }); + if (!abortEvent) { + _context4.next = 34; + break; + } + throw abortEvent; + case 34: + if (!this.isCancel()) { + _context4.next = 36; + break; + } + throw this._makeCancelEvent(); + case 36: + if (!(errors && errors.length > 0)) { _context4.next = 40; break; - - case 28: - _context4.next = 30; - return this._parallelNode(todo, parallel, uploadPartJob, sourceData); - - case 30: - errors = _context4.sent; - abortEvent = errors.find(function (err) { - return err.name === 'abort'; - }); - - if (!abortEvent) { - _context4.next = 34; - break; - } - - throw abortEvent; - - case 34: - if (!this.isCancel()) { - _context4.next = 36; - break; - } - - throw this._makeCancelEvent(); - - case 36: - if (!(errors && errors.length > 0)) { - _context4.next = 40; - break; - } - - err = errors[0]; - err.message = "Failed to copy some parts with error: ".concat(err.toString(), " part_num: ").concat(err.partNum); - throw err; - - case 40: - _context4.next = 42; - return this.completeMultipartUpload(name, uploadId, doneParts, options); - - case 42: - return _context4.abrupt("return", _context4.sent); - - case 43: - case "end": - return _context4.stop(); - } + } + err = errors[0]; + err.message = "Failed to copy some parts with error: ".concat(err.toString(), " part_num: ").concat(err.partNum); + throw err; + case 40: + _context4.next = 42; + return this.completeMultipartUpload(name, uploadId, doneParts, options); + case 42: + return _context4.abrupt("return", _context4.sent); + case 43: + case "end": + return _context4.stop(); } }, _callee4, this); })); - function _resumeMultipartCopy(_x8, _x9, _x10) { return _resumeMultipartCopy2.apply(this, arguments); } - return _resumeMultipartCopy; }(); - proto._divideMultipartCopyParts = function _divideMultipartCopyParts(fileSize, partSize, startOffset) { var numParts = Math.ceil(fileSize / partSize); var partOffs = []; - for (var i = 0; i < numParts; i++) { var start = partSize * i + startOffset; var end = Math.min(start + partSize, fileSize + startOffset); @@ -4735,148 +3827,120 @@ proto._divideMultipartCopyParts = function _divideMultipartCopyParts(fileSize, p end: end }); } - return partOffs; }; + /** * Get Object Meta * @param {String} bucket bucket name * @param {String} name object name * @param {Object} options */ - - proto._getObjectMeta = /*#__PURE__*/function () { var _getObjectMeta2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(bucket, name, options) { var currentBucket, data; return _regenerator.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - currentBucket = this.getBucket(); - this.setBucket(bucket); - _context5.next = 4; - return this.head(name, options); - - case 4: - data = _context5.sent; - this.setBucket(currentBucket); - return _context5.abrupt("return", data); - - case 7: - case "end": - return _context5.stop(); - } + while (1) switch (_context5.prev = _context5.next) { + case 0: + currentBucket = this.getBucket(); + this.setBucket(bucket); + _context5.next = 4; + return this.head(name, options); + case 4: + data = _context5.sent; + this.setBucket(currentBucket); + return _context5.abrupt("return", data); + case 7: + case "end": + return _context5.stop(); } }, _callee5, this); })); - function _getObjectMeta(_x13, _x14, _x15) { return _getObjectMeta2.apply(this, arguments); } - return _getObjectMeta; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.find.js":275,"core-js/modules/es.array.from.js":276,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.iterator.js":303,"debug":465}],30:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.find.js":313,"core-js/modules/es.array.from.js":314,"core-js/modules/es.array.map.js":318,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.iterator.js":345,"debug":538}],30:[function(require,module,exports){ (function (process){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.array.filter.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.array.sort.js"); - require("core-js/modules/es.array.concat.js"); - +require("core-js/modules/es.object.keys.js"); require("core-js/modules/es.regexp.to-string.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var copy = require('copy-to'); - var callback = require('./callback'); - var _require = require('./utils/deepCopy'), - deepCopyWith = _require.deepCopyWith; - + deepCopyWith = _require.deepCopyWith; var _require2 = require('./utils/isBuffer'), - isBuffer = _require2.isBuffer; - + isBuffer = _require2.isBuffer; var _require3 = require('./utils/omit'), - omit = _require3.omit; - + omit = _require3.omit; var proto = exports; + /** * List the on-going multipart uploads * https://help.aliyun.com/document_detail/31997.html * @param {Object} options * @return {Array} the multipart uploads */ - proto.listUploads = /*#__PURE__*/function () { var _listUploads = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(query, options) { var opt, params, result, uploads; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = options || {}; - opt = {}; - copy(options).to(opt); - opt.subres = 'uploads'; - params = this._objectRequestParams('GET', '', opt); - params.query = query; - params.xmlResponse = true; - params.successStatuses = [200]; - _context.next = 10; - return this.request(params); - - case 10: - result = _context.sent; - uploads = result.data.Upload || []; - - if (!Array.isArray(uploads)) { - uploads = [uploads]; - } - - uploads = uploads.map(function (up) { - return { - name: up.Key, - uploadId: up.UploadId, - initiated: up.Initiated - }; - }); - return _context.abrupt("return", { - res: result.res, - uploads: uploads, - bucket: result.data.Bucket, - nextKeyMarker: result.data.NextKeyMarker, - nextUploadIdMarker: result.data.NextUploadIdMarker, - isTruncated: result.data.IsTruncated === 'true' - }); - - case 15: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.subres = 'uploads'; + params = this._objectRequestParams('GET', '', opt); + params.query = query; + params.xmlResponse = true; + params.successStatuses = [200]; + _context.next = 10; + return this.request(params); + case 10: + result = _context.sent; + uploads = result.data.Upload || []; + if (!Array.isArray(uploads)) { + uploads = [uploads]; + } + uploads = uploads.map(function (up) { + return { + name: up.Key, + uploadId: up.UploadId, + initiated: up.Initiated + }; + }); + return _context.abrupt("return", { + res: result.res, + uploads: uploads, + bucket: result.data.Bucket, + nextKeyMarker: result.data.NextKeyMarker, + nextUploadIdMarker: result.data.NextUploadIdMarker, + isTruncated: result.data.IsTruncated === 'true' + }); + case 15: + case "end": + return _context.stop(); } }, _callee, this); })); - function listUploads(_x, _x2) { return _listUploads.apply(this, arguments); } - return listUploads; }(); + /** * List the done uploadPart parts * @param {String} name object name @@ -4888,157 +3952,133 @@ proto.listUploads = /*#__PURE__*/function () { * @param {Object} options * @return {Object} result */ - - proto.listParts = /*#__PURE__*/function () { var _listParts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name, uploadId, query, options) { var opt, params, result; return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - options = options || {}; - opt = {}; - copy(options).to(opt); - opt.subres = { - uploadId: uploadId - }; - params = this._objectRequestParams('GET', name, opt); - params.query = query; - params.xmlResponse = true; - params.successStatuses = [200]; - _context2.next = 10; - return this.request(params); - - case 10: - result = _context2.sent; - return _context2.abrupt("return", { - res: result.res, - uploadId: result.data.UploadId, - bucket: result.data.Bucket, - name: result.data.Key, - partNumberMarker: result.data.PartNumberMarker, - nextPartNumberMarker: result.data.NextPartNumberMarker, - maxParts: result.data.MaxParts, - isTruncated: result.data.IsTruncated, - parts: result.data.Part || [] - }); - - case 12: - case "end": - return _context2.stop(); - } + while (1) switch (_context2.prev = _context2.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.subres = { + uploadId: uploadId + }; + params = this._objectRequestParams('GET', name, opt); + params.query = query; + params.xmlResponse = true; + params.successStatuses = [200]; + _context2.next = 10; + return this.request(params); + case 10: + result = _context2.sent; + return _context2.abrupt("return", { + res: result.res, + uploadId: result.data.UploadId, + bucket: result.data.Bucket, + name: result.data.Key, + partNumberMarker: result.data.PartNumberMarker, + nextPartNumberMarker: result.data.NextPartNumberMarker, + maxParts: result.data.MaxParts, + isTruncated: result.data.IsTruncated, + parts: result.data.Part || [] + }); + case 12: + case "end": + return _context2.stop(); } }, _callee2, this); })); - function listParts(_x3, _x4, _x5, _x6) { return _listParts.apply(this, arguments); } - return listParts; }(); + /** * Abort a multipart upload transaction * @param {String} name the object name * @param {String} uploadId the upload id * @param {Object} options */ - - proto.abortMultipartUpload = /*#__PURE__*/function () { var _abortMultipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(name, uploadId, options) { var opt, params, result; return _regenerator.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - this._stop(); - - options = options || {}; - opt = {}; - copy(options).to(opt); - opt.subres = { - uploadId: uploadId - }; - params = this._objectRequestParams('DELETE', name, opt); - params.successStatuses = [204]; - _context3.next = 9; - return this.request(params); - - case 9: - result = _context3.sent; - return _context3.abrupt("return", { - res: result.res - }); - - case 11: - case "end": - return _context3.stop(); - } + while (1) switch (_context3.prev = _context3.next) { + case 0: + this._stop(); + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.subres = { + uploadId: uploadId + }; + params = this._objectRequestParams('DELETE', name, opt); + params.successStatuses = [204]; + _context3.next = 9; + return this.request(params); + case 9: + result = _context3.sent; + return _context3.abrupt("return", { + res: result.res + }); + case 11: + case "end": + return _context3.stop(); } }, _callee3, this); })); - function abortMultipartUpload(_x7, _x8, _x9) { return _abortMultipartUpload.apply(this, arguments); } - return abortMultipartUpload; }(); + /** * Initiate a multipart upload transaction * @param {String} name the object name * @param {Object} options * @return {String} upload id */ - - proto.initMultipartUpload = /*#__PURE__*/function () { var _initMultipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(name, options) { var opt, params, result; return _regenerator.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - options = options || {}; - opt = {}; - copy(options).to(opt); - opt.headers = opt.headers || {}; - - this._convertMetaToHeaders(options.meta, opt.headers); - - opt.subres = 'uploads'; - params = this._objectRequestParams('POST', name, opt); - params.mime = options.mime; - params.xmlResponse = true; - params.successStatuses = [200]; - _context4.next = 12; - return this.request(params); - - case 12: - result = _context4.sent; - return _context4.abrupt("return", { - res: result.res, - bucket: result.data.Bucket, - name: result.data.Key, - uploadId: result.data.UploadId - }); - - case 14: - case "end": - return _context4.stop(); - } + while (1) switch (_context4.prev = _context4.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.headers = opt.headers || {}; + this._convertMetaToHeaders(options.meta, opt.headers); + opt.subres = 'uploads'; + params = this._objectRequestParams('POST', name, opt); + params.mime = options.mime; + params.xmlResponse = true; + params.successStatuses = [200]; + _context4.next = 12; + return this.request(params); + case 12: + result = _context4.sent; + return _context4.abrupt("return", { + res: result.res, + bucket: result.data.Bucket, + name: result.data.Key, + uploadId: result.data.UploadId + }); + case 14: + case "end": + return _context4.stop(); } }, _callee4, this); })); - function initMultipartUpload(_x10, _x11) { return _initMultipartUpload.apply(this, arguments); } - return initMultipartUpload; }(); + /** * Upload a part in a multipart upload transaction * @param {String} name the object name @@ -5049,61 +4089,48 @@ proto.initMultipartUpload = /*#__PURE__*/function () { * @param {Integer} end part end bytes e.g: 204800 * @param {Object} options */ - - proto.uploadPart = /*#__PURE__*/function () { var _uploadPart2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(name, uploadId, partNo, file, start, end, options) { var data, isBrowserEnv; return _regenerator.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - data = { - size: end - start - }; - isBrowserEnv = process && process.browser; - - if (!isBrowserEnv) { - _context5.next = 8; - break; - } - - _context5.next = 5; - return this._createBuffer(file, start, end); - - case 5: - data.content = _context5.sent; - _context5.next = 11; + while (1) switch (_context5.prev = _context5.next) { + case 0: + data = { + size: end - start + }; + isBrowserEnv = process && process.browser; + if (!isBrowserEnv) { + _context5.next = 8; break; - - case 8: - _context5.next = 10; - return this._createStream(file, start, end); - - case 10: - data.stream = _context5.sent; - - case 11: - _context5.next = 13; - return this._uploadPart(name, uploadId, partNo, data, options); - - case 13: - return _context5.abrupt("return", _context5.sent); - - case 14: - case "end": - return _context5.stop(); - } + } + _context5.next = 5; + return this._createBuffer(file, start, end); + case 5: + data.content = _context5.sent; + _context5.next = 11; + break; + case 8: + _context5.next = 10; + return this._createStream(file, start, end); + case 10: + data.stream = _context5.sent; + case 11: + _context5.next = 13; + return this._uploadPart(name, uploadId, partNo, data, options); + case 13: + return _context5.abrupt("return", _context5.sent); + case 14: + case "end": + return _context5.stop(); } }, _callee5, this); })); - function uploadPart(_x12, _x13, _x14, _x15, _x16, _x17, _x18) { return _uploadPart2.apply(this, arguments); } - return uploadPart; }(); + /** * Complete a multipart upload transaction * @param {String} name the object name @@ -5123,92 +4150,76 @@ proto.uploadPart = /*#__PURE__*/function () { * key2: 'value2' * } */ - - proto.completeMultipartUpload = /*#__PURE__*/function () { var _completeMultipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(name, uploadId, parts, options) { var completeParts, xml, i, p, opt, params, result, ret; return _regenerator.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - completeParts = parts.concat().sort(function (a, b) { - return a.number - b.number; - }).filter(function (item, index, arr) { - return !index || item.number !== arr[index - 1].number; - }); - xml = '\n\n'; - - for (i = 0; i < completeParts.length; i++) { - p = completeParts[i]; - xml += '\n'; - xml += "".concat(p.number, "\n"); - xml += "".concat(p.etag, "\n"); - xml += '\n'; - } - - xml += ''; - options = options || {}; - opt = {}; - opt = deepCopyWith(options, function (_) { - if (isBuffer(_)) return null; - }); - opt.subres = { - uploadId: uploadId - }; - opt.headers = omit(opt.headers, ['x-oss-server-side-encryption', 'x-oss-storage-class']); - params = this._objectRequestParams('POST', name, opt); - callback.encodeCallback(params, opt); - params.mime = 'xml'; - params.content = xml; - - if (!(params.headers && params.headers['x-oss-callback'])) { - params.xmlResponse = true; - } - - params.successStatuses = [200]; - _context6.next = 17; - return this.request(params); - - case 17: - result = _context6.sent; - - if (!options.progress) { - _context6.next = 21; - break; - } - + while (1) switch (_context6.prev = _context6.next) { + case 0: + completeParts = parts.concat().sort(function (a, b) { + return a.number - b.number; + }).filter(function (item, index, arr) { + return !index || item.number !== arr[index - 1].number; + }); + xml = '\n\n'; + for (i = 0; i < completeParts.length; i++) { + p = completeParts[i]; + xml += '\n'; + xml += "".concat(p.number, "\n"); + xml += "".concat(p.etag, "\n"); + xml += '\n'; + } + xml += ''; + options = options || {}; + opt = {}; + opt = deepCopyWith(options, function (_) { + if (isBuffer(_)) return null; + }); + opt.subres = { + uploadId: uploadId + }; + opt.headers = omit(opt.headers, ['x-oss-server-side-encryption', 'x-oss-storage-class']); + params = this._objectRequestParams('POST', name, opt); + callback.encodeCallback(params, opt); + params.mime = 'xml'; + params.content = xml; + if (!(params.headers && params.headers['x-oss-callback'])) { + params.xmlResponse = true; + } + params.successStatuses = [200]; + _context6.next = 17; + return this.request(params); + case 17: + result = _context6.sent; + if (!options.progress) { _context6.next = 21; - return options.progress(1, null, result.res); - - case 21: - ret = { - res: result.res, - bucket: params.bucket, - name: name, - etag: result.res.headers.etag - }; - - if (params.headers && params.headers['x-oss-callback']) { - ret.data = JSON.parse(result.data.toString()); - } - - return _context6.abrupt("return", ret); - - case 24: - case "end": - return _context6.stop(); - } + break; + } + _context6.next = 21; + return options.progress(1, null, result.res); + case 21: + ret = { + res: result.res, + bucket: params.bucket, + name: name, + etag: result.res.headers.etag + }; + if (params.headers && params.headers['x-oss-callback']) { + ret.data = JSON.parse(result.data.toString()); + } + return _context6.abrupt("return", ret); + case 24: + case "end": + return _context6.stop(); } }, _callee6, this); })); - function completeMultipartUpload(_x19, _x20, _x21, _x22) { return _completeMultipartUpload.apply(this, arguments); } - return completeMultipartUpload; }(); + /** * Upload a part in a multipart upload transaction * @param {String} name the object name @@ -5217,291 +4228,227 @@ proto.completeMultipartUpload = /*#__PURE__*/function () { * @param {Object} data the body data * @param {Object} options */ - - proto._uploadPart = /*#__PURE__*/function () { var _uploadPart3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(name, uploadId, partNo, data, options) { var opt, params, isBrowserEnv, result; return _regenerator.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - options = options || {}; - opt = {}; - copy(options).to(opt); - opt.headers = opt.headers || {}; - opt.headers['Content-Length'] = data.size; // Uploading shards does not require x-oss server side encryption - - opt.headers = omit(opt.headers, ['x-oss-server-side-encryption']); - opt.subres = { - partNumber: partNo, - uploadId: uploadId - }; - params = this._objectRequestParams('PUT', name, opt); - params.mime = opt.mime; - isBrowserEnv = process && process.browser; - isBrowserEnv ? params.content = data.content : params.stream = data.stream; - params.successStatuses = [200]; - params.disabledMD5 = options.disabledMD5; - _context7.next = 15; - return this.request(params); - - case 15: - result = _context7.sent; - - if (result.res.headers.etag) { - _context7.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 18: - if (data.stream) { - data.stream = null; - params.stream = null; - } - - return _context7.abrupt("return", { - name: name, - etag: result.res.headers.etag, - res: result.res - }); - - case 20: - case "end": - return _context7.stop(); - } + while (1) switch (_context7.prev = _context7.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.headers = opt.headers || {}; + opt.headers['Content-Length'] = data.size; + + // Uploading shards does not require x-oss server side encryption + opt.headers = omit(opt.headers, ['x-oss-server-side-encryption']); + opt.subres = { + partNumber: partNo, + uploadId: uploadId + }; + params = this._objectRequestParams('PUT', name, opt); + params.mime = opt.mime; + isBrowserEnv = process && process.browser; + isBrowserEnv ? params.content = data.content : params.stream = data.stream; + params.successStatuses = [200]; + params.disabledMD5 = options.disabledMD5; + _context7.next = 15; + return this.request(params); + case 15: + result = _context7.sent; + if (result.res.headers.etag) { + _context7.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 18: + if (data.stream) { + data.stream = null; + params.stream = null; + } + return _context7.abrupt("return", { + name: name, + etag: result.res.headers.etag, + res: result.res + }); + case 20: + case "end": + return _context7.stop(); } }, _callee7, this); })); - function _uploadPart(_x23, _x24, _x25, _x26, _x27) { return _uploadPart3.apply(this, arguments); } - return _uploadPart; }(); }).call(this)}).call(this,require('_process')) -},{"./callback":24,"./utils/deepCopy":58,"./utils/isBuffer":65,"./utils/omit":73,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"_process":467,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.map.js":280,"core-js/modules/es.array.sort.js":282,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],31:[function(require,module,exports){ +},{"./callback":24,"./utils/deepCopy":59,"./utils/isBuffer":68,"./utils/omit":76,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"_process":540,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.sort.js":320,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341}],31:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.regexp.exec.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var urlutil = require('url'); - var utility = require('utility'); - var copy = require('copy-to'); - var signHelper = require('../../common/signUtils'); - var _require = require('../utils/isIP'), - isIP = _require.isIP; - + isIP = _require.isIP; var _require2 = require('../utils/setSTSToken'), - setSTSToken = _require2.setSTSToken; - + setSTSToken = _require2.setSTSToken; var _require3 = require('../utils/isFunction'), - isFunction = _require3.isFunction; - + isFunction = _require3.isFunction; var proto = exports; + /** * asyncSignatureUrl * @param {String} name object name * @param {Object} options options * @param {boolean} [strictObjectNameValidation=true] the flag of verifying object name strictly */ - proto.asyncSignatureUrl = /*#__PURE__*/function () { var _asyncSignatureUrl = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var strictObjectNameValidation, - expires, - params, - resource, - signRes, - url, - _args = arguments; + expires, + params, + resource, + signRes, + url, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - strictObjectNameValidation = _args.length > 2 && _args[2] !== undefined ? _args[2] : true; - - if (!isIP(this.options.endpoint.hostname)) { - _context.next = 3; - break; - } - - throw new Error('can not get the object URL when endpoint is IP'); - - case 3: - if (!(strictObjectNameValidation && /^\?/.test(name))) { - _context.next = 5; - break; - } - - throw new Error("Invalid object name ".concat(name)); - - case 5: - options = options || {}; - name = this._objectName(name); - options.method = options.method || 'GET'; - expires = utility.timestamp() + (options.expires || 1800); - params = { - bucket: this.options.bucket, - object: name - }; - resource = this._getResource(params); - - if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { - _context.next = 14; - break; - } - + while (1) switch (_context.prev = _context.next) { + case 0: + strictObjectNameValidation = _args.length > 2 && _args[2] !== undefined ? _args[2] : true; + if (!isIP(this.options.endpoint.hostname)) { + _context.next = 3; + break; + } + throw new Error('can not get the object URL when endpoint is IP'); + case 3: + if (!(strictObjectNameValidation && /^\?/.test(name))) { + _context.next = 5; + break; + } + throw new Error("Invalid object name ".concat(name)); + case 5: + options = options || {}; + name = this._objectName(name); + options.method = options.method || 'GET'; + expires = utility.timestamp() + (options.expires || 1800); + params = { + bucket: this.options.bucket, + object: name + }; + resource = this._getResource(params); + if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { _context.next = 14; - return setSTSToken.call(this); - - case 14: - if (this.options.stsToken) { - options['security-token'] = this.options.stsToken; - } - - signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires); - url = urlutil.parse(this._getReqUrl(params)); - url.query = { - OSSAccessKeyId: this.options.accessKeyId, - Expires: expires, - Signature: signRes.Signature - }; - copy(signRes.subResource).to(url.query); - return _context.abrupt("return", url.format()); - - case 20: - case "end": - return _context.stop(); - } + break; + } + _context.next = 14; + return setSTSToken.call(this); + case 14: + if (this.options.stsToken) { + options['security-token'] = this.options.stsToken; + } + signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires); + url = urlutil.parse(this._getReqUrl(params)); + url.query = { + OSSAccessKeyId: this.options.accessKeyId, + Expires: expires, + Signature: signRes.Signature + }; + copy(signRes.subResource).to(url.query); + return _context.abrupt("return", url.format()); + case 20: + case "end": + return _context.stop(); } }, _callee, this); })); - function asyncSignatureUrl(_x, _x2) { return _asyncSignatureUrl.apply(this, arguments); } - return asyncSignatureUrl; }(); -},{"../../common/signUtils":50,"../utils/isFunction":68,"../utils/isIP":69,"../utils/setSTSToken":76,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"copy-to":94,"core-js/modules/es.regexp.exec.js":300,"url":472,"utility":474}],32:[function(require,module,exports){ +},{"../../common/signUtils":51,"../utils/isFunction":71,"../utils/isIP":72,"../utils/setSTSToken":79,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"copy-to":107,"core-js/modules/es.regexp.exec.js":340,"url":545,"utility":547}],32:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - 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"); - require("core-js/modules/es.array.find.js"); - require("core-js/modules/es.array.includes.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var _require = require('../utils/checkBucketName'), - _checkBucketName = _require.checkBucketName; - + _checkBucketName = _require.checkBucketName; var proto = exports; var REPLACE_HEDERS = ['content-type', 'content-encoding', 'content-language', 'content-disposition', 'cache-control', 'expires']; - proto.copy = /*#__PURE__*/function () { var _copy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, sourceName, bucketName, options) { var params, result, data; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if ((0, _typeof2.default)(bucketName) === 'object') { - options = bucketName; // 兼容旧版本,旧版本第三个参数为options - } - - options = options || {}; - options.headers = options.headers || {}; - Object.keys(options.headers).forEach(function (key) { - options.headers["x-oss-copy-source-".concat(key.toLowerCase())] = options.headers[key]; - }); - - if (options.meta || Object.keys(options.headers).find(function (_) { - return REPLACE_HEDERS.includes(_.toLowerCase()); - })) { - options.headers['x-oss-metadata-directive'] = 'REPLACE'; - } - - this._convertMetaToHeaders(options.meta, options.headers); - - sourceName = this._getSourceName(sourceName, bucketName); - - if (options.versionId) { - sourceName = "".concat(sourceName, "?versionId=").concat(options.versionId); - } - - options.headers['x-oss-copy-source'] = sourceName; - params = this._objectRequestParams('PUT', name, options); - params.xmlResponse = true; - params.successStatuses = [200, 304]; - _context.next = 14; - return this.request(params); - - case 14: - result = _context.sent; - data = result.data; - - if (data) { - data = { - etag: data.ETag, - lastModified: data.LastModified - }; - } - - return _context.abrupt("return", { - data: data, - res: result.res - }); - - case 18: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + if ((0, _typeof2.default)(bucketName) === 'object') { + options = bucketName; // 兼容旧版本,旧版本第三个参数为options + } + options = options || {}; + options.headers = options.headers || {}; + Object.keys(options.headers).forEach(function (key) { + options.headers["x-oss-copy-source-".concat(key.toLowerCase())] = options.headers[key]; + }); + if (options.meta || Object.keys(options.headers).find(function (_) { + return REPLACE_HEDERS.includes(_.toLowerCase()); + })) { + options.headers['x-oss-metadata-directive'] = 'REPLACE'; + } + this._convertMetaToHeaders(options.meta, options.headers); + sourceName = this._getSourceName(sourceName, bucketName); + if (options.versionId) { + sourceName = "".concat(sourceName, "?versionId=").concat(options.versionId); + } + options.headers['x-oss-copy-source'] = sourceName; + params = this._objectRequestParams('PUT', name, options); + params.xmlResponse = true; + params.successStatuses = [200, 304]; + _context.next = 14; + return this.request(params); + case 14: + result = _context.sent; + data = result.data; + if (data) { + data = { + etag: data.ETag, + lastModified: data.LastModified + }; + } + return _context.abrupt("return", { + data: data, + res: result.res + }); + case 18: + case "end": + return _context.stop(); } }, _callee, this); })); - function copy(_x, _x2, _x3, _x4) { return _copy.apply(this, arguments); } - return copy; -}(); // todo delete - +}(); +// todo delete proto._getSourceName = function _getSourceName(sourceName, bucketName) { if (typeof bucketName === 'string') { sourceName = this._objectName(sourceName); @@ -5511,25 +4458,19 @@ proto._getSourceName = function _getSourceName(sourceName, bucketName) { bucketName = sourceName.replace(/\/(.+?)(\/.*)/, '$1'); sourceName = sourceName.replace(/(\/.+?\/)(.*)/, '$2'); } - _checkBucketName(bucketName); - sourceName = encodeURIComponent(sourceName); sourceName = "/".concat(bucketName, "/").concat(sourceName); return sourceName; }; -},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"@babel/runtime/regenerator":80,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.find.js":275,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],33:[function(require,module,exports){ +},{"../utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.find.js":313,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382}],33:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; /** * delete @@ -5541,178 +4482,142 @@ var proto = exports; proto.delete = /*#__PURE__*/function () { var _delete2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var options, - params, - result, - _args = arguments; + 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] : {}; - options.subres = Object.assign({}, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - params = this._objectRequestParams('DELETE', name, options); - params.successStatuses = [204]; - _context.next = 7; - return this.request(params); - - case 7: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 9: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({}, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('DELETE', name, options); + params.successStatuses = [204]; + _context.next = 7; + return this.request(params); + case 7: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 9: + case "end": + return _context.stop(); } }, _callee, this); })); - function _delete(_x) { return _delete2.apply(this, arguments); } - return _delete; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],34:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],34:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - /* eslint-disable object-curly-newline */ var utility = require('utility'); - var _require = require('../utils/obj2xml'), - obj2xml = _require.obj2xml; - + obj2xml = _require.obj2xml; var proto = exports; - proto.deleteMulti = /*#__PURE__*/function () { var _deleteMulti = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(names) { var options, - objects, - i, - object, - _names$i, - key, - versionId, - paramXMLObj, - paramXML, - params, - result, - r, - deleted, - _args = arguments; - + objects, + i, + object, + _names$i, + key, + versionId, + paramXMLObj, + paramXML, + params, + result, + r, + deleted, + _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] : {}; - objects = []; - - if (!(!names || !names.length)) { - _context.next = 4; - break; - } - - throw new Error('names is required'); - - case 4: - for (i = 0; i < names.length; i++) { - object = {}; - - if (typeof names[i] === 'string') { - object.Key = utility.escape(this._objectName(names[i])); - } else { - _names$i = names[i], key = _names$i.key, versionId = _names$i.versionId; - object.Key = utility.escape(this._objectName(key)); - object.VersionId = versionId; - } - - objects.push(object); + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + objects = []; + if (!(!names || !names.length)) { + _context.next = 4; + break; + } + throw new Error('names is required'); + case 4: + for (i = 0; i < names.length; i++) { + object = {}; + if (typeof names[i] === 'string') { + object.Key = utility.escape(this._objectName(names[i])); + } else { + _names$i = names[i], key = _names$i.key, versionId = _names$i.versionId; + object.Key = utility.escape(this._objectName(key)); + object.VersionId = versionId; } - - paramXMLObj = { - Delete: { - Quiet: !!options.quiet, - Object: objects - } - }; - paramXML = obj2xml(paramXMLObj, { - headers: true - }); - options.subres = Object.assign({ - delete: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; + objects.push(object); + } + paramXMLObj = { + Delete: { + Quiet: !!options.quiet, + Object: objects } - - params = this._objectRequestParams('POST', '', options); - params.mime = 'xml'; - params.content = paramXML; - params.xmlResponse = true; - params.successStatuses = [200]; - _context.next = 16; - return this.request(params); - - case 16: - result = _context.sent; - r = result.data; - deleted = r && r.Deleted || null; - - if (deleted) { - if (!Array.isArray(deleted)) { - deleted = [deleted]; - } + }; + paramXML = obj2xml(paramXMLObj, { + headers: true + }); + options.subres = Object.assign({ + delete: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('POST', '', options); + params.mime = 'xml'; + params.content = paramXML; + params.xmlResponse = true; + params.successStatuses = [200]; + _context.next = 16; + return this.request(params); + case 16: + result = _context.sent; + r = result.data; + deleted = r && r.Deleted || null; + if (deleted) { + if (!Array.isArray(deleted)) { + deleted = [deleted]; } - - return _context.abrupt("return", { - res: result.res, - deleted: deleted || [] - }); - - case 21: - case "end": - return _context.stop(); - } + } + return _context.abrupt("return", { + res: result.res, + deleted: deleted || [] + }); + case 21: + case "end": + return _context.stop(); } }, _callee, this); })); - function deleteMulti(_x) { return _deleteMulti.apply(this, arguments); } - return deleteMulti; }(); -},{"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287,"utility":474}],35:[function(require,module,exports){ +},{"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325,"utility":547}],35:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; /** * deleteObjectTagging @@ -5723,73 +4628,61 @@ var proto = exports; proto.deleteObjectTagging = /*#__PURE__*/function () { var _deleteObjectTagging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var options, - params, - result, - _args = arguments; + 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] : {}; - options.subres = Object.assign({ - tagging: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - name = this._objectName(name); - params = this._objectRequestParams('DELETE', name, options); - params.successStatuses = [204]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - return _context.abrupt("return", { - status: result.status, - res: result.res - }); - - case 10: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + tagging: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('DELETE', name, options); + params.successStatuses = [204]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); - function deleteObjectTagging(_x) { return _deleteObjectTagging.apply(this, arguments); } - return deleteObjectTagging; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],36:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],36:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.concat.js"); - var urlutil = require('url'); - var _require = require('../utils/isIP'), - isIP = _require.isIP; - + isIP = _require.isIP; var proto = exports; + /** * Get Object url by name * @param {String} name - object name * @param {String} [baseUrl] - If provide `baseUrl`, will use `baseUrl` instead the default `endpoint and bucket`. * @return {String} object url include bucket */ - proto.generateObjectUrl = function generateObjectUrl(name, baseUrl) { if (isIP(this.options.endpoint.hostname)) { throw new Error('can not get the object URL when endpoint is IP'); } - if (!baseUrl) { baseUrl = this.options.endpoint.format(); var copyUrl = urlutil.parse(baseUrl); @@ -5800,26 +4693,19 @@ proto.generateObjectUrl = function generateObjectUrl(name, baseUrl) { } else if (baseUrl[baseUrl.length - 1] !== '/') { baseUrl += '/'; } - return baseUrl + this._escape(this._objectName(name)); }; -},{"../utils/isIP":69,"core-js/modules/es.array.concat.js":272,"url":472}],37:[function(require,module,exports){ +},{"../utils/isIP":72,"core-js/modules/es.array.concat.js":310,"url":545}],37:[function(require,module,exports){ (function (process){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var fs = require('fs'); - var is = require('is-type-of'); - var proto = exports; /** * get @@ -5828,373 +4714,301 @@ var proto = exports; * @param {Object} options * @param {{res}} */ - proto.get = /*#__PURE__*/function () { var _get = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, file) { var options, - writeStream, - needDestroy, - isBrowserEnv, - responseCacheControl, - defaultSubresOptions, - result, - params, - _args = arguments; + writeStream, + needDestroy, + isBrowserEnv, + responseCacheControl, + defaultSubresOptions, + result, + params, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - writeStream = null; - needDestroy = false; - - if (is.writableStream(file)) { - writeStream = file; - } else if (is.string(file)) { - writeStream = fs.createWriteStream(file); - needDestroy = true; - } else { - // get(name, options) - options = file; - } - - options = options || {}; - 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; - } - - if (options.process) { - options.subres['x-oss-process'] = options.process; - } - - _context.prev = 11; - params = this._objectRequestParams('GET', name, options); - params.writeStream = writeStream; - params.successStatuses = [200, 206, 304]; - _context.next = 17; - return this.request(params); - - case 17: - result = _context.sent; - - if (needDestroy) { - writeStream.destroy(); - } - - _context.next = 28; - break; - - case 21: - _context.prev = 21; - _context.t0 = _context["catch"](11); - - if (!needDestroy) { - _context.next = 27; - break; - } - - writeStream.destroy(); // should delete the exists file before throw error - + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + writeStream = null; + needDestroy = false; + if (is.writableStream(file)) { + writeStream = file; + } else if (is.string(file)) { + writeStream = fs.createWriteStream(file); + needDestroy = true; + } else { + // get(name, options) + options = file; + } + options = options || {}; + 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; + } + if (options.process) { + options.subres['x-oss-process'] = options.process; + } + _context.prev = 11; + params = this._objectRequestParams('GET', name, options); + params.writeStream = writeStream; + params.successStatuses = [200, 206, 304]; + _context.next = 17; + return this.request(params); + case 17: + result = _context.sent; + if (needDestroy) { + writeStream.destroy(); + } + _context.next = 28; + break; + case 21: + _context.prev = 21; + _context.t0 = _context["catch"](11); + if (!needDestroy) { _context.next = 27; - return this._deleteFileSafe(file); - - case 27: - throw _context.t0; - - case 28: - return _context.abrupt("return", { - res: result.res, - content: result.data - }); - - case 29: - case "end": - return _context.stop(); - } + break; + } + writeStream.destroy(); + // should delete the exists file before throw error + _context.next = 27; + return this._deleteFileSafe(file); + case 27: + throw _context.t0; + case 28: + return _context.abrupt("return", { + res: result.res, + content: result.data + }); + case 29: + case "end": + return _context.stop(); } }, _callee, this, [[11, 21]]); })); - function get(_x, _x2) { return _get.apply(this, arguments); } - return get; }(); }).call(this)}).call(this,require('_process')) -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"_process":467,"core-js/modules/es.object.assign.js":287,"fs":89,"is-type-of":466}],38:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"_process":540,"core-js/modules/es.object.assign.js":325,"fs":102,"is-type-of":539}],38:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; + /* * Get object's ACL * @param {String} name the object key * @param {Object} options * @return {Object} */ - proto.getACL = /*#__PURE__*/function () { var _getACL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var options, - params, - result, - _args = arguments; + 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] : {}; - options.subres = Object.assign({ - acl: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - name = this._objectName(name); - params = this._objectRequestParams('GET', name, options); - params.successStatuses = [200]; - params.xmlResponse = true; - _context.next = 9; - return this.request(params); - - case 9: - result = _context.sent; - return _context.abrupt("return", { - acl: result.data.AccessControlList.Grant, - owner: { - id: result.data.Owner.ID, - displayName: result.data.Owner.DisplayName - }, - res: result.res - }); - - case 11: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + acl: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('GET', name, options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 9; + return this.request(params); + case 9: + result = _context.sent; + return _context.abrupt("return", { + acl: result.data.AccessControlList.Grant, + owner: { + id: result.data.Owner.ID, + displayName: result.data.Owner.DisplayName + }, + res: result.res + }); + case 11: + case "end": + return _context.stop(); } }, _callee, this); })); - function getACL(_x) { return _getACL.apply(this, arguments); } - return getACL; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],39:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],39:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - 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"); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.number.constructor.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - /* eslint-disable no-use-before-define */ var proto = exports; - var _require = require('../utils/isObject'), - isObject = _require.isObject; - + isObject = _require.isObject; var _require2 = require('../utils/isArray'), - isArray = _require2.isArray; - + isArray = _require2.isArray; proto.getBucketVersions = getBucketVersions; proto.listObjectVersions = getBucketVersions; - function getBucketVersions() { return _getBucketVersions.apply(this, arguments); } - function _getBucketVersions() { _getBucketVersions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var query, - options, - params, - result, - objects, - deleteMarker, - that, - prefixes, - _args = arguments; + options, + params, + result, + objects, + deleteMarker, + that, + prefixes, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - query = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; - options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; - - if (!(query.versionIdMarker && query.keyMarker === undefined)) { - _context.next = 4; - break; - } - - throw new Error('A version-id marker cannot be specified without a key marker'); - - case 4: - options.subres = Object.assign({ - versions: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - params = this._objectRequestParams('GET', '', options); - params.xmlResponse = true; - params.successStatuses = [200]; - params.query = formatQuery(query); - _context.next = 12; - return this.request(params); - - case 12: - result = _context.sent; - objects = result.data.Version || []; - deleteMarker = result.data.DeleteMarker || []; - that = this; - - if (objects) { - if (!Array.isArray(objects)) { - objects = [objects]; - } - - objects = objects.map(function (obj) { - return { - name: obj.Key, - url: that._objectUrl(obj.Key), - lastModified: obj.LastModified, - isLatest: obj.IsLatest === 'true', - versionId: obj.VersionId, - etag: obj.ETag, - type: obj.Type, - size: Number(obj.Size), - storageClass: obj.StorageClass, - owner: { - id: obj.Owner.ID, - displayName: obj.Owner.DisplayName - } - }; - }); + while (1) switch (_context.prev = _context.next) { + case 0: + query = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + if (!(query.versionIdMarker && query.keyMarker === undefined)) { + _context.next = 4; + break; + } + throw new Error('A version-id marker cannot be specified without a key marker'); + case 4: + options.subres = Object.assign({ + versions: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('GET', '', options); + params.xmlResponse = true; + params.successStatuses = [200]; + params.query = formatQuery(query); + _context.next = 12; + return this.request(params); + case 12: + result = _context.sent; + objects = result.data.Version || []; + deleteMarker = result.data.DeleteMarker || []; + that = this; + if (objects) { + if (!Array.isArray(objects)) { + objects = [objects]; } - - if (deleteMarker) { - if (!isArray(deleteMarker)) { - deleteMarker = [deleteMarker]; - } - - deleteMarker = deleteMarker.map(function (obj) { - return { - name: obj.Key, - lastModified: obj.LastModified, - versionId: obj.VersionId, - owner: { - id: obj.Owner.ID, - displayName: obj.Owner.DisplayName - } - }; - }); + objects = objects.map(function (obj) { + return { + name: obj.Key, + url: that._objectUrl(obj.Key), + lastModified: obj.LastModified, + isLatest: obj.IsLatest === 'true', + versionId: obj.VersionId, + etag: obj.ETag, + type: obj.Type, + size: Number(obj.Size), + storageClass: obj.StorageClass, + owner: { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + } + }; + }); + } + if (deleteMarker) { + if (!isArray(deleteMarker)) { + deleteMarker = [deleteMarker]; } - - prefixes = result.data.CommonPrefixes || null; - - if (prefixes) { - if (!isArray(prefixes)) { - prefixes = [prefixes]; - } - - prefixes = prefixes.map(function (item) { - return item.Prefix; - }); + deleteMarker = deleteMarker.map(function (obj) { + return { + name: obj.Key, + lastModified: obj.LastModified, + versionId: obj.VersionId, + owner: { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + } + }; + }); + } + prefixes = result.data.CommonPrefixes || null; + if (prefixes) { + if (!isArray(prefixes)) { + prefixes = [prefixes]; } - - return _context.abrupt("return", { - res: result.res, - objects: objects, - deleteMarker: deleteMarker, - prefixes: prefixes, - // attirbute of legacy error - nextMarker: result.data.NextKeyMarker || null, - // attirbute of legacy error - NextVersionIdMarker: result.data.NextVersionIdMarker || null, - nextKeyMarker: result.data.NextKeyMarker || null, - nextVersionIdMarker: result.data.NextVersionIdMarker || null, - isTruncated: result.data.IsTruncated === 'true' + prefixes = prefixes.map(function (item) { + return item.Prefix; }); - - case 21: - case "end": - return _context.stop(); - } + } + return _context.abrupt("return", { + res: result.res, + objects: objects, + deleteMarker: deleteMarker, + prefixes: prefixes, + // attirbute of legacy error + nextMarker: result.data.NextKeyMarker || null, + // attirbute of legacy error + NextVersionIdMarker: result.data.NextVersionIdMarker || null, + nextKeyMarker: result.data.NextKeyMarker || null, + nextVersionIdMarker: result.data.NextVersionIdMarker || null, + isTruncated: result.data.IsTruncated === 'true' + }); + case 21: + case "end": + return _context.stop(); } }, _callee, this); })); return _getBucketVersions.apply(this, arguments); } - function camel2Line(name) { return name.replace(/([A-Z])/g, '-$1').toLowerCase(); } - function formatQuery() { var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var obj = {}; - if (isObject(query)) { Object.keys(query).forEach(function (key) { obj[camel2Line(key)] = query[key]; }); } - return obj; } -},{"../utils/isArray":63,"../utils/isObject":70,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.map.js":280,"core-js/modules/es.number.constructor.js":286,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],40:[function(require,module,exports){ +},{"../utils/isArray":66,"../utils/isObject":73,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.map.js":318,"core-js/modules/es.number.constructor.js":324,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382}],40:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; /** * getObjectMeta @@ -6207,65 +5021,50 @@ proto.getObjectMeta = /*#__PURE__*/function () { var _getObjectMeta = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = options || {}; - name = this._objectName(name); - options.subres = Object.assign({ - objectMeta: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - params = this._objectRequestParams('HEAD', name, options); - params.successStatuses = [200]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - return _context.abrupt("return", { - status: result.status, - res: result.res - }); - - case 10: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + name = this._objectName(name); + options.subres = Object.assign({ + objectMeta: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('HEAD', name, options); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 10: + case "end": + return _context.stop(); } }, _callee, this); })); - function getObjectMeta(_x, _x2) { return _getObjectMeta.apply(this, arguments); } - return getObjectMeta; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],41:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],41:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; - var _require = require('../utils/isObject'), - isObject = _require.isObject; + isObject = _require.isObject; /** * getObjectTagging * @param {String} name - object name @@ -6273,75 +5072,64 @@ var _require = require('../utils/isObject'), * @return {Object} */ - proto.getObjectTagging = /*#__PURE__*/function () { var _getObjectTagging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var options, - params, - result, - Tagging, - Tag, - tag, - _args = arguments; + params, + result, + Tagging, + Tag, + tag, + _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] : {}; - options.subres = Object.assign({ - tagging: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - name = this._objectName(name); - params = this._objectRequestParams('GET', name, options); - params.successStatuses = [200]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - _context.next = 11; - return this.parseXML(result.data); - - case 11: - Tagging = _context.sent; - Tag = Tagging.TagSet.Tag; - Tag = Tag && isObject(Tag) ? [Tag] : Tag || []; - tag = {}; - Tag.forEach(function (item) { - tag[item.Key] = item.Value; - }); - return _context.abrupt("return", { - status: result.status, - res: result.res, - tag: tag - }); - - case 17: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + tagging: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('GET', name, options); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + _context.next = 11; + return this.parseXML(result.data); + case 11: + Tagging = _context.sent; + Tag = Tagging.TagSet.Tag; + Tag = Tag && isObject(Tag) ? [Tag] : Tag || []; + tag = {}; + Tag.forEach(function (item) { + tag[item.Key] = item.Value; + }); + return _context.abrupt("return", { + status: result.status, + res: result.res, + tag: tag + }); + case 17: + case "end": + return _context.stop(); } }, _callee, this); })); - function getObjectTagging(_x) { return _getObjectTagging.apply(this, arguments); } - return getObjectTagging; }(); -},{"../utils/isObject":70,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],42:[function(require,module,exports){ +},{"../utils/isObject":73,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":331,"core-js/modules/web.dom-collections.for-each.js":382}],42:[function(require,module,exports){ "use strict"; var _require = require('../utils/isIP'), - isIP = _require.isIP; - + isIP = _require.isIP; var proto = exports; /** * Get Object url by name @@ -6350,32 +5138,25 @@ var proto = exports; * will use `baseUrl` instead the default `endpoint`. * @return {String} object url */ - proto.getObjectUrl = function getObjectUrl(name, baseUrl) { if (isIP(this.options.endpoint.hostname)) { throw new Error('can not get the object URL when endpoint is IP'); } - if (!baseUrl) { baseUrl = this.options.endpoint.format(); } else if (baseUrl[baseUrl.length - 1] !== '/') { baseUrl += '/'; } - return baseUrl + this._escape(this._objectName(name)); }; -},{"../utils/isIP":69}],43:[function(require,module,exports){ +},{"../utils/isIP":72}],43:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; /** * getSymlink @@ -6387,72 +5168,56 @@ var proto = exports; proto.getSymlink = /*#__PURE__*/function () { var _getSymlink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var options, - params, - result, - target, - _args = arguments; + params, + result, + target, + _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] : {}; - options.subres = Object.assign({ - symlink: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - name = this._objectName(name); - params = this._objectRequestParams('GET', name, options); - params.successStatuses = [200]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - target = result.res.headers['x-oss-symlink-target']; - return _context.abrupt("return", { - targetName: decodeURIComponent(target), - res: result.res - }); - - case 11: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + symlink: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('GET', name, options); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + target = result.res.headers['x-oss-symlink-target']; + return _context.abrupt("return", { + targetName: decodeURIComponent(target), + res: result.res + }); + case 11: + case "end": + return _context.stop(); } }, _callee, this); })); - function getSymlink(_x) { return _getSymlink.apply(this, arguments); } - return getSymlink; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],44:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],44:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - 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"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var _require = require('../utils/checkEnv'), - checkEnv = _require.checkEnv; - + checkEnv = _require.checkEnv; var proto = exports; /** * head @@ -6464,149 +5229,118 @@ var proto = exports; proto.head = /*#__PURE__*/function () { var _head = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { var options, - params, - result, - data, - _args = arguments; + params, + result, + data, + _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] : {}; - 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) { - options.subres.versionId = options.versionId; - } - - params = this._objectRequestParams('HEAD', name, options); - params.successStatuses = [200, 304]; - _context.next = 8; - return this.request(params); - - case 8: - result = _context.sent; - data = { - meta: null, - res: result.res, - status: result.status - }; - - if (result.status === 200) { - Object.keys(result.headers).forEach(function (k) { - if (k.indexOf('x-oss-meta-') === 0) { - if (!data.meta) { - data.meta = {}; - } - - data.meta[k.substring(11)] = result.headers[k]; + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[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) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('HEAD', name, options); + params.successStatuses = [200, 304]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + data = { + meta: null, + res: result.res, + status: result.status + }; + if (result.status === 200) { + Object.keys(result.headers).forEach(function (k) { + if (k.indexOf('x-oss-meta-') === 0) { + if (!data.meta) { + data.meta = {}; } - }); - } - - return _context.abrupt("return", data); - - case 12: - case "end": - return _context.stop(); - } + data.meta[k.substring(11)] = result.headers[k]; + } + }); + } + return _context.abrupt("return", data); + case 12: + case "end": + return _context.stop(); } }, _callee, this); })); - function head(_x) { return _head.apply(this, arguments); } - return head; }(); -},{"../utils/checkEnv":53,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],45:[function(require,module,exports){ +},{"../utils/checkEnv":54,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/web.dom-collections.for-each.js":382}],45:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; + /* * Set object's ACL * @param {String} name the object key * @param {String} acl the object ACL * @param {Object} options */ - proto.putACL = /*#__PURE__*/function () { var _putACL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, acl, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = options || {}; - options.subres = Object.assign({ - acl: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - options.headers = options.headers || {}; - options.headers['x-oss-object-acl'] = acl; - name = this._objectName(name); - params = this._objectRequestParams('PUT', name, options); - params.successStatuses = [200]; - _context.next = 10; - return this.request(params); - - case 10: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 12: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + options.subres = Object.assign({ + acl: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + options.headers = options.headers || {}; + options.headers['x-oss-object-acl'] = acl; + name = this._objectName(name); + params = this._objectRequestParams('PUT', name, options); + params.successStatuses = [200]; + _context.next = 10; + return this.request(params); + case 10: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 12: + case "end": + return _context.stop(); } }, _callee, this); })); - function putACL(_x, _x2, _x3) { return _putACL.apply(this, arguments); } - return putACL; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],46:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],46:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.object.keys.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var _require = require('../utils/obj2xml'), - obj2xml = _require.obj2xml; - + obj2xml = _require.obj2xml; var _require2 = require('../utils/checkObjectTag'), - checkObjectTag = _require2.checkObjectTag; - + checkObjectTag = _require2.checkObjectTag; var proto = exports; /** * putObjectTagging @@ -6618,78 +5352,66 @@ var proto = exports; proto.putObjectTagging = /*#__PURE__*/function () { var _putObjectTagging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, tag) { var options, - params, - paramXMLObj, - result, - _args = arguments; + params, + paramXMLObj, + result, + _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; - checkObjectTag(tag); - options.subres = Object.assign({ - tagging: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - name = this._objectName(name); - params = this._objectRequestParams('PUT', name, options); - params.successStatuses = [200]; - tag = Object.keys(tag).map(function (key) { - return { - Key: key, - Value: tag[key] - }; - }); - paramXMLObj = { - Tagging: { - TagSet: { - Tag: tag - } - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + checkObjectTag(tag); + options.subres = Object.assign({ + tagging: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('PUT', name, options); + params.successStatuses = [200]; + tag = Object.keys(tag).map(function (key) { + return { + Key: key, + Value: tag[key] }; - params.mime = 'xml'; - params.content = obj2xml(paramXMLObj); - _context.next = 13; - return this.request(params); - - case 13: - result = _context.sent; - return _context.abrupt("return", { - res: result.res, - status: result.status - }); - - case 15: - case "end": - return _context.stop(); - } + }); + paramXMLObj = { + Tagging: { + TagSet: { + Tag: tag + } + } + }; + params.mime = 'xml'; + params.content = obj2xml(paramXMLObj); + _context.next = 13; + return this.request(params); + case 13: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 15: + case "end": + return _context.stop(); } }, _callee, this); })); - function putObjectTagging(_x, _x2) { return _putObjectTagging.apply(this, arguments); } - return putObjectTagging; }(); -},{"../utils/checkObjectTag":54,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.map.js":280,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290}],47:[function(require,module,exports){ +},{"../utils/checkObjectTag":55,"../utils/obj2xml":75,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.map.js":318,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":330}],47:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var proto = exports; /** * putSymlink @@ -6703,72 +5425,56 @@ proto.putSymlink = /*#__PURE__*/function () { var _putSymlink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, targetName, options) { var params, result; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = options || {}; - options.headers = options.headers || {}; - targetName = this._escape(this._objectName(targetName)); - - this._convertMetaToHeaders(options.meta, options.headers); - - options.headers['x-oss-symlink-target'] = targetName; - options.subres = Object.assign({ - symlink: '' - }, options.subres); - - if (options.versionId) { - options.subres.versionId = options.versionId; - } - - if (options.storageClass) { - options.headers['x-oss-storage-class'] = options.storageClass; - } - - name = this._objectName(name); - params = this._objectRequestParams('PUT', name, options); - params.successStatuses = [200]; - _context.next = 13; - return this.request(params); - - case 13: - result = _context.sent; - return _context.abrupt("return", { - res: result.res - }); - - case 15: - case "end": - return _context.stop(); - } + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + options.headers = options.headers || {}; + targetName = this._escape(this._objectName(targetName)); + this._convertMetaToHeaders(options.meta, options.headers); + options.headers['x-oss-symlink-target'] = targetName; + options.subres = Object.assign({ + symlink: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + if (options.storageClass) { + options.headers['x-oss-storage-class'] = options.storageClass; + } + name = this._objectName(name); + params = this._objectRequestParams('PUT', name, options); + params.successStatuses = [200]; + _context.next = 13; + return this.request(params); + case 13: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 15: + case "end": + return _context.stop(); } }, _callee, this); })); - function putSymlink(_x, _x2, _x3) { return _putSymlink.apply(this, arguments); } - return putSymlink; }(); -},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],48:[function(require,module,exports){ +},{"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],48:[function(require,module,exports){ "use strict"; require("core-js/modules/es.regexp.exec.js"); - var urlutil = require('url'); - var utility = require('utility'); - var copy = require('copy-to'); - var signHelper = require('../../common/signUtils'); - var _require = require('../utils/isIP'), - isIP = _require.isIP; - + isIP = _require.isIP; var proto = exports; + /** * signatureUrl * @deprecated will be deprecated in 7.x @@ -6776,18 +5482,14 @@ var proto = exports; * @param {Object} options options * @param {boolean} [strictObjectNameValidation=true] the flag of verifying object name strictly */ - proto.signatureUrl = function signatureUrl(name, options) { var strictObjectNameValidation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - if (isIP(this.options.endpoint.hostname)) { throw new Error('can not get the object URL when endpoint is IP'); } - if (strictObjectNameValidation && /^\?/.test(name)) { throw new Error("Invalid object name ".concat(name)); } - options = options || {}; name = this._objectName(name); options.method = options.method || 'GET'; @@ -6796,15 +5498,11 @@ proto.signatureUrl = function signatureUrl(name, options) { bucket: this.options.bucket, object: name }; - var resource = this._getResource(params); - if (this.options.stsToken) { options['security-token'] = this.options.stsToken; } - var signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires); - var url = urlutil.parse(this._getReqUrl(params)); url.query = { OSSAccessKeyId: this.options.accessKeyId, @@ -6815,142 +5513,200 @@ proto.signatureUrl = function signatureUrl(name, options) { return url.format(); }; -},{"../../common/signUtils":50,"../utils/isIP":69,"copy-to":94,"core-js/modules/es.regexp.exec.js":300,"url":472,"utility":474}],49:[function(require,module,exports){ +},{"../../common/signUtils":51,"../utils/isIP":72,"copy-to":107,"core-js/modules/es.regexp.exec.js":340,"url":545,"utility":547}],49:[function(require,module,exports){ "use strict"; +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.symbol.js"); +require("core-js/modules/es.array.filter.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.object.get-own-property-descriptor.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.get-own-property-descriptors.js"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.join.js"); +require("core-js/modules/es.array.concat.js"); +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +var dateFormat = require('dateformat'); +var urlUtil = require('url'); +var signHelper = require('../../common/signUtils'); +var _require = require('../utils/setSTSToken'), + setSTSToken = _require.setSTSToken; +var _require2 = require('../utils/isFunction'), + isFunction = _require2.isFunction; +var _require3 = require('../utils/getStandardRegion'), + getStandardRegion = _require3.getStandardRegion; +var proto = exports; -require("core-js/modules/es.array.iterator.js"); +/** + * signatureUrlV4 + * + * @param {string} method + * @param {number} expires + * @param {Object} [request] + * @param {Object} [request.headers] + * @param {Object} [request.queries] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] + */ +proto.signatureUrlV4 = /*#__PURE__*/function () { + var _signatureUrlV = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(method, expires, request, objectName, additionalHeaders) { + var headers, queries, date, formattedDate, onlyDate, fixedAdditionalHeaders, region, canonicalRequest, stringToSign, signedUrl; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + headers = request && request.headers || {}; + queries = _objectSpread({}, request && request.queries || {}); + date = new Date(); + formattedDate = dateFormat(date, "UTC:yyyymmdd'T'HHMMss'Z'"); + onlyDate = formattedDate.split('T')[0]; + fixedAdditionalHeaders = signHelper.fixAdditionalHeaders(additionalHeaders); + region = getStandardRegion(this.options.region); + if (fixedAdditionalHeaders.length > 0) { + queries['x-oss-additional-headers'] = fixedAdditionalHeaders.join(';'); + } + queries['x-oss-credential'] = "".concat(this.options.accessKeyId, "/").concat(onlyDate, "/").concat(region, "/oss/aliyun_v4_request"); + queries['x-oss-date'] = formattedDate; + queries['x-oss-expires'] = expires; + queries['x-oss-signature-version'] = 'OSS4-HMAC-SHA256'; + if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { + _context.next = 15; + break; + } + _context.next = 15; + return setSTSToken.call(this); + case 15: + if (this.options.stsToken) { + queries['x-oss-security-token'] = this.options.stsToken; + } + canonicalRequest = signHelper.getCanonicalRequest(method, { + headers: headers, + queries: queries + }, this.options.bucket, objectName, fixedAdditionalHeaders); + stringToSign = signHelper.getStringToSign(region, formattedDate, canonicalRequest); + queries['x-oss-signature'] = signHelper.getSignatureV4(this.options.accessKeySecret, onlyDate, region, stringToSign); + signedUrl = urlUtil.parse(this._getReqUrl({ + bucket: this.options.bucket, + object: objectName + })); + signedUrl.query = _objectSpread({}, queries); + return _context.abrupt("return", signedUrl.format()); + case 22: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function signatureUrlV4(_x, _x2, _x3, _x4, _x5) { + return _signatureUrlV.apply(this, arguments); + } + return signatureUrlV4; +}(); -require("core-js/modules/es.object.to-string.js"); +},{"../../common/signUtils":51,"../utils/getStandardRegion":64,"../utils/isFunction":71,"../utils/setSTSToken":79,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/defineProperty":83,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.join.js":317,"core-js/modules/es.object.get-own-property-descriptor.js":327,"core-js/modules/es.object.get-own-property-descriptors.js":328,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.symbol.js":356,"core-js/modules/web.dom-collections.for-each.js":382,"dateformat":385,"url":545}],50:[function(require,module,exports){ +"use strict"; +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.object.to-string.js"); require("core-js/modules/es.promise.js"); - require("core-js/modules/es.string.iterator.js"); - require("core-js/modules/web.dom-collections.iterator.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - require("core-js/modules/es.function.name.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - var _require = require('./utils/isArray'), - isArray = _require.isArray; - + isArray = _require.isArray; var proto = exports; - proto._parallelNode = /*#__PURE__*/function () { var _parallelNode2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(todo, parallel, fn, sourceData) { var that, jobErr, jobs, tempBatch, remainder, batch, taskIndex, i; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - that = this; // upload in parallel - - jobErr = []; - jobs = []; - tempBatch = todo.length / parallel; - remainder = todo.length % parallel; - batch = remainder === 0 ? tempBatch : (todo.length - remainder) / parallel + 1; - taskIndex = 1; - i = 0; - - case 8: - if (!(i < todo.length)) { - _context.next = 26; - break; - } - - if (!that.isCancel()) { - _context.next = 11; - break; - } - - return _context.abrupt("break", 26); - - case 11: - if (sourceData) { - jobs.push(fn(that, todo[i], sourceData)); - } else { - jobs.push(fn(that, todo[i])); - } - - if (!(jobs.length === parallel || taskIndex === batch && i === todo.length - 1)) { - _context.next = 23; - break; - } - - _context.prev = 13; - taskIndex += 1; - /* eslint no-await-in-loop: [0] */ - - _context.next = 17; - return Promise.all(jobs); - - case 17: - _context.next = 22; + while (1) switch (_context.prev = _context.next) { + case 0: + that = this; // upload in parallel + jobErr = []; + jobs = []; + tempBatch = todo.length / parallel; + remainder = todo.length % parallel; + batch = remainder === 0 ? tempBatch : (todo.length - remainder) / parallel + 1; + taskIndex = 1; + i = 0; + case 8: + if (!(i < todo.length)) { + _context.next = 26; break; - - case 19: - _context.prev = 19; - _context.t0 = _context["catch"](13); - jobErr.push(_context.t0); - - case 22: - jobs = []; - - case 23: - i++; - _context.next = 8; + } + if (!that.isCancel()) { + _context.next = 11; break; - - case 26: - return _context.abrupt("return", jobErr); - - case 27: - case "end": - return _context.stop(); - } + } + return _context.abrupt("break", 26); + case 11: + if (sourceData) { + jobs.push(fn(that, todo[i], sourceData)); + } else { + jobs.push(fn(that, todo[i])); + } + if (!(jobs.length === parallel || taskIndex === batch && i === todo.length - 1)) { + _context.next = 23; + break; + } + _context.prev = 13; + taskIndex += 1; + /* eslint no-await-in-loop: [0] */ + _context.next = 17; + return Promise.all(jobs); + case 17: + _context.next = 22; + break; + case 19: + _context.prev = 19; + _context.t0 = _context["catch"](13); + jobErr.push(_context.t0); + case 22: + jobs = []; + case 23: + i++; + _context.next = 8; + break; + case 26: + return _context.abrupt("return", jobErr); + case 27: + case "end": + return _context.stop(); } }, _callee, this, [[13, 19]]); })); - function _parallelNode(_x, _x2, _x3, _x4) { return _parallelNode2.apply(this, arguments); } - return _parallelNode; }(); - proto._parallel = function _parallel(todo, parallel, jobPromise) { var that = this; return new Promise(function (resolve) { var _jobErr = []; - if (parallel <= 0 || !todo) { resolve(_jobErr); return; } - function onlyOnce(fn) { return function () { if (fn === null) throw new Error('Callback was already called.'); var callFn = fn; fn = null; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - callFn.apply(this, args); }; } - function createArrayIterator(coll) { var i = -1; var len = coll.length; @@ -6961,20 +5717,15 @@ proto._parallel = function _parallel(todo, parallel, jobPromise) { } : null; }; } - var nextElem = createArrayIterator(todo); var done = false; var running = 0; var looping = false; - function iterateeCallback(err) { running -= 1; - if (err) { done = true; - _jobErr.push(err); - resolve(_jobErr); } else if (done && running <= 0) { done = true; @@ -6988,7 +5739,6 @@ proto._parallel = function _parallel(todo, parallel, jobPromise) { } } } - function iteratee(value, callback) { jobPromise(value).then(function (result) { callback(null, result); @@ -6996,33 +5746,26 @@ proto._parallel = function _parallel(todo, parallel, jobPromise) { callback(err); }); } - function replenish() { looping = true; - while (running < parallel && !done && !that.isCancel()) { var elem = nextElem(); - if (elem === null || _jobErr.length > 0) { done = true; - if (running <= 0) { resolve(_jobErr); } - return; } - running += 1; iteratee(elem.value, onlyOnce(iterateeCallback)); } - looping = false; } - replenish(); }); }; + /** * cancel operation, now can use with multipartUpload * @param {Object} abort @@ -7030,11 +5773,8 @@ proto._parallel = function _parallel(todo, parallel, jobPromise) { * {String} anort.uploadId upload id * {String} anort.options timeout */ - - proto.cancel = function cancel(abort) { this.options.cancelFlag = true; - if (isArray(this.multipartUploadStreams)) { this.multipartUploadStreams.forEach(function (_) { if (_.destroyed === false) { @@ -7042,41 +5782,35 @@ proto.cancel = function cancel(abort) { name: 'cancel', message: 'cancel' }; - _.destroy(err); } }); } - this.multipartUploadStreams = []; - if (abort) { this.abortMultipartUpload(abort.name, abort.uploadId, abort.options); } }; - proto.isCancel = function isCancel() { return this.options.cancelFlag; }; - proto.resetCancelFlag = function resetCancelFlag() { this.options.cancelFlag = false; }; - proto._stop = function _stop() { this.options.cancelFlag = true; -}; // cancel is not error , so create an object - +}; +// cancel is not error , so create an object proto._makeCancelEvent = function _makeCancelEvent() { var cancelEvent = { status: 0, name: 'cancel' }; return cancelEvent; -}; // abort is not error , so create an object - +}; +// abort is not error , so create an object proto._makeAbortEvent = function _makeAbortEvent() { var abortEvent = { status: 0, @@ -7086,44 +5820,47 @@ proto._makeAbortEvent = function _makeAbortEvent() { return abortEvent; }; -},{"./utils/isArray":63,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.string.iterator.js":303,"core-js/modules/web.dom-collections.for-each.js":339,"core-js/modules/web.dom-collections.iterator.js":340}],50:[function(require,module,exports){ +},{"./utils/isArray":66,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.string.iterator.js":345,"core-js/modules/web.dom-collections.for-each.js":382,"core-js/modules/web.dom-collections.iterator.js":383}],51:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); require("core-js/modules/es.string.trim.js"); - require("core-js/modules/es.array.sort.js"); - require("core-js/modules/es.array.join.js"); - 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"); - require("core-js/modules/es.array.concat.js"); - +require("core-js/modules/es.array.filter.js"); +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.set.js"); +require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.string.starts-with.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.object.entries.js"); require("core-js/modules/es.regexp.to-string.js"); - var crypto = require('./../../shims/crypto/crypto.js'); - var is = require('is-type-of'); - +var qs = require('qs'); var _require = require('./utils/lowercaseKeyHeader'), - lowercaseKeyHeader = _require.lowercaseKeyHeader; + lowercaseKeyHeader = _require.lowercaseKeyHeader; +var _require2 = require('./utils/encodeString'), + encodeString = _require2.encodeString; + /** * * @param {String} resourcePath * @param {Object} parameters * @return */ - - exports.buildCanonicalizedResource = function buildCanonicalizedResource(resourcePath, parameters) { var canonicalizedResource = "".concat(resourcePath); var separatorString = '?'; - if (is.string(parameters) && parameters.trim() !== '') { canonicalizedResource += separatorString + parameters; } else if (is.array(parameters)) { @@ -7136,25 +5873,20 @@ exports.buildCanonicalizedResource = function buildCanonicalizedResource(resourc } else if (entry1[0] < entry2[0]) { return -1; } - return 0; }; - var processFunc = function processFunc(key) { canonicalizedResource += separatorString + key; - if (parameters[key] || parameters[key] === 0) { canonicalizedResource += "=".concat(parameters[key]); } - separatorString = '&'; }; - Object.keys(parameters).sort(compareFunc).forEach(processFunc); } - return canonicalizedResource; }; + /** * @param {String} method * @param {String} resourcePath @@ -7162,8 +5894,6 @@ exports.buildCanonicalizedResource = function buildCanonicalizedResource(resourc * @param {String} expires * @return {String} canonicalString */ - - exports.buildCanonicalString = function canonicalString(method, resourcePath, request, expires) { request = request || {}; var headers = lowercaseKeyHeader(request.headers); @@ -7173,7 +5903,6 @@ exports.buildCanonicalString = function canonicalString(method, resourcePath, re 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(); - if (lowerKey.indexOf(OSS_PREFIX) === 0) { headersToSign[lowerKey] = String(headers[key]).trim(); } @@ -7185,27 +5914,168 @@ exports.buildCanonicalString = function canonicalString(method, resourcePath, re signContent.push(this.buildCanonicalizedResource(resourcePath, request.parameters)); return signContent.join('\n'); }; + /** * @param {String} accessKeySecret * @param {String} canonicalString */ - - exports.computeSignature = function computeSignature(accessKeySecret, canonicalString) { var headerEncoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'utf-8'; var signature = crypto.createHmac('sha1', accessKeySecret); return signature.update(Buffer.from(canonicalString, headerEncoding)).digest('base64'); }; + /** * @param {String} accessKeyId * @param {String} accessKeySecret * @param {String} canonicalString */ - - exports.authorization = function authorization(accessKeyId, accessKeySecret, canonicalString, headerEncoding) { return "OSS ".concat(accessKeyId, ":").concat(this.computeSignature(accessKeySecret, canonicalString, headerEncoding)); }; + +/** + * @param {string[]} [additionalHeaders] + * @returns {string[]} + */ +exports.fixAdditionalHeaders = function (additionalHeaders) { + if (!additionalHeaders) { + return []; + } + var OSS_PREFIX = 'x-oss-'; + return (0, _toConsumableArray2.default)(new Set(additionalHeaders.map(function (v) { + return v.toLowerCase(); + }))).filter(function (v) { + return v !== 'content-type' && v !== 'content-md5' && !v.startsWith(OSS_PREFIX); + }).sort(); +}; + +/** + * @param {string} method + * @param {Object} request + * @param {Object} request.headers + * @param {Object} [request.queries] + * @param {string} [bucketName] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] additional headers after deduplication, lowercase and sorting + * @returns {string} + */ +exports.getCanonicalRequest = function getCanonicalRequest(method, request, bucketName, objectName, additionalHeaders) { + var headers = lowercaseKeyHeader(request.headers); + var queries = request.queries || {}; + var OSS_PREFIX = 'x-oss-'; + if (objectName && !bucketName) { + throw Error('Please ensure that bucketName is passed into getCanonicalRequest.'); + } + var signContent = [method.toUpperCase(), + // HTTP Verb + encodeString("/".concat(bucketName ? "".concat(bucketName, "/") : '').concat(objectName || '')).replace(/%2F/g, '/') // Canonical URI + ]; + + // Canonical Query String + signContent.push(qs.stringify(queries, { + encoder: encodeString, + sort: function sort(a, b) { + return a.localeCompare(b); + }, + strictNullHandling: true + })); + + // Canonical Headers + if (additionalHeaders) { + additionalHeaders.forEach(function (v) { + if (!Object.prototype.hasOwnProperty.call(headers, v)) { + throw Error("Can't find additional header ".concat(v, " in request headers.")); + } + }); + } + var tempHeaders = new Set(additionalHeaders); + Object.keys(headers).forEach(function (v) { + if (v === 'content-type' || v === 'content-md5' || v.startsWith(OSS_PREFIX)) { + tempHeaders.add(v); + } + }); + var canonicalHeaders = "".concat((0, _toConsumableArray2.default)(tempHeaders).sort().map(function (v) { + return "".concat(v, ":").concat(is.string(headers[v]) ? headers[v].trim() : headers[v], "\n"); + }).join('')); + signContent.push(canonicalHeaders); + + // Additional Headers + if (additionalHeaders.length > 0) { + signContent.push(additionalHeaders.join(';')); + } else { + signContent.push(''); + } + + // Hashed Payload + signContent.push(headers['x-oss-content-sha256'] || 'UNSIGNED-PAYLOAD'); + return signContent.join('\n'); +}; + +/** + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} date ISO8601 UTC:yyyymmdd'T'HHMMss'Z' + * @param {string} canonicalRequest + * @returns {string} + */ +exports.getStringToSign = function getStringToSign(region, date, canonicalRequest) { + var stringToSign = ['OSS4-HMAC-SHA256', date, // TimeStamp + "".concat(date.split('T')[0], "/").concat(region, "/oss/aliyun_v4_request"), + // Scope + crypto.createHash('sha256').update(canonicalRequest).digest('hex') // Hashed Canonical Request + ]; + return stringToSign.join('\n'); +}; + +/** + * @param {String} accessKeySecret + * @param {string} date yyyymmdd + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} stringToSign + * @returns {string} + */ +exports.getSignatureV4 = function getSignatureV4(accessKeySecret, date, region, stringToSign) { + var signingDate = crypto.createHmac('sha256', "aliyun_v4".concat(accessKeySecret)).update(date).digest(); + var signingRegion = crypto.createHmac('sha256', signingDate).update(region).digest(); + var signingOss = crypto.createHmac('sha256', signingRegion).update('oss').digest(); + var signingKey = crypto.createHmac('sha256', signingOss).update('aliyun_v4_request').digest(); + var signatureValue = crypto.createHmac('sha256', signingKey).update(stringToSign).digest('hex'); + return signatureValue; +}; + +/** + * @param {String} accessKeyId + * @param {String} accessKeySecret + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} method + * @param {Object} request + * @param {Object} request.headers + * @param {Object} [request.queries] + * @param {string} [bucketName] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] + * @param {string} [headerEncoding='utf-8'] + * @returns {string} + */ +exports.authorizationV4 = function authorizationV4(accessKeyId, accessKeySecret, region, method, request, bucketName, objectName, additionalHeaders) { + var headerEncoding = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 'utf-8'; + var fixedAdditionalHeaders = this.fixAdditionalHeaders(additionalHeaders); + var fixedHeaders = {}; + Object.entries(request.headers).forEach(function (v) { + fixedHeaders[v[0]] = is.string(v[1]) ? Buffer.from(v[1], headerEncoding).toString() : v[1]; + }); + var date = fixedHeaders['x-oss-date'] || request.queries && request.queries['x-oss-date']; + var canonicalRequest = this.getCanonicalRequest(method, { + headers: fixedHeaders, + queries: request.queries + }, bucketName, objectName, fixedAdditionalHeaders); + var stringToSign = this.getStringToSign(region, date, canonicalRequest); + var onlyDate = date.split('T')[0]; + var signatureValue = this.getSignatureV4(accessKeySecret, onlyDate, region, stringToSign); + var additionalHeadersValue = fixedAdditionalHeaders.length > 0 ? "AdditionalHeaders=".concat(fixedAdditionalHeaders.join(';'), ",") : ''; + return "OSS4-HMAC-SHA256 Credential=".concat(accessKeyId, "/").concat(onlyDate, "/").concat(region, "/oss/aliyun_v4_request,").concat(additionalHeadersValue, "Signature=").concat(signatureValue); +}; + /** * * @param {String} accessKeySecret @@ -7213,8 +6083,6 @@ exports.authorization = function authorization(accessKeyId, accessKeySecret, can * @param {String} resource * @param {Number} expires */ - - exports._signatureForURL = function _signatureForURL(accessKeySecret) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var resource = arguments.length > 2 ? arguments[2] : undefined; @@ -7222,29 +6090,24 @@ exports._signatureForURL = function _signatureForURL(accessKeySecret) { var headerEncoding = arguments.length > 4 ? arguments[4] : undefined; var headers = {}; var _options$subResource = options.subResource, - subResource = _options$subResource === void 0 ? {} : _options$subResource; - + subResource = _options$subResource === void 0 ? {} : _options$subResource; if (options.process) { var processKeyword = 'x-oss-process'; subResource[processKeyword] = options.process; } - if (options.trafficLimit) { var trafficLimitKey = 'x-oss-traffic-limit'; subResource[trafficLimitKey] = options.trafficLimit; } - if (options.response) { Object.keys(options.response).forEach(function (k) { var key = "response-".concat(k.toLowerCase()); subResource[key] = options.response[k]; }); } - Object.keys(options).forEach(function (key) { var lowerKey = key.toLowerCase(); var value = options[key]; - if (lowerKey.indexOf('x-oss-') === 0) { headers[lowerKey] = value; } else if (lowerKey.indexOf('content-md5') === 0) { @@ -7253,27 +6116,21 @@ exports._signatureForURL = function _signatureForURL(accessKeySecret) { headers[key] = value; } }); - if (Object.prototype.hasOwnProperty.call(options, 'security-token')) { subResource['security-token'] = options['security-token']; } - if (Object.prototype.hasOwnProperty.call(options, 'callback')) { var json = { callbackUrl: encodeURI(options.callback.url), callbackBody: options.callback.body }; - if (options.callback.host) { json.callbackHost = options.callback.host; } - if (options.callback.contentType) { json.callbackBodyType = options.callback.contentType; } - subResource.callback = Buffer.from(JSON.stringify(json)).toString('base64'); - if (options.callback.customValue) { var callbackVar = {}; Object.keys(options.callback.customValue).forEach(function (key) { @@ -7282,7 +6139,6 @@ exports._signatureForURL = function _signatureForURL(accessKeySecret) { subResource['callback-var'] = Buffer.from(JSON.stringify(callbackVar)).toString('base64'); } } - var canonicalString = this.buildCanonicalString(options.method, resource, { headers: headers, parameters: subResource @@ -7294,30 +6150,26 @@ exports._signatureForURL = function _signatureForURL(accessKeySecret) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"./../../shims/crypto/crypto.js":461,"./utils/lowercaseKeyHeader":71,"buffer":90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.sort.js":282,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.trim.js":308,"core-js/modules/web.dom-collections.for-each.js":339,"is-type-of":466}],51:[function(require,module,exports){ +},{"./../../shims/crypto/crypto.js":533,"./utils/encodeString":60,"./utils/lowercaseKeyHeader":74,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/toConsumableArray":88,"buffer":103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.sort.js":320,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.set.js":343,"core-js/modules/es.string.iterator.js":345,"core-js/modules/es.string.replace.js":347,"core-js/modules/es.string.starts-with.js":350,"core-js/modules/es.string.trim.js":351,"core-js/modules/web.dom-collections.for-each.js":382,"core-js/modules/web.dom-collections.iterator.js":383,"is-type-of":539,"qs":447}],52:[function(require,module,exports){ "use strict"; require("core-js/modules/es.regexp.exec.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.checkBucketName = void 0; - exports.checkBucketName = function (name) { var createBucket = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/; - if (!bucketRegex.test(name)) { throw new Error('The bucket must be conform to the specifications'); } }; -},{"core-js/modules/es.regexp.exec.js":300}],52:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":340}],53:[function(require,module,exports){ "use strict"; require("core-js/modules/es.regexp.exec.js"); - Object.defineProperty(exports, "__esModule", { value: true }); @@ -7326,34 +6178,29 @@ var checkConfigMap = { endpoint: checkEndpoint, region: /^[a-zA-Z0-9\-_]+$/ }; - function checkEndpoint(endpoint) { if (typeof endpoint === 'string') { return /^[a-zA-Z0-9._:/-]+$/.test(endpoint); } else if (endpoint.host) { return /^[a-zA-Z0-9._:/-]+$/.test(endpoint.host); } - return false; } - exports.checkConfigValid = function (conf, key) { if (checkConfigMap[key]) { var isConfigValid = true; - if (checkConfigMap[key] instanceof Function) { isConfigValid = checkConfigMap[key](conf); } else { isConfigValid = checkConfigMap[key].test(conf); } - if (!isConfigValid) { throw new Error("The ".concat(key, " must be conform to the specifications")); } } }; -},{"core-js/modules/es.regexp.exec.js":300}],53:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":340}],54:[function(require,module,exports){ (function (process){(function (){ "use strict"; @@ -7361,38 +6208,29 @@ 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":467}],54:[function(require,module,exports){ +},{"_process":540}],55:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.object.entries.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.checkObjectTag = void 0; - var _require = require('./checkValid'), - checkValid = _require.checkValid; - + checkValid = _require.checkValid; var _require2 = require('./isObject'), - isObject = _require2.isObject; - + isObject = _require2.isObject; var commonRules = [{ validator: function validator(value) { if (typeof value !== 'string') { @@ -7413,18 +6251,14 @@ var rules = { msg: 'tag value can be a maximum of 256 bytes in length' }]) }; - function checkObjectTag(tag) { if (!isObject(tag)) { throw new Error('tag must be Object'); } - var entries = Object.entries(tag); - if (entries.length > 10) { throw new Error('maximum of 10 tags for a object'); } - var rulesIndexKey = ['key', 'value']; entries.forEach(function (keyValue) { keyValue.forEach(function (item, index) { @@ -7432,23 +6266,18 @@ function checkObjectTag(tag) { }); }); } - exports.checkObjectTag = checkObjectTag; -},{"./checkValid":55,"./isObject":70,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.entries.js":288,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],55:[function(require,module,exports){ +},{"./checkValid":56,"./isObject":73,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.to-string.js":331,"core-js/modules/web.dom-collections.for-each.js":382}],56:[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.regexp.exec.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.checkValid = void 0; - function checkValid(_value, _rules) { _rules.forEach(function (rule) { if (rule.validator) { @@ -7458,93 +6287,75 @@ function checkValid(_value, _rules) { } }); } - exports.checkValid = checkValid; -},{"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/web.dom-collections.for-each.js":339}],56:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/web.dom-collections.for-each.js":382}],57:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; require("core-js/modules/es.array.includes.js"); - require("core-js/modules/es.string.includes.js"); - require("core-js/modules/es.object.assign.js"); - +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.entries.js"); require("core-js/modules/es.array.concat.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.createRequest = void 0; - var crypto = require('./../../../shims/crypto/crypto.js'); - var debug = require('debug')('ali-oss'); - +var _isString = require('lodash/isString'); +var _isArray = require('lodash/isArray'); +var _isObject = require('lodash/isObject'); var mime = require('mime'); - var dateFormat = require('dateformat'); - var copy = require('copy-to'); - var path = require('path'); - var _require = require('./encoder'), - encoder = _require.encoder; - + encoder = _require.encoder; var _require2 = require('./isIP'), - isIP = _require2.isIP; - + isIP = _require2.isIP; var _require3 = require('./setRegion'), - setRegion = _require3.setRegion; - + setRegion = _require3.setRegion; var _require4 = require('../client/getReqUrl'), - getReqUrl = _require4.getReqUrl; - + getReqUrl = _require4.getReqUrl; var _require5 = require('./isDingTalk'), - isDingTalk = _require5.isDingTalk; - + isDingTalk = _require5.isDingTalk; function getHeader(headers, name) { return headers[name] || headers[name.toLowerCase()]; } - function delHeader(headers, name) { delete headers[name]; delete headers[name.toLowerCase()]; } - function createRequest(params) { var date = new Date(); - if (this.options.amendTimeSkewed) { date = +new Date() + this.options.amendTimeSkewed; } - var headers = { - 'x-oss-date': dateFormat(date, "UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'") + 'x-oss-date': dateFormat(date, this.options.authorizationV4 ? "UTC:yyyymmdd'T'HHMMss'Z'" : "UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'") }; - + if (this.options.authorizationV4) { + headers['x-oss-content-sha256'] = 'UNSIGNED-PAYLOAD'; + } if (typeof window !== 'undefined') { headers['x-oss-user-agent'] = this.userAgent; } - if (this.userAgent.includes('nodejs')) { headers['User-Agent'] = this.userAgent; } - if (this.options.isRequestPay) { Object.assign(headers, { 'x-oss-request-payer': 'requester' }); } - if (this.options.stsToken) { headers['x-oss-security-token'] = this.options.stsToken; } - copy(params.headers).to(headers); - if (!getHeader(headers, 'Content-Type')) { if (params.mime && params.mime.indexOf('/') > 0) { headers['Content-Type'] = params.mime; @@ -7554,11 +6365,9 @@ function createRequest(params) { headers['Content-Type'] = mime.getType(params.mime || path.extname(params.object || '')); } } - if (!getHeader(headers, 'Content-Type')) { delHeader(headers, 'Content-Type'); } - if (params.content) { if (!params.disabledMD5) { if (!params.headers || !params.headers['Content-MD5']) { @@ -7567,33 +6376,46 @@ function createRequest(params) { headers['Content-MD5'] = params.headers['Content-MD5']; } } - if (!headers['Content-Length']) { headers['Content-Length'] = params.content.length; } } - var hasOwnProperty = Object.prototype.hasOwnProperty; - for (var k in headers) { if (headers[k] && hasOwnProperty.call(headers, k)) { headers[k] = encoder(String(headers[k]), this.options.headerEncoding); } } - - var authResource = this._getResource(params); - - headers.authorization = this.authorization(params.method, authResource, params.subres, headers, this.options.headerEncoding); // const url = this._getReqUrl(params); - + var queries = {}; + if (_isString(params.subres)) { + queries[params.subres] = null; + } else if (_isArray(params.subres)) { + params.subres.forEach(function (v) { + queries[v] = null; + }); + } else if (_isObject(params.subres)) { + Object.entries(params.subres).forEach(function (v) { + queries[v[0]] = v[1] === '' ? null : v[1]; + }); + } + if (_isObject(params.query)) { + Object.entries(params.query).forEach(function (v) { + queries[v[0]] = v[1]; + }); + } + headers.authorization = this.options.authorizationV4 ? this.authorizationV4(params.method, { + headers: headers, + queries: queries + }, params.bucket, params.object, params.additionalHeaders) : this.authorization(params.method, this._getResource(params), params.subres, headers, this.options.headerEncoding); + // const url = this._getReqUrl(params); if (isIP(this.options.endpoint.hostname)) { var _this$options = this.options, - region = _this$options.region, - internal = _this$options.internal, - secure = _this$options.secure; + region = _this$options.region, + internal = _this$options.internal, + secure = _this$options.secure; var hostInfo = setRegion(region, internal, secure); headers.host = "".concat(params.bucket, ".").concat(hostInfo.host); } - var url = getReqUrl.bind(this)(params); debug('request %s %s, with headers %j, !!stream: %s', params.method, url, headers, !!params.stream); var timeout = params.timeout || this.options.timeout; @@ -7607,15 +6429,12 @@ function createRequest(params) { customResponse: params.customResponse, ctx: params.ctx || this.ctx }; - if (this.agent) { reqParams.agent = this.agent; } - if (this.httpsAgent) { reqParams.httpsAgent = this.httpsAgent; } - reqParams.enableProxy = !!this.options.enableProxy; reqParams.proxy = this.options.proxy ? this.options.proxy : null; return { @@ -7623,61 +6442,50 @@ function createRequest(params) { params: reqParams }; } - exports.createRequest = createRequest; }).call(this)}).call(this,require("buffer").Buffer) -},{"../client/getReqUrl":25,"./../../../shims/crypto/crypto.js":461,"./encoder":59,"./isDingTalk":66,"./isIP":69,"./setRegion":75,"buffer":90,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.string.includes.js":302,"dateformat":342,"debug":465,"mime":374,"path":378}],57:[function(require,module,exports){ +},{"../client/getReqUrl":25,"./../../../shims/crypto/crypto.js":533,"./encoder":61,"./isDingTalk":69,"./isIP":72,"./setRegion":78,"buffer":103,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.string.includes.js":344,"core-js/modules/web.dom-collections.for-each.js":382,"dateformat":385,"debug":538,"lodash/isArray":424,"lodash/isObject":425,"lodash/isString":427,"mime":432,"path":441}],58:[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.entries.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - require("core-js/modules/es.array.includes.js"); - require("core-js/modules/es.object.keys.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.dataFix = void 0; - var isObject_1 = require("./isObject"); - var TRUE = ['true', 'TRUE', '1', 1]; var FALSE = ['false', 'FALSE', '0', 0]; - function dataFix(o, conf, finalKill) { if (!isObject_1.isObject(o)) return; var _conf$remove = conf.remove, - remove = _conf$remove === void 0 ? [] : _conf$remove, - _conf$rename = conf.rename, - rename = _conf$rename === void 0 ? {} : _conf$rename, - _conf$camel = conf.camel, - camel = _conf$camel === void 0 ? [] : _conf$camel, - _conf$bool = conf.bool, - bool = _conf$bool === void 0 ? [] : _conf$bool, - _conf$lowerFirst = conf.lowerFirst, - lowerFirst = _conf$lowerFirst === void 0 ? false : _conf$lowerFirst; // 删除不需要的数据 - + remove = _conf$remove === void 0 ? [] : _conf$remove, + _conf$rename = conf.rename, + rename = _conf$rename === void 0 ? {} : _conf$rename, + _conf$camel = conf.camel, + camel = _conf$camel === void 0 ? [] : _conf$camel, + _conf$bool = conf.bool, + bool = _conf$bool === void 0 ? [] : _conf$bool, + _conf$lowerFirst = conf.lowerFirst, + lowerFirst = _conf$lowerFirst === void 0 ? false : _conf$lowerFirst; + // 删除不需要的数据 remove.forEach(function (v) { return delete o[v]; - }); // 重命名 - + }); + // 重命名 Object.entries(rename).forEach(function (v) { if (!o[v[0]]) return; if (o[v[1]]) return; o[v[1]] = o[v[0]]; delete o[v[0]]; - }); // 驼峰化 - + }); + // 驼峰化 camel.forEach(function (v) { if (!o[v]) return; var afterKey = v.replace(/^(.)/, function ($0) { @@ -7686,38 +6494,34 @@ function dataFix(o, conf, finalKill) { return $1.toUpperCase(); }); if (o[afterKey]) return; - o[afterKey] = o[v]; // todo 暂时兼容以前数据,不做删除 + o[afterKey] = o[v]; + // todo 暂时兼容以前数据,不做删除 // delete o[v]; - }); // 转换值为布尔值 - + }); + // 转换值为布尔值 bool.forEach(function (v) { o[v] = fixBool(o[v]); - }); // finalKill - + }); + // finalKill if (typeof finalKill === 'function') { finalKill(o); - } // 首字母转小写 - - + } + // 首字母转小写 fixLowerFirst(o, lowerFirst); return dataFix; } - exports.dataFix = dataFix; - function fixBool(value) { if (!value) return false; if (TRUE.includes(value)) return true; return FALSE.includes(value) ? false : value; } - function fixLowerFirst(o, lowerFirst) { if (lowerFirst) { Object.keys(o).forEach(function (key) { var lowerK = key.replace(/^\w/, function (match) { return match.toLowerCase(); }); - if (typeof o[lowerK] === 'undefined') { o[lowerK] = o[key]; delete o[key]; @@ -7726,64 +6530,49 @@ function fixLowerFirst(o, lowerFirst) { } } -},{"./isObject":70,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.entries.js":288,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],58:[function(require,module,exports){ +},{"./isObject":73,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382}],59:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - require("core-js/modules/es.array.slice.js"); - 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"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - Object.defineProperty(exports, "__esModule", { value: true }); 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]); }); return copy; }; - 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 { @@ -7791,132 +6580,127 @@ exports.deepCopyWith = function (obj, customizer) { } }; -},{"./isBuffer":65,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],59:[function(require,module,exports){ -(function (Buffer){(function (){ +},{"./isBuffer":68,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/web.dom-collections.for-each.js":382}],60:[function(require,module,exports){ "use strict"; +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.regexp.to-string.js"); +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encodeString = void 0; +var toString_1 = __importDefault(require("lodash/toString")); +function encodeString(str) { + var tempStr = toString_1.default(str); + return encodeURIComponent(tempStr).replace(/[!'()*]/g, function (c) { + return "%".concat(c.charCodeAt(0).toString(16).toUpperCase()); + }); +} +exports.encodeString = encodeString; + +},{"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347,"lodash/toString":429}],61:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true }); exports.encoder = void 0; - function encoder(str) { var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utf-8'; if (encoding === 'utf-8') return str; return Buffer.from(str).toString('latin1'); } - exports.encoder = encoder; }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":90,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],60:[function(require,module,exports){ +},{"buffer":103,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341}],62:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.formatInventoryConfig = void 0; - var dataFix_1 = require("../utils/dataFix"); - var isObject_1 = require("../utils/isObject"); - var isArray_1 = require("../utils/isArray"); - var formatObjKey_1 = require("../utils/formatObjKey"); - function formatInventoryConfig(inventoryConfig) { var toArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (toArray && isObject_1.isObject(inventoryConfig)) inventoryConfig = [inventoryConfig]; - if (isArray_1.isArray(inventoryConfig)) { inventoryConfig = inventoryConfig.map(formatFn); } else { inventoryConfig = formatFn(inventoryConfig); } - return inventoryConfig; } - exports.formatInventoryConfig = formatInventoryConfig; - function formatFn(_) { dataFix_1.dataFix(_, { bool: ['IsEnabled'] }, function (conf) { - var _a, _b; // prefix - - + var _a, _b; + // prefix conf.prefix = conf.Filter.Prefix; - delete conf.Filter; // OSSBucketDestination - - conf.OSSBucketDestination = conf.Destination.OSSBucketDestination; // OSSBucketDestination.rolename - + delete conf.Filter; + // OSSBucketDestination + conf.OSSBucketDestination = conf.Destination.OSSBucketDestination; + // OSSBucketDestination.rolename conf.OSSBucketDestination.rolename = conf.OSSBucketDestination.RoleArn.replace(/.*\//, ''); - delete conf.OSSBucketDestination.RoleArn; // OSSBucketDestination.bucket - + delete conf.OSSBucketDestination.RoleArn; + // OSSBucketDestination.bucket conf.OSSBucketDestination.bucket = conf.OSSBucketDestination.Bucket.replace(/.*:::/, ''); delete conf.OSSBucketDestination.Bucket; - delete conf.Destination; // frequency - + delete conf.Destination; + // frequency conf.frequency = conf.Schedule.Frequency; - delete conf.Schedule.Frequency; // optionalFields - + delete conf.Schedule.Frequency; + // optionalFields if (((_a = conf === null || conf === void 0 ? void 0 : conf.OptionalFields) === null || _a === void 0 ? void 0 : _a.Field) && !isArray_1.isArray((_b = conf.OptionalFields) === null || _b === void 0 ? void 0 : _b.Field)) conf.OptionalFields.Field = [conf.OptionalFields.Field]; - }); // firstLowerCase - + }); + // firstLowerCase _ = formatObjKey_1.formatObjKey(_, 'firstLowerCase', { exclude: ['OSSBucketDestination', 'SSE-OSS', 'SSE-KMS'] }); return _; } -},{"../utils/dataFix":57,"../utils/formatObjKey":61,"../utils/isArray":63,"../utils/isObject":70,"core-js/modules/es.array.map.js":280,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305}],61:[function(require,module,exports){ +},{"../utils/dataFix":58,"../utils/formatObjKey":63,"../utils/isArray":66,"../utils/isObject":73,"core-js/modules/es.array.map.js":318,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.replace.js":347}],63:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - 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"); - require("core-js/modules/es.array.includes.js"); - require("core-js/modules/es.string.includes.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.formatObjKey = void 0; - function formatObjKey(obj, type, options) { if (obj === null || (0, _typeof2.default)(obj) !== 'object') { return obj; } - var o; - if (Array.isArray(obj)) { o = []; - for (var i = 0; i < obj.length; i++) { o.push(formatObjKey(obj[i], type, options)); } @@ -7926,15 +6710,11 @@ function formatObjKey(obj, type, options) { o[handelFormat(key, type, options)] = formatObjKey(obj[key], type, options); }); } - return o; } - exports.formatObjKey = formatObjKey; - function handelFormat(key, type, options) { if (options && options.exclude && options.exclude.includes(key)) return key; - if (type === 'firstUpperCase') { key = key.replace(/^./, function (_) { return _.toUpperCase(); @@ -7944,67 +6724,71 @@ function handelFormat(key, type, options) { return _.toLowerCase(); }); } - return key; } -},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.includes.js":302,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],62:[function(require,module,exports){ +},{"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.includes.js":344,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382}],64:[function(require,module,exports){ "use strict"; require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getStandardRegion = void 0; +function getStandardRegion(str) { + return str.replace(/^oss-/g, ''); +} +exports.getStandardRegion = getStandardRegion; + +},{"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.replace.js":347}],65:[function(require,module,exports){ +"use strict"; +require("core-js/modules/es.regexp.exec.js"); Object.defineProperty(exports, "__esModule", { value: true }); exports.getStrBytesCount = void 0; - function getStrBytesCount(str) { var bytesCount = 0; - for (var i = 0; i < str.length; i++) { var c = str.charAt(i); - if (/^[\u00-\uff]$/.test(c)) { bytesCount += 1; } else { bytesCount += 2; } } - return bytesCount; } - exports.getStrBytesCount = getStrBytesCount; -},{"core-js/modules/es.regexp.exec.js":300}],63:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":340}],66:[function(require,module,exports){ "use strict"; require("core-js/modules/es.object.to-string.js"); - +require("core-js/modules/es.regexp.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true }); exports.isArray = void 0; - exports.isArray = function (obj) { return Object.prototype.toString.call(obj) === '[object Array]'; }; -},{"core-js/modules/es.object.to-string.js":291}],64:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341}],67:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isBlob = void 0; - function isBlob(blob) { return typeof Blob !== 'undefined' && blob instanceof Blob; } - exports.isBlob = isBlob; -},{}],65:[function(require,module,exports){ +},{}],68:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -8012,171 +6796,136 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isBuffer = void 0; - function isBuffer(obj) { return Buffer.isBuffer(obj); } - exports.isBuffer = isBuffer; }).call(this)}).call(this,{"isBuffer":require("../../../node_modules/is-buffer/index.js")}) -},{"../../../node_modules/is-buffer/index.js":366}],66:[function(require,module,exports){ +},{"../../../node_modules/is-buffer/index.js":411}],69:[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"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.isDingTalk = void 0; - function isDingTalk() { if (process.browser && window.navigator.userAgent.toLowerCase().includes('aliapp(dingtalk')) { return true; } - return false; } - exports.isDingTalk = isDingTalk; }).call(this)}).call(this,require('_process')) -},{"_process":467,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.string.includes.js":302}],67:[function(require,module,exports){ +},{"_process":540,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.string.includes.js":344}],70:[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; }; -},{}],68:[function(require,module,exports){ +},{}],71:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFunction = void 0; - exports.isFunction = function (v) { return typeof v === 'function'; }; -},{}],69:[function(require,module,exports){ +},{}],72:[function(require,module,exports){ "use strict"; require("core-js/modules/es.regexp.exec.js"); - Object.defineProperty(exports, "__esModule", { value: true }); -exports.isIP = void 0; // it provide commont methods for node and browser , we will add more solutions later in this file - +exports.isIP = void 0; +// it provide commont methods for node and browser , we will add more solutions later in this file /** * Judge isIP include ipv4 or ipv6 * @param {String} options * @return {Array} the multipart uploads */ - exports.isIP = function (host) { var ipv4Regex = /^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/; var ipv6Regex = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; return ipv4Regex.test(host) || ipv6Regex.test(host); }; -},{"core-js/modules/es.regexp.exec.js":300}],70:[function(require,module,exports){ +},{"core-js/modules/es.regexp.exec.js":340}],73:[function(require,module,exports){ "use strict"; require("core-js/modules/es.object.to-string.js"); - +require("core-js/modules/es.regexp.to-string.js"); Object.defineProperty(exports, "__esModule", { value: true }); exports.isObject = void 0; - exports.isObject = function (obj) { return Object.prototype.toString.call(obj) === '[object Object]'; }; -},{"core-js/modules/es.object.to-string.js":291}],71:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341}],74:[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":70,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],72:[function(require,module,exports){ +},{"./isObject":73,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/web.dom-collections.for-each.js":382}],75:[function(require,module,exports){ "use strict"; require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - require("core-js/modules/es.object.to-string.js"); - +require("core-js/modules/es.regexp.to-string.js"); require("core-js/modules/web.dom-collections.for-each.js"); - require("core-js/modules/es.object.keys.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.array.join.js"); - require("core-js/modules/es.array.map.js"); - -require("core-js/modules/es.regexp.to-string.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.obj2xml = void 0; - var formatObjKey_1 = require("./formatObjKey"); - function type(params) { return Object.prototype.toString.call(params).replace(/(.*? |])/g, '').toLowerCase(); } - function obj2xml(obj, options) { var s = ''; - if (options && options.headers) { s = '\n'; } - if (options && options.firstUpperCase) { obj = formatObjKey_1.formatObjKey(obj, 'firstUpperCase'); } - if (type(obj) === 'object') { Object.keys(obj).forEach(function (key) { // filter undefined or null @@ -8197,56 +6946,37 @@ function obj2xml(obj, options) { } else { s += obj.toString(); } - return s; } - exports.obj2xml = obj2xml; -},{"./formatObjKey":61,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.map.js":280,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],73:[function(require,module,exports){ +},{"./formatObjKey":63,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.map.js":318,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382}],76:[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.regexp.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; } - +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; - + _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var path = _step.value; @@ -8257,39 +6987,32 @@ function omit(originalObject, keysToOmit) { } finally { _iterator.f(); } - return cloneObject; } - exports.omit = omit; -},{"core-js/modules/es.array.from.js":276,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.iterator.js":303,"core-js/modules/es.symbol.description.js":310,"core-js/modules/es.symbol.iterator.js":312,"core-js/modules/es.symbol.js":313,"core-js/modules/web.dom-collections.iterator.js":340}],74:[function(require,module,exports){ +},{"core-js/modules/es.array.from.js":314,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.iterator.js":345,"core-js/modules/es.symbol.description.js":353,"core-js/modules/es.symbol.iterator.js":355,"core-js/modules/es.symbol.js":356,"core-js/modules/web.dom-collections.iterator.js":383}],77:[function(require,module,exports){ "use strict"; require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.promise.js"); - Object.defineProperty(exports, "__esModule", { value: true }); exports.retry = void 0; - function retry(func, retryMax) { var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var retryNum = 0; var _config$retryDelay = config.retryDelay, - retryDelay = _config$retryDelay === void 0 ? 500 : _config$retryDelay, - _config$errorHandler = config.errorHandler, - errorHandler = _config$errorHandler === void 0 ? function () { - return true; - } : _config$errorHandler; - + retryDelay = _config$retryDelay === void 0 ? 500 : _config$retryDelay, + _config$errorHandler = config.errorHandler, + errorHandler = _config$errorHandler === void 0 ? function () { + return true; + } : _config$errorHandler; var funcR = function funcR() { for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) { arg[_key] = arguments[_key]; } - return new Promise(function (resolve, reject) { func.apply(void 0, arg).then(function (result) { retryNum = 0; @@ -8307,13 +7030,11 @@ function retry(func, retryMax) { }); }); }; - return funcR; } - exports.retry = retry; -},{"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295}],75:[function(require,module,exports){ +},{"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335}],78:[function(require,module,exports){ "use strict"; var __importDefault = void 0 && (void 0).__importDefault || function (mod) { @@ -8321,118 +7042,88 @@ var __importDefault = void 0 && (void 0).__importDefault || function (mod) { "default": mod }; }; - Object.defineProperty(exports, "__esModule", { value: true }); exports.setRegion = void 0; - var url_1 = __importDefault(require("url")); - var checkConfigValid_1 = require("./checkConfigValid"); - function setRegion(region) { var internal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var secure = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; checkConfigValid_1.checkConfigValid(region, 'region'); var protocol = secure ? 'https://' : 'http://'; var suffix = internal ? '-internal.aliyuncs.com' : '.aliyuncs.com'; - var prefix = 'vpc100-oss-cn-'; // aliyun VPC region: https://help.aliyun.com/knowledge_detail/38740.html - + var prefix = 'vpc100-oss-cn-'; + // aliyun VPC region: https://help.aliyun.com/knowledge_detail/38740.html if (region.substr(0, prefix.length) === prefix) { suffix = '.aliyuncs.com'; } - return url_1.default.parse(protocol + region + suffix); } - exports.setRegion = setRegion; -},{"./checkConfigValid":52,"url":472}],76:[function(require,module,exports){ +},{"./checkConfigValid":53,"url":545}],79:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - require("core-js/modules/es.object.keys.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.array.find.js"); - require("core-js/modules/es.object.assign.js"); - var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - Object.defineProperty(exports, "__esModule", { value: true }); exports.checkCredentials = exports.setSTSToken = void 0; - var formatObjKey_1 = require("./formatObjKey"); - function setSTSToken() { return _setSTSToken.apply(this, arguments); } - function _setSTSToken() { _setSTSToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var now, credentials; return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (!this.options) this.options = {}; - 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 7: - credentials = _context.sent; - credentials = formatObjKey_1.formatObjKey(credentials, 'firstLowerCase'); - - if (credentials.securityToken) { - credentials.stsToken = credentials.securityToken; - } - - checkCredentials(credentials); - Object.assign(this.options, credentials); - - case 12: - _context.next = 15; + while (1) switch (_context.prev = _context.next) { + case 0: + if (!this.options) this.options = {}; + now = new Date(); + if (!this.stsTokenFreshTime) { + _context.next = 14; break; - - case 14: - this.stsTokenFreshTime = now; - - case 15: - return _context.abrupt("return", null); - - case 16: - case "end": - return _context.stop(); - } + } + if (!(+now - this.stsTokenFreshTime >= this.options.refreshSTSTokenInterval)) { + _context.next = 12; + break; + } + this.stsTokenFreshTime = now; + _context.next = 7; + return this.options.refreshSTSToken(); + case 7: + credentials = _context.sent; + credentials = formatObjKey_1.formatObjKey(credentials, 'firstLowerCase'); + if (credentials.securityToken) { + credentials.stsToken = credentials.securityToken; + } + checkCredentials(credentials); + Object.assign(this.options, credentials); + 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(); } }, _callee, this); })); return _setSTSToken.apply(this, arguments); } - exports.setSTSToken = setSTSToken; - function checkCredentials(obj) { var stsTokenKey = ['accessKeySecret', 'accessKeyId', 'stsToken']; var objKeys = Object.keys(obj); @@ -8444,10 +7135,22 @@ function checkCredentials(obj) { } }); } - exports.checkCredentials = checkCredentials; -},{"./formatObjKey":61,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.find.js":275,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291}],77:[function(require,module,exports){ +},{"./formatObjKey":63,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.find.js":313,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331}],80:[function(require,module,exports){ +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; +} +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],81:[function(require,module,exports){ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return arrayLikeToArray(arr); +} +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./arrayLikeToArray.js":80}],82:[function(require,module,exports){ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); @@ -8456,70 +7159,449 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { reject(error); return; } - if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - function _asyncToGenerator(fn) { return function () { var self = this, - args = arguments; + args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); - function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } - function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } - _next(undefined); }); }; } - module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; -},{}],78:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ +var toPropertyKey = require("./toPropertyKey.js"); +function _defineProperty(obj, key, value) { + key = toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./toPropertyKey.js":90}],84:[function(require,module,exports){ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; -},{}],79:[function(require,module,exports){ -function _typeof(obj) { +},{}],85:[function(require,module,exports){ +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],86:[function(require,module,exports){ +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],87:[function(require,module,exports){ +var _typeof = require("./typeof.js")["default"]; +function _regeneratorRuntime() { + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; +} +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./typeof.js":91}],88:[function(require,module,exports){ +var arrayWithoutHoles = require("./arrayWithoutHoles.js"); +var iterableToArray = require("./iterableToArray.js"); +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var nonIterableSpread = require("./nonIterableSpread.js"); +function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); +} +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./arrayWithoutHoles.js":81,"./iterableToArray.js":85,"./nonIterableSpread.js":86,"./unsupportedIterableToArray.js":92}],89:[function(require,module,exports){ +var _typeof = require("./typeof.js")["default"]; +function toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./typeof.js":91}],90:[function(require,module,exports){ +var _typeof = require("./typeof.js")["default"]; +var toPrimitive = require("./toPrimitive.js"); +function toPropertyKey(t) { + var i = toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : String(i); +} +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./toPrimitive.js":89,"./typeof.js":91}],91:[function(require,module,exports){ +function _typeof(o) { "@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); + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); } - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; -},{}],80:[function(require,module,exports){ -module.exports = require("regenerator-runtime"); +},{}],92:[function(require,module,exports){ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +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); +} +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./arrayLikeToArray.js":80}],93:[function(require,module,exports){ +// TODO(Babel 8): Remove this file. + +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) { + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } +} -},{"regenerator-runtime":395}],81:[function(require,module,exports){ +},{"../helpers/regeneratorRuntime":87}],94:[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 () {} -},{}],82:[function(require,module,exports){ +},{}],95:[function(require,module,exports){ (function (global){(function (){ 'use strict'; -var objectAssign = require('object-assign'); +var objectAssign = require('object.assign/polyfill')(); // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: @@ -9025,7 +8107,7 @@ var objectKeys = Object.keys || function (obj) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"object-assign":377,"util/":85}],83:[function(require,module,exports){ +},{"object.assign/polyfill":440,"util/":98}],96:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -9050,14 +8132,14 @@ if (typeof Object.create === 'function') { } } -},{}],84:[function(require,module,exports){ +},{}],97:[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'; } -},{}],85:[function(require,module,exports){ +},{}],98:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -9647,7 +8729,7 @@ function hasOwnProperty(obj, prop) { } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":84,"_process":467,"inherits":83}],86:[function(require,module,exports){ +},{"./support/isBuffer":97,"_process":540,"inherits":96}],99:[function(require,module,exports){ (function (global){(function (){ 'use strict'; @@ -9678,7 +8760,7 @@ module.exports = function availableTypedArrays() { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],87:[function(require,module,exports){ +},{}],100:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -9830,7 +8912,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],88:[function(require,module,exports){ +},{}],101:[function(require,module,exports){ /*! * Bowser - a browser detector * https://github.com/ded/bowser @@ -10476,9 +9558,9 @@ function fromByteArray (uint8) { return bowser }); -},{}],89:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ -},{}],90:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ (function (Buffer){(function (){ /*! * The buffer module from node.js, for the browser. @@ -12259,7 +11341,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"base64-js":87,"buffer":90,"ieee754":357}],91:[function(require,module,exports){ +},{"base64-js":100,"buffer":103,"ieee754":402}],104:[function(require,module,exports){ module.exports = { "100": "Continue", "101": "Switching Protocols", @@ -12325,7 +11407,7 @@ module.exports = { "511": "Network Authentication Required" } -},{}],92:[function(require,module,exports){ +},{}],105:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('get-intrinsic'); @@ -12342,17 +11424,18 @@ module.exports = function callBoundIntrinsic(name, allowMissing) { return intrinsic; }; -},{"./":93,"get-intrinsic":348}],93:[function(require,module,exports){ +},{"./":106,"get-intrinsic":392}],106:[function(require,module,exports){ 'use strict'; var bind = require('function-bind'); var GetIntrinsic = require('get-intrinsic'); +var setFunctionLength = require('set-function-length'); +var $TypeError = GetIntrinsic('%TypeError%'); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); var $max = GetIntrinsic('%Math.max%'); @@ -12366,19 +11449,15 @@ if ($defineProperty) { } module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } + if (typeof originalFunction !== 'function') { + throw new $TypeError('a function is required'); } - return func; + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); }; var applyBind = function applyBind() { @@ -12391,7 +11470,7 @@ if ($defineProperty) { module.exports.apply = applyBind; } -},{"function-bind":347,"get-intrinsic":348}],94:[function(require,module,exports){ +},{"function-bind":391,"get-intrinsic":392,"set-function-length":468}],107:[function(require,module,exports){ /*! * copy-to - index.js * Copyright(c) 2014 dead_horse @@ -12554,56 +11633,57 @@ function notDefined(obj, key) { && obj.__lookupSetter__(key) === undefined; } -},{}],95:[function(require,module,exports){ -var global = require('../internals/global'); +},{}],108:[function(require,module,exports){ +'use strict'; var isCallable = require('../internals/is-callable'); var tryToString = require('../internals/try-to-string'); -var TypeError = global.TypeError; +var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument; - throw TypeError(tryToString(argument) + ' is not a function'); + throw new $TypeError(tryToString(argument) + ' is not a function'); }; -},{"../internals/global":163,"../internals/is-callable":176,"../internals/try-to-string":257}],96:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/is-callable":203,"../internals/try-to-string":293}],109:[function(require,module,exports){ +'use strict'; var isConstructor = require('../internals/is-constructor'); var tryToString = require('../internals/try-to-string'); -var TypeError = global.TypeError; +var $TypeError = TypeError; // `Assert: IsConstructor(argument) is true` module.exports = function (argument) { if (isConstructor(argument)) return argument; - throw TypeError(tryToString(argument) + ' is not a constructor'); + throw new $TypeError(tryToString(argument) + ' is not a constructor'); }; -},{"../internals/global":163,"../internals/is-constructor":177,"../internals/try-to-string":257}],97:[function(require,module,exports){ -var global = require('../internals/global'); -var isCallable = require('../internals/is-callable'); +},{"../internals/is-constructor":204,"../internals/try-to-string":293}],110:[function(require,module,exports){ +'use strict'; +var isPossiblePrototype = require('../internals/is-possible-prototype'); -var String = global.String; -var TypeError = global.TypeError; +var $String = String; +var $TypeError = TypeError; module.exports = function (argument) { - if (typeof argument == 'object' || isCallable(argument)) return argument; - throw TypeError("Can't set " + String(argument) + ' as a prototype'); + if (isPossiblePrototype(argument)) return argument; + throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; -},{"../internals/global":163,"../internals/is-callable":176}],98:[function(require,module,exports){ +},{"../internals/is-possible-prototype":209}],111:[function(require,module,exports){ +'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var create = require('../internals/object-create'); -var definePropertyModule = require('../internals/object-define-property'); +var defineProperty = require('../internals/object-define-property').f; var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables -if (ArrayPrototype[UNSCOPABLES] == undefined) { - definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { +if (ArrayPrototype[UNSCOPABLES] === undefined) { + defineProperty(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); @@ -12614,7 +11694,7 @@ module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; -},{"../internals/object-create":196,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],99:[function(require,module,exports){ +},{"../internals/object-create":229,"../internals/object-define-property":231,"../internals/well-known-symbol":306}],112:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; @@ -12624,37 +11704,51 @@ module.exports = function (S, index, unicode) { return index + (unicode ? charAt(S, index).length : 1); }; -},{"../internals/string-multibyte":239}],100:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/string-multibyte":271}],113:[function(require,module,exports){ +'use strict'; var isPrototypeOf = require('../internals/object-is-prototype-of'); -var TypeError = global.TypeError; +var $TypeError = TypeError; module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; - throw TypeError('Incorrect invocation'); + throw new $TypeError('Incorrect invocation'); }; -},{"../internals/global":163,"../internals/object-is-prototype-of":204}],101:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/object-is-prototype-of":238}],114:[function(require,module,exports){ +'use strict'; var isObject = require('../internals/is-object'); -var String = global.String; -var TypeError = global.TypeError; +var $String = String; +var $TypeError = TypeError; // `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument; - throw TypeError(String(argument) + ' is not an object'); + throw new $TypeError($String(argument) + ' is not an object'); }; -},{"../internals/global":163,"../internals/is-object":180}],102:[function(require,module,exports){ -// eslint-disable-next-line es-x/no-typed-arrays -- safe +},{"../internals/is-object":208}],115:[function(require,module,exports){ +'use strict'; +// eslint-disable-next-line es/no-typed-arrays -- safe module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; -},{}],103:[function(require,module,exports){ +},{}],116:[function(require,module,exports){ +'use strict'; +// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it +var fails = require('../internals/fails'); + +module.exports = fails(function () { + if (typeof ArrayBuffer == 'function') { + var buffer = new ArrayBuffer(8); + // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe + if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); + } +}); + +},{"../internals/fails":171}],117:[function(require,module,exports){ 'use strict'; -var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native'); +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'); @@ -12663,14 +11757,17 @@ 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 redefine = require('../internals/redefine'); -var defineProperty = require('../internals/object-define-property').f; +var defineBuiltIn = require('../internals/define-built-in'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); 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 enforceInternalState = InternalStateModule.enforce; +var getInternalState = InternalStateModule.get; var Int8Array = global.Int8Array; var Int8ArrayPrototype = Int8Array && Int8Array.prototype; var Uint8ClampedArray = global.Uint8ClampedArray; @@ -12682,7 +11779,7 @@ var TypeError = global.TypeError; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); -var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR'); +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; @@ -12713,6 +11810,13 @@ var isView = function isView(it) { || 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); +}; + var isTypedArray = function (it) { if (!isObject(it)) return false; var klass = classof(it); @@ -12722,12 +11826,12 @@ var isTypedArray = function (it) { var aTypedArray = function (it) { if (isTypedArray(it)) return it; - throw TypeError('Target is not a typed array'); + throw new TypeError('Target is not a typed array'); }; var aTypedArrayConstructor = function (C) { if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C; - throw TypeError(tryToString(C) + ' is not a typed array constructor'); + throw new TypeError(tryToString(C) + ' is not a typed array constructor'); }; var exportTypedArrayMethod = function (KEY, property, forced, options) { @@ -12744,7 +11848,7 @@ var exportTypedArrayMethod = function (KEY, property, forced, options) { } } if (!TypedArrayPrototype[KEY] || forced) { - redefine(TypedArrayPrototype, KEY, forced ? property + defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options); } }; @@ -12762,14 +11866,14 @@ var exportTypedArrayStaticMethod = function (KEY, property, forced) { 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 && TypedArray[KEY] || property); + 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)) { - redefine(TypedArrayConstructor, KEY, property); + defineBuiltIn(TypedArrayConstructor, KEY, property); } } }; @@ -12777,21 +11881,21 @@ var exportTypedArrayStaticMethod = function (KEY, property, forced) { for (NAME in TypedArrayConstructorsList) { Constructor = global[NAME]; Prototype = Constructor && Constructor.prototype; - if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor); + 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) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor); + 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'); + throw new TypeError('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); @@ -12812,9 +11916,12 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== 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; - } }); + defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, { + configurable: true, + get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + } + }); for (NAME in TypedArrayConstructorsList) if (global[NAME]) { createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); } @@ -12822,51 +11929,54 @@ if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { module.exports = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, - TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR, 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 }; -},{"../internals/array-buffer-native":102,"../internals/classof":124,"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/global":163,"../internals/has-own-property":164,"../internals/is-callable":176,"../internals/is-object":180,"../internals/object-define-property":198,"../internals/object-get-prototype-of":203,"../internals/object-is-prototype-of":204,"../internals/object-set-prototype-of":208,"../internals/redefine":222,"../internals/try-to-string":257,"../internals/uid":263,"../internals/well-known-symbol":268}],104:[function(require,module,exports){ +},{"../internals/array-buffer-basic-detection":115,"../internals/classof":138,"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/global":188,"../internals/has-own-property":189,"../internals/internal-state":199,"../internals/is-callable":203,"../internals/is-object":208,"../internals/object-get-prototype-of":236,"../internals/object-is-prototype-of":238,"../internals/object-set-prototype-of":242,"../internals/try-to-string":293,"../internals/uid":299,"../internals/well-known-symbol":306}],118:[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-native'); +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 redefineAll = require('../internals/redefine-all'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +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 fround = require('../internals/math-fround'); 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 arraySlice = require('../internals/array-slice'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var copyConstructorProperties = require('../internals/copy-constructor-properties'); var setToStringTag = require('../internals/set-to-string-tag'); var InternalStateModule = require('../internals/internal-state'); 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 getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER); +var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW); +var setInternalState = InternalStateModule.set; var NativeArrayBuffer = global[ARRAY_BUFFER]; var $ArrayBuffer = NativeArrayBuffer; var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; @@ -12898,35 +12008,42 @@ var unpackInt32 = function (buffer) { }; var packFloat32 = function (number) { - return packIEEE754(number, 23, 4); + return packIEEE754(fround(number), 23, 4); }; var packFloat64 = function (number) { return packIEEE754(number, 52, 8); }; -var addGetter = function (Constructor, key) { - defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } }); +var addGetter = function (Constructor, key, getInternalState) { + defineBuiltInAccessor(Constructor[PROTOTYPE], key, { + configurable: true, + get: function () { + return getInternalState(this)[key]; + } + }); }; var get = function (view, count, index, isLittleEndian) { + var store = getInternalDataViewState(view); var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; + var boolIsLittleEndian = !!isLittleEndian; + if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX); + var bytes = store.bytes; var start = intIndex + store.byteOffset; var pack = arraySlice(bytes, start, start + count); - return isLittleEndian ? pack : reverse(pack); + return boolIsLittleEndian ? pack : reverse(pack); }; var set = function (view, count, index, conversion, value, isLittleEndian) { + var store = getInternalDataViewState(view); 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 boolIsLittleEndian = !!isLittleEndian; + if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX); + var bytes = store.bytes; + var start = intIndex + store.byteOffset; + for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1]; }; if (!NATIVE_ARRAY_BUFFER) { @@ -12934,10 +12051,14 @@ if (!NATIVE_ARRAY_BUFFER) { anInstance(this, ArrayBufferPrototype); var byteLength = toIndex(length); setInternalState(this, { + type: ARRAY_BUFFER, bytes: fill(Array(byteLength), 0), byteLength: byteLength }); - if (!DESCRIPTORS) this.byteLength = byteLength; + if (!DESCRIPTORS) { + this.byteLength = byteLength; + this.detached = false; + } }; ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE]; @@ -12945,15 +12066,18 @@ if (!NATIVE_ARRAY_BUFFER) { $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance(this, DataViewPrototype); anInstance(buffer, ArrayBufferPrototype); - var bufferLength = getInternalState(buffer).byteLength; + var bufferState = getInternalArrayBufferState(buffer); + var bufferLength = bufferState.byteLength; var offset = toIntegerOrInfinity(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); + if (offset < 0 || offset > bufferLength) throw new RangeError('Wrong offset'); byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + if (offset + byteLength > bufferLength) throw new RangeError(WRONG_LENGTH); setInternalState(this, { + type: DATA_VIEW, buffer: buffer, byteLength: byteLength, - byteOffset: offset + byteOffset: offset, + bytes: bufferState.bytes }); if (!DESCRIPTORS) { this.buffer = buffer; @@ -12965,13 +12089,13 @@ if (!NATIVE_ARRAY_BUFFER) { DataViewPrototype = $DataView[PROTOTYPE]; if (DESCRIPTORS) { - addGetter($ArrayBuffer, 'byteLength'); - addGetter($DataView, 'buffer'); - addGetter($DataView, 'byteLength'); - addGetter($DataView, 'byteOffset'); + addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState); + addGetter($DataView, 'buffer', getInternalDataViewState); + addGetter($DataView, 'byteLength', getInternalDataViewState); + addGetter($DataView, 'byteOffset', getInternalDataViewState); } - redefineAll(DataViewPrototype, { + defineBuiltIns(DataViewPrototype, { getInt8: function getInt8(byteOffset) { return get(this, 1, byteOffset)[0] << 24 >> 24; }, @@ -12979,24 +12103,24 @@ if (!NATIVE_ARRAY_BUFFER) { return get(this, 1, byteOffset)[0]; }, getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false); 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); + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false); return bytes[1] << 8 | bytes[0]; }, getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)); }, getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0; }, getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); + return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23); }, getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); + return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52); }, setInt8: function setInt8(byteOffset, value) { set(this, 1, byteOffset, packInt8, value); @@ -13005,22 +12129,22 @@ if (!NATIVE_ARRAY_BUFFER) { set(this, 1, byteOffset, packInt8, value); }, setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false); }, setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false); }, setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false); }, setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false); }, setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false); }, setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false); } }); } else { @@ -13034,23 +12158,19 @@ if (!NATIVE_ARRAY_BUFFER) { new NativeArrayBuffer(); new NativeArrayBuffer(1.5); new NativeArrayBuffer(NaN); - return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; + return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; })) { - /* eslint-enable no-new -- required for testing */ + /* eslint-enable no-new -- required for testing */ $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, ArrayBufferPrototype); - return new NativeArrayBuffer(toIndex(length)); + return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer); }; $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype; - for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) { - createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); - } - } - ArrayBufferPrototype.constructor = $ArrayBuffer; + + copyConstructorProperties($ArrayBuffer, NativeArrayBuffer); } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER); } @@ -13065,7 +12185,7 @@ if (!NATIVE_ARRAY_BUFFER) { var $setInt8 = uncurryThis(DataViewPrototype.setInt8); testView.setInt8(0, 2147483648); testView.setInt8(1, 2147483649); - if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll(DataViewPrototype, { + if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, { setInt8: function setInt8(byteOffset, value) { $setInt8(this, byteOffset, value << 24 >> 24); }, @@ -13083,17 +12203,18 @@ module.exports = { DataView: $DataView }; -},{"../internals/an-instance":100,"../internals/array-buffer-native":102,"../internals/array-fill":106,"../internals/array-slice-simple":116,"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/fails":150,"../internals/function-name":156,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/ieee754":169,"../internals/internal-state":173,"../internals/object-define-property":198,"../internals/object-get-own-property-names":201,"../internals/object-get-prototype-of":203,"../internals/object-set-prototype-of":208,"../internals/redefine-all":221,"../internals/set-to-string-tag":234,"../internals/to-index":246,"../internals/to-integer-or-infinity":248,"../internals/to-length":249}],105:[function(require,module,exports){ +},{"../internals/an-instance":113,"../internals/array-buffer-basic-detection":115,"../internals/array-fill":120,"../internals/array-slice":131,"../internals/copy-constructor-properties":141,"../internals/create-non-enumerable-property":145,"../internals/define-built-in-accessor":148,"../internals/define-built-ins":150,"../internals/descriptors":153,"../internals/fails":171,"../internals/function-name":178,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/ieee754":194,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/math-fround":222,"../internals/object-get-prototype-of":236,"../internals/object-set-prototype-of":242,"../internals/set-to-string-tag":266,"../internals/to-index":281,"../internals/to-integer-or-infinity":283,"../internals/to-length":284}],119:[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'); var min = Math.min; // `Array.prototype.copyWithin` method implementation // https://tc39.es/ecma262/#sec-array.prototype.copywithin -// eslint-disable-next-line es-x/no-array-prototype-copywithin -- safe +// 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); @@ -13109,13 +12230,13 @@ module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* } while (count-- > 0) { if (from in O) O[to] = O[from]; - else delete O[to]; + else deletePropertyOrThrow(O, to); to += inc; from += inc; } return O; }; -},{"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-object":250}],106:[function(require,module,exports){ +},{"../internals/delete-property-or-throw":152,"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-object":285}],120:[function(require,module,exports){ 'use strict'; var toObject = require('../internals/to-object'); var toAbsoluteIndex = require('../internals/to-absolute-index'); @@ -13134,7 +12255,7 @@ module.exports = function fill(value /* , start = 0, end = @length */) { return O; }; -},{"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-object":250}],107:[function(require,module,exports){ +},{"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-object":285}],121:[function(require,module,exports){ 'use strict'; var $forEach = require('../internals/array-iteration').forEach; var arrayMethodIsStrict = require('../internals/array-method-is-strict'); @@ -13145,23 +12266,23 @@ var STRICT_METHOD = arrayMethodIsStrict('forEach'); // 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-x/no-array-prototype-foreach -- safe +// eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach; -},{"../internals/array-iteration":111,"../internals/array-method-is-strict":114}],108:[function(require,module,exports){ +},{"../internals/array-iteration":125,"../internals/array-method-is-strict":128}],122:[function(require,module,exports){ +'use strict'; var lengthOfArrayLike = require('../internals/length-of-array-like'); -module.exports = function (Constructor, list) { +module.exports = function (Constructor, list, $length) { var index = 0; - var length = lengthOfArrayLike(list); + var length = arguments.length > 2 ? $length : lengthOfArrayLike(list); var result = new Constructor(length); while (length > index) result[index] = list[index++]; return result; }; -},{"../internals/length-of-array-like":188}],109:[function(require,module,exports){ +},{"../internals/length-of-array-like":219}],123:[function(require,module,exports){ 'use strict'; -var global = require('../internals/global'); var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var toObject = require('../internals/to-object'); @@ -13173,7 +12294,7 @@ var createProperty = require('../internals/create-property'); var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); -var Array = global.Array; +var $Array = Array; // `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from @@ -13188,7 +12309,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef 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))) { + if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { iterator = getIterator(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; @@ -13198,7 +12319,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef } } else { length = lengthOfArrayLike(O); - result = IS_CONSTRUCTOR ? new this(length) : Array(length); + result = IS_CONSTRUCTOR ? new this(length) : $Array(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); @@ -13208,7 +12329,8 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef return result; }; -},{"../internals/call-with-safe-iteration-closing":121,"../internals/create-property":131,"../internals/function-bind-context":153,"../internals/function-call":155,"../internals/get-iterator":160,"../internals/get-iterator-method":159,"../internals/global":163,"../internals/is-array-iterator-method":174,"../internals/is-constructor":177,"../internals/length-of-array-like":188,"../internals/to-object":250}],110:[function(require,module,exports){ +},{"../internals/call-with-safe-iteration-closing":135,"../internals/create-property":147,"../internals/function-bind-context":175,"../internals/function-call":177,"../internals/get-iterator":184,"../internals/get-iterator-method":183,"../internals/is-array-iterator-method":200,"../internals/is-constructor":204,"../internals/length-of-array-like":219,"../internals/to-object":285}],124:[function(require,module,exports){ +'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var toAbsoluteIndex = require('../internals/to-absolute-index'); var lengthOfArrayLike = require('../internals/length-of-array-like'); @@ -13222,10 +12344,10 @@ var createMethod = function (IS_INCLUDES) { 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) { + 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; + 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; @@ -13242,7 +12364,8 @@ module.exports = { indexOf: createMethod(false) }; -},{"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-indexed-object":247}],111:[function(require,module,exports){ +},{"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-indexed-object":282}],125:[function(require,module,exports){ +'use strict'; var bind = require('../internals/function-bind-context'); var uncurryThis = require('../internals/function-uncurry-this'); var IndexedObject = require('../internals/indexed-object'); @@ -13254,18 +12377,18 @@ var push = uncurryThis([].push); // `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; + 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 boundFunction = bind(callbackfn, that); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; @@ -13317,9 +12440,9 @@ module.exports = { filterReject: createMethod(7) }; -},{"../internals/array-species-create":120,"../internals/function-bind-context":153,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/length-of-array-like":188,"../internals/to-object":250}],112:[function(require,module,exports){ +},{"../internals/array-species-create":134,"../internals/function-bind-context":175,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/length-of-array-like":219,"../internals/to-object":285}],126:[function(require,module,exports){ 'use strict'; -/* eslint-disable es-x/no-array-prototype-lastindexof -- safe */ +/* 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'); @@ -13346,7 +12469,8 @@ module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[ return -1; } : $lastIndexOf; -},{"../internals/array-method-is-strict":114,"../internals/function-apply":152,"../internals/length-of-array-like":188,"../internals/to-indexed-object":247,"../internals/to-integer-or-infinity":248}],113:[function(require,module,exports){ +},{"../internals/array-method-is-strict":128,"../internals/function-apply":174,"../internals/length-of-array-like":219,"../internals/to-indexed-object":282,"../internals/to-integer-or-infinity":283}],127:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/engine-v8-version'); @@ -13367,7 +12491,7 @@ module.exports = function (METHOD_NAME) { }); }; -},{"../internals/engine-v8-version":146,"../internals/fails":150,"../internals/well-known-symbol":268}],114:[function(require,module,exports){ +},{"../internals/engine-v8-version":167,"../internals/fails":171,"../internals/well-known-symbol":306}],128:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); @@ -13379,22 +12503,22 @@ module.exports = function (METHOD_NAME, argument) { }); }; -},{"../internals/fails":150}],115:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/fails":171}],129:[function(require,module,exports){ +'use strict'; 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'); -var TypeError = global.TypeError; +var $TypeError = TypeError; // `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); + aCallable(callbackfn); var index = IS_RIGHT ? length - 1 : 0; var i = IS_RIGHT ? -1 : 1; if (argumentsLength < 2) while (true) { @@ -13405,7 +12529,7 @@ var createMethod = function (IS_RIGHT) { } index += i; if (IS_RIGHT ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); + throw new $TypeError('Reduce of empty array with no initial value'); } } for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { @@ -13424,85 +12548,94 @@ module.exports = { right: createMethod(true) }; -},{"../internals/a-callable":95,"../internals/global":163,"../internals/indexed-object":170,"../internals/length-of-array-like":188,"../internals/to-object":250}],116:[function(require,module,exports){ -var global = require('../internals/global'); -var toAbsoluteIndex = require('../internals/to-absolute-index'); -var lengthOfArrayLike = require('../internals/length-of-array-like'); -var createProperty = require('../internals/create-property'); +},{"../internals/a-callable":108,"../internals/indexed-object":195,"../internals/length-of-array-like":219,"../internals/to-object":285}],130:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var isArray = require('../internals/is-array'); -var Array = global.Array; -var max = Math.max; +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; -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; +// 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; + } +}(); + +module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { + if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) { + throw new $TypeError('Cannot set read only .length'); + } return O.length = length; +} : function (O, length) { + return O.length = length; }; -},{"../internals/create-property":131,"../internals/global":163,"../internals/length-of-array-like":188,"../internals/to-absolute-index":245}],117:[function(require,module,exports){ +},{"../internals/descriptors":153,"../internals/is-array":201}],131:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis([].slice); -},{"../internals/function-uncurry-this":157}],118:[function(require,module,exports){ -var arraySlice = require('../internals/array-slice-simple'); +},{"../internals/function-uncurry-this":181}],132:[function(require,module,exports){ +'use strict'; +var arraySlice = require('../internals/array-slice'); var floor = Math.floor; -var mergeSort = function (array, comparefn) { +var sort = 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 - ); -}; -var insertionSort = function (array, comparefn) { - var length = array.length; - var i = 1; - var element, j; + if (length < 8) { + // insertion sort + var i = 1; + var element, j; - while (i < length) { - j = i; - element = array[i]; - while (j && comparefn(array[j - 1], element) > 0) { - array[j] = array[--j]; + 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; } - if (j !== i++) array[j] = element; - } return array; -}; + } else { + // merge sort + var middle = floor(length / 2); + var left = sort(arraySlice(array, 0, middle), comparefn); + var right = sort(arraySlice(array, middle), comparefn); + var llength = left.length; + var rlength = right.length; + var lindex = 0; + var rindex = 0; -var merge = function (array, left, right, comparefn) { - var llength = left.length; - var rlength = right.length; - var lindex = 0; - var rindex = 0; + 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++]; + } + } - 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; + return array; }; -module.exports = mergeSort; +module.exports = sort; -},{"../internals/array-slice-simple":116}],119:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/array-slice":131}],133:[function(require,module,exports){ +'use strict'; 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'); var SPECIES = wellKnownSymbol('species'); -var Array = global.Array; +var $Array = Array; // a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate @@ -13511,15 +12644,16 @@ module.exports = function (originalArray) { if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback - if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined; + 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; + } return C === undefined ? $Array : C; }; -},{"../internals/global":163,"../internals/is-array":175,"../internals/is-constructor":177,"../internals/is-object":180,"../internals/well-known-symbol":268}],120:[function(require,module,exports){ +},{"../internals/is-array":201,"../internals/is-constructor":204,"../internals/is-object":208,"../internals/well-known-symbol":306}],134:[function(require,module,exports){ +'use strict'; var arraySpeciesConstructor = require('../internals/array-species-constructor'); // `ArraySpeciesCreate` abstract operation @@ -13528,7 +12662,8 @@ module.exports = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; -},{"../internals/array-species-constructor":119}],121:[function(require,module,exports){ +},{"../internals/array-species-constructor":133}],135:[function(require,module,exports){ +'use strict'; var anObject = require('../internals/an-object'); var iteratorClose = require('../internals/iterator-close'); @@ -13541,7 +12676,8 @@ module.exports = function (iterator, fn, value, ENTRIES) { } }; -},{"../internals/an-object":101,"../internals/iterator-close":185}],122:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/iterator-close":214}],136:[function(require,module,exports){ +'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); @@ -13560,12 +12696,14 @@ try { iteratorWithReturn[ITERATOR] = function () { return this; }; - // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing + // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { /* empty */ } module.exports = function (exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + try { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + } catch (error) { return false; } // workaround of old WebKit + `eval` bug var ITERATION_SUPPORT = false; try { var object = {}; @@ -13581,7 +12719,8 @@ module.exports = function (exec, SKIP_CLOSING) { return ITERATION_SUPPORT; }; -},{"../internals/well-known-symbol":268}],123:[function(require,module,exports){ +},{"../internals/well-known-symbol":306}],137:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toString = uncurryThis({}.toString); @@ -13591,18 +12730,18 @@ module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; -},{"../internals/function-uncurry-this":157}],124:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/function-uncurry-this":181}],138:[function(require,module,exports){ +'use strict'; 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'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); -var Object = global.Object; +var $Object = Object; // ES3 wrong here -var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; +var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { @@ -13616,14 +12755,331 @@ 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 + : 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; + : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; +}; + +},{"../internals/classof-raw":137,"../internals/is-callable":203,"../internals/to-string-tag-support":290,"../internals/well-known-symbol":306}],139:[function(require,module,exports){ +'use strict'; +var create = require('../internals/object-create'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var defineBuiltIns = require('../internals/define-built-ins'); +var bind = require('../internals/function-bind-context'); +var anInstance = require('../internals/an-instance'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var iterate = require('../internals/iterate'); +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); +var setSpecies = require('../internals/set-species'); +var DESCRIPTORS = require('../internals/descriptors'); +var fastKey = require('../internals/internal-metadata').fastKey; +var InternalStateModule = require('../internals/internal-state'); + +var setInternalState = InternalStateModule.set; +var internalStateGetterFor = InternalStateModule.getterFor; + +module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var Constructor = wrapper(function (that, iterable) { + anInstance(that, Prototype); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + index: create(null), + first: undefined, + last: undefined, + size: 0 + }); + if (!DESCRIPTORS) that.size = 0; + if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); + }); + + var Prototype = Constructor.prototype; + + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, index; + // change existing entry + if (entry) { + entry.value = value; + // create new entry + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: undefined, + removed: false + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (DESCRIPTORS) state.size++; + else that.size++; + // add to index + if (index !== 'F') state.index[index] = entry; + } return that; + }; + + var getEntry = function (that, key) { + var state = getInternalState(that); + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return state.index[index]; + // frozen object case + for (entry = state.first; entry; entry = entry.next) { + if (entry.key === key) return entry; + } + }; + + defineBuiltIns(Prototype, { + // `{ Map, Set }.prototype.clear()` methods + // https://tc39.es/ecma262/#sec-map.prototype.clear + // https://tc39.es/ecma262/#sec-set.prototype.clear + clear: function clear() { + var that = this; + var state = getInternalState(that); + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) entry.previous = entry.previous.next = undefined; + entry = entry.next; + } + state.first = state.last = undefined; + state.index = create(null); + if (DESCRIPTORS) state.size = 0; + else that.size = 0; + }, + // `{ Map, Set }.prototype.delete(key)` methods + // https://tc39.es/ecma262/#sec-map.prototype.delete + // https://tc39.es/ecma262/#sec-set.prototype.delete + 'delete': function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first === entry) state.first = next; + if (state.last === entry) state.last = prev; + if (DESCRIPTORS) state.size--; + else that.size--; + } return !!entry; + }, + // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods + // https://tc39.es/ecma262/#sec-map.prototype.foreach + // https://tc39.es/ecma262/#sec-set.prototype.foreach + forEach: function forEach(callbackfn /* , that = undefined */) { + var state = getInternalState(this); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); + var entry; + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + } + }, + // `{ Map, Set}.prototype.has(key)` methods + // https://tc39.es/ecma262/#sec-map.prototype.has + // https://tc39.es/ecma262/#sec-set.prototype.has + has: function has(key) { + return !!getEntry(this, key); + } + }); + + defineBuiltIns(Prototype, IS_MAP ? { + // `Map.prototype.get(key)` method + // https://tc39.es/ecma262/#sec-map.prototype.get + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // `Map.prototype.set(key, value)` method + // https://tc39.es/ecma262/#sec-map.prototype.set + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } : { + // `Set.prototype.add(value)` method + // https://tc39.es/ecma262/#sec-set.prototype.add + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', { + configurable: true, + get: function () { + return getInternalState(this).size; + } + }); + return Constructor; + }, + setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; + var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods + // https://tc39.es/ecma262/#sec-map.prototype.entries + // https://tc39.es/ecma262/#sec-map.prototype.keys + // https://tc39.es/ecma262/#sec-map.prototype.values + // https://tc39.es/ecma262/#sec-map.prototype-@@iterator + // https://tc39.es/ecma262/#sec-set.prototype.entries + // https://tc39.es/ecma262/#sec-set.prototype.keys + // https://tc39.es/ecma262/#sec-set.prototype.values + // https://tc39.es/ecma262/#sec-set.prototype-@@iterator + defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { + setInternalState(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined + }); + }, function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + // or finish the iteration + state.target = undefined; + return createIterResultObject(undefined, true); + } + // return step by kind + if (kind === 'keys') return createIterResultObject(entry.key, false); + if (kind === 'values') return createIterResultObject(entry.value, false); + return createIterResultObject([entry.key, entry.value], false); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // `{ Map, Set }.prototype[@@species]` accessors + // https://tc39.es/ecma262/#sec-get-map-@@species + // https://tc39.es/ecma262/#sec-get-set-@@species + setSpecies(CONSTRUCTOR_NAME); + } +}; + +},{"../internals/an-instance":113,"../internals/create-iter-result-object":144,"../internals/define-built-in-accessor":148,"../internals/define-built-ins":150,"../internals/descriptors":153,"../internals/function-bind-context":175,"../internals/internal-metadata":198,"../internals/internal-state":199,"../internals/is-null-or-undefined":207,"../internals/iterate":213,"../internals/iterator-define":216,"../internals/object-create":229,"../internals/set-species":265}],140:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +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 InternalMetadataModule = require('../internals/internal-metadata'); +var iterate = require('../internals/iterate'); +var anInstance = require('../internals/an-instance'); +var isCallable = require('../internals/is-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var isObject = require('../internals/is-object'); +var fails = require('../internals/fails'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var setToStringTag = require('../internals/set-to-string-tag'); +var inheritIfRequired = require('../internals/inherit-if-required'); + +module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; + var ADDER = IS_MAP ? 'set' : 'add'; + var NativeConstructor = global[CONSTRUCTOR_NAME]; + var NativePrototype = NativeConstructor && NativeConstructor.prototype; + var Constructor = NativeConstructor; + var exported = {}; + + var fixMethod = function (KEY) { + var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); + defineBuiltIn(NativePrototype, KEY, + KEY === 'add' ? function add(value) { + uncurriedNativeMethod(this, value === 0 ? 0 : value); + return this; + } : KEY === 'delete' ? function (key) { + return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); + } : KEY === 'get' ? function get(key) { + return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); + } : KEY === 'has' ? function has(key) { + return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); + } : function set(key, value) { + uncurriedNativeMethod(this, key === 0 ? 0 : key, value); + return this; + } + ); + }; + + var REPLACE = isForced( + CONSTRUCTOR_NAME, + !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + })) + ); + + if (REPLACE) { + // create collection constructor + Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); + InternalMetadataModule.enable(); + } else if (isForced(CONSTRUCTOR_NAME, true)) { + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + // eslint-disable-next-line no-new -- required for testing + var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new NativeConstructor(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + + if (!ACCEPT_ITERABLES) { + Constructor = wrapper(function (dummy, iterable) { + anInstance(dummy, NativePrototype); + var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); + if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); + return that; + }); + Constructor.prototype = NativePrototype; + NativePrototype.constructor = Constructor; + } + + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + + // weak collections should not contains .clear method + if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; + } + + exported[CONSTRUCTOR_NAME] = Constructor; + $({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); + + setToStringTag(Constructor, CONSTRUCTOR_NAME); + + if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + + return Constructor; }; -},{"../internals/classof-raw":123,"../internals/global":163,"../internals/is-callable":176,"../internals/to-string-tag-support":255,"../internals/well-known-symbol":268}],125:[function(require,module,exports){ +},{"../internals/an-instance":113,"../internals/check-correctness-of-iteration":136,"../internals/define-built-in":149,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/inherit-if-required":196,"../internals/internal-metadata":198,"../internals/is-callable":203,"../internals/is-forced":205,"../internals/is-null-or-undefined":207,"../internals/is-object":208,"../internals/iterate":213,"../internals/set-to-string-tag":266}],141:[function(require,module,exports){ +'use strict'; var hasOwn = require('../internals/has-own-property'); var ownKeys = require('../internals/own-keys'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); @@ -13641,7 +13097,8 @@ module.exports = function (target, source, exceptions) { } }; -},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/own-keys":212}],126:[function(require,module,exports){ +},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/own-keys":246}],142:[function(require,module,exports){ +'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); @@ -13658,35 +13115,27 @@ module.exports = function (METHOD_NAME) { } return false; }; -},{"../internals/well-known-symbol":268}],127:[function(require,module,exports){ +},{"../internals/well-known-symbol":306}],143:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; - // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing + // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); -},{"../internals/fails":150}],128:[function(require,module,exports){ +},{"../internals/fails":171}],144:[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, 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; +// `CreateIterResultObject` abstract operation +// https://tc39.es/ecma262/#sec-createiterresultobject +module.exports = function (value, done) { + return { value: value, done: done }; }; -},{"../internals/create-property-descriptor":130,"../internals/iterators":187,"../internals/iterators-core":186,"../internals/object-create":196,"../internals/set-to-string-tag":234}],129:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); @@ -13698,7 +13147,8 @@ module.exports = DESCRIPTORS ? function (object, key, value) { return object; }; -},{"../internals/create-property-descriptor":130,"../internals/descriptors":134,"../internals/object-define-property":198}],130:[function(require,module,exports){ +},{"../internals/create-property-descriptor":146,"../internals/descriptors":153,"../internals/object-define-property":231}],146:[function(require,module,exports){ +'use strict'; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), @@ -13708,7 +13158,7 @@ module.exports = function (bitmap, value) { }; }; -},{}],131:[function(require,module,exports){ +},{}],147:[function(require,module,exports){ 'use strict'; var toPropertyKey = require('../internals/to-property-key'); var definePropertyModule = require('../internals/object-define-property'); @@ -13720,130 +13170,93 @@ module.exports = function (object, key, value) { else object[propertyKey] = value; }; -},{"../internals/create-property-descriptor":130,"../internals/object-define-property":198,"../internals/to-property-key":254}],132:[function(require,module,exports){ +},{"../internals/create-property-descriptor":146,"../internals/object-define-property":231,"../internals/to-property-key":289}],148:[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/create-iterator-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 redefine = require('../internals/redefine'); -var wellKnownSymbol = require('../internals/well-known-symbol'); -var Iterators = require('../internals/iterators'); -var IteratorsCore = require('../internals/iterators-core'); +var makeBuiltIn = require('../internals/make-built-in'); +var defineProperty = require('../internals/object-define-property'); -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'; - -var returnThis = function () { return this; }; - -module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - - 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 = function (target, name, descriptor) { + if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); + if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); + return defineProperty.f(target, name, descriptor); +}; - 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; +},{"../internals/make-built-in":220,"../internals/object-define-property":231}],149:[function(require,module,exports){ +'use strict'; +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; +}; - // 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])) { - redefine(CurrentIteratorPrototype, ITERATOR, returnThis); - } - } - // Set @@toStringTag to native iterators - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; - } - } +},{"../internals/define-global-property":151,"../internals/is-callable":203,"../internals/make-built-in":220,"../internals/object-define-property":231}],150:[function(require,module,exports){ +'use strict'; +var defineBuiltIn = require('../internals/define-built-in'); - // 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); }; - } - } +module.exports = function (target, src, options) { + for (var key in src) defineBuiltIn(target, key, src[key], options); + return target; +}; - // 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); - } +},{"../internals/define-built-in":149}],151:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); - // define iterator - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); - } - Iterators[NAME] = defaultIterator; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; - return methods; +module.exports = function (key, value) { + try { + defineProperty(global, key, { value: value, configurable: true, writable: true }); + } catch (error) { + global[key] = value; + } return value; }; -},{"../internals/create-iterator-constructor":128,"../internals/create-non-enumerable-property":129,"../internals/export":149,"../internals/function-call":155,"../internals/function-name":156,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/iterators":187,"../internals/iterators-core":186,"../internals/object-get-prototype-of":203,"../internals/object-set-prototype-of":208,"../internals/redefine":222,"../internals/set-to-string-tag":234,"../internals/well-known-symbol":268}],133:[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; +},{"../internals/global":188}],152:[function(require,module,exports){ +'use strict'; +var tryToString = require('../internals/try-to-string'); -module.exports = function (NAME) { - var Symbol = path.Symbol || (path.Symbol = {}); - if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { - value: wrappedWellKnownSymbolModule.f(NAME) - }); +var $TypeError = TypeError; + +module.exports = function (O, P) { + if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); }; -},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/path":213,"../internals/well-known-symbol-wrapped":267}],134:[function(require,module,exports){ +},{"../internals/try-to-string":293}],153:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing - return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); -},{"../internals/fails":150}],135:[function(require,module,exports){ +},{"../internals/fails":171}],154:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); var isObject = require('../internals/is-object'); @@ -13855,7 +13268,18 @@ module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; -},{"../internals/global":163,"../internals/is-object":180}],136:[function(require,module,exports){ +},{"../internals/global":188,"../internals/is-object":208}],155:[function(require,module,exports){ +'use strict'; +var $TypeError = TypeError; +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 + +module.exports = function (it) { + if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); + return it; +}; + +},{}],156:[function(require,module,exports){ +'use strict'; // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods module.exports = { @@ -13892,7 +13316,8 @@ module.exports = { TouchList: 0 }; -},{}],137:[function(require,module,exports){ +},{}],157:[function(require,module,exports){ +'use strict'; // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` var documentCreateElement = require('../internals/document-create-element'); @@ -13901,49 +13326,66 @@ var DOMTokenListPrototype = classList && classList.constructor && classList.cons module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; -},{"../internals/document-create-element":135}],138:[function(require,module,exports){ +},{"../internals/document-create-element":154}],158:[function(require,module,exports){ +'use strict'; var userAgent = require('../internals/engine-user-agent'); var firefox = userAgent.match(/firefox\/(\d+)/i); module.exports = !!firefox && +firefox[1]; -},{"../internals/engine-user-agent":145}],139:[function(require,module,exports){ -module.exports = typeof window == 'object' && typeof Deno != 'object'; +},{"../internals/engine-user-agent":166}],159:[function(require,module,exports){ +'use strict'; +var IS_DENO = require('../internals/engine-is-deno'); +var IS_NODE = require('../internals/engine-is-node'); + +module.exports = !IS_DENO && !IS_NODE + && typeof window == 'object' + && typeof document == 'object'; -},{}],140:[function(require,module,exports){ +},{"../internals/engine-is-deno":160,"../internals/engine-is-node":164}],160:[function(require,module,exports){ +'use strict'; +/* global Deno -- Deno case */ +module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; + +},{}],161:[function(require,module,exports){ +'use strict'; var UA = require('../internals/engine-user-agent'); module.exports = /MSIE|Trident/.test(UA); -},{"../internals/engine-user-agent":145}],141:[function(require,module,exports){ +},{"../internals/engine-user-agent":166}],162:[function(require,module,exports){ +'use strict'; var userAgent = require('../internals/engine-user-agent'); -var global = require('../internals/global'); -module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined; +module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; -},{"../internals/engine-user-agent":145,"../internals/global":163}],142:[function(require,module,exports){ +},{"../internals/engine-user-agent":166}],163:[function(require,module,exports){ +'use strict'; var userAgent = require('../internals/engine-user-agent'); +// eslint-disable-next-line redos/no-vulnerable -- safe module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); -},{"../internals/engine-user-agent":145}],143:[function(require,module,exports){ -var classof = require('../internals/classof-raw'); +},{"../internals/engine-user-agent":166}],164:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); +var classof = require('../internals/classof-raw'); -module.exports = classof(global.process) == 'process'; +module.exports = classof(global.process) === 'process'; -},{"../internals/classof-raw":123,"../internals/global":163}],144:[function(require,module,exports){ +},{"../internals/classof-raw":137,"../internals/global":188}],165:[function(require,module,exports){ +'use strict'; var userAgent = require('../internals/engine-user-agent'); module.exports = /web0s(?!.*chrome)/i.test(userAgent); -},{"../internals/engine-user-agent":145}],145:[function(require,module,exports){ -var getBuiltIn = require('../internals/get-built-in'); - -module.exports = getBuiltIn('navigator', 'userAgent') || ''; +},{"../internals/engine-user-agent":166}],166:[function(require,module,exports){ +'use strict'; +module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; -},{"../internals/get-built-in":158}],146:[function(require,module,exports){ +},{}],167:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); var userAgent = require('../internals/engine-user-agent'); @@ -13972,14 +13414,16 @@ if (!version && userAgent) { module.exports = version; -},{"../internals/engine-user-agent":145,"../internals/global":163}],147:[function(require,module,exports){ +},{"../internals/engine-user-agent":166,"../internals/global":188}],168:[function(require,module,exports){ +'use strict'; var userAgent = require('../internals/engine-user-agent'); var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); module.exports = !!webkit && +webkit[1]; -},{"../internals/engine-user-agent":145}],148:[function(require,module,exports){ +},{"../internals/engine-user-agent":166}],169:[function(require,module,exports){ +'use strict'; // IE8- don't enum bug keys module.exports = [ 'constructor', @@ -13991,29 +13435,30 @@ module.exports = [ 'valueOf' ]; -},{}],149:[function(require,module,exports){ +},{}],170:[function(require,module,exports){ +'use strict'; 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 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.noTargetGet - prevent calling a getter on target - options.name - the .name of the function if it does not match the key + 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; @@ -14023,13 +13468,13 @@ module.exports = function (options, source) { if (GLOBAL) { target = global; } else if (STATIC) { - target = global[TARGET] || setGlobal(TARGET, {}); + target = global[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; - if (options.noTargetGet) { + if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; @@ -14043,12 +13488,12 @@ module.exports = function (options, source) { if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } - // extend global - redefine(target, key, sourceProperty, options); + defineBuiltIn(target, key, sourceProperty, options); } }; -},{"../internals/copy-constructor-properties":125,"../internals/create-non-enumerable-property":129,"../internals/global":163,"../internals/is-forced":178,"../internals/object-get-own-property-descriptor":199,"../internals/redefine":222,"../internals/set-global":232}],150:[function(require,module,exports){ +},{"../internals/copy-constructor-properties":141,"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/define-global-property":151,"../internals/global":188,"../internals/is-forced":205,"../internals/object-get-own-property-descriptor":232}],171:[function(require,module,exports){ +'use strict'; module.exports = function (exec) { try { return !!exec(); @@ -14057,12 +13502,12 @@ module.exports = function (exec) { } }; -},{}],151:[function(require,module,exports){ +},{}],172:[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 redefine = require('../internals/redefine'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); +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'); @@ -14078,7 +13523,7 @@ module.exports = function (KEY, exec, FORCED, SHAM) { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; + return ''[KEY](O) !== 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { @@ -14099,7 +13544,10 @@ module.exports = function (KEY, exec, FORCED, SHAM) { re[SYMBOL] = /./[SYMBOL]; } - re.exec = function () { execCalled = true; return null; }; + re.exec = function () { + execCalled = true; + return null; + }; re[SYMBOL](''); return !execCalled; @@ -14126,27 +13574,38 @@ module.exports = function (KEY, exec, FORCED, SHAM) { return { done: false }; }); - redefine(String.prototype, KEY, methods[0]); - redefine(RegExpPrototype, SYMBOL, methods[1]); + defineBuiltIn(String.prototype, KEY, methods[0]); + defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]); } if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true); }; -},{"../internals/create-non-enumerable-property":129,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/redefine":222,"../internals/regexp-exec":224,"../internals/well-known-symbol":268,"../modules/es.regexp.exec":300}],152:[function(require,module,exports){ +},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/fails":171,"../internals/function-uncurry-this-clause":180,"../internals/regexp-exec":256,"../internals/well-known-symbol":306,"../modules/es.regexp.exec":340}],173:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); + +module.exports = !fails(function () { + // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing + return Object.isExtensible(Object.preventExtensions({})); +}); + +},{"../internals/fails":171}],174:[function(require,module,exports){ +'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; var call = FunctionPrototype.call; -// eslint-disable-next-line es-x/no-reflect -- safe +// 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); }); -},{"../internals/function-bind-native":154}],153:[function(require,module,exports){ -var uncurryThis = require('../internals/function-uncurry-this'); +},{"../internals/function-bind-native":176}],175:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this-clause'); var aCallable = require('../internals/a-callable'); var NATIVE_BIND = require('../internals/function-bind-native'); @@ -14160,17 +13619,19 @@ module.exports = function (fn, that) { }; }; -},{"../internals/a-callable":95,"../internals/function-bind-native":154,"../internals/function-uncurry-this":157}],154:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/function-bind-native":176,"../internals/function-uncurry-this-clause":180}],176:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { - // eslint-disable-next-line es-x/no-function-prototype-bind -- safe + // 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'); }); -},{"../internals/fails":150}],155:[function(require,module,exports){ +},{"../internals/fails":171}],177:[function(require,module,exports){ +'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var call = Function.prototype.call; @@ -14179,12 +13640,13 @@ module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; -},{"../internals/function-bind-native":154}],156:[function(require,module,exports){ +},{"../internals/function-bind-native":176}],178:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var hasOwn = require('../internals/has-own-property'); var FunctionPrototype = Function.prototype; -// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); @@ -14198,23 +13660,46 @@ module.exports = { CONFIGURABLE: CONFIGURABLE }; -},{"../internals/descriptors":134,"../internals/has-own-property":164}],157:[function(require,module,exports){ +},{"../internals/descriptors":153,"../internals/has-own-property":189}],179:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var aCallable = require('../internals/a-callable'); + +module.exports = function (object, key, method) { + try { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); + } catch (error) { /* empty */ } +}; + +},{"../internals/a-callable":108,"../internals/function-uncurry-this":181}],180:[function(require,module,exports){ +'use strict'; +var classofRaw = require('../internals/classof-raw'); +var uncurryThis = require('../internals/function-uncurry-this'); + +module.exports = function (fn) { + // Nashorn bug: + // https://github.com/zloirock/core-js/issues/1128 + // https://github.com/zloirock/core-js/issues/1130 + if (classofRaw(fn) === 'Function') return uncurryThis(fn); +}; + +},{"../internals/classof-raw":137,"../internals/function-uncurry-this":181}],181:[function(require,module,exports){ +'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; -var bind = FunctionPrototype.bind; var call = FunctionPrototype.call; -var uncurryThis = NATIVE_BIND && bind.bind(call, call); +var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); -module.exports = NATIVE_BIND ? function (fn) { - return fn && uncurryThis(fn); -} : function (fn) { - return fn && function () { +module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { + return function () { return call.apply(fn, arguments); }; }; -},{"../internals/function-bind-native":154}],158:[function(require,module,exports){ +},{"../internals/function-bind-native":176}],182:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); var isCallable = require('../internals/is-callable'); @@ -14226,47 +13711,84 @@ module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; }; -},{"../internals/global":163,"../internals/is-callable":176}],159:[function(require,module,exports){ +},{"../internals/global":188,"../internals/is-callable":203}],183:[function(require,module,exports){ +'use strict'; 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 ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { - if (it != undefined) return getMethod(it, ITERATOR) + if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; -},{"../internals/classof":124,"../internals/get-method":161,"../internals/iterators":187,"../internals/well-known-symbol":268}],160:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/classof":138,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/iterators":218,"../internals/well-known-symbol":306}],184:[function(require,module,exports){ +'use strict'; 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'); -var TypeError = global.TypeError; +var $TypeError = TypeError; 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'); + throw new $TypeError(tryToString(argument) + ' is not iterable'); +}; + +},{"../internals/a-callable":108,"../internals/an-object":114,"../internals/function-call":177,"../internals/get-iterator-method":183,"../internals/try-to-string":293}],185:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var isArray = require('../internals/is-array'); +var isCallable = require('../internals/is-callable'); +var classof = require('../internals/classof-raw'); +var toString = require('../internals/to-string'); + +var push = uncurryThis([].push); + +module.exports = function (replacer) { + if (isCallable(replacer)) return replacer; + if (!isArray(replacer)) return; + var rawLength = replacer.length; + var keys = []; + for (var i = 0; i < rawLength; i++) { + var element = replacer[i]; + if (typeof element == 'string') push(keys, element); + else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element)); + } + var keysLength = keys.length; + var root = true; + return function (key, value) { + if (root) { + root = false; + return value; + } + if (isArray(this)) return value; + for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value; + }; }; -},{"../internals/a-callable":95,"../internals/an-object":101,"../internals/function-call":155,"../internals/get-iterator-method":159,"../internals/global":163,"../internals/try-to-string":257}],161:[function(require,module,exports){ +},{"../internals/classof-raw":137,"../internals/function-uncurry-this":181,"../internals/is-array":201,"../internals/is-callable":203,"../internals/to-string":291}],186:[function(require,module,exports){ +'use strict'; var aCallable = require('../internals/a-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod module.exports = function (V, P) { var func = V[P]; - return func == null ? undefined : aCallable(func); + return isNullOrUndefined(func) ? undefined : aCallable(func); }; -},{"../internals/a-callable":95}],162:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/is-null-or-undefined":207}],187:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toObject = require('../internals/to-object'); @@ -14274,6 +13796,7 @@ var floor = Math.floor; var charAt = uncurryThis(''.charAt); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); +// eslint-disable-next-line redos/no-vulnerable -- safe var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; @@ -14312,25 +13835,28 @@ module.exports = function (matched, str, position, captures, namedCaptures, repl }); }; -},{"../internals/function-uncurry-this":157,"../internals/to-object":250}],163:[function(require,module,exports){ +},{"../internals/function-uncurry-this":181,"../internals/to-object":285}],188:[function(require,module,exports){ (function (global){(function (){ +'use strict'; var check = function (it) { - return it && it.Math == Math && it; + return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = - // eslint-disable-next-line es-x/no-global-this -- safe + // 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) || + check(typeof this == 'object' && this) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],164:[function(require,module,exports){ +},{}],189:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toObject = require('../internals/to-object'); @@ -14338,47 +13864,48 @@ var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty -// eslint-disable-next-line es-x/no-object-hasown -- safe +// eslint-disable-next-line es/no-object-hasown -- safe module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; -},{"../internals/function-uncurry-this":157,"../internals/to-object":250}],165:[function(require,module,exports){ +},{"../internals/function-uncurry-this":181,"../internals/to-object":285}],190:[function(require,module,exports){ +'use strict'; module.exports = {}; -},{}],166:[function(require,module,exports){ -var global = require('../internals/global'); - +},{}],191:[function(require,module,exports){ +'use strict'; module.exports = function (a, b) { - var console = global.console; - if (console && console.error) { - arguments.length == 1 ? console.error(a) : console.error(a, b); - } + try { + // eslint-disable-next-line no-console -- safe + arguments.length === 1 ? console.error(a) : console.error(a, b); + } catch (error) { /* empty */ } }; -},{"../internals/global":163}],167:[function(require,module,exports){ +},{}],192:[function(require,module,exports){ +'use strict'; var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); -},{"../internals/get-built-in":158}],168:[function(require,module,exports){ +},{"../internals/get-built-in":182}],193:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var createElement = require('../internals/document-create-element'); // Thanks to IE8 for its funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } - }).a != 7; + }).a !== 7; }); -},{"../internals/descriptors":134,"../internals/document-create-element":135,"../internals/fails":150}],169:[function(require,module,exports){ +},{"../internals/descriptors":153,"../internals/document-create-element":154,"../internals/fails":171}],194:[function(require,module,exports){ +'use strict'; // IEEE754 conversions based on https://github.com/feross/ieee754 -var global = require('../internals/global'); - -var Array = global.Array; +var $Array = Array; var abs = Math.abs; var pow = Math.pow; var floor = Math.floor; @@ -14386,7 +13913,7 @@ var log = Math.log; var LN2 = Math.LN2; var pack = function (number, mantissaLength, bytes) { - var buffer = Array(bytes); + var buffer = $Array(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; @@ -14396,9 +13923,9 @@ var pack = function (number, mantissaLength, bytes) { var exponent, mantissa, c; number = abs(number); // eslint-disable-next-line no-self-compare -- NaN check - if (number != number || number === Infinity) { + if (number !== number || number === Infinity) { // eslint-disable-next-line no-self-compare -- NaN check - mantissa = number != number ? 1 : 0; + mantissa = number !== number ? 1 : 0; exponent = eMax; } else { exponent = floor(log(number) / LN2); @@ -14421,7 +13948,7 @@ var pack = function (number, mantissaLength, bytes) { exponent = eMax; } else if (exponent + eBias >= 1) { mantissa = (number * c - 1) * pow(2, mantissaLength); - exponent = exponent + eBias; + exponent += eBias; } else { mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); exponent = 0; @@ -14470,8 +13997,8 @@ var unpack = function (buffer, mantissaLength) { } else if (exponent === eMax) { return mantissa ? NaN : sign ? -Infinity : Infinity; } else { - mantissa = mantissa + pow(2, mantissaLength); - exponent = exponent - eBias; + mantissa += pow(2, mantissaLength); + exponent -= eBias; } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); }; @@ -14480,25 +14007,26 @@ module.exports = { unpack: unpack }; -},{"../internals/global":163}],170:[function(require,module,exports){ -var global = require('../internals/global'); +},{}],195:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var classof = require('../internals/classof-raw'); -var Object = global.Object; +var $Object = Object; var split = uncurryThis(''.split); // 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); + return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { - return classof(it) == 'String' ? split(it, '') : Object(it); -} : Object; + return classof(it) === 'String' ? split(it, '') : $Object(it); +} : $Object; -},{"../internals/classof-raw":123,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163}],171:[function(require,module,exports){ +},{"../internals/classof-raw":137,"../internals/fails":171,"../internals/function-uncurry-this":181}],196:[function(require,module,exports){ +'use strict'; var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var setPrototypeOf = require('../internals/object-set-prototype-of'); @@ -14518,7 +14046,8 @@ module.exports = function ($this, dummy, Wrapper) { return $this; }; -},{"../internals/is-callable":176,"../internals/is-object":180,"../internals/object-set-prototype-of":208}],172:[function(require,module,exports){ +},{"../internals/is-callable":203,"../internals/is-object":208,"../internals/object-set-prototype-of":242}],197:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var isCallable = require('../internals/is-callable'); var store = require('../internals/shared-store'); @@ -14534,10 +14063,102 @@ if (!isCallable(store.inspectSource)) { module.exports = store.inspectSource; -},{"../internals/function-uncurry-this":157,"../internals/is-callable":176,"../internals/shared-store":236}],173:[function(require,module,exports){ -var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); -var global = require('../internals/global'); +},{"../internals/function-uncurry-this":181,"../internals/is-callable":203,"../internals/shared-store":268}],198:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); +var hiddenKeys = require('../internals/hidden-keys'); +var isObject = require('../internals/is-object'); +var hasOwn = require('../internals/has-own-property'); +var defineProperty = require('../internals/object-define-property').f; +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external'); +var isExtensible = require('../internals/object-is-extensible'); +var uid = require('../internals/uid'); +var FREEZING = require('../internals/freezing'); + +var REQUIRED = false; +var METADATA = uid('meta'); +var id = 0; + +var setMetadata = function (it) { + defineProperty(it, METADATA, { value: { + objectID: 'O' + id++, // object ID + weakData: {} // weak collections IDs + } }); +}; + +var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!hasOwn(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMetadata(it); + // return object ID + } return it[METADATA].objectID; +}; + +var getWeakData = function (it, create) { + if (!hasOwn(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs + } return it[METADATA].weakData; +}; + +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); + return it; +}; + +var enable = function () { + meta.enable = function () { /* empty */ }; + REQUIRED = true; + var getOwnPropertyNames = getOwnPropertyNamesModule.f; + var splice = uncurryThis([].splice); + var test = {}; + test[METADATA] = 1; + + // prevent exposing of metadata key + if (getOwnPropertyNames(test).length) { + getOwnPropertyNamesModule.f = function (it) { + var result = getOwnPropertyNames(it); + for (var i = 0, length = result.length; i < length; i++) { + if (result[i] === METADATA) { + splice(result, i, 1); + break; + } + } return result; + }; + + $({ target: 'Object', stat: true, forced: true }, { + getOwnPropertyNames: getOwnPropertyNamesExternalModule.f + }); + } +}; + +var meta = module.exports = { + enable: enable, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze +}; + +hiddenKeys[METADATA] = true; + +},{"../internals/export":170,"../internals/freezing":173,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/is-object":208,"../internals/object-define-property":231,"../internals/object-get-own-property-names":234,"../internals/object-get-own-property-names-external":233,"../internals/object-is-extensible":237,"../internals/uid":299}],199:[function(require,module,exports){ +'use strict'; +var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection'); +var global = require('../internals/global'); var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var hasOwn = require('../internals/has-own-property'); @@ -14558,27 +14179,29 @@ var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; 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); + /* eslint-disable no-self-assign -- prototype methods protection */ + store.get = store.get; + store.has = store.has; + store.set = store.set; + /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { - if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); + if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; - wmset(store, it, metadata); + store.set(it, metadata); return metadata; }; get = function (it) { - return wmget(store, it) || {}; + return store.get(it) || {}; }; has = function (it) { - return wmhas(store, it); + return store.has(it); }; } else { var STATE = sharedKey('state'); @@ -14605,7 +14228,8 @@ module.exports = { getterFor: getterFor }; -},{"../internals/create-non-enumerable-property":129,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/is-object":180,"../internals/native-weak-map":192,"../internals/shared-key":235,"../internals/shared-store":236}],174:[function(require,module,exports){ +},{"../internals/create-non-enumerable-property":145,"../internals/global":188,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/is-object":208,"../internals/shared-key":267,"../internals/shared-store":268,"../internals/weak-map-basic-detection":303}],200:[function(require,module,exports){ +'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); @@ -14617,24 +14241,42 @@ module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; -},{"../internals/iterators":187,"../internals/well-known-symbol":268}],175:[function(require,module,exports){ +},{"../internals/iterators":218,"../internals/well-known-symbol":306}],201:[function(require,module,exports){ +'use strict'; var classof = require('../internals/classof-raw'); // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray -// eslint-disable-next-line es-x/no-array-isarray -- safe +// eslint-disable-next-line es/no-array-isarray -- safe module.exports = Array.isArray || function isArray(argument) { - return classof(argument) == 'Array'; + return classof(argument) === 'Array'; }; -},{"../internals/classof-raw":123}],176:[function(require,module,exports){ +},{"../internals/classof-raw":137}],202:[function(require,module,exports){ +'use strict'; +var classof = require('../internals/classof'); + +module.exports = function (it) { + var klass = classof(it); + return klass === 'BigInt64Array' || klass === 'BigUint64Array'; +}; + +},{"../internals/classof":138}],203:[function(require,module,exports){ +'use strict'; +// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot +var documentAll = typeof document == 'object' && document.all; + // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable -module.exports = function (argument) { +// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing +module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { + return typeof argument == 'function' || argument === documentAll; +} : function (argument) { return typeof argument == 'function'; }; -},{}],177:[function(require,module,exports){ +},{}],204:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); @@ -14647,7 +14289,7 @@ 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); +var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; @@ -14688,7 +14330,8 @@ module.exports = !construct || fails(function () { || called; }) ? isConstructorLegacy : isConstructorModern; -},{"../internals/classof":124,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/get-built-in":158,"../internals/inspect-source":172,"../internals/is-callable":176}],178:[function(require,module,exports){ +},{"../internals/classof":138,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/get-built-in":182,"../internals/inspect-source":197,"../internals/is-callable":203}],205:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); @@ -14696,8 +14339,8 @@ var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; - return value == POLYFILL ? true - : value == NATIVE ? false + return value === POLYFILL ? true + : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; @@ -14712,29 +14355,49 @@ var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; -},{"../internals/fails":150,"../internals/is-callable":176}],179:[function(require,module,exports){ +},{"../internals/fails":171,"../internals/is-callable":203}],206:[function(require,module,exports){ +'use strict'; var isObject = require('../internals/is-object'); var floor = Math.floor; // `IsIntegralNumber` abstract operation // https://tc39.es/ecma262/#sec-isintegralnumber -// eslint-disable-next-line es-x/no-number-isinteger -- safe +// eslint-disable-next-line es/no-number-isinteger -- safe module.exports = Number.isInteger || function isInteger(it) { return !isObject(it) && isFinite(it) && floor(it) === it; }; -},{"../internals/is-object":180}],180:[function(require,module,exports){ +},{"../internals/is-object":208}],207:[function(require,module,exports){ +'use strict'; +// 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; +}; + +},{}],208:[function(require,module,exports){ +'use strict'; var isCallable = require('../internals/is-callable'); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; -},{"../internals/is-callable":176}],181:[function(require,module,exports){ +},{"../internals/is-callable":203}],209:[function(require,module,exports){ +'use strict'; +var isObject = require('../internals/is-object'); + +module.exports = function (argument) { + return isObject(argument) || argument === null; +}; + +},{"../internals/is-object":208}],210:[function(require,module,exports){ +'use strict'; module.exports = false; -},{}],182:[function(require,module,exports){ +},{}],211:[function(require,module,exports){ +'use strict'; var isObject = require('../internals/is-object'); var classof = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); @@ -14745,27 +14408,27 @@ var MATCH = wellKnownSymbol('match'); // https://tc39.es/ecma262/#sec-isregexp module.exports = function (it) { var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp'); }; -},{"../internals/classof-raw":123,"../internals/is-object":180,"../internals/well-known-symbol":268}],183:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/classof-raw":137,"../internals/is-object":208,"../internals/well-known-symbol":306}],212:[function(require,module,exports){ +'use strict'; 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 Object = global.Object; +var $Object = Object; 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)); + return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; -},{"../internals/get-built-in":158,"../internals/global":163,"../internals/is-callable":176,"../internals/object-is-prototype-of":204,"../internals/use-symbol-as-uid":264}],184:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/get-built-in":182,"../internals/is-callable":203,"../internals/object-is-prototype-of":238,"../internals/use-symbol-as-uid":300}],213:[function(require,module,exports){ +'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); @@ -14777,7 +14440,7 @@ var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); var iteratorClose = require('../internals/iterator-close'); -var TypeError = global.TypeError; +var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; @@ -14789,6 +14452,7 @@ var ResultPrototype = Result.prototype; 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); @@ -14806,11 +14470,13 @@ module.exports = function (iterable, unboundFunction, options) { } return INTERRUPTED ? fn(value, stop) : fn(value); }; - if (IS_ITERATOR) { + 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'); + if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { @@ -14821,7 +14487,7 @@ module.exports = function (iterable, unboundFunction, options) { iterator = getIterator(iterable, iterFn); } - next = iterator.next; + next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); @@ -14832,7 +14498,8 @@ module.exports = function (iterable, unboundFunction, options) { } return new Result(false); }; -},{"../internals/an-object":101,"../internals/function-bind-context":153,"../internals/function-call":155,"../internals/get-iterator":160,"../internals/get-iterator-method":159,"../internals/global":163,"../internals/is-array-iterator-method":174,"../internals/iterator-close":185,"../internals/length-of-array-like":188,"../internals/object-is-prototype-of":204,"../internals/try-to-string":257}],185:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/function-bind-context":175,"../internals/function-call":177,"../internals/get-iterator":184,"../internals/get-iterator-method":183,"../internals/is-array-iterator-method":200,"../internals/iterator-close":214,"../internals/length-of-array-like":219,"../internals/object-is-prototype-of":238,"../internals/try-to-string":293}],214:[function(require,module,exports){ +'use strict'; var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var getMethod = require('../internals/get-method'); @@ -14857,13 +14524,136 @@ module.exports = function (iterator, kind, value) { return value; }; -},{"../internals/an-object":101,"../internals/function-call":155,"../internals/get-method":161}],186:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/function-call":177,"../internals/get-method":186}],215:[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, 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; +}; + +},{"../internals/create-property-descriptor":146,"../internals/iterators":218,"../internals/iterators-core":217,"../internals/object-create":229,"../internals/set-to-string-tag":266}],216:[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'); + +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'; + +var returnThis = function () { return this; }; + +module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND && 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 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; + + // 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; + } + } + + // 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); }; + } + } + + // 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); + } + + // define iterator + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); + } + Iterators[NAME] = defaultIterator; + + return methods; +}; + +},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/export":170,"../internals/function-call":177,"../internals/function-name":178,"../internals/is-callable":203,"../internals/is-pure":210,"../internals/iterator-create-constructor":215,"../internals/iterators":218,"../internals/iterators-core":217,"../internals/object-get-prototype-of":236,"../internals/object-set-prototype-of":242,"../internals/set-to-string-tag":266,"../internals/well-known-symbol":306}],217:[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 redefine = require('../internals/redefine'); +var defineBuiltIn = require('../internals/define-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); @@ -14874,7 +14664,7 @@ var BUGGY_SAFARI_ITERATORS = false; // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; -/* eslint-disable es-x/no-array-prototype-keys -- safe */ +/* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` @@ -14885,7 +14675,7 @@ if ([].keys) { } } -var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () { +var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype[ITERATOR].call(test) !== test; @@ -14897,7 +14687,7 @@ else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable(IteratorPrototype[ITERATOR])) { - redefine(IteratorPrototype, ITERATOR, function () { + defineBuiltIn(IteratorPrototype, ITERATOR, function () { return this; }); } @@ -14907,9 +14697,10 @@ module.exports = { BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; -},{"../internals/fails":150,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/object-create":196,"../internals/object-get-prototype-of":203,"../internals/redefine":222,"../internals/well-known-symbol":268}],187:[function(require,module,exports){ -arguments[4][165][0].apply(exports,arguments) -},{"dup":165}],188:[function(require,module,exports){ +},{"../internals/define-built-in":149,"../internals/fails":171,"../internals/is-callable":203,"../internals/is-object":208,"../internals/is-pure":210,"../internals/object-create":229,"../internals/object-get-prototype-of":236,"../internals/well-known-symbol":306}],218:[function(require,module,exports){ +arguments[4][190][0].apply(exports,arguments) +},{"dup":190}],219:[function(require,module,exports){ +'use strict'; var toLength = require('../internals/to-length'); // `LengthOfArrayLike` abstract operation @@ -14918,11 +14709,134 @@ module.exports = function (obj) { return toLength(obj.length); }; -},{"../internals/to-length":249}],189:[function(require,module,exports){ +},{"../internals/to-length":284}],220:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +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'); + +var enforceInternalState = InternalStateModule.enforce; +var getInternalState = InternalStateModule.get; +var $String = String; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; +var stringSlice = uncurryThis(''.slice); +var replace = uncurryThis(''.replace); +var join = uncurryThis([].join); + +var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { + return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; +}); + +var TEMPLATE = String(String).split('String'); + +var makeBuiltIn = module.exports = function (value, name, options) { + if (stringSlice($String(name), 0, 7) === 'Symbol(') { + name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; + } + 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; + } + 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 = join(TEMPLATE, typeof name == 'string' ? name : ''); + } return value; +}; + +// 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'); + +},{"../internals/descriptors":153,"../internals/fails":171,"../internals/function-name":178,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/inspect-source":197,"../internals/internal-state":199,"../internals/is-callable":203}],221:[function(require,module,exports){ +'use strict'; +var sign = require('../internals/math-sign'); + +var abs = Math.abs; + +var EPSILON = 2.220446049250313e-16; // Number.EPSILON +var INVERSE_EPSILON = 1 / EPSILON; + +var roundTiesToEven = function (n) { + return n + INVERSE_EPSILON - INVERSE_EPSILON; +}; + +module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) { + var n = +x; + var absolute = abs(n); + var s = sign(n); + if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON; + var a = (1 + FLOAT_EPSILON / EPSILON) * absolute; + var result = a - (a - absolute); + // eslint-disable-next-line no-self-compare -- NaN check + if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity; + return s * result; +}; + +},{"../internals/math-sign":223}],222:[function(require,module,exports){ +'use strict'; +var floatRound = require('../internals/math-float-round'); + +var FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23; +var FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104 +var FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126; + +// `Math.fround` method implementation +// https://tc39.es/ecma262/#sec-math.fround +// eslint-disable-next-line es/no-math-fround -- safe +module.exports = Math.fround || function fround(x) { + return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE); +}; + +},{"../internals/math-float-round":221}],223:[function(require,module,exports){ +'use strict'; +// `Math.sign` method implementation +// https://tc39.es/ecma262/#sec-math.sign +// eslint-disable-next-line es/no-math-sign -- safe +module.exports = Math.sign || function sign(x) { + var n = +x; + // eslint-disable-next-line no-self-compare -- NaN check + return n === 0 || n !== n ? n : n < 0 ? -1 : 1; +}; + +},{}],224:[function(require,module,exports){ +'use strict'; +var ceil = Math.ceil; +var floor = Math.floor; + +// `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); +}; + +},{}],225:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); +var safeGetBuiltIn = require('../internals/safe-get-built-in'); var bind = require('../internals/function-bind-context'); -var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var macrotask = require('../internals/task').set; +var Queue = require('../internals/queue'); 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'); @@ -14932,28 +14846,22 @@ 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 flush, head, last, notify, toggle, node, promise, then; +var microtask = safeGetBuiltIn('queueMicrotask'); +var notify, toggle, node, promise, then; // modern engines have queueMicrotask method -if (!queueMicrotask) { - flush = function () { +if (!microtask) { + var queue = new Queue(); + + var 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; + while (fn = queue.get()) try { + fn(); + } catch (error) { + if (queue.head) notify(); + throw error; + } if (parent) parent.enter(); }; @@ -14988,61 +14896,31 @@ if (!queueMicrotask) { // - onreadystatechange // - setTimeout } else { - // strange IE + webpack dev server bug - use .bind(global) + // `webpack` dev server bug on IE global methods - use bind(fn, global) macrotask = bind(macrotask, global); notify = function () { macrotask(flush); }; } -} - -module.exports = queueMicrotask || function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; -}; -},{"../internals/engine-is-ios":142,"../internals/engine-is-ios-pebble":141,"../internals/engine-is-node":143,"../internals/engine-is-webos-webkit":144,"../internals/function-bind-context":153,"../internals/global":163,"../internals/object-get-own-property-descriptor":199,"../internals/task":243}],190:[function(require,module,exports){ -var NATIVE_SYMBOL = require('../internals/native-symbol'); - -/* eslint-disable es-x/no-symbol -- safe */ -module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; - -},{"../internals/native-symbol":191}],191:[function(require,module,exports){ -/* eslint-disable es-x/no-symbol -- required for testing */ -var V8_VERSION = require('../internals/engine-v8-version'); -var fails = require('../internals/fails'); - -// eslint-disable-next-line es-x/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; -}); - -},{"../internals/engine-v8-version":146,"../internals/fails":150}],192:[function(require,module,exports){ -var global = require('../internals/global'); -var isCallable = require('../internals/is-callable'); -var inspectSource = require('../internals/inspect-source'); - -var WeakMap = global.WeakMap; + microtask = function (fn) { + if (!queue.head) notify(); + queue.add(fn); + }; +} -module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap)); +module.exports = microtask; -},{"../internals/global":163,"../internals/inspect-source":172,"../internals/is-callable":176}],193:[function(require,module,exports){ +},{"../internals/engine-is-ios":163,"../internals/engine-is-ios-pebble":162,"../internals/engine-is-node":164,"../internals/engine-is-webos-webkit":165,"../internals/function-bind-context":175,"../internals/global":188,"../internals/queue":254,"../internals/safe-get-built-in":263,"../internals/task":277}],226:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); +var $TypeError = TypeError; + var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); @@ -15056,19 +14934,19 @@ module.exports.f = function (C) { return new PromiseCapability(C); }; -},{"../internals/a-callable":95}],194:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/a-callable":108}],227:[function(require,module,exports){ +'use strict'; var isRegExp = require('../internals/is-regexp'); -var TypeError = global.TypeError; +var $TypeError = TypeError; module.exports = function (it) { if (isRegExp(it)) { - throw TypeError("The method doesn't accept regular expressions"); + throw new $TypeError("The method doesn't accept regular expressions"); } return it; }; -},{"../internals/global":163,"../internals/is-regexp":182}],195:[function(require,module,exports){ +},{"../internals/is-regexp":211}],228:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var uncurryThis = require('../internals/function-uncurry-this'); @@ -15080,9 +14958,9 @@ var propertyIsEnumerableModule = require('../internals/object-property-is-enumer var toObject = require('../internals/to-object'); var IndexedObject = require('../internals/indexed-object'); -// eslint-disable-next-line es-x/no-object-assign -- safe +// eslint-disable-next-line es/no-object-assign -- safe var $assign = Object.assign; -// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing +// eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty = Object.defineProperty; var concat = uncurryThis([].concat); @@ -15102,12 +14980,12 @@ module.exports = !$assign || fails(function () { // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; - // eslint-disable-next-line es-x/no-symbol -- safe - var symbol = Symbol(); + // eslint-disable-next-line es/no-symbol -- safe + var symbol = Symbol('assign detection'); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); - return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet; + 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; @@ -15127,7 +15005,8 @@ module.exports = !$assign || fails(function () { } return T; } : $assign; -},{"../internals/descriptors":134,"../internals/fails":150,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/object-get-own-property-symbols":202,"../internals/object-keys":206,"../internals/object-property-is-enumerable":207,"../internals/to-object":250}],196:[function(require,module,exports){ +},{"../internals/descriptors":153,"../internals/fails":171,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/object-get-own-property-symbols":235,"../internals/object-keys":240,"../internals/object-property-is-enumerable":241,"../internals/to-object":285}],229:[function(require,module,exports){ +'use strict'; /* global ActiveXObject -- old IE, WSH */ var anObject = require('../internals/an-object'); var definePropertiesModule = require('../internals/object-define-properties'); @@ -15199,7 +15078,7 @@ hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create -// eslint-disable-next-line es-x/no-object-create -- safe +// eslint-disable-next-line es/no-object-create -- safe module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { @@ -15212,7 +15091,8 @@ module.exports = Object.create || function create(O, Properties) { return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; -},{"../internals/an-object":101,"../internals/document-create-element":135,"../internals/enum-bug-keys":148,"../internals/hidden-keys":165,"../internals/html":167,"../internals/object-define-properties":197,"../internals/shared-key":235}],197:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/document-create-element":154,"../internals/enum-bug-keys":169,"../internals/hidden-keys":190,"../internals/html":192,"../internals/object-define-properties":230,"../internals/shared-key":267}],230:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); var definePropertyModule = require('../internals/object-define-property'); @@ -15222,7 +15102,7 @@ var objectKeys = require('../internals/object-keys'); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties -// eslint-disable-next-line es-x/no-object-defineproperties -- safe +// 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); @@ -15234,18 +15114,18 @@ exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : return O; }; -},{"../internals/an-object":101,"../internals/descriptors":134,"../internals/object-define-property":198,"../internals/object-keys":206,"../internals/to-indexed-object":247,"../internals/v8-prototype-define-bug":265}],198:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/an-object":114,"../internals/descriptors":153,"../internals/object-define-property":231,"../internals/object-keys":240,"../internals/to-indexed-object":282,"../internals/v8-prototype-define-bug":301}],231:[function(require,module,exports){ +'use strict'; 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 TypeError = global.TypeError; -// eslint-disable-next-line es-x/no-object-defineproperty -- safe +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; -// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; @@ -15275,12 +15155,13 @@ exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P 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 ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; -},{"../internals/an-object":101,"../internals/descriptors":134,"../internals/global":163,"../internals/ie8-dom-define":168,"../internals/to-property-key":254,"../internals/v8-prototype-define-bug":265}],199:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/descriptors":153,"../internals/ie8-dom-define":193,"../internals/to-property-key":289,"../internals/v8-prototype-define-bug":301}],232:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var call = require('../internals/function-call'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); @@ -15290,7 +15171,7 @@ var toPropertyKey = require('../internals/to-property-key'); var hasOwn = require('../internals/has-own-property'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); -// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method @@ -15304,12 +15185,13 @@ exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDes if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; -},{"../internals/create-property-descriptor":130,"../internals/descriptors":134,"../internals/function-call":155,"../internals/has-own-property":164,"../internals/ie8-dom-define":168,"../internals/object-property-is-enumerable":207,"../internals/to-indexed-object":247,"../internals/to-property-key":254}],200:[function(require,module,exports){ -/* eslint-disable es-x/no-object-getownpropertynames -- safe */ +},{"../internals/create-property-descriptor":146,"../internals/descriptors":153,"../internals/function-call":177,"../internals/has-own-property":189,"../internals/ie8-dom-define":193,"../internals/object-property-is-enumerable":241,"../internals/to-indexed-object":282,"../internals/to-property-key":289}],233:[function(require,module,exports){ +'use strict'; +/* 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'); +var arraySlice = require('../internals/array-slice'); var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; @@ -15324,12 +15206,13 @@ var getWindowNames = function (it) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window module.exports.f = function getOwnPropertyNames(it) { - return windowNames && classof(it) == 'Window' + return windowNames && classof(it) === 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); }; -},{"../internals/array-slice-simple":116,"../internals/classof-raw":123,"../internals/object-get-own-property-names":201,"../internals/to-indexed-object":247}],201:[function(require,module,exports){ +},{"../internals/array-slice":131,"../internals/classof-raw":137,"../internals/object-get-own-property-names":234,"../internals/to-indexed-object":282}],234:[function(require,module,exports){ +'use strict'; var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); @@ -15337,17 +15220,18 @@ var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames -// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe +// eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; -},{"../internals/enum-bug-keys":148,"../internals/object-keys-internal":205}],202:[function(require,module,exports){ -// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe +},{"../internals/enum-bug-keys":169,"../internals/object-keys-internal":239}],235:[function(require,module,exports){ +'use strict'; +// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; -},{}],203:[function(require,module,exports){ -var global = require('../internals/global'); +},{}],236:[function(require,module,exports){ +'use strict'; var hasOwn = require('../internals/has-own-property'); var isCallable = require('../internals/is-callable'); var toObject = require('../internals/to-object'); @@ -15355,26 +15239,48 @@ var sharedKey = require('../internals/shared-key'); var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); var IE_PROTO = sharedKey('IE_PROTO'); -var Object = global.Object; -var ObjectPrototype = Object.prototype; +var $Object = Object; +var ObjectPrototype = $Object.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof -module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { +// 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; + } return object instanceof $Object ? ObjectPrototype : null; }; -},{"../internals/correct-prototype-getter":127,"../internals/global":163,"../internals/has-own-property":164,"../internals/is-callable":176,"../internals/shared-key":235,"../internals/to-object":250}],204:[function(require,module,exports){ +},{"../internals/correct-prototype-getter":143,"../internals/has-own-property":189,"../internals/is-callable":203,"../internals/shared-key":267,"../internals/to-object":285}],237:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var isObject = require('../internals/is-object'); +var classof = require('../internals/classof-raw'); +var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible'); + +// eslint-disable-next-line es/no-object-isextensible -- safe +var $isExtensible = Object.isExtensible; +var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); }); + +// `Object.isExtensible` method +// https://tc39.es/ecma262/#sec-object.isextensible +module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) { + if (!isObject(it)) return false; + if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false; + return $isExtensible ? $isExtensible(it) : true; +} : $isExtensible; + +},{"../internals/array-buffer-non-extensible":116,"../internals/classof-raw":137,"../internals/fails":171,"../internals/is-object":208}],238:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis({}.isPrototypeOf); -},{"../internals/function-uncurry-this":157}],205:[function(require,module,exports){ +},{"../internals/function-uncurry-this":181}],239:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var hasOwn = require('../internals/has-own-property'); var toIndexedObject = require('../internals/to-indexed-object'); @@ -15396,21 +15302,22 @@ module.exports = function (object, names) { return result; }; -},{"../internals/array-includes":110,"../internals/function-uncurry-this":157,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/to-indexed-object":247}],206:[function(require,module,exports){ +},{"../internals/array-includes":124,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/to-indexed-object":282}],240:[function(require,module,exports){ +'use strict'; var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys -// eslint-disable-next-line es-x/no-object-keys -- safe +// eslint-disable-next-line es/no-object-keys -- safe module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; -},{"../internals/enum-bug-keys":148,"../internals/object-keys-internal":205}],207:[function(require,module,exports){ +},{"../internals/enum-bug-keys":169,"../internals/object-keys-internal":239}],241:[function(require,module,exports){ 'use strict'; var $propertyIsEnumerable = {}.propertyIsEnumerable; -// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug @@ -15423,23 +15330,23 @@ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; -},{}],208:[function(require,module,exports){ +},{}],242:[function(require,module,exports){ +'use strict'; /* eslint-disable no-proto -- safe */ -var uncurryThis = require('../internals/function-uncurry-this'); +var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); var anObject = require('../internals/an-object'); var aPossiblePrototype = require('../internals/a-possible-prototype'); // `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-x/no-object-setprototypeof -- safe +// 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-x/no-object-getownpropertydescriptor -- safe - setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set); + setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } @@ -15452,9 +15359,12 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { }; }() : undefined); -},{"../internals/a-possible-prototype":97,"../internals/an-object":101,"../internals/function-uncurry-this":157}],209:[function(require,module,exports){ +},{"../internals/a-possible-prototype":110,"../internals/an-object":114,"../internals/function-uncurry-this-accessor":179}],243:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); var uncurryThis = require('../internals/function-uncurry-this'); +var objectGetPrototypeOf = require('../internals/object-get-prototype-of'); var objectKeys = require('../internals/object-keys'); var toIndexedObject = require('../internals/to-indexed-object'); var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; @@ -15462,18 +15372,28 @@ var $propertyIsEnumerable = require('../internals/object-property-is-enumerable' var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); var push = uncurryThis([].push); +// in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys +// of `null` prototype objects +var IE_BUG = DESCRIPTORS && fails(function () { + // eslint-disable-next-line es/no-object-create -- safe + var O = Object.create(null); + O[2] = 2; + return !propertyIsEnumerable(O, 2); +}); + // `Object.{ entries, values }` methods implementation var createMethod = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); var keys = objectKeys(O); + var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null; var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; - if (!DESCRIPTORS || propertyIsEnumerable(O, key)) { + if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) { push(result, TO_ENTRIES ? [key, O[key]] : O[key]); } } @@ -15490,7 +15410,7 @@ module.exports = { values: createMethod(false) }; -},{"../internals/descriptors":134,"../internals/function-uncurry-this":157,"../internals/object-keys":206,"../internals/object-property-is-enumerable":207,"../internals/to-indexed-object":247}],210:[function(require,module,exports){ +},{"../internals/descriptors":153,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/object-get-prototype-of":236,"../internals/object-keys":240,"../internals/object-property-is-enumerable":241,"../internals/to-indexed-object":282}],244:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var classof = require('../internals/classof'); @@ -15501,13 +15421,13 @@ module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; -},{"../internals/classof":124,"../internals/to-string-tag-support":255}],211:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/classof":138,"../internals/to-string-tag-support":290}],245:[function(require,module,exports){ +'use strict'; var call = require('../internals/function-call'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); -var TypeError = global.TypeError; +var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive @@ -15516,10 +15436,11 @@ module.exports = function (input, pref) { 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"); + throw new $TypeError("Can't convert object to primitive value"); }; -},{"../internals/function-call":155,"../internals/global":163,"../internals/is-callable":176,"../internals/is-object":180}],212:[function(require,module,exports){ +},{"../internals/function-call":177,"../internals/is-callable":203,"../internals/is-object":208}],246:[function(require,module,exports){ +'use strict'; var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); @@ -15535,12 +15456,14 @@ module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; -},{"../internals/an-object":101,"../internals/function-uncurry-this":157,"../internals/get-built-in":158,"../internals/object-get-own-property-names":201,"../internals/object-get-own-property-symbols":202}],213:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/function-uncurry-this":181,"../internals/get-built-in":182,"../internals/object-get-own-property-names":234,"../internals/object-get-own-property-symbols":235}],247:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); module.exports = global; -},{"../internals/global":163}],214:[function(require,module,exports){ +},{"../internals/global":188}],248:[function(require,module,exports){ +'use strict'; module.exports = function (exec) { try { return { error: false, value: exec() }; @@ -15549,7 +15472,8 @@ module.exports = function (exec) { } }; -},{}],215:[function(require,module,exports){ +},{}],249:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var isCallable = require('../internals/is-callable'); @@ -15557,6 +15481,7 @@ 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'); @@ -15577,18 +15502,18 @@ var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () { // 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(PROMISE_CONSTRUCTOR_SOURCE)) return false; - // 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; + 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 && !NATIVE_PROMISE_REJECTION_EVENT; + } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT; }); module.exports = { @@ -15597,12 +15522,14 @@ module.exports = { SUBCLASSING: SUBCLASSING }; -},{"../internals/engine-is-browser":139,"../internals/engine-v8-version":146,"../internals/global":163,"../internals/inspect-source":172,"../internals/is-callable":176,"../internals/is-forced":178,"../internals/is-pure":181,"../internals/promise-native-constructor":216,"../internals/well-known-symbol":268}],216:[function(require,module,exports){ +},{"../internals/engine-is-browser":159,"../internals/engine-is-deno":160,"../internals/engine-v8-version":167,"../internals/global":188,"../internals/inspect-source":197,"../internals/is-callable":203,"../internals/is-forced":205,"../internals/is-pure":210,"../internals/promise-native-constructor":250,"../internals/well-known-symbol":306}],250:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); module.exports = global.Promise; -},{"../internals/global":163}],217:[function(require,module,exports){ +},{"../internals/global":188}],251:[function(require,module,exports){ +'use strict'; var anObject = require('../internals/an-object'); var isObject = require('../internals/is-object'); var newPromiseCapability = require('../internals/new-promise-capability'); @@ -15616,7 +15543,8 @@ module.exports = function (C, x) { return promiseCapability.promise; }; -},{"../internals/an-object":101,"../internals/is-object":180,"../internals/new-promise-capability":193}],218:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/is-object":208,"../internals/new-promise-capability":226}],252:[function(require,module,exports){ +'use strict'; 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; @@ -15625,7 +15553,8 @@ module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(func NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ }); }); -},{"../internals/check-correctness-of-iteration":122,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216}],219:[function(require,module,exports){ +},{"../internals/check-correctness-of-iteration":136,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250}],253:[function(require,module,exports){ +'use strict'; var defineProperty = require('../internals/object-define-property').f; module.exports = function (Target, Source, key) { @@ -15636,7 +15565,8 @@ module.exports = function (Target, Source, key) { }); }; -},{"../internals/object-define-property":198}],220:[function(require,module,exports){ +},{"../internals/object-define-property":231}],254:[function(require,module,exports){ +'use strict'; var Queue = function () { this.head = null; this.tail = null; @@ -15645,15 +15575,16 @@ var Queue = function () { Queue.prototype = { add: function (item) { var entry = { item: item, next: null }; - if (this.head) this.tail.next = entry; + var tail = this.tail; + if (tail) 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; + var next = this.head = entry.next; + if (next === null) this.tail = null; return entry.item; } } @@ -15661,71 +15592,15 @@ Queue.prototype = { module.exports = Queue; -},{}],221:[function(require,module,exports){ -var redefine = require('../internals/redefine'); - -module.exports = function (target, src, options) { - for (var key in src) redefine(target, key, src[key], options); - return target; -}; - -},{"../internals/redefine":222}],222:[function(require,module,exports){ -var global = require('../internals/global'); -var isCallable = require('../internals/is-callable'); -var hasOwn = require('../internals/has-own-property'); -var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); -var setGlobal = require('../internals/set-global'); -var inspectSource = require('../internals/inspect-source'); -var InternalStateModule = require('../internals/internal-state'); -var CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE; - -var getInternalState = InternalStateModule.get; -var enforceInternalState = InternalStateModule.enforce; -var TEMPLATE = String(String).split('String'); - -(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 name = options && options.name !== undefined ? options.name : key; - var state; - if (isCallable(value)) { - if (String(name).slice(0, 7) === 'Symbol(') { - name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']'; - } - if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { - createNonEnumerableProperty(value, 'name', name); - } - state = enforceInternalState(value); - if (!state.source) { - state.source = TEMPLATE.join(typeof name == 'string' ? name : ''); - } - } - 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 isCallable(this) && getInternalState(this).source || inspectSource(this); -}); - -},{"../internals/create-non-enumerable-property":129,"../internals/function-name":156,"../internals/global":163,"../internals/has-own-property":164,"../internals/inspect-source":172,"../internals/internal-state":173,"../internals/is-callable":176,"../internals/set-global":232}],223:[function(require,module,exports){ -var global = require('../internals/global'); +},{}],255:[function(require,module,exports){ +'use strict'; 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'); -var TypeError = global.TypeError; +var $TypeError = TypeError; // `RegExpExec` abstract operation // https://tc39.es/ecma262/#sec-regexpexec @@ -15737,10 +15612,10 @@ module.exports = function (R, S) { return result; } if (classof(R) === 'RegExp') return call(regexpExec, R, S); - throw TypeError('RegExp#exec called on incompatible receiver'); + throw new $TypeError('RegExp#exec called on incompatible receiver'); }; -},{"../internals/an-object":101,"../internals/classof-raw":123,"../internals/function-call":155,"../internals/global":163,"../internals/is-callable":176,"../internals/regexp-exec":224}],224:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/classof-raw":137,"../internals/function-call":177,"../internals/is-callable":203,"../internals/regexp-exec":256}],256:[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 */ @@ -15837,7 +15712,7 @@ if (PATCH) { } 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 /(.?)?/ + // 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; @@ -15859,7 +15734,7 @@ if (PATCH) { module.exports = patchedExec; -},{"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/internal-state":173,"../internals/object-create":196,"../internals/regexp-flags":225,"../internals/regexp-sticky-helpers":227,"../internals/regexp-unsupported-dot-all":228,"../internals/regexp-unsupported-ncg":229,"../internals/shared":237,"../internals/to-string":256}],225:[function(require,module,exports){ +},{"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/internal-state":199,"../internals/object-create":229,"../internals/regexp-flags":257,"../internals/regexp-sticky-helpers":259,"../internals/regexp-unsupported-dot-all":260,"../internals/regexp-unsupported-ncg":261,"../internals/shared":269,"../internals/to-string":291}],257:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); @@ -15874,11 +15749,13 @@ module.exports = function () { 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; }; -},{"../internals/an-object":101}],226:[function(require,module,exports){ +},{"../internals/an-object":114}],258:[function(require,module,exports){ +'use strict'; var call = require('../internals/function-call'); var hasOwn = require('../internals/has-own-property'); var isPrototypeOf = require('../internals/object-is-prototype-of'); @@ -15892,7 +15769,8 @@ module.exports = function (R) { ? call(regExpFlags, R) : flags; }; -},{"../internals/function-call":155,"../internals/has-own-property":164,"../internals/object-is-prototype-of":204,"../internals/regexp-flags":225}],227:[function(require,module,exports){ +},{"../internals/function-call":177,"../internals/has-own-property":189,"../internals/object-is-prototype-of":238,"../internals/regexp-flags":257}],259:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); var global = require('../internals/global'); @@ -15902,7 +15780,7 @@ var $RegExp = global.RegExp; var UNSUPPORTED_Y = fails(function () { var re = $RegExp('a', 'y'); re.lastIndex = 2; - return re.exec('abcd') != null; + return re.exec('abcd') !== null; }); // UC Browser bug @@ -15915,7 +15793,7 @@ 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; + return re.exec('str') !== null; }); module.exports = { @@ -15924,7 +15802,8 @@ module.exports = { UNSUPPORTED_Y: UNSUPPORTED_Y }; -},{"../internals/fails":150,"../internals/global":163}],228:[function(require,module,exports){ +},{"../internals/fails":171,"../internals/global":188}],260:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); var global = require('../internals/global'); @@ -15933,10 +15812,11 @@ var $RegExp = global.RegExp; module.exports = fails(function () { var re = $RegExp('.', 's'); - return !(re.dotAll && re.exec('\n') && re.flags === 's'); + return !(re.dotAll && re.test('\n') && re.flags === 's'); }); -},{"../internals/fails":150,"../internals/global":163}],229:[function(require,module,exports){ +},{"../internals/fails":171,"../internals/global":188}],261:[function(require,module,exports){ +'use strict'; var fails = require('../internals/fails'); var global = require('../internals/global'); @@ -15949,45 +15829,48 @@ module.exports = fails(function () { 'b'.replace(re, '$c') !== 'bc'; }); -},{"../internals/fails":150,"../internals/global":163}],230:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/fails":171,"../internals/global":188}],262:[function(require,module,exports){ +'use strict'; +var isNullOrUndefined = require('../internals/is-null-or-undefined'); -var TypeError = global.TypeError; +var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); + if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; -},{"../internals/global":163}],231:[function(require,module,exports){ +},{"../internals/is-null-or-undefined":207}],263:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var DESCRIPTORS = require('../internals/descriptors'); + +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Avoid NodeJS experimental warning +module.exports = function (name) { + if (!DESCRIPTORS) return global[name]; + var descriptor = getOwnPropertyDescriptor(global, name); + return descriptor && descriptor.value; +}; + +},{"../internals/descriptors":153,"../internals/global":188}],264:[function(require,module,exports){ +'use strict'; // `SameValue` abstract operation // https://tc39.es/ecma262/#sec-samevalue -// eslint-disable-next-line es-x/no-object-is -- safe +// 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; + return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y; }; -},{}],232:[function(require,module,exports){ -var global = require('../internals/global'); - -// eslint-disable-next-line es-x/no-object-defineproperty -- safe -var defineProperty = Object.defineProperty; - -module.exports = function (key, value) { - try { - defineProperty(global, key, { value: value, configurable: true, writable: true }); - } catch (error) { - global[key] = value; - } return value; -}; - -},{"../internals/global":163}],233:[function(require,module,exports){ +},{}],265:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); -var definePropertyModule = require('../internals/object-define-property'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var wellKnownSymbol = require('../internals/well-known-symbol'); var DESCRIPTORS = require('../internals/descriptors'); @@ -15995,17 +15878,17 @@ var SPECIES = wellKnownSymbol('species'); module.exports = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); - var defineProperty = definePropertyModule.f; if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { - defineProperty(Constructor, SPECIES, { + defineBuiltInAccessor(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; -},{"../internals/descriptors":134,"../internals/get-built-in":158,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],234:[function(require,module,exports){ +},{"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/get-built-in":182,"../internals/well-known-symbol":306}],266:[function(require,module,exports){ +'use strict'; var defineProperty = require('../internals/object-define-property').f; var hasOwn = require('../internals/has-own-property'); var wellKnownSymbol = require('../internals/well-known-symbol'); @@ -16019,7 +15902,8 @@ module.exports = function (target, TAG, STATIC) { } }; -},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],235:[function(require,module,exports){ +},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/well-known-symbol":306}],267:[function(require,module,exports){ +'use strict'; var shared = require('../internals/shared'); var uid = require('../internals/uid'); @@ -16029,32 +15913,36 @@ module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; -},{"../internals/shared":237,"../internals/uid":263}],236:[function(require,module,exports){ +},{"../internals/shared":269,"../internals/uid":299}],268:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); -var setGlobal = require('../internals/set-global'); +var defineGlobalProperty = require('../internals/define-global-property'); var SHARED = '__core-js_shared__'; -var store = global[SHARED] || setGlobal(SHARED, {}); +var store = global[SHARED] || defineGlobalProperty(SHARED, {}); module.exports = store; -},{"../internals/global":163,"../internals/set-global":232}],237:[function(require,module,exports){ +},{"../internals/define-global-property":151,"../internals/global":188}],269:[function(require,module,exports){ +'use strict'; var IS_PURE = require('../internals/is-pure'); var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.22.1', + version: '3.35.0', mode: IS_PURE ? 'pure' : 'global', - copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE', + copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); -},{"../internals/is-pure":181,"../internals/shared-store":236}],238:[function(require,module,exports){ +},{"../internals/is-pure":210,"../internals/shared-store":268}],270:[function(require,module,exports){ +'use strict'; 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'); var SPECIES = wellKnownSymbol('species'); @@ -16064,10 +15952,11 @@ var SPECIES = wellKnownSymbol('species'); module.exports = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S); + return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S); }; -},{"../internals/a-constructor":96,"../internals/an-object":101,"../internals/well-known-symbol":268}],239:[function(require,module,exports){ +},{"../internals/a-constructor":109,"../internals/an-object":114,"../internals/is-null-or-undefined":207,"../internals/well-known-symbol":306}],271:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toString = require('../internals/to-string'); @@ -16105,7 +15994,8 @@ module.exports = { charAt: createMethod(true) }; -},{"../internals/function-uncurry-this":157,"../internals/require-object-coercible":230,"../internals/to-integer-or-infinity":248,"../internals/to-string":256}],240:[function(require,module,exports){ +},{"../internals/function-uncurry-this":181,"../internals/require-object-coercible":262,"../internals/to-integer-or-infinity":283,"../internals/to-string":291}],272:[function(require,module,exports){ +'use strict'; var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; var fails = require('../internals/fails'); var whitespaces = require('../internals/whitespaces'); @@ -16122,23 +16012,23 @@ module.exports = function (METHOD_NAME) { }); }; -},{"../internals/fails":150,"../internals/function-name":156,"../internals/whitespaces":269}],241:[function(require,module,exports){ +},{"../internals/fails":171,"../internals/function-name":178,"../internals/whitespaces":307}],273:[function(require,module,exports){ +'use strict'; 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'); var replace = uncurryThis(''.replace); -var whitespace = '[' + whitespaces + ']'; -var ltrim = RegExp('^' + whitespace + whitespace + '*'); -var rtrim = RegExp(whitespace + whitespace + '*$'); +var ltrim = RegExp('^[' + whitespaces + ']+'); +var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$'); // `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, ''); + if (TYPE & 2) string = replace(string, rtrim, '$1'); return string; }; }; @@ -16155,11 +16045,33 @@ module.exports = { trim: createMethod(3) }; -},{"../internals/function-uncurry-this":157,"../internals/require-object-coercible":230,"../internals/to-string":256,"../internals/whitespaces":269}],242:[function(require,module,exports){ +},{"../internals/function-uncurry-this":181,"../internals/require-object-coercible":262,"../internals/to-string":291,"../internals/whitespaces":307}],274:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-symbol -- required for testing */ +var V8_VERSION = require('../internals/engine-v8-version'); +var fails = require('../internals/fails'); +var global = require('../internals/global'); + +var $String = global.String; + +// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + var symbol = Symbol('symbol detection'); + // Chrome 38 Symbol has incorrect toString conversion + // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances + // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, + // of course, fail. + 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; +}); + +},{"../internals/engine-v8-version":167,"../internals/fails":171,"../internals/global":188}],275:[function(require,module,exports){ +'use strict'; var call = require('../internals/function-call'); var getBuiltIn = require('../internals/get-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); -var redefine = require('../internals/redefine'); +var defineBuiltIn = require('../internals/define-built-in'); module.exports = function () { var Symbol = getBuiltIn('Symbol'); @@ -16171,13 +16083,21 @@ module.exports = function () { // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive // eslint-disable-next-line no-unused-vars -- required for .length - redefine(SymbolPrototype, TO_PRIMITIVE, function (hint) { + defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) { return call(valueOf, this); - }); + }, { arity: 1 }); } }; -},{"../internals/function-call":155,"../internals/get-built-in":158,"../internals/redefine":222,"../internals/well-known-symbol":268}],243:[function(require,module,exports){ +},{"../internals/define-built-in":149,"../internals/function-call":177,"../internals/get-built-in":182,"../internals/well-known-symbol":306}],276:[function(require,module,exports){ +'use strict'; +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); + +/* eslint-disable es/no-symbol -- safe */ +module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; + +},{"../internals/symbol-constructor-detection":274}],277:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); var apply = require('../internals/function-apply'); var bind = require('../internals/function-bind-context'); @@ -16201,12 +16121,12 @@ var String = global.String; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; -var location, defer, channel, port; +var $location, defer, channel, port; -try { +fails(function () { // Deno throws a ReferenceError on `location` access without `--location` flag - location = global.location; -} catch (error) { /* empty */ } + $location = global.location; +}); var run = function (id) { if (hasOwn(queue, id)) { @@ -16222,13 +16142,13 @@ var runner = function (id) { }; }; -var listener = function (event) { +var eventListener = function (event) { run(event.data); }; -var post = function (id) { +var globalPostMessageDefer = function (id) { // old engines have not location.origin - global.postMessage(String(id), location.protocol + '//' + location.host); + global.postMessage(String(id), $location.protocol + '//' + $location.host); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: @@ -16261,7 +16181,7 @@ if (!set || !clear) { } else if (MessageChannel && !IS_IOS) { channel = new MessageChannel(); port = channel.port2; - channel.port1.onmessage = listener; + channel.port1.onmessage = eventListener; defer = bind(port.postMessage, port); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' @@ -16269,11 +16189,11 @@ if (!set || !clear) { global.addEventListener && isCallable(global.postMessage) && !global.importScripts && - location && location.protocol !== 'file:' && - !fails(post) + $location && $location.protocol !== 'file:' && + !fails(globalPostMessageDefer) ) { - defer = post; - global.addEventListener('message', listener, false); + defer = globalPostMessageDefer; + global.addEventListener('message', eventListener, false); // IE8- } else if (ONREADYSTATECHANGE in createElement('script')) { defer = function (id) { @@ -16295,14 +16215,16 @@ module.exports = { clear: clear }; -},{"../internals/array-slice":117,"../internals/document-create-element":135,"../internals/engine-is-ios":142,"../internals/engine-is-node":143,"../internals/fails":150,"../internals/function-apply":152,"../internals/function-bind-context":153,"../internals/global":163,"../internals/has-own-property":164,"../internals/html":167,"../internals/is-callable":176,"../internals/validate-arguments-length":266}],244:[function(require,module,exports){ +},{"../internals/array-slice":131,"../internals/document-create-element":154,"../internals/engine-is-ios":163,"../internals/engine-is-node":164,"../internals/fails":171,"../internals/function-apply":174,"../internals/function-bind-context":175,"../internals/global":188,"../internals/has-own-property":189,"../internals/html":192,"../internals/is-callable":203,"../internals/validate-arguments-length":302}],278:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); // `thisNumberValue` abstract operation // https://tc39.es/ecma262/#sec-thisnumbervalue module.exports = uncurryThis(1.0.valueOf); -},{"../internals/function-uncurry-this":157}],245:[function(require,module,exports){ +},{"../internals/function-uncurry-this":181}],279:[function(require,module,exports){ +'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var max = Math.max; @@ -16316,12 +16238,27 @@ module.exports = function (index, length) { return integer < 0 ? max(integer + length, 0) : min(integer, length); }; -},{"../internals/to-integer-or-infinity":248}],246:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/to-integer-or-infinity":283}],280:[function(require,module,exports){ +'use strict'; +var toPrimitive = require('../internals/to-primitive'); + +var $TypeError = TypeError; + +// `ToBigInt` abstract operation +// https://tc39.es/ecma262/#sec-tobigint +module.exports = function (argument) { + var prim = toPrimitive(argument, 'number'); + if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint"); + // eslint-disable-next-line es/no-bigint -- safe + return BigInt(prim); +}; + +},{"../internals/to-primitive":288}],281:[function(require,module,exports){ +'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toLength = require('../internals/to-length'); -var RangeError = global.RangeError; +var $RangeError = RangeError; // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex @@ -16329,11 +16266,12 @@ 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'); + if (number !== length) throw new $RangeError('Wrong length or index'); return length; }; -},{"../internals/global":163,"../internals/to-integer-or-infinity":248,"../internals/to-length":249}],247:[function(require,module,exports){ +},{"../internals/to-integer-or-infinity":283,"../internals/to-length":284}],282:[function(require,module,exports){ +'use strict'; // toObject with fallback for non-array-like ES3 strings var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); @@ -16342,19 +16280,20 @@ module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; -},{"../internals/indexed-object":170,"../internals/require-object-coercible":230}],248:[function(require,module,exports){ -var ceil = Math.ceil; -var floor = Math.floor; +},{"../internals/indexed-object":195,"../internals/require-object-coercible":262}],283:[function(require,module,exports){ +'use strict'; +var trunc = require('../internals/math-trunc'); // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity module.exports = function (argument) { var number = +argument; - // eslint-disable-next-line no-self-compare -- safe - return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number); + // eslint-disable-next-line no-self-compare -- NaN check + return number !== number || number === 0 ? 0 : trunc(number); }; -},{}],249:[function(require,module,exports){ +},{"../internals/math-trunc":224}],284:[function(require,module,exports){ +'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var min = Math.min; @@ -16365,44 +16304,44 @@ module.exports = function (argument) { return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; -},{"../internals/to-integer-or-infinity":248}],250:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/to-integer-or-infinity":283}],285:[function(require,module,exports){ +'use strict'; var requireObjectCoercible = require('../internals/require-object-coercible'); -var Object = global.Object; +var $Object = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { - return Object(requireObjectCoercible(argument)); + return $Object(requireObjectCoercible(argument)); }; -},{"../internals/global":163,"../internals/require-object-coercible":230}],251:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/require-object-coercible":262}],286:[function(require,module,exports){ +'use strict'; var toPositiveInteger = require('../internals/to-positive-integer'); -var RangeError = global.RangeError; +var $RangeError = RangeError; module.exports = function (it, BYTES) { var offset = toPositiveInteger(it); - if (offset % BYTES) throw RangeError('Wrong offset'); + if (offset % BYTES) throw new $RangeError('Wrong offset'); return offset; }; -},{"../internals/global":163,"../internals/to-positive-integer":252}],252:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/to-positive-integer":287}],287:[function(require,module,exports){ +'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); -var RangeError = global.RangeError; +var $RangeError = RangeError; module.exports = function (it) { var result = toIntegerOrInfinity(it); - if (result < 0) throw RangeError("The argument can't be less than 0"); + if (result < 0) throw new $RangeError("The argument can't be less than 0"); return result; }; -},{"../internals/global":163,"../internals/to-integer-or-infinity":248}],253:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/to-integer-or-infinity":283}],288:[function(require,module,exports){ +'use strict'; var call = require('../internals/function-call'); var isObject = require('../internals/is-object'); var isSymbol = require('../internals/is-symbol'); @@ -16410,7 +16349,7 @@ var getMethod = require('../internals/get-method'); var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); var wellKnownSymbol = require('../internals/well-known-symbol'); -var TypeError = global.TypeError; +var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation @@ -16423,13 +16362,14 @@ module.exports = function (input, pref) { 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"); + throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; -},{"../internals/function-call":155,"../internals/get-method":161,"../internals/global":163,"../internals/is-object":180,"../internals/is-symbol":183,"../internals/ordinary-to-primitive":211,"../internals/well-known-symbol":268}],254:[function(require,module,exports){ +},{"../internals/function-call":177,"../internals/get-method":186,"../internals/is-object":208,"../internals/is-symbol":212,"../internals/ordinary-to-primitive":245,"../internals/well-known-symbol":306}],289:[function(require,module,exports){ +'use strict'; var toPrimitive = require('../internals/to-primitive'); var isSymbol = require('../internals/is-symbol'); @@ -16440,7 +16380,8 @@ module.exports = function (argument) { return isSymbol(key) ? key : key + ''; }; -},{"../internals/is-symbol":183,"../internals/to-primitive":253}],255:[function(require,module,exports){ +},{"../internals/is-symbol":212,"../internals/to-primitive":288}],290:[function(require,module,exports){ +'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); @@ -16450,31 +16391,39 @@ test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; -},{"../internals/well-known-symbol":268}],256:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/well-known-symbol":306}],291:[function(require,module,exports){ +'use strict'; var classof = require('../internals/classof'); -var String = global.String; +var $String = String; module.exports = function (argument) { - if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); - return String(argument); + if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); + return $String(argument); }; -},{"../internals/classof":124,"../internals/global":163}],257:[function(require,module,exports){ -var global = require('../internals/global'); +},{"../internals/classof":138}],292:[function(require,module,exports){ +'use strict'; +var round = Math.round; -var String = global.String; +module.exports = function (it) { + var value = round(it); + return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; +}; + +},{}],293:[function(require,module,exports){ +'use strict'; +var $String = String; module.exports = function (argument) { try { - return String(argument); + return $String(argument); } catch (error) { return 'Object'; } }; -},{"../internals/global":163}],258:[function(require,module,exports){ +},{}],294:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); @@ -16490,6 +16439,7 @@ 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 toUint8Clamped = require('../internals/to-uint8-clamped'); var toPropertyKey = require('../internals/to-property-key'); var hasOwn = require('../internals/has-own-property'); var classof = require('../internals/classof'); @@ -16502,48 +16452,42 @@ var getOwnPropertyNames = require('../internals/object-get-own-property-names'). var typedArrayFrom = require('../internals/typed-array-from'); var forEach = require('../internals/array-iteration').forEach; var setSpecies = require('../internals/set-species'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var definePropertyModule = require('../internals/object-define-property'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list'); var InternalStateModule = require('../internals/internal-state'); var inheritIfRequired = require('../internals/inherit-if-required'); 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_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR; 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) { - aTypedArrayConstructor(C); - var index = 0; - var length = list.length; - var result = new 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]; - } }); + defineBuiltInAccessor(it, key, { + configurable: true, + get: function () { + return getInternalState(this)[key]; + } + }); }; var isArrayBuffer = function (it) { var klass; - return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; + return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer'; }; var isTypedArrayIndex = function (target, key) { @@ -16594,7 +16538,7 @@ if (DESCRIPTORS) { }); module.exports = function (TYPE, wrapper, CLAMPED) { - var BYTES = TYPE.match(/\d+$/)[0] / 8; + var BYTES = TYPE.match(/\d+/)[0] / 8; var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + TYPE; var SETTER = 'set' + TYPE; @@ -16610,8 +16554,7 @@ if (DESCRIPTORS) { 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); + data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true); }; var addElement = function (that, index) { @@ -16641,16 +16584,16 @@ if (DESCRIPTORS) { byteOffset = toOffset(offset, BYTES); var $len = data.byteLength; if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); + if ($len % BYTES) throw new RangeError(WRONG_LENGTH); byteLength = $len - byteOffset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); + if (byteLength < 0) throw new RangeError(WRONG_LENGTH); } else { byteLength = toLength($length) * BYTES; - if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); + if (byteLength + byteOffset > $len) throw new RangeError(WRONG_LENGTH); } length = byteLength / BYTES; } else if (isTypedArray(data)) { - return fromList(TypedArrayConstructor, data); + return arrayFromConstructorAndList(TypedArrayConstructor, data); } else { return call(typedArrayFrom, TypedArrayConstructor, data); } @@ -16676,7 +16619,7 @@ if (DESCRIPTORS) { : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data); - if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); + if (isTypedArray(data)) return arrayFromConstructorAndList(TypedArrayConstructor, data); return call(typedArrayFrom, TypedArrayConstructor, data); }(), dummy, TypedArrayConstructor); }); @@ -16694,17 +16637,17 @@ if (DESCRIPTORS) { createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); } - createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor); + enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor; if (TYPED_ARRAY_TAG) { createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); } + var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor; + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; - $({ - global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS - }, exported); + $({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); @@ -16718,7 +16661,8 @@ if (DESCRIPTORS) { }; } else module.exports = function () { /* empty */ }; -},{"../internals/an-instance":100,"../internals/array-buffer":104,"../internals/array-buffer-view-core":103,"../internals/array-iteration":111,"../internals/classof":124,"../internals/create-non-enumerable-property":129,"../internals/create-property-descriptor":130,"../internals/descriptors":134,"../internals/export":149,"../internals/function-call":155,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/internal-state":173,"../internals/is-integral-number":179,"../internals/is-object":180,"../internals/is-symbol":183,"../internals/object-create":196,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/object-set-prototype-of":208,"../internals/set-species":233,"../internals/to-index":246,"../internals/to-length":249,"../internals/to-offset":251,"../internals/to-property-key":254,"../internals/typed-array-constructors-require-wrappers":259,"../internals/typed-array-from":261}],259:[function(require,module,exports){ +},{"../internals/an-instance":113,"../internals/array-buffer":118,"../internals/array-buffer-view-core":117,"../internals/array-from-constructor-and-list":122,"../internals/array-iteration":125,"../internals/classof":138,"../internals/create-non-enumerable-property":145,"../internals/create-property-descriptor":146,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/export":170,"../internals/function-call":177,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/is-integral-number":206,"../internals/is-object":208,"../internals/is-symbol":212,"../internals/object-create":229,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/object-set-prototype-of":242,"../internals/set-species":265,"../internals/to-index":281,"../internals/to-length":284,"../internals/to-offset":286,"../internals/to-property-key":289,"../internals/to-uint8-clamped":292,"../internals/typed-array-constructors-require-wrappers":295,"../internals/typed-array-from":297}],295:[function(require,module,exports){ +'use strict'; /* eslint-disable no-new -- required for testing */ var global = require('../internals/global'); var fails = require('../internals/fails'); @@ -16742,7 +16686,8 @@ module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; }); -},{"../internals/array-buffer-view-core":103,"../internals/check-correctness-of-iteration":122,"../internals/fails":150,"../internals/global":163}],260:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/check-correctness-of-iteration":136,"../internals/fails":171,"../internals/global":188}],296:[function(require,module,exports){ +'use strict'; var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list'); var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); @@ -16750,7 +16695,8 @@ module.exports = function (instance, list) { return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list); }; -},{"../internals/array-from-constructor-and-list":108,"../internals/typed-array-species-constructor":262}],261:[function(require,module,exports){ +},{"../internals/array-from-constructor-and-list":122,"../internals/typed-array-species-constructor":298}],297:[function(require,module,exports){ +'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aConstructor = require('../internals/a-constructor'); @@ -16759,7 +16705,9 @@ 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'); module.exports = function from(source /* , mapfn, thisArg */) { var C = aConstructor(this); @@ -16768,7 +16716,7 @@ module.exports = function from(source /* , mapfn, thisArg */) { var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iteratorMethod = getIteratorMethod(O); - var i, length, result, step, iterator, next; + var i, length, result, thisIsBigIntArray, value, step, iterator, next; if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { iterator = getIterator(O, iteratorMethod); next = iterator.next; @@ -16782,26 +16730,31 @@ module.exports = function from(source /* , mapfn, thisArg */) { } length = lengthOfArrayLike(O); result = new (aTypedArrayConstructor(C))(length); + thisIsBigIntArray = isBigIntArray(result); for (i = 0; length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[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; }; -},{"../internals/a-constructor":96,"../internals/array-buffer-view-core":103,"../internals/function-bind-context":153,"../internals/function-call":155,"../internals/get-iterator":160,"../internals/get-iterator-method":159,"../internals/is-array-iterator-method":174,"../internals/length-of-array-like":188,"../internals/to-object":250}],262:[function(require,module,exports){ +},{"../internals/a-constructor":109,"../internals/array-buffer-view-core":117,"../internals/function-bind-context":175,"../internals/function-call":177,"../internals/get-iterator":184,"../internals/get-iterator-method":183,"../internals/is-array-iterator-method":200,"../internals/is-big-int-array":202,"../internals/length-of-array-like":219,"../internals/to-big-int":280,"../internals/to-object":285}],298:[function(require,module,exports){ +'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var speciesConstructor = require('../internals/species-constructor'); -var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR; var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; // a part of `TypedArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#typedarray-species-create module.exports = function (originalArray) { - return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR])); + return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray))); }; -},{"../internals/array-buffer-view-core":103,"../internals/species-constructor":238}],263:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/species-constructor":270}],299:[function(require,module,exports){ +'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var id = 0; @@ -16812,75 +16765,96 @@ module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; -},{"../internals/function-uncurry-this":157}],264:[function(require,module,exports){ -/* eslint-disable es-x/no-symbol -- required for testing */ -var NATIVE_SYMBOL = require('../internals/native-symbol'); +},{"../internals/function-uncurry-this":181}],300:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-symbol -- required for testing */ +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; -},{"../internals/native-symbol":191}],265:[function(require,module,exports){ +},{"../internals/symbol-constructor-detection":274}],301:[function(require,module,exports){ +'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 module.exports = DESCRIPTORS && fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false - }).prototype != 42; + }).prototype !== 42; }); -},{"../internals/descriptors":134,"../internals/fails":150}],266:[function(require,module,exports){ -var global = require('../internals/global'); - -var TypeError = global.TypeError; +},{"../internals/descriptors":153,"../internals/fails":171}],302:[function(require,module,exports){ +'use strict'; +var $TypeError = TypeError; module.exports = function (passed, required) { - if (passed < required) throw TypeError('Not enough arguments'); + if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; -},{"../internals/global":163}],267:[function(require,module,exports){ +},{}],303:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); + +var WeakMap = global.WeakMap; + +module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); + +},{"../internals/global":188,"../internals/is-callable":203}],304:[function(require,module,exports){ +'use strict'; +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 (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); +}; + +},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/path":247,"../internals/well-known-symbol-wrapped":305}],305:[function(require,module,exports){ +'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); exports.f = wellKnownSymbol; -},{"../internals/well-known-symbol":268}],268:[function(require,module,exports){ +},{"../internals/well-known-symbol":306}],306:[function(require,module,exports){ +'use strict'; 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/native-symbol'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); -var WellKnownSymbolsStore = shared('wks'); var Symbol = global.Symbol; -var symbolFor = Symbol && Symbol['for']; -var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; +var WellKnownSymbolsStore = shared('wks'); +var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; 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); - } + if (!hasOwn(WellKnownSymbolsStore, name)) { + WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) + ? Symbol[name] + : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; -},{"../internals/global":163,"../internals/has-own-property":164,"../internals/native-symbol":191,"../internals/shared":237,"../internals/uid":263,"../internals/use-symbol-as-uid":264}],269:[function(require,module,exports){ +},{"../internals/global":188,"../internals/has-own-property":189,"../internals/shared":269,"../internals/symbol-constructor-detection":274,"../internals/uid":299,"../internals/use-symbol-as-uid":300}],307:[function(require,module,exports){ +'use strict'; // 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'; -},{}],270:[function(require,module,exports){ +},{}],308:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); @@ -16893,16 +16867,16 @@ var NativeArrayBuffer = global[ARRAY_BUFFER]; // `ArrayBuffer` constructor // https://tc39.es/ecma262/#sec-arraybuffer-constructor -$({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, { +$({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer }, { ArrayBuffer: ArrayBuffer }); setSpecies(ARRAY_BUFFER); -},{"../internals/array-buffer":104,"../internals/export":149,"../internals/global":163,"../internals/set-species":233}],271:[function(require,module,exports){ +},{"../internals/array-buffer":118,"../internals/export":170,"../internals/global":188,"../internals/set-species":265}],309:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); -var uncurryThis = require('../internals/function-uncurry-this'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); var fails = require('../internals/fails'); var ArrayBufferModule = require('../internals/array-buffer'); var anObject = require('../internals/an-object'); @@ -16913,7 +16887,7 @@ var speciesConstructor = require('../internals/species-constructor'); var ArrayBuffer = ArrayBufferModule.ArrayBuffer; var DataView = ArrayBufferModule.DataView; var DataViewPrototype = DataView.prototype; -var un$ArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice); +var nativeArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice); var getUint8 = uncurryThis(DataViewPrototype.getUint8); var setUint8 = uncurryThis(DataViewPrototype.setUint8); @@ -16925,8 +16899,8 @@ var INCORRECT_SLICE = fails(function () { // https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice $({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { slice: function slice(start, end) { - if (un$ArrayBufferSlice && end === undefined) { - return un$ArrayBufferSlice(anObject(this), start); // FF fix + if (nativeArrayBufferSlice && end === undefined) { + return nativeArrayBufferSlice(anObject(this), start); // FF fix } var length = anObject(this).byteLength; var first = toAbsoluteIndex(start, length); @@ -16941,15 +16915,15 @@ $({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, } }); -},{"../internals/an-object":101,"../internals/array-buffer":104,"../internals/export":149,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/species-constructor":238,"../internals/to-absolute-index":245,"../internals/to-length":249}],272:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/array-buffer":118,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this-clause":180,"../internals/species-constructor":270,"../internals/to-absolute-index":279,"../internals/to-length":284}],310:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); -var global = require('../internals/global'); var fails = require('../internals/fails'); var isArray = require('../internals/is-array'); var isObject = require('../internals/is-object'); 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'); @@ -16957,9 +16931,6 @@ 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'; -var TypeError = global.TypeError; // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation @@ -16970,20 +16941,18 @@ var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { 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; +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat'); // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species -$({ target: 'Array', proto: true, forced: FORCED }, { +$({ 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); @@ -16994,10 +16963,10 @@ $({ target: 'Array', proto: true, forced: FORCED }, { E = i === -1 ? O : arguments[i]; if (isConcatSpreadable(E)) { len = lengthOfArrayLike(E); - if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + doesNotExceedSafeInteger(n + len); 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); + doesNotExceedSafeInteger(n + 1); createProperty(A, n++, E); } } @@ -17006,7 +16975,8 @@ $({ target: 'Array', proto: true, forced: FORCED }, { } }); -},{"../internals/array-method-has-species-support":113,"../internals/array-species-create":120,"../internals/create-property":131,"../internals/engine-v8-version":146,"../internals/export":149,"../internals/fails":150,"../internals/global":163,"../internals/is-array":175,"../internals/is-object":180,"../internals/length-of-array-like":188,"../internals/to-object":250,"../internals/well-known-symbol":268}],273:[function(require,module,exports){ +},{"../internals/array-method-has-species-support":127,"../internals/array-species-create":134,"../internals/create-property":147,"../internals/does-not-exceed-safe-integer":155,"../internals/engine-v8-version":167,"../internals/export":170,"../internals/fails":171,"../internals/is-array":201,"../internals/is-object":208,"../internals/length-of-array-like":219,"../internals/to-object":285,"../internals/well-known-symbol":306}],311:[function(require,module,exports){ +'use strict'; var $ = require('../internals/export'); var fill = require('../internals/array-fill'); var addToUnscopables = require('../internals/add-to-unscopables'); @@ -17020,7 +16990,7 @@ $({ target: 'Array', proto: true }, { // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('fill'); -},{"../internals/add-to-unscopables":98,"../internals/array-fill":106,"../internals/export":149}],274:[function(require,module,exports){ +},{"../internals/add-to-unscopables":111,"../internals/array-fill":120,"../internals/export":170}],312:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $filter = require('../internals/array-iteration').filter; @@ -17037,7 +17007,7 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { } }); -},{"../internals/array-iteration":111,"../internals/array-method-has-species-support":113,"../internals/export":149}],275:[function(require,module,exports){ +},{"../internals/array-iteration":125,"../internals/array-method-has-species-support":127,"../internals/export":170}],313:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $find = require('../internals/array-iteration').find; @@ -17047,6 +17017,7 @@ var FIND = 'find'; var SKIPS_HOLES = true; // Shouldn't skip holes +// eslint-disable-next-line es/no-array-prototype-find -- testing if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); // `Array.prototype.find` method @@ -17060,13 +17031,14 @@ $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND); -},{"../internals/add-to-unscopables":98,"../internals/array-iteration":111,"../internals/export":149}],276:[function(require,module,exports){ +},{"../internals/add-to-unscopables":111,"../internals/array-iteration":125,"../internals/export":170}],314:[function(require,module,exports){ +'use strict'; 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-x/no-array-from -- required for testing + // eslint-disable-next-line es/no-array-from -- required for testing Array.from(iterable); }); @@ -17076,15 +17048,22 @@ $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: from }); -},{"../internals/array-from":109,"../internals/check-correctness-of-iteration":122,"../internals/export":149}],277:[function(require,module,exports){ +},{"../internals/array-from":123,"../internals/check-correctness-of-iteration":136,"../internals/export":170}],315:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $includes = require('../internals/array-includes').includes; +var fails = require('../internals/fails'); var addToUnscopables = require('../internals/add-to-unscopables'); +// FF99+ bug +var BROKEN_ON_SPARSE = fails(function () { + // eslint-disable-next-line es/no-array-prototype-includes -- detection + return !Array(1).includes(); +}); + // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes -$({ target: 'Array', proto: true }, { +$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } @@ -17093,14 +17072,15 @@ $({ target: 'Array', proto: true }, { // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('includes'); -},{"../internals/add-to-unscopables":98,"../internals/array-includes":110,"../internals/export":149}],278:[function(require,module,exports){ +},{"../internals/add-to-unscopables":111,"../internals/array-includes":124,"../internals/export":170,"../internals/fails":171}],316:[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/define-iterator'); +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'); @@ -17130,15 +17110,15 @@ module.exports = defineIterator(Array, 'Array', function (iterated, kind) { }, 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 }; + return createIterResultObject(undefined, 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 }; + switch (state.kind) { + case 'keys': return createIterResultObject(index, false); + case 'values': return createIterResultObject(target[index], false); + } return createIterResultObject([index, target[index]], false); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% @@ -17156,7 +17136,7 @@ if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { defineProperty(values, 'name', { value: 'values' }); } catch (error) { /* empty */ } -},{"../internals/add-to-unscopables":98,"../internals/define-iterator":132,"../internals/descriptors":134,"../internals/internal-state":173,"../internals/is-pure":181,"../internals/iterators":187,"../internals/object-define-property":198,"../internals/to-indexed-object":247}],279:[function(require,module,exports){ +},{"../internals/add-to-unscopables":111,"../internals/create-iter-result-object":144,"../internals/descriptors":153,"../internals/internal-state":199,"../internals/is-pure":210,"../internals/iterator-define":216,"../internals/iterators":218,"../internals/object-define-property":231,"../internals/to-indexed-object":282}],317:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); @@ -17164,20 +17144,20 @@ var IndexedObject = require('../internals/indexed-object'); var toIndexedObject = require('../internals/to-indexed-object'); var arrayMethodIsStrict = require('../internals/array-method-is-strict'); -var un$Join = uncurryThis([].join); +var nativeJoin = uncurryThis([].join); -var ES3_STRINGS = IndexedObject != Object; -var STRICT_METHOD = arrayMethodIsStrict('join', ','); +var ES3_STRINGS = IndexedObject !== Object; +var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ','); // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join -$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, { +$({ target: 'Array', proto: true, forced: FORCED }, { join: function join(separator) { - return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator); + return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator); } }); -},{"../internals/array-method-is-strict":114,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/to-indexed-object":247}],280:[function(require,module,exports){ +},{"../internals/array-method-is-strict":128,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/to-indexed-object":282}],318:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $map = require('../internals/array-iteration').map; @@ -17194,10 +17174,9 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { } }); -},{"../internals/array-iteration":111,"../internals/array-method-has-species-support":113,"../internals/export":149}],281:[function(require,module,exports){ +},{"../internals/array-iteration":125,"../internals/array-method-has-species-support":127,"../internals/export":170}],319:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); -var global = require('../internals/global'); var isArray = require('../internals/is-array'); var isConstructor = require('../internals/is-constructor'); var isObject = require('../internals/is-object'); @@ -17207,12 +17186,12 @@ 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 un$Slice = require('../internals/array-slice'); +var nativeSlice = require('../internals/array-slice'); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); var SPECIES = wellKnownSymbol('species'); -var Array = global.Array; +var $Array = Array; var max = Math.max; // `Array.prototype.slice` method @@ -17229,30 +17208,31 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { if (isArray(O)) { Constructor = O.constructor; // cross-realm fallback - if (isConstructor(Constructor) && (Constructor === Array || isArray(Constructor.prototype))) { + 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 un$Slice(O, k, fin); + if (Constructor === $Array || Constructor === undefined) { + return nativeSlice(O, k, fin); } } - result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)); + 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":113,"../internals/array-slice":117,"../internals/create-property":131,"../internals/export":149,"../internals/global":163,"../internals/is-array":175,"../internals/is-constructor":177,"../internals/is-object":180,"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-indexed-object":247,"../internals/well-known-symbol":268}],282:[function(require,module,exports){ +},{"../internals/array-method-has-species-support":127,"../internals/array-slice":131,"../internals/create-property":147,"../internals/export":170,"../internals/is-array":201,"../internals/is-constructor":204,"../internals/is-object":208,"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-indexed-object":282,"../internals/well-known-symbol":306}],320:[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'); @@ -17263,7 +17243,7 @@ var V8 = require('../internals/engine-v8-version'); var WEBKIT = require('../internals/engine-webkit-version'); var test = []; -var un$Sort = uncurryThis(test.sort); +var nativeSort = uncurryThis(test.sort); var push = uncurryThis(test.push); // IE8- @@ -17331,7 +17311,7 @@ $({ target: 'Array', proto: true, forced: FORCED }, { var array = toObject(this); - if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn); + if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn); var items = []; var arrayLength = lengthOfArrayLike(array); @@ -17343,35 +17323,34 @@ $({ target: 'Array', proto: true, forced: FORCED }, { internalSort(items, getSortCompare(comparefn)); - itemsLength = items.length; + itemsLength = lengthOfArrayLike(items); index = 0; while (index < itemsLength) array[index] = items[index++]; - while (index < arrayLength) delete array[index++]; + while (index < arrayLength) deletePropertyOrThrow(array, index++); return array; } }); -},{"../internals/a-callable":95,"../internals/array-method-is-strict":114,"../internals/array-sort":118,"../internals/engine-ff-version":138,"../internals/engine-is-ie-or-edge":140,"../internals/engine-v8-version":146,"../internals/engine-webkit-version":147,"../internals/export":149,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/length-of-array-like":188,"../internals/to-object":250,"../internals/to-string":256}],283:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/array-method-is-strict":128,"../internals/array-sort":132,"../internals/delete-property-or-throw":152,"../internals/engine-ff-version":158,"../internals/engine-is-ie-or-edge":161,"../internals/engine-v8-version":167,"../internals/engine-webkit-version":168,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/length-of-array-like":219,"../internals/to-object":285,"../internals/to-string":291}],321:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); -var global = require('../internals/global'); +var toObject = require('../internals/to-object'); var toAbsoluteIndex = require('../internals/to-absolute-index'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var lengthOfArrayLike = require('../internals/length-of-array-like'); -var toObject = require('../internals/to-object'); +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 deletePropertyOrThrow = require('../internals/delete-property-or-throw'); var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); -var TypeError = global.TypeError; 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.es/ecma262/#sec-array.prototype.splice @@ -17392,9 +17371,7 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { insertCount = argumentsLength - 2; actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); } - if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { - throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); - } + doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); A = arraySpeciesCreate(O, actualDeleteCount); for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; @@ -17406,30 +17383,31 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { from = k + actualDeleteCount; to = k + insertCount; if (from in O) O[to] = O[from]; - else delete O[to]; + else deletePropertyOrThrow(O, to); } - for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; + 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 delete O[to]; + else deletePropertyOrThrow(O, to); } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } - O.length = len - actualDeleteCount + insertCount; + setArrayLength(O, len - actualDeleteCount + insertCount); return A; } }); -},{"../internals/array-method-has-species-support":113,"../internals/array-species-create":120,"../internals/create-property":131,"../internals/export":149,"../internals/global":163,"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-integer-or-infinity":248,"../internals/to-object":250}],284:[function(require,module,exports){ +},{"../internals/array-method-has-species-support":127,"../internals/array-set-length":130,"../internals/array-species-create":134,"../internals/create-property":147,"../internals/delete-property-or-throw":152,"../internals/does-not-exceed-safe-integer":155,"../internals/export":170,"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-integer-or-infinity":283,"../internals/to-object":285}],322:[function(require,module,exports){ +'use strict'; 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; +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var FunctionPrototype = Function.prototype; var functionToString = uncurryThis(FunctionPrototype.toString); @@ -17440,7 +17418,7 @@ var NAME = 'name'; // Function instances `.name` property // https://tc39.es/ecma262/#sec-function-instances-name if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { - defineProperty(FunctionPrototype, NAME, { + defineBuiltInAccessor(FunctionPrototype, NAME, { configurable: true, get: function () { try { @@ -17452,20 +17430,21 @@ if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { }); } -},{"../internals/descriptors":134,"../internals/function-name":156,"../internals/function-uncurry-this":157,"../internals/object-define-property":198}],285:[function(require,module,exports){ +},{"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/function-name":178,"../internals/function-uncurry-this":181}],323:[function(require,module,exports){ +'use strict'; 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 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/native-symbol'); +var getReplacerFunction = require('../internals/get-json-replacer-function'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var $String = String; var $stringify = getBuiltIn('JSON', 'stringify'); var exec = uncurryThis(/./.exec); var charAt = uncurryThis(''.charAt); @@ -17478,13 +17457,13 @@ var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { - var symbol = getBuiltIn('Symbol')(); + var symbol = getBuiltIn('Symbol')('stringify detection'); // MS Edge converts symbol values to JSON as {} - return $stringify([symbol]) != '[null]' + return $stringify([symbol]) !== '[null]' // WebKit converts symbol values to JSON as null - || $stringify({ a: symbol }) != '{}' + || $stringify({ a: symbol }) !== '{}' // V8 throws on boxed symbols - || $stringify(Object(symbol)) != '{}'; + || $stringify(Object(symbol)) !== '{}'; }); // https://github.com/tc39/proposal-well-formed-stringify @@ -17495,13 +17474,13 @@ var ILL_FORMED_UNICODE = fails(function () { 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); + var $replacer = getReplacerFunction(replacer); + if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined + args[1] = function (key, value) { + // some old implementations (like WebKit) could pass numbers as keys + if (isCallable($replacer)) value = call($replacer, this, $String(key), value); if (!isSymbol(value)) return value; }; - args[1] = replacer; return apply($stringify, null, args); }; @@ -17516,7 +17495,7 @@ var fixIllFormed = function (match, offset, string) { if ($stringify) { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify - $({ target: 'JSON', stat: true, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { + $({ 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); @@ -17526,13 +17505,15 @@ if ($stringify) { }); } -},{"../internals/array-slice":117,"../internals/export":149,"../internals/fails":150,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-built-in":158,"../internals/is-array":175,"../internals/is-callable":176,"../internals/is-object":180,"../internals/is-symbol":183,"../internals/native-symbol":191}],286:[function(require,module,exports){ +},{"../internals/array-slice":131,"../internals/export":170,"../internals/fails":171,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-built-in":182,"../internals/get-json-replacer-function":185,"../internals/is-callable":203,"../internals/is-symbol":212,"../internals/symbol-constructor-detection":274}],324:[function(require,module,exports){ 'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); var DESCRIPTORS = require('../internals/descriptors'); var global = require('../internals/global'); +var path = require('../internals/path'); var uncurryThis = require('../internals/function-uncurry-this'); var isForced = require('../internals/is-forced'); -var redefine = require('../internals/redefine'); var hasOwn = require('../internals/has-own-property'); var inheritIfRequired = require('../internals/inherit-if-required'); var isPrototypeOf = require('../internals/object-is-prototype-of'); @@ -17547,9 +17528,10 @@ var trim = require('../internals/string-trim').trim; var NUMBER = 'Number'; var NativeNumber = global[NUMBER]; +var PureNumberNamespace = path[NUMBER]; var NumberPrototype = NativeNumber.prototype; var TypeError = global.TypeError; -var arraySlice = uncurryThis(''.slice); +var stringSlice = uncurryThis(''.slice); var charCodeAt = uncurryThis(''.charCodeAt); // `ToNumeric` abstract operation @@ -17564,7 +17546,7 @@ var toNumeric = function (value) { 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 (isSymbol(it)) throw new TypeError('Cannot convert a Symbol value to a number'); if (typeof it == 'string' && it.length > 2) { it = trim(it); first = charCodeAt(it, 0); @@ -17573,11 +17555,22 @@ var toNumber = function (argument) { 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; + // fast equal of /^0b[01]+$/i + case 66: + case 98: + radix = 2; + maxCode = 49; + break; + // fast equal of /^0o[0-7]+$/i + case 79: + case 111: + radix = 8; + maxCode = 55; + break; + default: + return +it; } - digits = arraySlice(it, 2); + digits = stringSlice(it, 2); length = digits.length; for (index = 0; index < length; index++) { code = charCodeAt(digits, index); @@ -17589,17 +17582,30 @@ var toNumber = function (argument) { } return +it; }; +var FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1')); + +var calledWithNew = function (dummy) { + // includes check on 1..constructor(foo) case + return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); }); +}; + // `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) : ( +var NumberWrapper = function Number(value) { + var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); + return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n; +}; + +NumberWrapper.prototype = NumberPrototype; +if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper; + +$({ global: true, constructor: true, wrap: true, forced: FORCED }, { + Number: NumberWrapper +}); + +// Use `internal/copy-constructor-properties` helper in `core-js@4` +var copyConstructorProperties = function (target, source) { + for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): @@ -17607,27 +17613,29 @@ if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumb // 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)); + if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) { + defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } - NumberWrapper.prototype = NumberPrototype; - NumberPrototype.constructor = NumberWrapper; - redefine(global, NUMBER, NumberWrapper); -} +}; + +if (IS_PURE && PureNumberNamespace) copyConstructorProperties(path[NUMBER], PureNumberNamespace); +if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber); -},{"../internals/descriptors":134,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/is-forced":178,"../internals/is-symbol":183,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/redefine":222,"../internals/string-trim":241,"../internals/this-number-value":244,"../internals/to-primitive":253}],287:[function(require,module,exports){ +},{"../internals/descriptors":153,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/is-forced":205,"../internals/is-pure":210,"../internals/is-symbol":212,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/path":247,"../internals/string-trim":273,"../internals/this-number-value":278,"../internals/to-primitive":288}],325:[function(require,module,exports){ +'use strict'; var $ = require('../internals/export'); var assign = require('../internals/object-assign'); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign -// eslint-disable-next-line es-x/no-object-assign -- required for testing -$({ target: 'Object', stat: true, forced: Object.assign !== 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/export":149,"../internals/object-assign":195}],288:[function(require,module,exports){ +},{"../internals/export":170,"../internals/object-assign":228}],326:[function(require,module,exports){ +'use strict'; var $ = require('../internals/export'); var $entries = require('../internals/object-to-array').entries; @@ -17639,9 +17647,55 @@ $({ target: 'Object', stat: true }, { } }); -},{"../internals/export":149,"../internals/object-to-array":209}],289:[function(require,module,exports){ +},{"../internals/export":170,"../internals/object-to-array":243}],327:[function(require,module,exports){ +'use strict'; var $ = require('../internals/export'); -var NATIVE_SYMBOL = require('../internals/native-symbol'); +var fails = require('../internals/fails'); +var toIndexedObject = require('../internals/to-indexed-object'); +var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var DESCRIPTORS = require('../internals/descriptors'); + +var FORCED = !DESCRIPTORS || fails(function () { nativeGetOwnPropertyDescriptor(1); }); + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor +$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { + return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); + } +}); + +},{"../internals/descriptors":153,"../internals/export":170,"../internals/fails":171,"../internals/object-get-own-property-descriptor":232,"../internals/to-indexed-object":282}],328:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var ownKeys = require('../internals/own-keys'); +var toIndexedObject = require('../internals/to-indexed-object'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var createProperty = require('../internals/create-property'); + +// `Object.getOwnPropertyDescriptors` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors +$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIndexedObject(object); + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var keys = ownKeys(O); + var result = {}; + var index = 0; + var key, descriptor; + while (keys.length > index) { + descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); + if (descriptor !== undefined) createProperty(result, key, descriptor); + } + return result; + } +}); + +},{"../internals/create-property":147,"../internals/descriptors":153,"../internals/export":170,"../internals/object-get-own-property-descriptor":232,"../internals/own-keys":246,"../internals/to-indexed-object":282}],329:[function(require,module,exports){ +'use strict'; +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'); @@ -17659,7 +17713,8 @@ $({ target: 'Object', stat: true, forced: FORCED }, { } }); -},{"../internals/export":149,"../internals/fails":150,"../internals/native-symbol":191,"../internals/object-get-own-property-symbols":202,"../internals/to-object":250}],290:[function(require,module,exports){ +},{"../internals/export":170,"../internals/fails":171,"../internals/object-get-own-property-symbols":235,"../internals/symbol-constructor-detection":274,"../internals/to-object":285}],330:[function(require,module,exports){ +'use strict'; var $ = require('../internals/export'); var toObject = require('../internals/to-object'); var nativeKeys = require('../internals/object-keys'); @@ -17675,18 +17730,19 @@ $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { } }); -},{"../internals/export":149,"../internals/fails":150,"../internals/object-keys":206,"../internals/to-object":250}],291:[function(require,module,exports){ +},{"../internals/export":170,"../internals/fails":171,"../internals/object-keys":240,"../internals/to-object":285}],331:[function(require,module,exports){ +'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); -var redefine = require('../internals/redefine'); +var defineBuiltIn = require('../internals/define-built-in'); var toString = require('../internals/object-to-string'); // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { - redefine(Object.prototype, 'toString', toString, { unsafe: true }); + defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true }); } -},{"../internals/object-to-string":210,"../internals/redefine":222,"../internals/to-string-tag-support":255}],292:[function(require,module,exports){ +},{"../internals/define-built-in":149,"../internals/object-to-string":244,"../internals/to-string-tag-support":290}],332:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); @@ -17727,7 +17783,7 @@ $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION } } }); -},{"../internals/a-callable":95,"../internals/export":149,"../internals/function-call":155,"../internals/iterate":184,"../internals/new-promise-capability":193,"../internals/perform":214,"../internals/promise-statics-incorrect-iteration":218}],293:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/export":170,"../internals/function-call":177,"../internals/iterate":213,"../internals/new-promise-capability":226,"../internals/perform":248,"../internals/promise-statics-incorrect-iteration":252}],333:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); @@ -17735,7 +17791,7 @@ var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detec var NativePromiseConstructor = require('../internals/promise-native-constructor'); var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); -var redefine = require('../internals/redefine'); +var defineBuiltIn = require('../internals/define-built-in'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; @@ -17751,19 +17807,18 @@ $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: tr if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['catch']; if (NativePromisePrototype['catch'] !== method) { - redefine(NativePromisePrototype, 'catch', method, { unsafe: true }); + defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true }); } } -},{"../internals/export":149,"../internals/get-built-in":158,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/redefine":222}],294:[function(require,module,exports){ +},{"../internals/define-built-in":149,"../internals/export":170,"../internals/get-built-in":182,"../internals/is-callable":203,"../internals/is-pure":210,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250}],334:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); 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 redefine = require('../internals/redefine'); -var redefineAll = require('../internals/redefine-all'); +var defineBuiltIn = require('../internals/define-built-in'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var setSpecies = require('../internals/set-species'); @@ -17816,7 +17871,7 @@ var isThenable = function (it) { var callReaction = function (reaction, state) { var value = state.value; - var ok = state.state == FULFILLED; + var ok = state.state === FULFILLED; var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; @@ -17838,7 +17893,7 @@ var callReaction = function (reaction, state) { } } if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); + reject(new TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { call(then, result, resolve, reject); } else resolve(result); @@ -17928,7 +17983,7 @@ var internalResolve = function (state, value, unwrap) { state.done = true; if (unwrap) state = unwrap; try { - if (state.facade === value) throw TypeError("Promise can't be resolved itself"); + if (state.facade === value) throw new TypeError("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask(function () { @@ -17983,23 +18038,20 @@ if (FORCED_PROMISE_CONSTRUCTOR) { }); }; - Internal.prototype = redefineAll(PromisePrototype, { - // `Promise.prototype.then` method - // https://tc39.es/ecma262/#sec-promise.prototype.then - // eslint-disable-next-line unicorn/no-thenable -- safe - 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; - } + // `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; }); OwnPromiseCapability = function () { @@ -18021,7 +18073,7 @@ if (FORCED_PROMISE_CONSTRUCTOR) { if (!NATIVE_PROMISE_SUBCLASSING) { // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs - redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { + defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { var that = this; return new PromiseConstructor(function (resolve, reject) { call(nativeThen, that, resolve, reject); @@ -18042,14 +18094,15 @@ if (FORCED_PROMISE_CONSTRUCTOR) { } } -$({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { +$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { Promise: PromiseConstructor }); setToStringTag(PromiseConstructor, PROMISE, false, true); setSpecies(PROMISE); -},{"../internals/a-callable":95,"../internals/an-instance":100,"../internals/engine-is-node":143,"../internals/export":149,"../internals/function-call":155,"../internals/global":163,"../internals/host-report-errors":166,"../internals/internal-state":173,"../internals/is-callable":176,"../internals/is-object":180,"../internals/is-pure":181,"../internals/microtask":189,"../internals/new-promise-capability":193,"../internals/object-set-prototype-of":208,"../internals/perform":214,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/queue":220,"../internals/redefine":222,"../internals/redefine-all":221,"../internals/set-species":233,"../internals/set-to-string-tag":234,"../internals/species-constructor":238,"../internals/task":243}],295:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/an-instance":113,"../internals/define-built-in":149,"../internals/engine-is-node":164,"../internals/export":170,"../internals/function-call":177,"../internals/global":188,"../internals/host-report-errors":191,"../internals/internal-state":199,"../internals/is-callable":203,"../internals/is-object":208,"../internals/is-pure":210,"../internals/microtask":225,"../internals/new-promise-capability":226,"../internals/object-set-prototype-of":242,"../internals/perform":248,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250,"../internals/queue":254,"../internals/set-species":265,"../internals/set-to-string-tag":266,"../internals/species-constructor":270,"../internals/task":277}],335:[function(require,module,exports){ +'use strict'; // 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'); @@ -18058,7 +18111,7 @@ require('../modules/es.promise.race'); require('../modules/es.promise.reject'); require('../modules/es.promise.resolve'); -},{"../modules/es.promise.all":292,"../modules/es.promise.catch":293,"../modules/es.promise.constructor":294,"../modules/es.promise.race":296,"../modules/es.promise.reject":297,"../modules/es.promise.resolve":298}],296:[function(require,module,exports){ +},{"../modules/es.promise.all":332,"../modules/es.promise.catch":333,"../modules/es.promise.constructor":334,"../modules/es.promise.race":336,"../modules/es.promise.reject":337,"../modules/es.promise.resolve":338}],336:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); @@ -18086,10 +18139,9 @@ $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION } } }); -},{"../internals/a-callable":95,"../internals/export":149,"../internals/function-call":155,"../internals/iterate":184,"../internals/new-promise-capability":193,"../internals/perform":214,"../internals/promise-statics-incorrect-iteration":218}],297:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/export":170,"../internals/function-call":177,"../internals/iterate":213,"../internals/new-promise-capability":226,"../internals/perform":248,"../internals/promise-statics-incorrect-iteration":252}],337:[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; @@ -18098,12 +18150,13 @@ var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detec $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { reject: function reject(r) { var capability = newPromiseCapabilityModule.f(this); - call(capability.reject, undefined, r); + var capabilityReject = capability.reject; + capabilityReject(r); return capability.promise; } }); -},{"../internals/export":149,"../internals/function-call":155,"../internals/new-promise-capability":193,"../internals/promise-constructor-detection":215}],298:[function(require,module,exports){ +},{"../internals/export":170,"../internals/new-promise-capability":226,"../internals/promise-constructor-detection":249}],338:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); @@ -18123,13 +18176,15 @@ $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR } }); -},{"../internals/export":149,"../internals/get-built-in":158,"../internals/is-pure":181,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/promise-resolve":217}],299:[function(require,module,exports){ +},{"../internals/export":170,"../internals/get-built-in":182,"../internals/is-pure":210,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250,"../internals/promise-resolve":251}],339:[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 inheritIfRequired = require('../internals/inherit-if-required'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var create = require('../internals/object-create'); var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; var isPrototypeOf = require('../internals/object-is-prototype-of'); var isRegExp = require('../internals/is-regexp'); @@ -18137,7 +18192,7 @@ 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 redefine = require('../internals/redefine'); +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; @@ -18155,7 +18210,7 @@ var charAt = uncurryThis(''.charAt); var replace = uncurryThis(''.replace); var stringIndexOf = uncurryThis(''.indexOf); var stringSlice = uncurryThis(''.slice); -// TODO: Use only propper RegExpIdentifierName +// TODO: Use only proper RegExpIdentifierName var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/; var re1 = /a/g; var re2 = /a/g; @@ -18170,7 +18225,7 @@ 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'; + return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i'; })); var handleDotAll = function (string) { @@ -18202,7 +18257,7 @@ var handleNCG = function (string) { var index = 0; var result = ''; var named = []; - var names = {}; + var names = create(null); var brackets = false; var ncg = false; var groupid = 0; @@ -18211,7 +18266,7 @@ var handleNCG = function (string) { for (; index <= length; index++) { chr = charAt(string, index); if (chr === '\\') { - chr = chr + charAt(string, ++index); + chr += charAt(string, ++index); } else if (chr === ']') { brackets = false; } else if (!brackets) switch (true) { @@ -18309,13 +18364,13 @@ if (isForced('RegExp', BASE_FORCED)) { RegExpPrototype.constructor = RegExpWrapper; RegExpWrapper.prototype = RegExpPrototype; - redefine(global, 'RegExp', RegExpWrapper); + defineBuiltIn(global, 'RegExp', RegExpWrapper, { constructor: true }); } // https://tc39.es/ecma262/#sec-get-regexp-@@species setSpecies('RegExp'); -},{"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/internal-state":173,"../internals/is-forced":178,"../internals/is-regexp":182,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/proxy-accessor":219,"../internals/redefine":222,"../internals/regexp-get-flags":226,"../internals/regexp-sticky-helpers":227,"../internals/regexp-unsupported-dot-all":228,"../internals/regexp-unsupported-ncg":229,"../internals/set-species":233,"../internals/to-string":256,"../internals/well-known-symbol":268}],300:[function(require,module,exports){ +},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/descriptors":153,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/is-forced":205,"../internals/is-regexp":211,"../internals/object-create":229,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/proxy-accessor":253,"../internals/regexp-get-flags":258,"../internals/regexp-sticky-helpers":259,"../internals/regexp-unsupported-dot-all":260,"../internals/regexp-unsupported-ncg":261,"../internals/set-species":265,"../internals/to-string":291,"../internals/well-known-symbol":306}],340:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var exec = require('../internals/regexp-exec'); @@ -18326,10 +18381,10 @@ $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { exec: exec }); -},{"../internals/export":149,"../internals/regexp-exec":224}],301:[function(require,module,exports){ +},{"../internals/export":170,"../internals/regexp-exec":256}],341:[function(require,module,exports){ 'use strict'; var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; -var redefine = require('../internals/redefine'); +var defineBuiltIn = require('../internals/define-built-in'); var anObject = require('../internals/an-object'); var $toString = require('../internals/to-string'); var fails = require('../internals/fails'); @@ -18337,16 +18392,16 @@ var getRegExpFlags = require('../internals/regexp-get-flags'); var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; -var n$ToString = RegExpPrototype[TO_STRING]; +var nativeToString = RegExpPrototype[TO_STRING]; -var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +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 && n$ToString.name != TO_STRING; +var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING; // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { - redefine(RegExp.prototype, TO_STRING, function toString() { + defineBuiltIn(RegExpPrototype, TO_STRING, function toString() { var R = anObject(this); var pattern = $toString(R.source); var flags = $toString(getRegExpFlags(R)); @@ -18354,7 +18409,23 @@ if (NOT_GENERIC || INCORRECT_NAME) { }, { unsafe: true }); } -},{"../internals/an-object":101,"../internals/fails":150,"../internals/function-name":156,"../internals/redefine":222,"../internals/regexp-get-flags":226,"../internals/to-string":256}],302:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/define-built-in":149,"../internals/fails":171,"../internals/function-name":178,"../internals/regexp-get-flags":258,"../internals/to-string":291}],342:[function(require,module,exports){ +'use strict'; +var collection = require('../internals/collection'); +var collectionStrong = require('../internals/collection-strong'); + +// `Set` constructor +// https://tc39.es/ecma262/#sec-set-objects +collection('Set', function (init) { + return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); + +},{"../internals/collection":140,"../internals/collection-strong":139}],343:[function(require,module,exports){ +'use strict'; +// TODO: Remove this module from `core-js@4` since it's replaced to module below +require('../modules/es.set.constructor'); + +},{"../modules/es.set.constructor":342}],344:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); @@ -18377,12 +18448,13 @@ $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, } }); -},{"../internals/correct-is-regexp-logic":126,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/not-a-regexp":194,"../internals/require-object-coercible":230,"../internals/to-string":256}],303:[function(require,module,exports){ +},{"../internals/correct-is-regexp-logic":142,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/not-a-regexp":227,"../internals/require-object-coercible":262,"../internals/to-string":291}],345:[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/define-iterator'); +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; @@ -18403,17 +18475,18 @@ defineIterator(String, 'String', function (iterated) { var string = state.string; var index = state.index; var point; - if (index >= string.length) return { value: undefined, done: true }; + if (index >= string.length) return createIterResultObject(undefined, true); point = charAt(string, index); state.index += point.length; - return { value: point, done: false }; + return createIterResultObject(point, false); }); -},{"../internals/define-iterator":132,"../internals/internal-state":173,"../internals/string-multibyte":239,"../internals/to-string":256}],304:[function(require,module,exports){ +},{"../internals/create-iter-result-object":144,"../internals/internal-state":199,"../internals/iterator-define":216,"../internals/string-multibyte":271,"../internals/to-string":291}],346:[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'); @@ -18428,7 +18501,7 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa // https://tc39.es/ecma262/#sec-string.prototype.match function match(regexp) { var O = requireObjectCoercible(this); - var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH); + var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH); return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O)); }, // `RegExp.prototype[@@match]` method @@ -18458,7 +18531,7 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa ]; }); -},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-call":155,"../internals/get-method":161,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/to-length":249,"../internals/to-string":256}],305:[function(require,module,exports){ +},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-call":177,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/to-length":284,"../internals/to-string":291}],347:[function(require,module,exports){ 'use strict'; var apply = require('../internals/function-apply'); var call = require('../internals/function-call'); @@ -18467,6 +18540,7 @@ var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known- 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'); @@ -18524,7 +18598,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa // https://tc39.es/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); - var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE); + var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE); return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue); @@ -18548,13 +18622,16 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa if (!functionalReplace) replaceValue = toString(replaceValue); var global = rx.global; + var fullUnicode; if (global) { - var fullUnicode = rx.unicode; + fullUnicode = rx.unicode; rx.lastIndex = 0; } + var results = []; + var result; while (true) { - var result = regExpExec(rx, S); + result = regExpExec(rx, S); if (result === null) break; push(results, result); @@ -18572,6 +18649,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa var matched = toString(result[0]); var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); var captures = []; + var replacement; // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in @@ -18582,7 +18660,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa if (functionalReplace) { var replacerArgs = concat([matched], captures, position, S); if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); - var replacement = toString(apply(replaceValue, undefined, replacerArgs)); + replacement = toString(apply(replaceValue, undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } @@ -18591,16 +18669,18 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa nextSourcePosition = position + matched.length; } } + return accumulatedResult + stringSlice(S, nextSourcePosition); } ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); -},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/fails":150,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-method":161,"../internals/get-substitution":162,"../internals/is-callable":176,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/to-integer-or-infinity":248,"../internals/to-length":249,"../internals/to-string":256,"../internals/well-known-symbol":268}],306:[function(require,module,exports){ +},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/fails":171,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-method":186,"../internals/get-substitution":187,"../internals/is-callable":203,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/to-integer-or-infinity":283,"../internals/to-length":284,"../internals/to-string":291,"../internals/well-known-symbol":306}],348:[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'); @@ -18614,7 +18694,7 @@ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCal // https://tc39.es/ecma262/#sec-string.prototype.search function search(regexp) { var O = requireObjectCoercible(this); - var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH); + var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH); return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O)); }, // `RegExp.prototype[@@search]` method @@ -18635,21 +18715,22 @@ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCal ]; }); -},{"../internals/an-object":101,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-call":155,"../internals/get-method":161,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/same-value":231,"../internals/to-string":256}],307:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-call":177,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/same-value":264,"../internals/to-string":291}],349:[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 isRegExp = require('../internals/is-regexp'); var anObject = require('../internals/an-object'); +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 toString = require('../internals/to-string'); var getMethod = require('../internals/get-method'); -var arraySlice = require('../internals/array-slice-simple'); +var arraySlice = require('../internals/array-slice'); var callRegExpExec = require('../internals/regexp-exec-abstract'); var regexpExec = require('../internals/regexp-exec'); var stickyHelpers = require('../internals/regexp-sticky-helpers'); @@ -18678,11 +18759,11 @@ var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { var internalSplit; if ( - 'abbc'.split(/(b)*/)[1] == 'c' || + '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 || + '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 @@ -18734,7 +18815,7 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa // https://tc39.es/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible(this); - var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT); + var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT); return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit); @@ -18793,7 +18874,41 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa ]; }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); -},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/array-slice-simple":116,"../internals/fails":150,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-method":161,"../internals/is-regexp":182,"../internals/regexp-exec":224,"../internals/regexp-exec-abstract":223,"../internals/regexp-sticky-helpers":227,"../internals/require-object-coercible":230,"../internals/species-constructor":238,"../internals/to-length":249,"../internals/to-string":256}],308:[function(require,module,exports){ +},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/array-slice":131,"../internals/fails":171,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/is-regexp":211,"../internals/regexp-exec":256,"../internals/regexp-exec-abstract":255,"../internals/regexp-sticky-helpers":259,"../internals/require-object-coercible":262,"../internals/species-constructor":270,"../internals/to-length":284,"../internals/to-string":291}],350:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); +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 stringSlice = uncurryThis(''.slice); +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.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 stringSlice(that, index, index + search.length) === search; + } +}); + +},{"../internals/correct-is-regexp-logic":142,"../internals/export":170,"../internals/function-uncurry-this-clause":180,"../internals/is-pure":210,"../internals/not-a-regexp":227,"../internals/object-get-own-property-descriptor":232,"../internals/require-object-coercible":262,"../internals/to-length":284,"../internals/to-string":291}],351:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $trim = require('../internals/string-trim').trim; @@ -18807,7 +18922,7 @@ $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { } }); -},{"../internals/export":149,"../internals/string-trim":241,"../internals/string-trim-forced":240}],309:[function(require,module,exports){ +},{"../internals/export":170,"../internals/string-trim":273,"../internals/string-trim-forced":272}],352:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); @@ -18815,7 +18930,7 @@ 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/native-symbol'); +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'); @@ -18833,14 +18948,15 @@ var getOwnPropertyDescriptorModule = require('../internals/object-get-own-proper var definePropertyModule = require('../internals/object-define-property'); var definePropertiesModule = require('../internals/object-define-properties'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); -var redefine = require('../internals/redefine'); +var defineBuiltIn = require('../internals/define-built-in'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); 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 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'); @@ -18856,6 +18972,7 @@ var getInternalState = InternalStateModule.getterFor(SYMBOL); var ObjectPrototype = Object[PROTOTYPE]; var $Symbol = global.Symbol; var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; +var RangeError = global.RangeError; var TypeError = global.TypeError; var QObject = global.QObject; var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; @@ -18872,18 +18989,20 @@ var WellKnownSymbolsStore = shared('wks'); 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 fallbackDefineProperty = 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 setSymbolDescriptor = DESCRIPTORS && fails(function () { + return nativeObjectCreate(nativeDefineProperty({}, 'a', { + get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } + })).a !== 7; +}) ? fallbackDefineProperty : nativeDefineProperty; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); @@ -18903,7 +19022,7 @@ var $defineProperty = function defineProperty(O, P, Attributes) { anObject(Attributes); if (hasOwn(AllSymbols, key)) { if (!Attributes.enumerable) { - if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); + if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null))); O[HIDDEN][key] = true; } else { if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; @@ -18970,13 +19089,20 @@ var $getOwnPropertySymbols = function (O) { // https://tc39.es/ecma262/#sec-symbol-constructor if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { - if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor'); + if (isPrototypeOf(SymbolPrototype, this)) throw new 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)); + var $this = this === undefined ? global : this; + if ($this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); + if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag)) $this[HIDDEN][tag] = false; + var descriptor = createPropertyDescriptor(1, value); + try { + setSymbolDescriptor($this, tag, descriptor); + } catch (error) { + if (!(error instanceof RangeError)) throw error; + fallbackDefineProperty($this, tag, descriptor); + } }; if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); return wrap(tag, description); @@ -18984,11 +19110,11 @@ if (!NATIVE_SYMBOL) { SymbolPrototype = $Symbol[PROTOTYPE]; - redefine(SymbolPrototype, 'toString', function toString() { + defineBuiltIn(SymbolPrototype, 'toString', function toString() { return getInternalState(this).tag; }); - redefine($Symbol, 'withoutSetter', function (description) { + defineBuiltIn($Symbol, 'withoutSetter', function (description) { return wrap(uid(description), description); }); @@ -19005,19 +19131,19 @@ if (!NATIVE_SYMBOL) { if (DESCRIPTORS) { // https://github.com/tc39/proposal-Symbol-description - nativeDefineProperty(SymbolPrototype, 'description', { + defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { return getInternalState(this).description; } }); if (!IS_PURE) { - redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); + defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); } } } -$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { +$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { Symbol: $Symbol }); @@ -19061,7 +19187,7 @@ setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; -},{"../internals/an-object":101,"../internals/array-iteration":111,"../internals/create-property-descriptor":130,"../internals/define-well-known-symbol":133,"../internals/descriptors":134,"../internals/export":149,"../internals/fails":150,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/internal-state":173,"../internals/is-pure":181,"../internals/native-symbol":191,"../internals/object-create":196,"../internals/object-define-properties":197,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-get-own-property-names-external":200,"../internals/object-get-own-property-symbols":202,"../internals/object-is-prototype-of":204,"../internals/object-keys":206,"../internals/object-property-is-enumerable":207,"../internals/redefine":222,"../internals/set-to-string-tag":234,"../internals/shared":237,"../internals/shared-key":235,"../internals/symbol-define-to-primitive":242,"../internals/to-indexed-object":247,"../internals/to-property-key":254,"../internals/to-string":256,"../internals/uid":263,"../internals/well-known-symbol":268,"../internals/well-known-symbol-wrapped":267}],310:[function(require,module,exports){ +},{"../internals/an-object":114,"../internals/array-iteration":125,"../internals/create-property-descriptor":146,"../internals/define-built-in":149,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/export":170,"../internals/fails":171,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/internal-state":199,"../internals/is-pure":210,"../internals/object-create":229,"../internals/object-define-properties":230,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/object-get-own-property-names":234,"../internals/object-get-own-property-names-external":233,"../internals/object-get-own-property-symbols":235,"../internals/object-is-prototype-of":238,"../internals/object-keys":240,"../internals/object-property-is-enumerable":241,"../internals/set-to-string-tag":266,"../internals/shared":269,"../internals/shared-key":267,"../internals/symbol-constructor-detection":274,"../internals/symbol-define-to-primitive":275,"../internals/to-indexed-object":282,"../internals/to-property-key":289,"../internals/to-string":291,"../internals/uid":299,"../internals/well-known-symbol":306,"../internals/well-known-symbol-define":304,"../internals/well-known-symbol-wrapped":305}],353:[function(require,module,exports){ // `Symbol.prototype.description` getter // https://tc39.es/ecma262/#sec-symbol.prototype.description 'use strict'; @@ -19073,7 +19199,7 @@ 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 defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var NativeSymbol = global.Symbol; @@ -19099,36 +19225,37 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; - var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)'; - var symbolToString = uncurryThis(SymbolPrototype.toString); - var symbolValueOf = uncurryThis(SymbolPrototype.valueOf); + var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; + var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); + var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); - defineProperty(SymbolPrototype, 'description', { + defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { - var symbol = symbolValueOf(this); - var string = symbolToString(symbol); + 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; } }); - $({ global: true, forced: true }, { + $({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } -},{"../internals/copy-constructor-properties":125,"../internals/descriptors":134,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/is-callable":176,"../internals/object-define-property":198,"../internals/object-is-prototype-of":204,"../internals/to-string":256}],311:[function(require,module,exports){ +},{"../internals/copy-constructor-properties":141,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/is-callable":203,"../internals/object-is-prototype-of":238,"../internals/to-string":291}],354:[function(require,module,exports){ +'use strict'; 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/native-symbol-registry'); +var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); var StringToSymbolRegistry = shared('string-to-symbol-registry'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); @@ -19146,14 +19273,16 @@ $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { } }); -},{"../internals/export":149,"../internals/get-built-in":158,"../internals/has-own-property":164,"../internals/native-symbol-registry":190,"../internals/shared":237,"../internals/to-string":256}],312:[function(require,module,exports){ -var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); +},{"../internals/export":170,"../internals/get-built-in":182,"../internals/has-own-property":189,"../internals/shared":269,"../internals/symbol-registry-detection":276,"../internals/to-string":291}],355:[function(require,module,exports){ +'use strict'; +var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); // `Symbol.iterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.iterator defineWellKnownSymbol('iterator'); -},{"../internals/define-well-known-symbol":133}],313:[function(require,module,exports){ +},{"../internals/well-known-symbol-define":304}],356:[function(require,module,exports){ +'use strict'; // 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'); @@ -19161,13 +19290,14 @@ require('../modules/es.symbol.key-for'); require('../modules/es.json.stringify'); require('../modules/es.object.get-own-property-symbols'); -},{"../modules/es.json.stringify":285,"../modules/es.object.get-own-property-symbols":289,"../modules/es.symbol.constructor":309,"../modules/es.symbol.for":311,"../modules/es.symbol.key-for":314}],314:[function(require,module,exports){ +},{"../modules/es.json.stringify":323,"../modules/es.object.get-own-property-symbols":329,"../modules/es.symbol.constructor":352,"../modules/es.symbol.for":354,"../modules/es.symbol.key-for":357}],357:[function(require,module,exports){ +'use strict'; 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/native-symbol-registry'); +var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); @@ -19175,12 +19305,12 @@ var SymbolToStringRegistry = shared('symbol-to-string-registry'); // 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 (!isSymbol(sym)) throw new TypeError(tryToString(sym) + ' is not a symbol'); if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; } }); -},{"../internals/export":149,"../internals/has-own-property":164,"../internals/is-symbol":183,"../internals/native-symbol-registry":190,"../internals/shared":237,"../internals/try-to-string":257}],315:[function(require,module,exports){ +},{"../internals/export":170,"../internals/has-own-property":189,"../internals/is-symbol":212,"../internals/shared":269,"../internals/symbol-registry-detection":276,"../internals/try-to-string":293}],358:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); @@ -19196,7 +19326,7 @@ exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-copy-within":105,"../internals/function-uncurry-this":157}],316:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-copy-within":119,"../internals/function-uncurry-this":181}],359:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $every = require('../internals/array-iteration').every; @@ -19210,29 +19340,38 @@ exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) { return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],317:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],360:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); -var call = require('../internals/function-call'); 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'); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var slice = uncurryThis(''.slice); + +// 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; +}); // `%TypedArray%.prototype.fill` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill exportTypedArrayMethod('fill', function fill(value /* , start, end */) { var length = arguments.length; - return call( - $fill, - aTypedArray(this), - value, - length > 1 ? arguments[1] : undefined, - length > 2 ? arguments[2] : undefined - ); -}); + 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); -},{"../internals/array-buffer-view-core":103,"../internals/array-fill":106,"../internals/function-call":155}],318:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-fill":120,"../internals/classof":138,"../internals/fails":171,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/to-big-int":280}],361:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $filter = require('../internals/array-iteration').filter; @@ -19248,7 +19387,7 @@ exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) { return fromSpeciesAndList(this, list); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111,"../internals/typed-array-from-species-and-list":260}],319:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125,"../internals/typed-array-from-species-and-list":296}],362:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $findIndex = require('../internals/array-iteration').findIndex; @@ -19262,7 +19401,7 @@ exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */ return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],320:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],363:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $find = require('../internals/array-iteration').find; @@ -19276,7 +19415,7 @@ exportTypedArrayMethod('find', function find(predicate /* , thisArg */) { return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],321:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],364:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $forEach = require('../internals/array-iteration').forEach; @@ -19290,7 +19429,7 @@ exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) { $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],322:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],365:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $includes = require('../internals/array-includes').includes; @@ -19304,7 +19443,7 @@ exportTypedArrayMethod('includes', function includes(searchElement /* , fromInde return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-includes":110}],323:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-includes":124}],366:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $indexOf = require('../internals/array-includes').indexOf; @@ -19318,7 +19457,7 @@ exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-includes":110}],324:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-includes":124}],367:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var fails = require('../internals/fails'); @@ -19366,7 +19505,7 @@ exportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUE // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); -},{"../internals/array-buffer-view-core":103,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/well-known-symbol":268,"../modules/es.array.iterator":278}],325:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/well-known-symbol":306,"../modules/es.array.iterator":316}],368:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var uncurryThis = require('../internals/function-uncurry-this'); @@ -19381,7 +19520,7 @@ exportTypedArrayMethod('join', function join(separator) { return $join(aTypedArray(this), separator); }); -},{"../internals/array-buffer-view-core":103,"../internals/function-uncurry-this":157}],326:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/function-uncurry-this":181}],369:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var apply = require('../internals/function-apply'); @@ -19397,7 +19536,7 @@ exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fr return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-last-index-of":112,"../internals/function-apply":152}],327:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-last-index-of":126,"../internals/function-apply":174}],370:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $map = require('../internals/array-iteration').map; @@ -19414,7 +19553,7 @@ exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) { }); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111,"../internals/typed-array-species-constructor":262}],328:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125,"../internals/typed-array-species-constructor":298}],371:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $reduceRight = require('../internals/array-reduce').right; @@ -19422,14 +19561,14 @@ var $reduceRight = require('../internals/array-reduce').right; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -// `%TypedArray%.prototype.reduceRicht` method +// `%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); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-reduce":115}],329:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-reduce":129}],372:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $reduce = require('../internals/array-reduce').left; @@ -19444,7 +19583,7 @@ exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */ return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-reduce":115}],330:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-reduce":129}],373:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); @@ -19467,7 +19606,7 @@ exportTypedArrayMethod('reverse', function reverse() { } return that; }); -},{"../internals/array-buffer-view-core":103}],331:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117}],374:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var call = require('../internals/function-call'); @@ -19484,15 +19623,15 @@ var $set = Int8ArrayPrototype && Int8ArrayPrototype.set; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing +var WORKS_WITH_OBJECTS_AND_GENERIC_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; }); // 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 TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () { var array = new Int8Array(2); array.set(1); array.set('2', 1); @@ -19505,15 +19644,15 @@ 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); + if (WORKS_WITH_OBJECTS_AND_GENERIC_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'); + if (len + offset > length) throw new RangeError('Wrong length'); while (index < len) this[offset + index] = src[index++]; -}, !WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); +}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); -},{"../internals/array-buffer-view-core":103,"../internals/fails":150,"../internals/function-call":155,"../internals/global":163,"../internals/length-of-array-like":188,"../internals/to-object":250,"../internals/to-offset":251}],332:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/fails":171,"../internals/function-call":177,"../internals/global":188,"../internals/length-of-array-like":219,"../internals/to-object":285,"../internals/to-offset":286}],375:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); @@ -19524,7 +19663,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var FORCED = fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing + // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).slice(); }); @@ -19540,7 +19679,7 @@ exportTypedArrayMethod('slice', function slice(start, end) { return result; }, FORCED); -},{"../internals/array-buffer-view-core":103,"../internals/array-slice":117,"../internals/fails":150,"../internals/typed-array-species-constructor":262}],333:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-slice":131,"../internals/fails":171,"../internals/typed-array-species-constructor":298}],376:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var $some = require('../internals/array-iteration').some; @@ -19554,10 +19693,10 @@ exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) { return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); -},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],334:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],377:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); -var uncurryThis = require('../internals/function-uncurry-this'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); var fails = require('../internals/fails'); var aCallable = require('../internals/a-callable'); var internalSort = require('../internals/array-sort'); @@ -19570,16 +19709,16 @@ var WEBKIT = require('../internals/engine-webkit-version'); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var Uint16Array = global.Uint16Array; -var un$Sort = Uint16Array && uncurryThis(Uint16Array.prototype.sort); +var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort); // WebKit -var ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails(function () { - un$Sort(new Uint16Array(2), null); +var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () { + nativeSort(new Uint16Array(2), null); }) && fails(function () { - un$Sort(new Uint16Array(2), {}); + nativeSort(new Uint16Array(2), {}); })); -var STABLE_SORT = !!un$Sort && !fails(function () { +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; @@ -19596,7 +19735,7 @@ var STABLE_SORT = !!un$Sort && !fails(function () { expected[index] = index - 2 * mod + 3; } - un$Sort(array, function (a, b) { + nativeSort(array, function (a, b) { return (a / 4 | 0) - (b / 4 | 0); }); @@ -19621,12 +19760,12 @@ var getSortCompare = function (comparefn) { // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort exportTypedArrayMethod('sort', function sort(comparefn) { if (comparefn !== undefined) aCallable(comparefn); - if (STABLE_SORT) return un$Sort(this, comparefn); + if (STABLE_SORT) return nativeSort(this, comparefn); return internalSort(aTypedArray(this), getSortCompare(comparefn)); }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); -},{"../internals/a-callable":95,"../internals/array-buffer-view-core":103,"../internals/array-sort":118,"../internals/engine-ff-version":138,"../internals/engine-is-ie-or-edge":140,"../internals/engine-v8-version":146,"../internals/engine-webkit-version":147,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163}],335:[function(require,module,exports){ +},{"../internals/a-callable":108,"../internals/array-buffer-view-core":117,"../internals/array-sort":132,"../internals/engine-ff-version":158,"../internals/engine-is-ie-or-edge":161,"../internals/engine-v8-version":167,"../internals/engine-webkit-version":168,"../internals/fails":171,"../internals/function-uncurry-this-clause":180,"../internals/global":188}],378:[function(require,module,exports){ 'use strict'; var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); var toLength = require('../internals/to-length'); @@ -19650,7 +19789,7 @@ exportTypedArrayMethod('subarray', function subarray(begin, end) { ); }); -},{"../internals/array-buffer-view-core":103,"../internals/to-absolute-index":245,"../internals/to-length":249,"../internals/typed-array-species-constructor":262}],336:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/to-absolute-index":279,"../internals/to-length":284,"../internals/typed-array-species-constructor":298}],379:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var apply = require('../internals/function-apply'); @@ -19669,7 +19808,7 @@ var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { }); var FORCED = fails(function () { - return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString(); + return [1, 2].toLocaleString() !== new Int8Array([1, 2]).toLocaleString(); }) || !fails(function () { Int8Array.prototype.toLocaleString.call([1, 2]); }); @@ -19684,7 +19823,7 @@ exportTypedArrayMethod('toLocaleString', function toLocaleString() { ); }, FORCED); -},{"../internals/array-buffer-view-core":103,"../internals/array-slice":117,"../internals/fails":150,"../internals/function-apply":152,"../internals/global":163}],337:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/array-slice":131,"../internals/fails":171,"../internals/function-apply":174,"../internals/global":188}],380:[function(require,module,exports){ 'use strict'; var exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod; var fails = require('../internals/fails'); @@ -19702,13 +19841,14 @@ if (fails(function () { arrayToString.call({}); })) { }; } -var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; +var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString; // `%TypedArray%.prototype.toString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); -},{"../internals/array-buffer-view-core":103,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163}],338:[function(require,module,exports){ +},{"../internals/array-buffer-view-core":117,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188}],381:[function(require,module,exports){ +'use strict'; var createTypedArrayConstructor = require('../internals/typed-array-constructor'); // `Uint8Array` constructor @@ -19719,7 +19859,8 @@ createTypedArrayConstructor('Uint8', function (init) { }; }); -},{"../internals/typed-array-constructor":258}],339:[function(require,module,exports){ +},{"../internals/typed-array-constructor":294}],382:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); var DOMIterables = require('../internals/dom-iterables'); var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); @@ -19743,16 +19884,17 @@ for (var COLLECTION_NAME in DOMIterables) { handlePrototype(DOMTokenListPrototype); -},{"../internals/array-for-each":107,"../internals/create-non-enumerable-property":129,"../internals/dom-iterables":136,"../internals/dom-token-list-prototype":137,"../internals/global":163}],340:[function(require,module,exports){ +},{"../internals/array-for-each":121,"../internals/create-non-enumerable-property":145,"../internals/dom-iterables":156,"../internals/dom-token-list-prototype":157,"../internals/global":188}],383:[function(require,module,exports){ +'use strict'; var global = require('../internals/global'); 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 setToStringTag = require('../internals/set-to-string-tag'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); -var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { @@ -19763,9 +19905,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues; } - if (!CollectionPrototype[TO_STRING_TAG]) { - createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); - } + setToStringTag(CollectionPrototype, COLLECTION_NAME, true); 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 { @@ -19783,7 +19923,7 @@ for (var COLLECTION_NAME in DOMIterables) { handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); -},{"../internals/create-non-enumerable-property":129,"../internals/dom-iterables":136,"../internals/dom-token-list-prototype":137,"../internals/global":163,"../internals/well-known-symbol":268,"../modules/es.array.iterator":278}],341:[function(require,module,exports){ +},{"../internals/create-non-enumerable-property":145,"../internals/dom-iterables":156,"../internals/dom-token-list-prototype":157,"../internals/global":188,"../internals/set-to-string-tag":266,"../internals/well-known-symbol":306,"../modules/es.array.iterator":316}],384:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -19892,7 +20032,7 @@ function objectToString(o) { return Object.prototype.toString.call(o); } -},{"buffer":90}],342:[function(require,module,exports){ +},{"buffer":103}],385:[function(require,module,exports){ /* * Date Format 1.2.3 * (c) 2007-2009 Steven Levithan @@ -20120,7 +20260,77 @@ function kindOf(val) { } })(this); -},{}],343:[function(require,module,exports){ +},{}],386:[function(require,module,exports){ +'use strict'; + +var hasPropertyDescriptors = require('has-property-descriptors')(); + +var GetIntrinsic = require('get-intrinsic'); + +var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true); +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var gopd = require('gopd'); + +/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ +module.exports = function defineDataProperty( + obj, + property, + value +) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new $TypeError('`obj` must be an object or a function`'); + } + if (typeof property !== 'string' && typeof property !== 'symbol') { + throw new $TypeError('`property` must be a string or a symbol`'); + } + if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { + throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); + } + if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { + throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); + } + if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { + throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); + } + if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { + throw new $TypeError('`loose`, if provided, must be a boolean'); + } + + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + + /* @type {false | TypedPropertyDescriptor} */ + var desc = !!gopd && gopd(obj, property); + + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { + // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable + obj[property] = value; // eslint-disable-line no-param-reassign + } else { + throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); + } +}; + +},{"get-intrinsic":392,"gopd":393,"has-property-descriptors":394}],387:[function(require,module,exports){ /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk @@ -20200,7 +20410,7 @@ function escapeHtml(string) { : html; } -},{}],344:[function(require,module,exports){ +},{}],388:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -20699,7 +20909,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) { } } -},{}],345:[function(require,module,exports){ +},{}],389:[function(require,module,exports){ 'use strict'; var isCallable = require('is-callable'); @@ -20763,49 +20973,81 @@ var forEach = function forEach(list, iterator, thisArg) { module.exports = forEach; -},{"is-callable":367}],346:[function(require,module,exports){ +},{"is-callable":412}],390:[function(require,module,exports){ 'use strict'; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; var toStr = Object.prototype.toString; +var max = Math.max; var funcType = '[object Function]'; +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + module.exports = function bind(that) { var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } - var args = slice.call(arguments, 1); + var args = slicy(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, - args.concat(slice.call(arguments)) + concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); } + return target.apply( + that, + concatty(args, arguments) + ); + }; - var boundLength = Math.max(0, target.length - args.length); + var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); + boundArgs[i] = '$' + i; } - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; @@ -20817,14 +21059,14 @@ module.exports = function bind(that) { return bound; }; -},{}],347:[function(require,module,exports){ +},{}],391:[function(require,module,exports){ 'use strict'; var implementation = require('./implementation'); module.exports = Function.prototype.bind || implementation; -},{"./implementation":346}],348:[function(require,module,exports){ +},{"./implementation":390}],392:[function(require,module,exports){ 'use strict'; var undefined; @@ -21041,7 +21283,7 @@ var LEGACY_ALIASES = { }; var bind = require('function-bind'); -var hasOwn = require('has'); +var hasOwn = require('hasown'); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); @@ -21177,7 +21419,7 @@ module.exports = function GetIntrinsic(name, allowMissing) { return value; }; -},{"function-bind":347,"has":354,"has-proto":350,"has-symbols":351}],349:[function(require,module,exports){ +},{"function-bind":391,"has-proto":395,"has-symbols":396,"hasown":399}],393:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('get-intrinsic'); @@ -21195,7 +21437,42 @@ if ($gOPD) { module.exports = $gOPD; -},{"get-intrinsic":348}],350:[function(require,module,exports){ +},{"get-intrinsic":392}],394:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +var hasPropertyDescriptors = function hasPropertyDescriptors() { + if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + return true; + } catch (e) { + // IE 8 has a broken defineProperty + return false; + } + } + return false; +}; + +hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + // node v0.6 has a bug where array lengths can be Set but not Defined + if (!hasPropertyDescriptors()) { + return null; + } + try { + return $defineProperty([], 'length', { value: 1 }).length !== 1; + } catch (e) { + // In Firefox 4-22, defining length on an array throws an exception. + return true; + } +}; + +module.exports = hasPropertyDescriptors; + +},{"get-intrinsic":392}],395:[function(require,module,exports){ 'use strict'; var test = { @@ -21208,7 +21485,7 @@ module.exports = function hasProto() { return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); }; -},{}],351:[function(require,module,exports){ +},{}],396:[function(require,module,exports){ 'use strict'; var origSymbol = typeof Symbol !== 'undefined' && Symbol; @@ -21223,7 +21500,7 @@ module.exports = function hasNativeSymbols() { return hasSymbolSham(); }; -},{"./shams":352}],352:[function(require,module,exports){ +},{"./shams":397}],397:[function(require,module,exports){ 'use strict'; /* eslint complexity: [2, 18], max-statements: [2, 33] */ @@ -21267,7 +21544,7 @@ module.exports = function hasSymbols() { return true; }; -},{}],353:[function(require,module,exports){ +},{}],398:[function(require,module,exports){ 'use strict'; var hasSymbols = require('has-symbols/shams'); @@ -21276,14 +21553,17 @@ module.exports = function hasToStringTagShams() { return hasSymbols() && !!Symbol.toStringTag; }; -},{"has-symbols/shams":352}],354:[function(require,module,exports){ +},{"has-symbols/shams":397}],399:[function(require,module,exports){ 'use strict'; +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; var bind = require('function-bind'); -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); +/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ +module.exports = bind.call(call, $hasOwn); -},{"function-bind":347}],355:[function(require,module,exports){ +},{"function-bind":391}],400:[function(require,module,exports){ var http = require('http') var url = require('url') @@ -21316,7 +21596,7 @@ function validateParams (params) { return params } -},{"http":468,"url":472}],356:[function(require,module,exports){ +},{"http":541,"url":545}],401:[function(require,module,exports){ /*! * humanize-ms - index.js * Copyright(c) 2014 dead_horse @@ -21342,7 +21622,7 @@ module.exports = function (t) { return r; }; -},{"ms":376,"util":419}],357:[function(require,module,exports){ +},{"ms":434,"util":491}],402:[function(require,module,exports){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m @@ -21429,7 +21709,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],358:[function(require,module,exports){ +},{}],403:[function(require,module,exports){ 'use strict'; var types = [ require('./nextTick'), @@ -21528,7 +21808,7 @@ function immediate(task) { } } -},{"./messageChannel":359,"./mutation.js":360,"./nextTick":89,"./queueMicrotask":361,"./stateChange":362,"./timeout":363}],359:[function(require,module,exports){ +},{"./messageChannel":404,"./mutation.js":405,"./nextTick":102,"./queueMicrotask":406,"./stateChange":407,"./timeout":408}],404:[function(require,module,exports){ (function (global){(function (){ 'use strict'; @@ -21549,7 +21829,7 @@ exports.install = function (func) { }; }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],360:[function(require,module,exports){ +},{}],405:[function(require,module,exports){ (function (global){(function (){ 'use strict'; //based off rsvp https://github.com/tildeio/rsvp.js @@ -21574,7 +21854,7 @@ exports.install = function (handle) { }; }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],361:[function(require,module,exports){ +},{}],406:[function(require,module,exports){ (function (global){(function (){ 'use strict'; exports.test = function () { @@ -21588,7 +21868,7 @@ exports.install = function (func) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],362:[function(require,module,exports){ +},{}],407:[function(require,module,exports){ (function (global){(function (){ 'use strict'; @@ -21615,7 +21895,7 @@ exports.install = function (handle) { }; }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],363:[function(require,module,exports){ +},{}],408:[function(require,module,exports){ 'use strict'; exports.test = function () { return true; @@ -21626,7 +21906,7 @@ exports.install = function (t) { setTimeout(t, 0); }; }; -},{}],364:[function(require,module,exports){ +},{}],409:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -21655,7 +21935,7 @@ if (typeof Object.create === 'function') { } } -},{}],365:[function(require,module,exports){ +},{}],410:[function(require,module,exports){ 'use strict'; var hasToStringTag = require('has-tostringtag/shams')(); @@ -21690,7 +21970,7 @@ isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; -},{"call-bind/callBound":92,"has-tostringtag/shams":353}],366:[function(require,module,exports){ +},{"call-bind/callBound":105,"has-tostringtag/shams":398}],411:[function(require,module,exports){ /*! * Determine if an object is a Buffer * @@ -21713,7 +21993,7 @@ function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -},{}],367:[function(require,module,exports){ +},{}],412:[function(require,module,exports){ 'use strict'; var fnToStr = Function.prototype.toString; @@ -21816,7 +22096,7 @@ module.exports = reflectApply return tryFunctionObject(value); }; -},{}],368:[function(require,module,exports){ +},{}],413:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; @@ -21856,7 +22136,7 @@ module.exports = function isGeneratorFunction(fn) { return getProto(fn) === GeneratorFunction; }; -},{"has-tostringtag/shams":353}],369:[function(require,module,exports){ +},{"has-tostringtag/shams":398}],414:[function(require,module,exports){ 'use strict'; var whichTypedArray = require('which-typed-array'); @@ -21865,14 +22145,7 @@ module.exports = function isTypedArray(value) { return !!whichTypedArray(value); }; -},{"which-typed-array":420}],370:[function(require,module,exports){ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - -},{}],371:[function(require,module,exports){ +},{"which-typed-array":492}],415:[function(require,module,exports){ (function (global){(function (){ /* * base64.js @@ -22106,7 +22379,383 @@ module.exports = Array.isArray || function (arr) { })); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],372:[function(require,module,exports){ +},{}],416:[function(require,module,exports){ +var root = require('./_root'); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + +},{"./_root":423}],417:[function(require,module,exports){ +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; + +},{}],418:[function(require,module,exports){ +var Symbol = require('./_Symbol'), + getRawTag = require('./_getRawTag'), + objectToString = require('./_objectToString'); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + +},{"./_Symbol":416,"./_getRawTag":421,"./_objectToString":422}],419:[function(require,module,exports){ +var Symbol = require('./_Symbol'), + arrayMap = require('./_arrayMap'), + isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; + +},{"./_Symbol":416,"./_arrayMap":417,"./isArray":424,"./isSymbol":428}],420:[function(require,module,exports){ +(function (global){(function (){ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],421:[function(require,module,exports){ +var Symbol = require('./_Symbol'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; + +},{"./_Symbol":416}],422:[function(require,module,exports){ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; + +},{}],423:[function(require,module,exports){ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + +},{"./_freeGlobal":420}],424:[function(require,module,exports){ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; + +},{}],425:[function(require,module,exports){ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + +},{}],426:[function(require,module,exports){ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + +},{}],427:[function(require,module,exports){ +var baseGetTag = require('./_baseGetTag'), + isArray = require('./isArray'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; + +},{"./_baseGetTag":418,"./isArray":424,"./isObjectLike":426}],428:[function(require,module,exports){ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; + +},{"./_baseGetTag":418,"./isObjectLike":426}],429:[function(require,module,exports){ +var baseToString = require('./_baseToString'); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; + +},{"./_baseToString":419}],430:[function(require,module,exports){ /*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong @@ -22140,7 +22789,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty * @public */ -function merge(dest, src, redefine) { +function merge (dest, src, redefine) { if (!dest) { throw new TypeError('argument dest is required') } @@ -22154,9 +22803,9 @@ function merge(dest, src, redefine) { redefine = true } - Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) { + Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) { if (!redefine && hasOwnProperty.call(dest, name)) { - // Skip desriptor + // Skip descriptor return } @@ -22168,35 +22817,29 @@ function merge(dest, src, redefine) { return dest } -},{}],373:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ 'use strict'; + /** * @param typeMap [Object] Map of MIME type -> Array[extensions] * @param ... */ - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.replace.js"); - require("core-js/modules/es.regexp.constructor.js"); - require("core-js/modules/es.regexp.to-string.js"); - function Mime() { this._types = Object.create(null); this._extensions = Object.create(null); - for (var i = 0; i < arguments.length; i++) { this.define(arguments[i]); } - this.define = this.define.bind(this); this.getType = this.getType.bind(this); this.getExtension = this.getExtension.bind(this); } + /** * Define mimetype -> extension mappings. Each key is a mime-type that maps * to an array of extensions associated with the type. The first extension is @@ -22216,42 +22859,37 @@ function Mime() { * @param map (Object) type definitions * @param force (Boolean) if true, force overriding of existing definitions */ - - Mime.prototype.define = function (typeMap, force) { for (var type in typeMap) { var extensions = typeMap[type].map(function (t) { return t.toLowerCase(); }); type = type.toLowerCase(); - for (var i = 0; i < extensions.length; i++) { - var ext = extensions[i]; // '*' prefix = not the preferred type for this extension. So fixup the - // extension, and skip it. + var ext = extensions[i]; + // '*' prefix = not the preferred type for this extension. So fixup the + // extension, and skip it. if (ext[0] === '*') { continue; } - if (!force && ext in this._types) { throw new Error('Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".'); } - this._types[ext] = type; - } // Use first extension as default - + } + // Use first extension as default if (force || !this._extensions[type]) { var _ext = extensions[0]; this._extensions[type] = _ext[0] !== '*' ? _ext : _ext.substr(1); } } }; + /** * Lookup a mime type based on extension */ - - Mime.prototype.getType = function (path) { path = String(path); var last = path.replace(/^.*[/\\]/, '').toLowerCase(); @@ -22260,26 +22898,23 @@ Mime.prototype.getType = function (path) { var hasDot = ext.length < last.length - 1; return (hasDot || !hasPath) && this._types[ext] || null; }; + /** * Return file extension associated with a mime type */ - - Mime.prototype.getExtension = function (type) { type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; return type && this._extensions[type.toLowerCase()] || null; }; - module.exports = Mime; -},{"core-js/modules/es.array.map.js":280,"core-js/modules/es.regexp.constructor.js":299,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305}],374:[function(require,module,exports){ +},{"core-js/modules/es.array.map.js":318,"core-js/modules/es.regexp.constructor.js":339,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347}],432:[function(require,module,exports){ 'use strict'; var Mime = require('./Mime'); - module.exports = new Mime(require('./types/standard')); -},{"./Mime":373,"./types/standard":375}],375:[function(require,module,exports){ +},{"./Mime":431,"./types/standard":433}],433:[function(require,module,exports){ "use strict"; module.exports = { @@ -22586,7 +23221,7 @@ module.exports = { "video/webm": ["webm"] }; -},{}],376:[function(require,module,exports){ +},{}],434:[function(require,module,exports){ /** * Helpers. */ @@ -22612,7 +23247,7 @@ var y = d * 365.25; * @api public */ -module.exports = function (val, options) { +module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { @@ -22750,99 +23385,817 @@ function plural(ms, msAbs, n, name) { return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } -},{}],377:[function(require,module,exports){ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ +},{}],435:[function(require,module,exports){ +(function (global){(function (){ +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +// ie, `has-tostringtag/shams +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') + ? Symbol.toStringTag + : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( + [].__proto__ === Array.prototype // eslint-disable-line no-proto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; +function addNumericSeparator(num, str) { + if ( + num === Infinity + || num === -Infinity + || num !== num + || (num && num > -1000 && num < 1000) + || $test.call(/e/, str) + ) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } +var utilInspect = require('./util.inspect'); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if ( + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity + : opts.maxStringLength !== null + ) + ) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } + + if ( + has(opts, 'indent') + && opts.indent !== null + && opts.indent !== '\t' + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) + ) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + + var indent = getIndent(opts, depth); + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } - return Object(val); + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other + /* eslint-env browser */ + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if (obj === global) { + return '{ [object globalThis] }'; + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + if (ys.length === 0) { return tag + '{}'; } + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; } -function shouldUseNative() { - try { - if (!Object.assign) { +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} + +function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } + +// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + if (typeof obj === 'symbol') { + return true; + } + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e) {} + return false; +} + +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + return false; +} + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { return f.name; } + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + // eslint-disable-next-line no-control-regex + var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} + +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} + +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; +} + +function indentedJoin(xs, indent) { + if (xs.length === 0) { return ''; } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section + continue; // eslint-disable-line no-restricted-syntax, no-continue + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + return xs; +} + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./util.inspect":102}],436:[function(require,module,exports){ +'use strict'; + +var keysShim; +if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = require('./isArguments'); // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { return false; } + }; - // Detect buggy property enumeration order in older V8 versions. + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } } + return theKeys; + }; +} +module.exports = keysShim; - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; +},{"./isArguments":438}],437:[function(require,module,exports){ +'use strict'; + +var slice = Array.prototype.slice; +var isArgs = require('./isArguments'); + +var origKeys = Object.keys; +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation'); + +var originalKeys = Object.keys; + +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; } -} + return Object.keys || keysShim; +}; -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; +module.exports = keysShim; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); +},{"./implementation":436,"./isArguments":438}],438:[function(require,module,exports){ +'use strict'; - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; + +},{}],439:[function(require,module,exports){ +'use strict'; + +// modified from https://github.com/es-shims/es6-shim +var objectKeys = require('object-keys'); +var hasSymbols = require('has-symbols/shams')(); +var callBound = require('call-bind/callBound'); +var toObject = Object; +var $push = callBound('Array.prototype.push'); +var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; + +// eslint-disable-next-line no-unused-vars +module.exports = function assign(target, source1) { + if (target == null) { throw new TypeError('target must be an object'); } + var to = toObject(target); // step 1 + if (arguments.length === 1) { + return to; // step 2 + } + for (var s = 1; s < arguments.length; ++s) { + var from = toObject(arguments[s]); // step 3.a.i + + // step 3.a.ii: + var keys = objectKeys(from); + var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); + if (getSymbols) { + var syms = getSymbols(from); + for (var j = 0; j < syms.length; ++j) { + var key = syms[j]; + if ($propIsEnumerable(from, key)) { + $push(keys, key); + } } } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } + // step 3.a.iii: + for (var i = 0; i < keys.length; ++i) { + var nextKey = keys[i]; + if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2 + var propValue = from[nextKey]; // step 3.a.iii.2.a + to[nextKey] = propValue; // step 3.a.iii.2.b } } } - return to; + return to; // step 4 +}; + +},{"call-bind/callBound":105,"has-symbols/shams":397,"object-keys":437}],440:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); + +var lacksProperEnumerationOrder = function () { + if (!Object.assign) { + return false; + } + /* + * v8, specifically in node 4.x, has a bug with incorrect property enumeration order + * note: this does not detect the bug unless there's 20 characters + */ + var str = 'abcdefghijklmnopqrst'; + var letters = str.split(''); + var map = {}; + for (var i = 0; i < letters.length; ++i) { + map[letters[i]] = letters[i]; + } + var obj = Object.assign({}, map); + var actual = ''; + for (var k in obj) { + actual += k; + } + return str !== actual; +}; + +var assignHasPendingExceptions = function () { + if (!Object.assign || !Object.preventExtensions) { + return false; + } + /* + * Firefox 37 still has "pending exception" logic in its Object.assign implementation, + * which is 72% slower than our shim, and Firefox 40's native implementation. + */ + var thrower = Object.preventExtensions({ 1: 2 }); + try { + Object.assign(thrower, 'xy'); + } catch (e) { + return thrower[1] === 'y'; + } + return false; +}; + +module.exports = function getPolyfill() { + if (!Object.assign) { + return implementation; + } + if (lacksProperEnumerationOrder()) { + return implementation; + } + if (assignHasPendingExceptions()) { + return implementation; + } + return Object.assign; }; -},{}],378:[function(require,module,exports){ +},{"./implementation":439}],441:[function(require,module,exports){ (function (process){(function (){ // 'path' module extracted from Node.js v8.11.1 (only the posix part) // transplited with Babel @@ -23375,7 +24728,7 @@ posix.posix = posix; module.exports = posix; }).call(this)}).call(this,require('_process')) -},{"_process":467}],379:[function(require,module,exports){ +},{"_process":540}],442:[function(require,module,exports){ (function (global){(function (){ /*! * Platform.js v1.3.6 @@ -24639,7 +25992,7 @@ module.exports = posix; }.call(this)); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],380:[function(require,module,exports){ +},{}],443:[function(require,module,exports){ (function (process){(function (){ 'use strict'; @@ -24688,7 +26041,7 @@ function nextTick(fn, arg1, arg2, arg3) { }).call(this)}).call(this,require('_process')) -},{"_process":467}],381:[function(require,module,exports){ +},{"_process":540}],444:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -24874,7 +26227,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],382:[function(require,module,exports){ +},{}],445:[function(require,module,exports){ (function (global){(function (){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { @@ -25161,257 +26514,1137 @@ process.umask = function() { return 0; }; error('invalid-input'); } - digit = basicToDigit(input.charCodeAt(index++)); + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],446:[function(require,module,exports){ +'use strict'; + +var replace = String.prototype.replace; +var percentTwenties = /%20/g; + +var Format = { + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' +}; + +module.exports = { + 'default': Format.RFC3986, + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return String(value); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 +}; + +},{}],447:[function(require,module,exports){ +'use strict'; + +var stringify = require('./stringify'); +var parse = require('./parse'); +var formats = require('./formats'); + +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; + +},{"./formats":446,"./parse":448,"./stringify":449}],448:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var defaults = { + allowDots: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: 'utf-8', + charsetSentinel: false, + comma: false, + decoder: utils.decode, + delimiter: '&', + depth: 5, + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1000, + parseArrays: true, + plainObjects: false, + strictNullHandling: false +}; + +var interpretNumericEntities = function (str) { + return str.replace(/&#(\d+);/g, function ($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); +}; + +var parseArrayValue = function (val, options) { + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { + return val.split(','); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + val = utils.maybeMap( + parseArrayValue(part.slice(pos + 1), options), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(val); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + if (has.call(obj, key)) { + obj[key] = utils.combine(obj[key], val); + } else { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var leaf = valuesParsed ? val : parseArrayValue(val, options); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = [].concat(leaf); + } else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var index = parseInt(cleanRoot, 10); + if (!options.parseArrays && cleanRoot === '') { + obj = { 0: leaf }; + } else if ( + !isNaN(index) + && root !== cleanRoot + && String(index) === cleanRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else if (cleanRoot !== '__proto__') { + obj[cleanRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + return { + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; + +},{"./utils":450}],449:[function(require,module,exports){ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + charset: 'utf-8', + charsetSentinel: false, + delimiter: '&', + encode: true, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel +) { + var obj = object; + + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix; + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']'); + + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + strictNullHandling, + skipNulls, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (opts && opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if (opts && 'indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (options.skipNulls && obj[key] === null) { + continue; + } + pushToArray(keys, stringify( + obj[key], + key, + generateArrayPrefix, + commaRoundTrip, + options.strictNullHandling, + options.skipNulls, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; + +},{"./formats":446,"./utils":450,"side-channel":469}],450:[function(require,module,exports){ +'use strict'; + +var formats = require('./formats'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + return array; +}()); - if (digit < t) { - break; - } +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } + if (isArray(obj)) { + var compacted = []; - w *= baseMinusT; + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } - } + item.obj[item.prop] = compacted; + } + } +}; - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } + return obj; +}; - n += floor(i / out); - i %= out; +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); + if (typeof source !== 'object') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } - } + return target; + } - return ucs2encode(output); - } + if (!target || typeof target !== 'object') { + return [target].concat(source); + } - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } - // Cache the length - inputLength = input.length; + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; - handledCPCount = basicLength = output.length; +var decode = function (str, decoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } - // Main encoding loop: - while (handledCPCount < inputLength) { + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + out += string.charAt(i); + continue; + } - delta += (m - n) * handledCPCountPlusOne; - n = m; + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + /* eslint operator-linebreak: [2, "before"] */ + out += hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } + return out; +}; - ++delta; - ++n; +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; - } - return output.join(''); - } + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); + } + } + } - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } + compactQueue(queue); - /*--------------------------------------------------------------------------*/ + return value; +}; - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.4.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { - // in Node.js, io.js, or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { - // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { - // in Rhino or a web browser - root.punycode = punycode; - } +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } -}(this)); + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; -}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],383:[function(require,module,exports){ +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; + } + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; + +},{"./formats":446}],451:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25497,7 +27730,7 @@ var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; -},{}],384:[function(require,module,exports){ +},{}],452:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25584,13 +27817,13 @@ var objectKeys = Object.keys || function (obj) { return res; }; -},{}],385:[function(require,module,exports){ +},{}],453:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); -},{"./decode":383,"./encode":384}],386:[function(require,module,exports){ +},{"./decode":451,"./encode":452}],454:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25722,7 +27955,7 @@ Duplex.prototype._destroy = function (err, cb) { pna.nextTick(cb, err); }; -},{"./_stream_readable":388,"./_stream_writable":390,"core-util-is":341,"inherits":364,"process-nextick-args":380}],387:[function(require,module,exports){ +},{"./_stream_readable":456,"./_stream_writable":458,"core-util-is":384,"inherits":409,"process-nextick-args":443}],455:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25770,7 +28003,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":389,"core-util-is":341,"inherits":364}],388:[function(require,module,exports){ +},{"./_stream_transform":457,"core-util-is":384,"inherits":409}],456:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -25827,7 +28060,7 @@ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } @@ -26397,8 +28630,8 @@ Readable.prototype.pipe = function (dest, pipeOpts) { // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; increasedAwaitDrain = true; } src.pause(); @@ -26492,7 +28725,7 @@ Readable.prototype.unpipe = function (dest) { state.flowing = false; for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); + dests[i].emit('unpipe', this, { hasUnpiped: false }); }return this; } @@ -26792,7 +29025,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./_stream_duplex":386,"./internal/streams/BufferList":391,"./internal/streams/destroy":392,"./internal/streams/stream":393,"_process":467,"core-util-is":341,"events":344,"inherits":364,"isarray":370,"process-nextick-args":380,"safe-buffer":396,"string_decoder/":413,"util":89}],389:[function(require,module,exports){ +},{"./_stream_duplex":454,"./internal/streams/BufferList":459,"./internal/streams/destroy":460,"./internal/streams/stream":461,"_process":540,"core-util-is":384,"events":388,"inherits":409,"isarray":462,"process-nextick-args":443,"safe-buffer":463,"string_decoder/":464,"util":102}],457:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -27007,7 +29240,7 @@ function done(stream, er, data) { return stream.push(null); } -},{"./_stream_duplex":386,"core-util-is":341,"inherits":364}],390:[function(require,module,exports){ +},{"./_stream_duplex":454,"core-util-is":384,"inherits":409}],458:[function(require,module,exports){ (function (process,global,setImmediate){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -27092,7 +29325,7 @@ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } @@ -27360,7 +29593,7 @@ Writable.prototype.uncork = function () { if (state.corked) { state.corked--; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; @@ -27602,7 +29835,7 @@ Writable.prototype.end = function (chunk, encoding, cb) { } // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); + if (!state.ending) endWritable(this, state, cb); }; function needFinish(state) { @@ -27663,11 +29896,9 @@ function onCorkedFinish(corkReq, state, err) { cb(err); entry = entry.next; } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } + + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { @@ -27697,7 +29928,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) -},{"./_stream_duplex":386,"./internal/streams/destroy":392,"./internal/streams/stream":393,"_process":467,"core-util-is":341,"inherits":364,"process-nextick-args":380,"safe-buffer":396,"timers":414,"util-deprecate":416}],391:[function(require,module,exports){ +},{"./_stream_duplex":454,"./internal/streams/destroy":460,"./internal/streams/stream":461,"_process":540,"core-util-is":384,"inherits":409,"process-nextick-args":443,"safe-buffer":463,"timers":486,"util-deprecate":488}],459:[function(require,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -27756,7 +29987,6 @@ module.exports = function () { BufferList.prototype.concat = function concat(n) { if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; @@ -27777,7 +30007,7 @@ if (util && util.inspect && util.inspect.custom) { return this.constructor.name + ' ' + obj; }; } -},{"safe-buffer":396,"util":89}],392:[function(require,module,exports){ +},{"safe-buffer":463,"util":102}],460:[function(require,module,exports){ 'use strict'; /**/ @@ -27795,832 +30025,455 @@ function destroy(err, cb) { if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; -},{"process-nextick-args":380}],393:[function(require,module,exports){ -module.exports = require('events').EventEmitter; - -},{"events":344}],394:[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":386,"./lib/_stream_passthrough.js":387,"./lib/_stream_readable.js":388,"./lib/_stream_transform.js":389,"./lib/_stream_writable.js":390}],395:[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) { - "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"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function(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 || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return 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) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - 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 = GeneratorFunctionPrototype; - define(Gp, "constructor", GeneratorFunctionPrototype); - define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); - GeneratorFunction.displayName = define( - GeneratorFunctionPrototype, - toStringTagSymbol, - "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) { - 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. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - 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); - define(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; - } - } - }; - } - - // 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"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - define(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. - 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) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); + } else if (err) { + if (!this._writableState) { + pna.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, this, err); } + } - if (typeof iterable.next === "function") { - return iterable; - } + return this; + } - 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; - } - } + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - next.value = undefined; - next.done = true; + if (this._readableState) { + this._readableState.destroyed = true; + } - return next; - }; + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } - return next.next = next; + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + pna.nextTick(emitErrorNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, _this, err); } + } else if (cb) { + cb(err); } + }); + + return this; +} - // Return an iterator with no values. - return { next: doneResult }; +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; } - exports.values = values; - function doneResult() { - return { value: undefined, done: true }; + 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; } +} - Context.prototype = { - constructor: Context, +function emitErrorNT(self, err) { + self.emit('error', err); +} - 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; - } - } - } - }, +module.exports = { + destroy: destroy, + undestroy: undestroy +}; +},{"process-nextick-args":443}],461:[function(require,module,exports){ +module.exports = require('events').EventEmitter; - stop: function() { - this.done = true; +},{"events":388}],462:[function(require,module,exports){ +var toString = {}.toString; - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; - return this.rval; - }, +},{}],463:[function(require,module,exports){ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer - dispatchException: function(exception) { - if (this.done) { - throw exception; - } +// 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 context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} - 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; - } +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) - return !! caught; - } +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; +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 +} - 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"); - } +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +},{"buffer":103}],464:[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. - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } +'use strict'; - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +/**/ - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, +var Buffer = require('safe-buffer').Buffer; +/**/ - 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; - } - } +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; + } +}; - 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; - } +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; + } + } +}; - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; +// 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; +} - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } +// 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); +} - return this.complete(record); - }, +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 || ''; +}; - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } +StringDecoder.prototype.end = utf8End; - 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; - } +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; - return ContinueSentinel; - }, +// 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; +}; - 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; - } - } - }, +// 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; +} - "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; - } +// 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; +} + +// 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'; } + } + } +} - // 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"); - }, +// 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; +} - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; +// 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 (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } +// 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; +} - return ContinueSentinel; +// 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); + } } - }; - - // 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; + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} -}( - // 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 : {} -)); +// 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; +} -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, in modern engines - // we can explicitly access globalThis. In older engines 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. - if (typeof globalThis === "object") { - globalThis.regeneratorRuntime = runtime; +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 { - Function("r", "regeneratorRuntime = r")(runtime); + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; } + return buf.toString('base64', i, buf.length - n); } -},{}],396:[function(require,module,exports){ +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; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} +},{"safe-buffer":463}],465:[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":454,"./lib/_stream_passthrough.js":455,"./lib/_stream_readable.js":456,"./lib/_stream_transform.js":457,"./lib/_stream_writable.js":458}],466:[function(require,module,exports){ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer @@ -28643,6 +30496,8 @@ function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } +SafeBuffer.prototype = Object.create(Buffer.prototype) + // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) @@ -28684,7 +30539,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":90}],397:[function(require,module,exports){ +},{"buffer":103}],467:[function(require,module,exports){ (function (Buffer){(function (){ ;(function (sax) { // wrapper for non-node envs sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } @@ -28852,6 +30707,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { } catch (ex) { Stream = function () {} } + if (!Stream) Stream = function () {} var streamWraps = sax.EVENTS.filter(function (ev) { return ev !== 'error' && ev !== 'end' @@ -30170,9 +32026,16 @@ SafeBuffer.allocUnsafeSlow = function (size) { } if (c === ';') { - parser[buffer] += parseEntity(parser) - parser.entity = '' - parser.state = returnState + if (parser.opt.unparsedEntities) { + var parsedEntity = parseEntity(parser) + parser.entity = '' + parser.state = returnState + parser.write(parsedEntity) + } else { + parser[buffer] += parseEntity(parser) + parser.entity = '' + parser.state = returnState + } } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) { parser.entity += c } else { @@ -30184,8 +32047,9 @@ SafeBuffer.allocUnsafeSlow = function (size) { continue - default: + default: /* istanbul ignore next */ { throw new Error(parser, 'Unknown state: ' + parser.state) + } } } // while @@ -30253,7 +32117,179 @@ SafeBuffer.allocUnsafeSlow = function (size) { })(typeof exports === 'undefined' ? this.sax = {} : exports) }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":90,"stream":398,"string_decoder":413}],398:[function(require,module,exports){ +},{"buffer":103,"stream":470,"string_decoder":485}],468:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var define = require('define-data-property'); +var hasDescriptors = require('has-property-descriptors')(); +var gOPD = require('gopd'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $floor = GetIntrinsic('%Math.floor%'); + +/** @typedef {(...args: unknown[]) => unknown} Func */ + +/** @type {(fn: T, length: number, loose?: boolean) => T} */ +module.exports = function setFunctionLength(fn, length) { + if (typeof fn !== 'function') { + throw new $TypeError('`fn` is not a function'); + } + if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { + throw new $TypeError('`length` must be a positive 32-bit integer'); + } + + var loose = arguments.length > 2 && !!arguments[2]; + + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ('length' in fn && gOPD) { + var desc = gOPD(fn, 'length'); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); + } else { + define(/** @type {Parameters[0]} */ (fn), 'length', length); + } + } + return fn; +}; + +},{"define-data-property":386,"get-intrinsic":392,"gopd":393,"has-property-descriptors":394}],469:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bind/callBound'); +var inspect = require('object-inspect'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $WeakMap = GetIntrinsic('%WeakMap%', true); +var $Map = GetIntrinsic('%Map%', true); + +var $weakMapGet = callBound('WeakMap.prototype.get', true); +var $weakMapSet = callBound('WeakMap.prototype.set', true); +var $weakMapHas = callBound('WeakMap.prototype.has', true); +var $mapGet = callBound('Map.prototype.get', true); +var $mapSet = callBound('Map.prototype.set', true); +var $mapHas = callBound('Map.prototype.has', true); + +/* + * This function traverses the list returning the node corresponding to the + * given key. + * + * That node is also moved to the head of the list, so that if it's accessed + * again we don't need to traverse the whole list. By doing so, all the recently + * used nodes can be accessed relatively quickly. + */ +var listGetNode = function (list, key) { // eslint-disable-line consistent-return + for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + curr.next = list.next; + list.next = curr; // eslint-disable-line no-param-reassign + return curr; + } + } +}; + +var listGet = function (objects, key) { + var node = listGetNode(objects, key); + return node && node.value; +}; +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + // Prepend the new node to the beginning of the list + objects.next = { // eslint-disable-line no-param-reassign + key: key, + next: objects.next, + value: value + }; + } +}; +var listHas = function (objects, key) { + return !!listGetNode(objects, key); +}; + +module.exports = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + get: function (key) { // eslint-disable-line consistent-return + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { // eslint-disable-line no-lonely-if + return listGet($o, key); + } + } + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapHas($m, key); + } + } else { + if ($o) { // eslint-disable-line no-lonely-if + return listHas($o, key); + } + } + return false; + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if ($Map) { + if (!$m) { + $m = new $Map(); + } + $mapSet($m, key, value); + } else { + if (!$o) { + /* + * Initialize the linked list as an empty node, so that we don't have + * to special-case handling of the first node: we can always refer to + * it as (previous node).next, instead of something like (list).head + */ + $o = { key: {}, next: null }; + } + listSet($o, key, value); + } + } + }; + return channel; +}; + +},{"call-bind/callBound":105,"get-intrinsic":392,"object-inspect":435}],470:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -30384,7 +32420,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":344,"inherits":364,"readable-stream/lib/_stream_duplex.js":400,"readable-stream/lib/_stream_passthrough.js":401,"readable-stream/lib/_stream_readable.js":402,"readable-stream/lib/_stream_transform.js":403,"readable-stream/lib/_stream_writable.js":404,"readable-stream/lib/internal/streams/end-of-stream.js":408,"readable-stream/lib/internal/streams/pipeline.js":410}],399:[function(require,module,exports){ +},{"events":388,"inherits":409,"readable-stream/lib/_stream_duplex.js":472,"readable-stream/lib/_stream_passthrough.js":473,"readable-stream/lib/_stream_readable.js":474,"readable-stream/lib/_stream_transform.js":475,"readable-stream/lib/_stream_writable.js":476,"readable-stream/lib/internal/streams/end-of-stream.js":480,"readable-stream/lib/internal/streams/pipeline.js":482}],471:[function(require,module,exports){ 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } @@ -30513,7 +32549,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; -},{}],400:[function(require,module,exports){ +},{}],472:[function(require,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -30642,7 +32678,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); }).call(this)}).call(this,require('_process')) -},{"./_stream_readable":402,"./_stream_writable":404,"_process":467,"inherits":364}],401:[function(require,module,exports){ +},{"./_stream_readable":474,"./_stream_writable":476,"_process":540,"inherits":409}],473:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -30680,7 +32716,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":403,"inherits":364}],402:[function(require,module,exports){ +},{"./_stream_transform":475,"inherits":409}],474:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -31710,7 +33746,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":399,"./_stream_duplex":400,"./internal/streams/async_iterator":405,"./internal/streams/buffer_list":406,"./internal/streams/destroy":407,"./internal/streams/from":409,"./internal/streams/state":411,"./internal/streams/stream":412,"_process":467,"buffer":90,"events":344,"inherits":364,"string_decoder/":413,"util":89}],403:[function(require,module,exports){ +},{"../errors":471,"./_stream_duplex":472,"./internal/streams/async_iterator":477,"./internal/streams/buffer_list":478,"./internal/streams/destroy":479,"./internal/streams/from":481,"./internal/streams/state":483,"./internal/streams/stream":484,"_process":540,"buffer":103,"events":388,"inherits":409,"string_decoder/":485,"util":102}],475:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -31901,7 +33937,7 @@ function done(stream, er, data) { if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } -},{"../errors":399,"./_stream_duplex":400,"inherits":364}],404:[function(require,module,exports){ +},{"../errors":471,"./_stream_duplex":472,"inherits":409}],476:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -32545,7 +34581,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":399,"./_stream_duplex":400,"./internal/streams/destroy":407,"./internal/streams/state":411,"./internal/streams/stream":412,"_process":467,"buffer":90,"inherits":364,"util-deprecate":416}],405:[function(require,module,exports){ +},{"../errors":471,"./_stream_duplex":472,"./internal/streams/destroy":479,"./internal/streams/state":483,"./internal/streams/stream":484,"_process":540,"buffer":103,"inherits":409,"util-deprecate":488}],477:[function(require,module,exports){ (function (process){(function (){ 'use strict'; @@ -32728,7 +34764,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat }; module.exports = createReadableStreamAsyncIterator; }).call(this)}).call(this,require('_process')) -},{"./end-of-stream":408,"_process":467}],406:[function(require,module,exports){ +},{"./end-of-stream":480,"_process":540}],478:[function(require,module,exports){ 'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } @@ -32912,7 +34948,7 @@ module.exports = /*#__PURE__*/function () { }]); return BufferList; }(); -},{"buffer":90,"util":89}],407:[function(require,module,exports){ +},{"buffer":103,"util":102}],479:[function(require,module,exports){ (function (process){(function (){ 'use strict'; @@ -33011,7 +35047,7 @@ module.exports = { errorOrDestroy: errorOrDestroy }; }).call(this)}).call(this,require('_process')) -},{"_process":467}],408:[function(require,module,exports){ +},{"_process":540}],480:[function(require,module,exports){ // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). @@ -33098,12 +35134,12 @@ function eos(stream, opts, callback) { }; } module.exports = eos; -},{"../../../errors":399}],409:[function(require,module,exports){ +},{"../../../errors":471}],481:[function(require,module,exports){ module.exports = function () { throw new Error('Readable.from is not available in the browser') }; -},{}],410:[function(require,module,exports){ +},{}],482:[function(require,module,exports){ // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). @@ -33190,7 +35226,7 @@ function pipeline() { return streams.reduce(pipe); } module.exports = pipeline; -},{"../../../errors":399,"./end-of-stream":408}],411:[function(require,module,exports){ +},{"../../../errors":471,"./end-of-stream":480}],483:[function(require,module,exports){ 'use strict'; var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; @@ -33213,306 +35249,11 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark: getHighWaterMark }; -},{"../../../errors":399}],412:[function(require,module,exports){ -arguments[4][393][0].apply(exports,arguments) -},{"dup":393,"events":344}],413:[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 || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// 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; -}; - -// 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; -} - -// 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; -} - -// 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'; - } - } - } -} - -// 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; -} - -// 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); -} - -// 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; -} - -// 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); -} - -// 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; -} - -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); -} - -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; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} -},{"safe-buffer":396}],414:[function(require,module,exports){ +},{"../../../errors":471}],484:[function(require,module,exports){ +arguments[4][461][0].apply(exports,arguments) +},{"dup":461,"events":388}],485:[function(require,module,exports){ +arguments[4][464][0].apply(exports,arguments) +},{"dup":464,"safe-buffer":466}],486:[function(require,module,exports){ (function (setImmediate,clearImmediate){(function (){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; @@ -33591,7 +35332,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : delete immediateIds[id]; }; }).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate) -},{"process/browser.js":381,"timers":414}],415:[function(require,module,exports){ +},{"process/browser.js":444,"timers":486}],487:[function(require,module,exports){ var Buffer = require('buffer').Buffer module.exports = function (buf) { @@ -33620,7 +35361,7 @@ module.exports = function (buf) { } } -},{"buffer":90}],416:[function(require,module,exports){ +},{"buffer":103}],488:[function(require,module,exports){ (function (global){(function (){ /** @@ -33691,9 +35432,9 @@ function config (name) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],417:[function(require,module,exports){ -arguments[4][84][0].apply(exports,arguments) -},{"dup":84}],418:[function(require,module,exports){ +},{}],489:[function(require,module,exports){ +arguments[4][97][0].apply(exports,arguments) +},{"dup":97}],490:[function(require,module,exports){ // Currently in sync with Node.js lib/internal/util/types.js // https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 @@ -34029,7 +35770,7 @@ exports.isAnyArrayBuffer = isAnyArrayBuffer; }); }); -},{"is-arguments":365,"is-generator-function":368,"is-typed-array":369,"which-typed-array":420}],419:[function(require,module,exports){ +},{"is-arguments":410,"is-generator-function":413,"is-typed-array":414,"which-typed-array":492}],491:[function(require,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -34748,7 +36489,7 @@ function callbackify(original) { exports.callbackify = callbackify; }).call(this)}).call(this,require('_process')) -},{"./support/isBuffer":417,"./support/types":418,"_process":467,"inherits":364}],420:[function(require,module,exports){ +},{"./support/isBuffer":489,"./support/types":490,"_process":540,"inherits":409}],492:[function(require,module,exports){ (function (global){(function (){ 'use strict'; @@ -34792,7 +36533,10 @@ if (hasToStringTag && gOPD && getPrototypeOf) { } else { forEach(typedArrays, function (typedArray) { var arr = new g[typedArray](); - cache['$' + typedArray] = callBind(arr.slice); + var fn = arr.slice || arr.set; + if (fn) { + cache['$' + typedArray] = callBind(fn); + } }); } @@ -34841,7 +36585,7 @@ module.exports = function whichTypedArray(value) { }; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"available-typed-arrays":86,"call-bind":93,"call-bind/callBound":92,"for-each":345,"gopd":349,"has-tostringtag/shams":353}],421:[function(require,module,exports){ +},{"available-typed-arrays":99,"call-bind":106,"call-bind/callBound":105,"for-each":389,"gopd":393,"has-tostringtag/shams":398}],493:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { "use strict"; @@ -34855,7 +36599,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],422:[function(require,module,exports){ +},{}],494:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { "use strict"; @@ -34984,7 +36728,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./defaults":423,"xmlbuilder":459}],423:[function(require,module,exports){ +},{"./defaults":495,"xmlbuilder":531}],495:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { exports.defaults = { @@ -35058,7 +36802,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],424:[function(require,module,exports){ +},{}],496:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { "use strict"; @@ -35455,7 +37199,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./bom":421,"./defaults":423,"./processors":425,"events":344,"sax":397,"timers":414}],425:[function(require,module,exports){ +},{"./bom":493,"./defaults":495,"./processors":497,"events":388,"sax":467,"timers":486}],497:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { "use strict"; @@ -35491,7 +37235,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],426:[function(require,module,exports){ +},{}],498:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { "use strict"; @@ -35532,7 +37276,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./builder":422,"./defaults":423,"./parser":424,"./processors":425}],427:[function(require,module,exports){ +},{"./builder":494,"./defaults":495,"./parser":496,"./processors":497}],499:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { module.exports = { @@ -35546,7 +37290,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],428:[function(require,module,exports){ +},{}],500:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { module.exports = { @@ -35571,7 +37315,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],429:[function(require,module,exports){ +},{}],501:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, @@ -35656,7 +37400,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],430:[function(require,module,exports){ +},{}],502:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { module.exports = { @@ -35668,7 +37412,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],431:[function(require,module,exports){ +},{}],503:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLAttribute, XMLNode; @@ -35778,7 +37522,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLNode":450}],432:[function(require,module,exports){ +},{"./NodeType":500,"./XMLNode":522}],504:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLCData, XMLCharacterData, @@ -35816,7 +37560,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLCharacterData":433}],433:[function(require,module,exports){ +},{"./NodeType":500,"./XMLCharacterData":505}],505:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLCharacterData, XMLNode, @@ -35897,7 +37641,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./XMLNode":450}],434:[function(require,module,exports){ +},{"./XMLNode":522}],506:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLCharacterData, XMLComment, @@ -35935,7 +37679,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLCharacterData":433}],435:[function(require,module,exports){ +},{"./NodeType":500,"./XMLCharacterData":505}],507:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList; @@ -36001,7 +37745,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./XMLDOMErrorHandler":436,"./XMLDOMStringList":438}],436:[function(require,module,exports){ +},{"./XMLDOMErrorHandler":508,"./XMLDOMStringList":510}],508:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLDOMErrorHandler; @@ -36019,7 +37763,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],437:[function(require,module,exports){ +},{}],509:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLDOMImplementation; @@ -36053,7 +37797,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],438:[function(require,module,exports){ +},{}],510:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLDOMStringList; @@ -36083,7 +37827,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],439:[function(require,module,exports){ +},{}],511:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDTDAttList, XMLNode, @@ -36140,7 +37884,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLNode":450}],440:[function(require,module,exports){ +},{"./NodeType":500,"./XMLNode":522}],512:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDTDElement, XMLNode, @@ -36180,7 +37924,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLNode":450}],441:[function(require,module,exports){ +},{"./NodeType":500,"./XMLNode":522}],513:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDTDEntity, XMLNode, isObject, @@ -36279,7 +38023,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./XMLNode":450}],442:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./XMLNode":522}],514:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDTDNotation, XMLNode, @@ -36333,7 +38077,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLNode":450}],443:[function(require,module,exports){ +},{"./NodeType":500,"./XMLNode":522}],515:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDeclaration, XMLNode, isObject, @@ -36378,7 +38122,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./XMLNode":450}],444:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./XMLNode":522}],516:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject, @@ -36566,7 +38310,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLNamedNodeMap":449,"./XMLNode":450}],445:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./XMLDTDAttList":511,"./XMLDTDElement":512,"./XMLDTDEntity":513,"./XMLDTDNotation":514,"./XMLNamedNodeMap":521,"./XMLNode":522}],517:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, @@ -36810,7 +38554,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./XMLDOMConfiguration":435,"./XMLDOMImplementation":437,"./XMLNode":450,"./XMLStringWriter":455,"./XMLStringifier":456}],446:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./XMLDOMConfiguration":507,"./XMLDOMImplementation":509,"./XMLNode":522,"./XMLStringWriter":527,"./XMLStringifier":528}],518:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, @@ -37340,7 +39084,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLAttribute":431,"./XMLCData":432,"./XMLComment":434,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDocument":445,"./XMLElement":448,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLStringWriter":455,"./XMLStringifier":456,"./XMLText":457}],447:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./WriterState":502,"./XMLAttribute":503,"./XMLCData":504,"./XMLComment":506,"./XMLDTDAttList":511,"./XMLDTDElement":512,"./XMLDTDEntity":513,"./XMLDTDNotation":514,"./XMLDeclaration":515,"./XMLDocType":516,"./XMLDocument":517,"./XMLElement":520,"./XMLProcessingInstruction":524,"./XMLRaw":525,"./XMLStringWriter":527,"./XMLStringifier":528,"./XMLText":529}],519:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLDummy, XMLNode, @@ -37373,7 +39117,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLNode":450}],448:[function(require,module,exports){ +},{"./NodeType":500,"./XMLNode":522}],520:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, @@ -37673,7 +39417,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./XMLAttribute":431,"./XMLNamedNodeMap":449,"./XMLNode":450}],449:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./XMLAttribute":503,"./XMLNamedNodeMap":521,"./XMLNode":522}],521:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLNamedNodeMap; @@ -37733,7 +39477,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],450:[function(require,module,exports){ +},{}],522:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, @@ -38520,7 +40264,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./DocumentPosition":427,"./NodeType":428,"./Utility":429,"./XMLCData":432,"./XMLComment":434,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDummy":447,"./XMLElement":448,"./XMLNamedNodeMap":449,"./XMLNodeList":451,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLText":457}],451:[function(require,module,exports){ +},{"./DocumentPosition":499,"./NodeType":500,"./Utility":501,"./XMLCData":504,"./XMLComment":506,"./XMLDeclaration":515,"./XMLDocType":516,"./XMLDummy":519,"./XMLElement":520,"./XMLNamedNodeMap":521,"./XMLNodeList":523,"./XMLProcessingInstruction":524,"./XMLRaw":525,"./XMLText":529}],523:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLNodeList; @@ -38550,7 +40294,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],452:[function(require,module,exports){ +},{}],524:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLCharacterData, XMLProcessingInstruction, @@ -38601,7 +40345,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLCharacterData":433}],453:[function(require,module,exports){ +},{"./NodeType":500,"./XMLCharacterData":505}],525:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLNode, XMLRaw, @@ -38638,7 +40382,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLNode":450}],454:[function(require,module,exports){ +},{"./NodeType":500,"./XMLNode":522}],526:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, WriterState, XMLStreamWriter, XMLWriterBase, @@ -38816,7 +40560,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./WriterState":430,"./XMLWriterBase":458}],455:[function(require,module,exports){ +},{"./NodeType":500,"./WriterState":502,"./XMLWriterBase":530}],527:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLStringWriter, XMLWriterBase, @@ -38853,7 +40597,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./XMLWriterBase":458}],456:[function(require,module,exports){ +},{"./XMLWriterBase":530}],528:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var XMLStringifier, @@ -39095,7 +40839,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{}],457:[function(require,module,exports){ +},{}],529:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, XMLCharacterData, XMLText, @@ -39166,7 +40910,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./XMLCharacterData":433}],458:[function(require,module,exports){ +},{"./NodeType":500,"./XMLCharacterData":505}],530:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign, @@ -39596,7 +41340,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLCData":432,"./XMLComment":434,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDummy":447,"./XMLElement":448,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLText":457}],459:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./WriterState":502,"./XMLCData":504,"./XMLComment":506,"./XMLDTDAttList":511,"./XMLDTDElement":512,"./XMLDTDEntity":513,"./XMLDTDNotation":514,"./XMLDeclaration":515,"./XMLDocType":516,"./XMLDummy":519,"./XMLElement":520,"./XMLProcessingInstruction":524,"./XMLRaw":525,"./XMLText":529}],531:[function(require,module,exports){ // Generated by CoffeeScript 1.12.7 (function() { var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref; @@ -39663,7 +41407,7 @@ module.exports = function whichTypedArray(value) { }).call(this); -},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLDOMImplementation":437,"./XMLDocument":445,"./XMLDocumentCB":446,"./XMLStreamWriter":454,"./XMLStringWriter":455}],460:[function(require,module,exports){ +},{"./NodeType":500,"./Utility":501,"./WriterState":502,"./XMLDOMImplementation":509,"./XMLDocument":517,"./XMLDocumentCB":518,"./XMLStreamWriter":526,"./XMLStringWriter":527}],532:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -39684,57 +41428,44 @@ function extend() { return target } -},{}],461:[function(require,module,exports){ +},{}],533:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.fill.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.regexp.to-string.js"); - require("core-js/modules/es.array.join.js"); - require("core-js/modules/es.array.slice.js"); - var Buffer = require('buffer').Buffer; - var sha = require('./sha'); - +var sha256 = require('./sha256'); var md5 = require('./md5'); - var algorithms = { sha1: sha, + sha256: sha256, md5: md5 }; var blocksize = 64; var zeroBuffer = Buffer.alloc(blocksize); zeroBuffer.fill(0); - function hmac(fn, key, data) { if (!Buffer.isBuffer(key)) key = Buffer.from(key); if (!Buffer.isBuffer(data)) data = Buffer.from(data); - if (key.length > blocksize) { key = fn(key); } else if (key.length < blocksize) { key = Buffer.concat([key, zeroBuffer], blocksize); } - var ipad = Buffer.alloc(blocksize), - opad = Buffer.alloc(blocksize); - + opad = Buffer.alloc(blocksize); for (var i = 0; i < blocksize; i++) { ipad[i] = key[i] ^ 0x36; opad[i] = key[i] ^ 0x5c; } - var hash = fn(Buffer.concat([ipad, data])); return fn(Buffer.concat([opad, hash])); } - function hash(alg, key) { alg = alg || 'sha1'; var fn = algorithms[alg]; @@ -39756,108 +41487,84 @@ function hash(alg, key) { } }; } - function error() { var m = [].slice.call(arguments).join(' '); throw new Error([m, 'we accept pull requests', 'http://github.com/dominictarr/crypto-browserify'].join('\n')); } - exports.createHash = function (alg) { return hash(alg); }; - exports.createHmac = function (alg, key) { return hash(alg, key); }; - exports.createCredentials = function () { error('sorry,createCredentials is not implemented yet'); }; - exports.createCipher = function () { error('sorry,createCipher is not implemented yet'); }; - exports.createCipheriv = function () { error('sorry,createCipheriv is not implemented yet'); }; - exports.createDecipher = function () { error('sorry,createDecipher is not implemented yet'); }; - exports.createDecipheriv = function () { error('sorry,createDecipheriv is not implemented yet'); }; - exports.createSign = function () { error('sorry,createSign is not implemented yet'); }; - exports.createVerify = function () { error('sorry,createVerify is not implemented yet'); }; - exports.createDiffieHellman = function () { error('sorry,createDiffieHellman is not implemented yet'); }; - exports.pbkdf2 = function () { error('sorry,pbkdf2 is not implemented yet'); }; -},{"./md5":463,"./sha":464,"buffer":90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.fill.js":273,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],462:[function(require,module,exports){ +},{"./md5":535,"./sha":536,"./sha256":537,"buffer":103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.fill.js":311,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341}],534:[function(require,module,exports){ "use strict"; require("core-js/modules/es.array.fill.js"); - require("core-js/modules/es.array.concat.js"); - var Buffer = require('buffer').Buffer; - var intSize = 4; var zeroBuffer = Buffer.alloc(intSize); zeroBuffer.fill(0); var chrsz = 8; - function toArray(buf, bigEndian) { if (buf.length % intSize !== 0) { var len = buf.length + (intSize - buf.length % intSize); buf = Buffer.concat([buf, zeroBuffer], len); } - var arr = []; var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE; - for (var i = 0; i < buf.length; i += intSize) { arr.push(fn.call(buf, i)); } - return arr; } - function toBuffer(arr, size, bigEndian) { var buf = Buffer.alloc(size); var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; - for (var i = 0; i < arr.length; i++) { fn.call(buf, arr[i], i * 4, true); } - return buf; } - function hash(buf, fn, hashSize, bigEndian) { if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); return toBuffer(arr, hashSize, bigEndian); } - module.exports = { hash: hash }; -},{"buffer":90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.fill.js":273}],463:[function(require,module,exports){ +},{"buffer":103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.fill.js":311}],535:[function(require,module,exports){ "use strict"; /* @@ -39868,20 +41575,19 @@ module.exports = { * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */ + var helpers = require('./helpers'); + /* * Perform a simple self-test to see if the VM is working */ - - function md5_vm_test() { return hex_md5('abc') == '900150983cd24fb0d6963f7d28e17f72'; } + /* * Calculate the MD5 of an array of little-endian words, and a bit length */ - - function core_md5(x, len) { /* append padding */ x[len >> 5] |= 0x80 << len % 32; @@ -39890,7 +41596,6 @@ function core_md5(x, len) { var b = -271733879; var c = -1732584194; var d = 271733878; - for (var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; @@ -39965,58 +41670,49 @@ function core_md5(x, len) { c = safe_add(c, oldc); d = safe_add(d, oldd); } - return Array(a, b, c, d); } + /* * These functions implement the four basic operations the algorithm uses. */ - - function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); } - function md5_ff(a, b, c, d, x, s, t) { return md5_cmn(b & c | ~b & d, a, b, x, s, t); } - function md5_gg(a, b, c, d, x, s, t) { return md5_cmn(b & d | c & ~d, a, b, x, s, t); } - function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } - function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | ~d), a, b, x, s, t); } + /* * Add integers, wrapping at 2^32. This uses 16-bit operations internally * to work around bugs in some JS interpreters. */ - - function safe_add(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return msw << 16 | lsw & 0xffff; } + /* * Bitwise rotate a 32-bit number to the left. */ - - function bit_rol(num, cnt) { return num << cnt | num >>> 32 - cnt; } - module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; -},{"./helpers":462}],464:[function(require,module,exports){ +},{"./helpers":534}],536:[function(require,module,exports){ "use strict"; /* @@ -40027,12 +41723,12 @@ module.exports = function md5(buf) { * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for details. */ + var helpers = require('./helpers'); + /* * Calculate the SHA-1 of an array of big-endian words, and a bit length */ - - function core_sha1(x, len) { /* append padding */ x[len >> 5] |= 0x80 << 24 - len % 32; @@ -40043,14 +41739,12 @@ function core_sha1(x, len) { var c = -1732584194; var d = 271733878; var e = -1009589776; - for (var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; var olde = e; - for (var j = 0; j < 80; j++) { if (j < 16) w[j] = x[i + j];else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1); var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j))); @@ -40060,102 +41754,178 @@ function core_sha1(x, len) { b = a; a = t; } - a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); e = safe_add(e, olde); } - return Array(a, b, c, d, e); } + /* * Perform the appropriate triplet combination function for the current * iteration */ - - function sha1_ft(t, b, c, d) { if (t < 20) return b & c | ~b & d; if (t < 40) return b ^ c ^ d; if (t < 60) return b & c | b & d | c & d; return b ^ c ^ d; } + /* * Determine the appropriate additive constant for the current iteration */ - - function sha1_kt(t) { return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514; } + /* * Add integers, wrapping at 2^32. This uses 16-bit operations internally * to work around bugs in some JS interpreters. */ - - function safe_add(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return msw << 16 | lsw & 0xffff; } + /* * Bitwise rotate a 32-bit number to the left. */ - - function rol(num, cnt) { return num << cnt | num >>> 32 - cnt; } - module.exports = function sha1(buf) { return helpers.hash(buf, core_sha1, 20, true); }; -},{"./helpers":462}],465:[function(require,module,exports){ +},{"./helpers":534}],537:[function(require,module,exports){ +"use strict"; + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var helpers = require('./helpers'); +var safe_add = function safe_add(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +}; +var S = function S(X, n) { + return X >>> n | X << 32 - n; +}; +var R = function R(X, n) { + return X >>> n; +}; +var Ch = function Ch(x, y, z) { + return x & y ^ ~x & z; +}; +var Maj = function Maj(x, y, z) { + return x & y ^ x & z ^ y & z; +}; +var Sigma0256 = function Sigma0256(x) { + return S(x, 2) ^ S(x, 13) ^ S(x, 22); +}; +var Sigma1256 = function Sigma1256(x) { + return S(x, 6) ^ S(x, 11) ^ S(x, 25); +}; +var Gamma0256 = function Gamma0256(x) { + return S(x, 7) ^ S(x, 18) ^ R(x, 3); +}; +var Gamma1256 = function Gamma1256(x) { + return S(x, 17) ^ S(x, 19) ^ R(x, 10); +}; +var core_sha256 = function core_sha256(m, l) { + var K = new Array(0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0xfc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x6ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2); + var HASH = new Array(0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19); + var W = new Array(64); + var a, b, c, d, e, f, g, h, i, j; + var T1, T2; + /* append padding */ + m[l >> 5] |= 0x80 << 24 - l % 32; + m[(l + 64 >> 9 << 4) + 15] = l; + for (var i = 0; i < m.length; i += 16) { + a = HASH[0]; + b = HASH[1]; + c = HASH[2]; + d = HASH[3]; + e = HASH[4]; + f = HASH[5]; + g = HASH[6]; + h = HASH[7]; + for (var j = 0; j < 64; j++) { + if (j < 16) { + W[j] = m[j + i]; + } else { + W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); + } + T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); + T2 = safe_add(Sigma0256(a), Maj(a, b, c)); + h = g; + g = f; + f = e; + e = safe_add(d, T1); + d = c; + c = b; + b = a; + a = safe_add(T1, T2); + } + HASH[0] = safe_add(a, HASH[0]); + HASH[1] = safe_add(b, HASH[1]); + HASH[2] = safe_add(c, HASH[2]); + HASH[3] = safe_add(d, HASH[3]); + HASH[4] = safe_add(e, HASH[4]); + HASH[5] = safe_add(f, HASH[5]); + HASH[6] = safe_add(g, HASH[6]); + HASH[7] = safe_add(h, HASH[7]); + } + return HASH; +}; +module.exports = function sha256(buf) { + return helpers.hash(buf, core_sha256, 32, true); +}; + +},{"./helpers":534}],538:[function(require,module,exports){ "use strict"; module.exports = function () { return function () {}; }; -},{}],466:[function(require,module,exports){ +},{}],539:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - var _require = require('stream'), - Stream = _require.Stream; - + Stream = _require.Stream; var _require2 = require('../lib/common/utils/isArray'), - isArray = _require2.isArray; - + isArray = _require2.isArray; module.exports.string = function isString(obj) { return typeof obj === 'string'; }; - module.exports.array = isArray; module.exports.buffer = Buffer.isBuffer; - function isStream(obj) { return obj instanceof Stream; } - module.exports.writableStream = function isWritableStream(obj) { return isStream(obj) && typeof obj._write === 'function' && (0, _typeof2.default)(obj._writableState) === 'object'; }; }).call(this)}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")}) -},{"../lib/common/utils/isArray":63,"../node_modules/is-buffer/index.js":366,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"stream":398}],467:[function(require,module,exports){ +},{"../lib/common/utils/isArray":66,"../node_modules/is-buffer/index.js":411,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,"stream":470}],540:[function(require,module,exports){ "use strict"; var immediate = require('immediate'); - var process = module.exports = {}; process.nextTick = immediate; process.title = 'browser'; @@ -40163,11 +41933,8 @@ process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues - process.versions = {}; - function noop() {} - process.on = noop; process.addListener = noop; process.once = noop; @@ -40177,125 +41944,105 @@ process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; - process.listeners = function (name) { return []; }; - process.binding = function (name) { throw new Error('process.binding is not supported'); }; - process.cwd = function () { return '/'; }; - process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; - process.umask = function () { return 0; }; -},{"immediate":358}],468:[function(require,module,exports){ +},{"immediate":403}],541:[function(require,module,exports){ (function (global){(function (){ "use strict"; require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.search.js"); - //"version": "2.8.2", var ClientRequest = require('./lib/request'); - var response = require('./lib/response'); - var extend = require('xtend'); - var statusCodes = require('builtin-status-codes'); - var url = require('url'); - var http = exports; - http.request = function (opts, cb) { - if (typeof opts === 'string') opts = url.parse(opts);else opts = extend(opts); // Normally, the page is loaded from http or https, so not specifying a protocol + if (typeof opts === 'string') opts = url.parse(opts);else opts = extend(opts); + + // 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:' : ''; var protocol = opts.protocol || defaultProtocol; var host = opts.hostname || opts.host; var port = opts.port; - var path = opts.path || '/'; // Necessary for IPv6 addresses + var path = opts.path || '/'; - if (host && host.indexOf(':') !== -1) host = '[' + host + ']'; // This may be a relative url. The browser should always be able to interpret it correctly. + // Necessary for IPv6 addresses + if (host && host.indexOf(':') !== -1) host = '[' + host + ']'; + // 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 || {}; // Also valid opts.auth, opts.mode + opts.headers = opts.headers || {}; + + // Also valid opts.auth, opts.mode var req = new ClientRequest(opts); if (cb) req.on('response', cb); return req; }; - http.get = function get(opts, cb) { var req = http.request(opts, cb); req.end(); return req; }; - http.ClientRequest = ClientRequest; http.IncomingMessage = response.IncomingMessage; - http.Agent = function () {}; - http.Agent.defaultMaxSockets = 4; http.globalAgent = new http.Agent(); http.STATUS_CODES = statusCodes; 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":470,"./lib/response":471,"builtin-status-codes":91,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.search.js":306,"url":472,"xtend":460}],469:[function(require,module,exports){ +},{"./lib/request":543,"./lib/response":544,"builtin-status-codes":104,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.search.js":348,"url":545,"xtend":532}],542:[function(require,module,exports){ (function (global){(function (){ "use strict"; require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.promise.js"); - require("core-js/modules/es.array-buffer.constructor.js"); - require("core-js/modules/es.array-buffer.slice.js"); - require("core-js/modules/es.array.slice.js"); - exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream); exports.writableStream = isFunction(global.WritableStream); exports.abortController = isFunction(global.AbortController); exports.blobConstructor = false; - try { new Blob([new ArrayBuffer(1)]); exports.blobConstructor = true; -} catch (e) {} // The xhr request to example.com may violate some restrictive CSP configurations, +} catch (e) {} + +// 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 (global.XMLHttpRequest) { - xhr = new global.XMLHttpRequest(); // If XDomainRequest is available (ie only, where xhr might not work + 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) { @@ -40305,82 +42052,61 @@ function getXHR() { // Service workers don't have XHR xhr = null; } - return xhr; } - function checkTypeSupport(type) { var xhr = getXHR(); if (!xhr) return false; - try { xhr.responseType = type; return xhr.responseType === type; } catch (e) {} - return false; -} // For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'. -// Safari 7.1 appears to have fixed this bug. - +} +// 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); // If fetch is supported, then arraybuffer will be supported too. Skip calling +var haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice); + +// If fetch is supported, then arraybuffer will be supported too. Skip calling // checkTypeSupport(), since that calls getXHR(). +exports.arraybuffer = exports.fetch || haveArrayBuffer && checkTypeSupport('arraybuffer'); -exports.arraybuffer = exports.fetch || haveArrayBuffer && checkTypeSupport('arraybuffer'); // These next two tests unavoidably show warnings in Chrome. Since fetch will always +// 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'); // If fetch is supported, then overrideMimeType will be supported too. Skip calling -// getXHR(). +exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer && checkTypeSupport('moz-chunked-arraybuffer'); +// If fetch is supported, then overrideMimeType will be supported too. Skip calling +// getXHR(). exports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false); exports.vbArray = isFunction(global.VBArray); - function isFunction(value) { return typeof value === 'function'; } - xhr = null; // Help gc }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"core-js/modules/es.array-buffer.constructor.js":270,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295}],470:[function(require,module,exports){ +},{"core-js/modules/es.array-buffer.constructor.js":308,"core-js/modules/es.array-buffer.slice.js":309,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335}],543:[function(require,module,exports){ (function (process,global,Buffer){(function (){ "use strict"; require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.regexp.to-string.js"); - require("core-js/modules/web.dom-collections.for-each.js"); - require("core-js/modules/es.object.keys.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.array.map.js"); - require("core-js/modules/es.function.name.js"); - require("core-js/modules/es.promise.js"); - -require("core-js/modules/es.regexp.exec.js"); - -require("core-js/modules/es.string.split.js"); - var capability = require('./capability'); - var inherits = require('inherits'); - var response = require('./response'); - var stream = require('readable-stream'); - var toArrayBuffer = require('to-arraybuffer'); - var IncomingMessage = response.IncomingMessage; var rStates = response.readyStates; - function decideMode(preferBinary, useFetch) { if (capability.fetch && useFetch) { return 'fetch'; @@ -40396,7 +42122,6 @@ function decideMode(preferBinary, useFetch) { return 'text'; } } - var ClientRequest = module.exports = function (opts) { var self = this; stream.Writable.call(self); @@ -40409,7 +42134,6 @@ var ClientRequest = module.exports = function (opts) { }); 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; @@ -40427,48 +42151,40 @@ var ClientRequest = module.exports = function (opts) { } else { throw new Error('Invalid value for opts.mode'); } - self._mode = decideMode(preferBinary, useFetch); self._fetchTimer = null; self.on('finish', function () { self._onFinish(); }); }; - inherits(ClientRequest, stream.Writable); - 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 + 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; self._headers[lowerName] = { name: name, value: value }; }; - ClientRequest.prototype.getHeader = function (name) { var header = this._headers[name.toLowerCase()]; - if (header) return header.value; return null; }; - 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; var headersObj = self._headers; var body = null; - if (opts.method !== 'GET' && opts.method !== 'HEAD') { if (capability.arraybuffer) { body = toArrayBuffer(Buffer.concat(self._body)); @@ -40482,14 +42198,13 @@ ClientRequest.prototype._onFinish = function () { // get utf8 string body = Buffer.concat(self._body).toString(); } - } // create flattened list of headers - + } + // 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]); @@ -40498,16 +42213,13 @@ ClientRequest.prototype._onFinish = function () { headersList.push([name, value]); } }); - if (self._mode === 'fetch') { var signal = null; var fetchTimer = null; - if (capability.abortController) { var controller = new AbortController(); signal = controller.signal; self._fetchAbortController = controller; - if ('requestTimeout' in opts && opts.requestTimeout !== 0) { self._fetchTimer = global.setTimeout(function () { self.emit('requestTimeout'); @@ -40515,7 +42227,6 @@ ClientRequest.prototype._onFinish = function () { }, opts.requestTimeout); } } - global.fetch(self._opts.url, { method: self._opts.method, headers: headersList, @@ -40525,7 +42236,6 @@ ClientRequest.prototype._onFinish = function () { signal: signal }).then(function (response) { self._fetchResponse = response; - self._connect(); }, function (reason) { global.clearTimeout(self._fetchTimer); @@ -40533,7 +42243,6 @@ ClientRequest.prototype._onFinish = function () { }); } else { var xhr = self._xhr = new global.XMLHttpRequest(); - try { xhr.open(self._opts.method, self._opts.url, true); } catch (err) { @@ -40541,49 +42250,41 @@ ClientRequest.prototype._onFinish = function () { self.emit('error', err); }); return; - } // Can't set responseType on really old browsers - + } + // Can't set responseType on really old browsers if ('responseType' in xhr) xhr.responseType = self._mode.split(':')[0]; if ('withCredentials' in xhr) xhr.withCredentials = !!opts.withCredentials; if (self._mode === 'text' && 'overrideMimeType' in xhr) xhr.overrideMimeType('text/plain; charset=x-user-defined'); - if ('requestTimeout' in opts) { xhr.timeout = opts.requestTimeout; - xhr.ontimeout = function () { self.emit('requestTimeout'); }; } - 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 + }; + // 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(); }; } - xhr.onerror = function () { if (self._destroyed) return; self.emit('error', new Error('XHR error')); }; - try { xhr.send(body); } catch (err) { @@ -40594,13 +42295,12 @@ ClientRequest.prototype._onFinish = function () { } } }; + /** * 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; @@ -40609,35 +42309,26 @@ function statusValid(xhr) { return false; } } - ClientRequest.prototype._onXHRProgress = function () { var self = this; if (!statusValid(self._xhr) || self._destroyed) return; if (!self._response) self._connect(); - self._response._onXHRProgress(); }; - ClientRequest.prototype._connect = function () { var self = this; if (self._destroyed) return; self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer); - self._response.on('error', function (err) { self.emit('error', err); }); - self.emit('response', self._response); }; - ClientRequest.prototype._write = function (chunk, encoding, cb) { var self = this; - self._body.push(chunk); - cb(); }; - ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () { var self = this; self._destroyed = true; @@ -40645,106 +42336,63 @@ ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () { if (self._response) self._response._destroyed = true; if (self._xhr) self._xhr.abort();else if (self._fetchAbortController) self._fetchAbortController.abort(); }; - 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); }; - ClientRequest.prototype.flushHeaders = function () {}; - ClientRequest.prototype.setTimeout = function () {}; - ClientRequest.prototype.setNoDelay = function () {}; +ClientRequest.prototype.setSocketKeepAlive = function () {}; -ClientRequest.prototype.setSocketKeepAlive = function () {}; // Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method - - +// 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']; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":469,"./response":471,"_process":467,"buffer":90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.split.js":307,"core-js/modules/web.dom-collections.for-each.js":339,"inherits":364,"readable-stream":394,"to-arraybuffer":415}],471:[function(require,module,exports){ +},{"./capability":542,"./response":544,"_process":540,"buffer":103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.map.js":318,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/web.dom-collections.for-each.js":382,"inherits":409,"readable-stream":465,"to-arraybuffer":487}],544:[function(require,module,exports){ (function (process,global,Buffer){(function (){ "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.promise.js"); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.split.js"); - require("core-js/modules/es.string.match.js"); - require("core-js/modules/es.array.iterator.js"); - require("core-js/modules/es.array-buffer.slice.js"); - require("core-js/modules/es.typed-array.uint8-array.js"); - require("core-js/modules/es.typed-array.copy-within.js"); - require("core-js/modules/es.typed-array.every.js"); - require("core-js/modules/es.typed-array.fill.js"); - require("core-js/modules/es.typed-array.filter.js"); - require("core-js/modules/es.typed-array.find.js"); - require("core-js/modules/es.typed-array.find-index.js"); - require("core-js/modules/es.typed-array.for-each.js"); - require("core-js/modules/es.typed-array.includes.js"); - require("core-js/modules/es.typed-array.index-of.js"); - require("core-js/modules/es.typed-array.iterator.js"); - require("core-js/modules/es.typed-array.join.js"); - require("core-js/modules/es.typed-array.last-index-of.js"); - require("core-js/modules/es.typed-array.map.js"); - require("core-js/modules/es.typed-array.reduce.js"); - require("core-js/modules/es.typed-array.reduce-right.js"); - require("core-js/modules/es.typed-array.reverse.js"); - require("core-js/modules/es.typed-array.set.js"); - require("core-js/modules/es.typed-array.slice.js"); - require("core-js/modules/es.typed-array.some.js"); - require("core-js/modules/es.typed-array.sort.js"); - require("core-js/modules/es.typed-array.subarray.js"); - require("core-js/modules/es.typed-array.to-locale-string.js"); - require("core-js/modules/es.typed-array.to-string.js"); - require("core-js/modules/es.array.slice.js"); - var capability = require('./capability'); - var inherits = require('inherits'); - var stream = require('readable-stream'); - var rStates = exports.readyStates = { UNSENT: 0, OPENED: 1, @@ -40752,7 +42400,6 @@ var rStates = exports.readyStates = { LOADING: 3, DONE: 4 }; - var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) { var self = this; stream.Readable.call(self); @@ -40760,26 +42407,24 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f self.headers = {}; self.rawHeaders = []; self.trailers = {}; - self.rawTrailers = []; // Fake the 'close' event, but only once 'end' fires + self.rawTrailers = []; + // 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'); }); }); - if (mode === 'fetch') { var read = 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) { @@ -40787,7 +42432,6 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f if (!self._destroyed) self.emit('error', err); }); }; - self._fetchResponse = response; self.url = response.url; self.statusCode = response.status; @@ -40796,7 +42440,6 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f self.headers[key.toLowerCase()] = header; self.rawHeaders.push(key, header); }); - if (capability.writableStream) { var writable = new WritableStream({ write: function write(chunk) { @@ -40818,7 +42461,6 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f if (!self._destroyed) self.emit('error', err); } }); - try { response.body.pipeTo(writable).catch(function (err) { global.clearTimeout(fetchTimer); @@ -40826,10 +42468,8 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f }); 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 - - + } + // fallback for when writableStream or pipeTo aren't available var reader = response.body.getReader(); read(); } else { @@ -40841,77 +42481,60 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f 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]); } }); 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 } } }; - inherits(IncomingMessage, stream.Readable); - IncomingMessage.prototype._read = function () { var self = this; var resolve = self._resumeFetch; - if (resolve) { self._resumeFetch = null; resolve(); } }; - IncomingMessage.prototype._onXHRProgress = function () { var self = this; var xhr = self._xhr; 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 @@ -40920,69 +42543,55 @@ IncomingMessage.prototype._onXHRProgress = function () { 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; - } - + for (var i = 0; i < newData.length; i++) buffer[i] = newData.charCodeAt(i) & 0xff; 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.onerror = ??? // TODO: this reader.readAsArrayBuffer(response); break; - } // The ms-stream case handles end separately in reader.onload() - + } + // The ms-stream case handles end separately in reader.onload() if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') { self.push(null); } }; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":469,"_process":467,"buffer":90,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.match.js":304,"core-js/modules/es.string.split.js":307,"core-js/modules/es.typed-array.copy-within.js":315,"core-js/modules/es.typed-array.every.js":316,"core-js/modules/es.typed-array.fill.js":317,"core-js/modules/es.typed-array.filter.js":318,"core-js/modules/es.typed-array.find-index.js":319,"core-js/modules/es.typed-array.find.js":320,"core-js/modules/es.typed-array.for-each.js":321,"core-js/modules/es.typed-array.includes.js":322,"core-js/modules/es.typed-array.index-of.js":323,"core-js/modules/es.typed-array.iterator.js":324,"core-js/modules/es.typed-array.join.js":325,"core-js/modules/es.typed-array.last-index-of.js":326,"core-js/modules/es.typed-array.map.js":327,"core-js/modules/es.typed-array.reduce-right.js":328,"core-js/modules/es.typed-array.reduce.js":329,"core-js/modules/es.typed-array.reverse.js":330,"core-js/modules/es.typed-array.set.js":331,"core-js/modules/es.typed-array.slice.js":332,"core-js/modules/es.typed-array.some.js":333,"core-js/modules/es.typed-array.sort.js":334,"core-js/modules/es.typed-array.subarray.js":335,"core-js/modules/es.typed-array.to-locale-string.js":336,"core-js/modules/es.typed-array.to-string.js":337,"core-js/modules/es.typed-array.uint8-array.js":338,"core-js/modules/web.dom-collections.for-each.js":339,"inherits":364,"readable-stream":394}],472:[function(require,module,exports){ +},{"./capability":542,"_process":540,"buffer":103,"core-js/modules/es.array-buffer.slice.js":309,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.match.js":346,"core-js/modules/es.string.split.js":349,"core-js/modules/es.typed-array.copy-within.js":358,"core-js/modules/es.typed-array.every.js":359,"core-js/modules/es.typed-array.fill.js":360,"core-js/modules/es.typed-array.filter.js":361,"core-js/modules/es.typed-array.find-index.js":362,"core-js/modules/es.typed-array.find.js":363,"core-js/modules/es.typed-array.for-each.js":364,"core-js/modules/es.typed-array.includes.js":365,"core-js/modules/es.typed-array.index-of.js":366,"core-js/modules/es.typed-array.iterator.js":367,"core-js/modules/es.typed-array.join.js":368,"core-js/modules/es.typed-array.last-index-of.js":369,"core-js/modules/es.typed-array.map.js":370,"core-js/modules/es.typed-array.reduce-right.js":371,"core-js/modules/es.typed-array.reduce.js":372,"core-js/modules/es.typed-array.reverse.js":373,"core-js/modules/es.typed-array.set.js":374,"core-js/modules/es.typed-array.slice.js":375,"core-js/modules/es.typed-array.some.js":376,"core-js/modules/es.typed-array.sort.js":377,"core-js/modules/es.typed-array.subarray.js":378,"core-js/modules/es.typed-array.to-locale-string.js":379,"core-js/modules/es.typed-array.to-string.js":380,"core-js/modules/es.typed-array.uint8-array.js":381,"core-js/modules/web.dom-collections.for-each.js":382,"inherits":409,"readable-stream":465}],545:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -41003,44 +42612,29 @@ IncomingMessage.prototype._onXHRProgress = function () { // 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 _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - require("core-js/modules/es.regexp.exec.js"); - require("core-js/modules/es.string.search.js"); - require("core-js/modules/es.array.concat.js"); - require("core-js/modules/es.string.split.js"); - require("core-js/modules/es.string.replace.js"); - require("core-js/modules/es.array.join.js"); - require("core-js/modules/es.string.trim.js"); - require("core-js/modules/es.string.match.js"); - require("core-js/modules/es.array.slice.js"); - require("core-js/modules/es.object.keys.js"); - require("core-js/modules/es.array.splice.js"); - var punycode = require('punycode'); - var util = require('./util'); - exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; - function Url() { this.protocol = null; this.slashes = null; @@ -41054,94 +42648,90 @@ function Url() { this.pathname = null; this.path = null; this.href = null; -} // Reference: RFC 3986, RFC 1808, RFC 2396 -// define these here so at least they only have to be -// compiled once on the first module load. +} +// Reference: RFC 3986, RFC 1808, RFC 2396 +// define these here so at least they only have to be +// compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - // Special case for a simple path URL -simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - // RFC 2396: characters reserved for delimiting URLs. -// We actually just auto-escape these. -delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], - // RFC 2396: characters not allowed for various reasons. -unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), - // Allowed by RFCs, but cause of XSS attacks. Always escape these. -autoEscape = ["'"].concat(unwise), - // Characters that are never ever allowed in a hostname. -// Note that any invalid chars are also handled, but these -// are the ones that are *expected* to be seen, so we fast-path -// them. -nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), - hostEndingChars = ['/', '?', '#'], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. -unsafeProtocol = { - javascript: true, - 'javascript:': true -}, - // protocols that never have a hostname. -hostlessProtocol = { - javascript: true, - 'javascript:': true -}, - // protocols that always contain a // bit. -slashedProtocol = { - http: true, - https: true, - ftp: true, - gopher: true, - file: true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true -}, - querystring = require('querystring'); - + portPattern = /:[0-9]*$/, + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ["'"].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + javascript: true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + javascript: true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + http: true, + https: true, + ftp: true, + gopher: true, + file: true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url(); u.parse(url, parseQueryString, slashesDenoteHost); return u; } - Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + (0, _typeof2.default)(url)); - } // Copy chrome, IE, opera backslash-handling behavior. + } + + // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 - - var queryIndex = url.indexOf('?'), - splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#', - uSplit = url.split(splitter), - slashRegex = /\\/g; + splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); - var rest = url; // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" + var rest = url; + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); - if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); - if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; - if (simplePath[2]) { this.search = simplePath[2]; - if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { @@ -41151,33 +42741,28 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { this.search = ''; this.query = {}; } - return this; } } - var proto = protocolPattern.exec(rest); - if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); - } // figure out if it's got a host + } + + // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. - - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } - if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. @@ -41190,20 +42775,20 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c + // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. + // find the first instance of any hostEndingChars var hostEnd = -1; - for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; - } // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - + } + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; - if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); @@ -41211,47 +42796,46 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); - } // Now we have a portion which is definitely the auth. - // Pull that off. - + } + // Now we have a portion which is definitely the auth. + // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); - } // the host is the remaining to the left of the first non-host char - + } + // the host is the remaining to the left of the first non-host char hostEnd = -1; - for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; - } // if we still have not hit it, then the entire thing is a host. - - + } + // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); // pull out port. + rest = rest.slice(hostEnd); - this.parseHost(); // we've indicated that there is a hostname, + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; - this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] + // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; - var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. - + // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split('.'); - for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; - if (!part.match(hostnamePartPattern)) { var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder @@ -41261,37 +42845,31 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { } else { newpart += part[j]; } - } // we test again with ASCII char only - - + } + // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); - if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } - if (notHost.length) { rest = '/' + notHost.join('.') + rest; } - this.hostname = validParts.join('.'); break; } } } } - if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } - if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that @@ -41299,24 +42877,23 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } - var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; - this.href += this.host; // strip [ and ] from the hostname - // the host field still retains them, though + this.href += this.host; + // strip [ and ] from the hostname + // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); - if (rest[0] !== '/') { rest = '/' + rest; } } - } // now rest is set to the post-host stuff. - // chop off any delim chars. - + } + // now rest is set to the post-host stuff. + // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they @@ -41325,60 +42902,51 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); - if (esc === ae) { esc = escape(ae); } - rest = rest.split(ae).join(esc); } - } // chop off from the tail first. - + } + // chop off from the tail first. var hash = rest.indexOf('#'); - if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } - var qm = rest.indexOf('?'); - if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); - if (parseQueryString) { this.query = querystring.parse(this.query); } - rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } - if (rest) this.pathname = rest; - if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; - } //to support http.request - + } + //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; - } // finally, reconstruct the href based on what has been validated. - + } + // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; -}; // format a parsed object into a url string - +}; +// format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. @@ -41388,47 +42956,40 @@ function urlFormat(obj) { if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } - Url.prototype.format = function () { var auth = this.auth || ''; - if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } - var protocol = this.protocol || '', - pathname = this.pathname || '', - hash = this.hash || '', - host = false, - query = ''; - + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); - if (this.port) { host += ':' + this.port; } } - if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } - var search = this.search || query && '?' + query || ''; - if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. - // unless they had them to begin with. + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } - if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function (match) { @@ -41437,63 +42998,55 @@ Url.prototype.format = function () { search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; - function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } - Url.prototype.resolve = function (relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; - function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } - Url.prototype.resolveObject = function (relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } - var result = new Url(); var tkeys = Object.keys(this); - for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; - } // hash is always overridden, no matter what. - // even href="" will remove it. - + } - result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; - } // hrefs like //foo/bar always cut to the protocol. - + } + // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); - for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; - } //urlParse appends trailing / to urls like http://www.example.com - + } + //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } - result.href = result.format(); return result; } - if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things @@ -41505,25 +43058,17 @@ Url.prototype.resolveObject = function (relative) { // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); - for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } - result.href = result.format(); return result; } - result.protocol = relative.protocol; - if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); - - while (relPath.length && !(relative.host = relPath.shift())) { - ; - } - + while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); @@ -41532,68 +43077,60 @@ Url.prototype.resolveObject = function (relative) { } else { result.pathname = relative.pathname; } - result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; - result.port = relative.port; // to support http.request - + result.port = relative.port; + // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } - result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } - var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/', - isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/', - mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, - removeAllDots = mustEndAbs, - srcPath = result.pathname && result.pathname.split('/') || [], - relPath = relative.pathname && relative.pathname.split('/') || [], - psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative + isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/', + mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. - if (psychotic) { result.hostname = ''; result.port = null; - if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host;else srcPath.unshift(result.host); } - result.host = ''; - if (relative.protocol) { relative.hostname = null; relative.port = null; - if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host;else relPath.unshift(relative.host); } - relative.host = null; } - mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } - if (isRelAbs) { // it's absolute. result.host = relative.host || relative.host === '' ? relative.host : result.host; result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; - srcPath = relPath; // fall through to the dot-handling below. + srcPath = relPath; + // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. @@ -41607,56 +43144,50 @@ Url.prototype.resolveObject = function (relative) { // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { - result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; - if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } - result.search = relative.search; - result.query = relative.query; //to support http.request - + result.query = relative.query; + //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } - result.href = result.format(); return result; } - if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. - result.pathname = null; //to support http.request - + result.pathname = null; + //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } - result.href = result.format(); return result; - } // if a url ENDs in . or .., then it must get a trailing slash. + } + + // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. - - var last = srcPath.slice(-1)[0]; - var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''; // strip single dots, resolve double dots to parent dir - // if the path tries to go above the root, `up` ends up > 0 + var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''; + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 var up = 0; - for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; - if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { @@ -41666,86 +43197,72 @@ Url.prototype.resolveObject = function (relative) { srcPath.splice(i, 1); up--; } - } // if the path is allowed to go above the root, restore leading ..s - + } + // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } - if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } - if (hasTrailingSlash && srcPath.join('/').substr(-1) !== '/') { srcPath.push(''); } + var isAbsolute = srcPath[0] === '' || srcPath[0] && srcPath[0].charAt(0) === '/'; - var isAbsolute = srcPath[0] === '' || srcPath[0] && srcPath[0].charAt(0) === '/'; // put the host back - + // put the host back if (psychotic) { - result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host + result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; - if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } - mustEndAbs = mustEndAbs || result.host && srcPath.length; - if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } - if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); - } //to support request.http - + } + //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } - result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; - Url.prototype.parseHost = function () { var host = this.host; var port = portPattern.exec(host); - if (port) { port = port[0]; - if (port !== ':') { this.port = port.substr(1); } - host = host.substr(0, host.length - port.length); } - if (host) this.hostname = host; }; -},{"./util":473,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.array.splice.js":283,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.match.js":304,"core-js/modules/es.string.replace.js":305,"core-js/modules/es.string.search.js":306,"core-js/modules/es.string.split.js":307,"core-js/modules/es.string.trim.js":308,"punycode":382,"querystring":385}],473:[function(require,module,exports){ +},{"./util":546,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.array.splice.js":321,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.match.js":346,"core-js/modules/es.string.replace.js":347,"core-js/modules/es.string.search.js":348,"core-js/modules/es.string.split.js":349,"core-js/modules/es.string.trim.js":351,"punycode":445,"querystring":453}],546:[function(require,module,exports){ 'use strict'; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - module.exports = { isString: function isString(arg) { return typeof arg === 'string'; @@ -41761,12 +43278,12 @@ module.exports = { } }; -},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79}],474:[function(require,module,exports){ +},{"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91}],547:[function(require,module,exports){ "use strict"; require("core-js/modules/es.number.constructor.js"); - // copy from https://github.com/node-modules/utility for browser + exports.encodeURIComponent = function (text) { try { return encodeURIComponent(text); @@ -41774,83 +43291,56 @@ exports.encodeURIComponent = function (text) { return text; } }; - exports.escape = require('escape-html'); - exports.timestamp = function timestamp(t) { if (t) { var v = t; - if (typeof v === 'string') { v = Number(v); } - if (String(t).length === 10) { v *= 1000; } - return new Date(v); } - return Math.round(Date.now() / 1000); }; -},{"core-js/modules/es.number.constructor.js":286,"escape-html":343}],475:[function(require,module,exports){ +},{"core-js/modules/es.number.constructor.js":324,"escape-html":387}],548:[function(require,module,exports){ (function (process,Buffer){(function (){ 'use strict'; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); - require("core-js/modules/es.string.trim.js"); - -require("core-js/modules/es.regexp.exec.js"); - -require("core-js/modules/es.string.split.js"); - require("core-js/modules/es.object.to-string.js"); - require("core-js/modules/es.promise.js"); - +require("core-js/modules/es.regexp.exec.js"); require("core-js/modules/es.function.name.js"); - require("core-js/modules/es.array.concat.js"); - var util = require('util'); - var urlutil = require('url'); - var http = require('http'); - var https = require('https'); - var debug = require('debug')('urllib'); - var ms = require('humanize-ms'); - var REQUEST_ID = 0; var MAX_VALUE = Math.pow(2, 31) - 10; var PROTO_RE = /^https?:\/\//i; - 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) { return reject(err); } - resolve({ data: data, status: res.statusCode, @@ -41858,45 +43348,37 @@ function makeCallback(resolve, reject) { res: res }); }; -} // exports.TIMEOUT = ms('5s'); - +} +// exports.TIMEOUT = ms('5s'); exports.TIMEOUTS = [ms('300s'), ms('300s')]; var TEXT_DATA_TYPES = ['json', 'text']; - exports.request = function request(url, args, callback) { // request(url, callback) if (arguments.length === 2 && typeof args === 'function') { callback = args; args = null; } - if (typeof callback === 'function') { return exports.requestWithCallback(url, args, callback); } - return new Promise(function (resolve, reject) { exports.requestWithCallback(url, args, makeCallback(resolve, reject)); }); }; - exports.requestWithCallback = function requestWithCallback(url, args, callback) { if (!url || typeof url !== 'string' && (0, _typeof2.default)(url) !== 'object') { var msg = util.format('expect request url to be a string or a http request options, but got' + ' %j', url); throw new Error(msg); } - if (arguments.length === 2 && typeof args === 'function') { callback = args; args = null; } - args = args || {}; - if (REQUEST_ID >= MAX_VALUE) { REQUEST_ID = 0; } - var reqId = ++REQUEST_ID; args.requestUrls = args.requestUrls || []; var reqMeta = { @@ -41905,48 +43387,42 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) args: args, ctx: args.ctx }; - if (args.emitter) { args.emitter.emit('request', reqMeta); } - args.timeout = args.timeout || exports.TIMEOUTS; args.maxRedirects = args.maxRedirects || 10; args.streaming = args.streaming || args.customResponse; var requestStartTime = Date.now(); var parsedUrl; - if (typeof url === 'string') { if (!PROTO_RE.test(url)) { // Support `request('www.server.com')` url = 'https://' + url; } - parsedUrl = urlutil.parse(url); } else { parsedUrl = url; } - var method = (args.type || args.method || parsedUrl.method || 'GET').toUpperCase(); var port = parsedUrl.port || 80; var httplib = http; var agent = getAgent(args.agent, exports.agent); var fixJSONCtlChars = args.fixJSONCtlChars; - if (parsedUrl.protocol === 'https:') { httplib = https; agent = getAgent(args.httpsAgent, exports.httpsAgent); - if (!parsedUrl.port) { port = 443; } - } // request through proxy tunnel + } + + // request through proxy tunnel // var proxyTunnelAgent = detectProxyAgent(parsedUrl, args); // if (proxyTunnelAgent) { // agent = proxyTunnelAgent; // } - var options = { host: parsedUrl.hostname || parsedUrl.host || 'localhost', path: parsedUrl.path || '/', @@ -41960,12 +43436,13 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // https://github.com/nodejs/node/blob/archived-io.js-v0.12/lib/net.js#L952 lookup: args.lookup }; - if (Array.isArray(args.timeout)) { options.requestTimeout = args.timeout[args.timeout.length - 1]; } else if (typeof args.timeout !== 'undefined') { options.requestTimeout = args.timeout; - } // const sslNames = [ + } + + // const sslNames = [ // 'pfx', // 'key', // 'passphrase', @@ -41982,40 +43459,36 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // options[name] = args[name]; // } // } + // don't check ssl // if (options.rejectUnauthorized === false && !options.hasOwnProperty('secureOptions')) { // options.secureOptions = require('constants').SSL_OP_NO_TLSv1_2; // } - var auth = args.auth || parsedUrl.auth; - if (auth) { options.auth = auth; - } // content undefined data 有值 - + } + // content undefined data 有值 var body = args.content || args.data; var dataAsQueryString = method === 'GET' || method === 'HEAD' || args.dataAsQueryString; - if (!args.content) { if (body && !(typeof body === 'string' || Buffer.isBuffer(body))) { if (dataAsQueryString) { // read: GET, HEAD, use query string body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body); } else { - var contentType = options.headers['Content-Type'] || options.headers['content-type']; // auto add application/x-www-form-urlencoded when using urlencode form request - + var contentType = options.headers['Content-Type'] || options.headers['content-type']; + // auto add application/x-www-form-urlencoded when using urlencode form request if (!contentType) { if (args.contentType === 'json') { contentType = 'application/json'; } else { contentType = 'application/x-www-form-urlencoded'; } - options.headers['Content-Type'] = contentType; } - if (parseContentType(contentType) === 'application/json') { body = JSON.stringify(body); } else { @@ -42024,49 +43497,39 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) } } } - } // if it's a GET or HEAD request, data should be sent as query string - + } + // if it's a GET or HEAD request, data should be sent as query string if (dataAsQueryString && body) { options.path += (parsedUrl.query ? '&' : '?') + body; body = null; } - var requestSize = 0; - if (body) { var length = body.length; - if (!Buffer.isBuffer(body)) { length = Buffer.byteLength(body); } - requestSize = options.headers['Content-Length'] = length; } - if (args.dataType === 'json') { options.headers.Accept = 'application/json'; } - if (typeof args.beforeRequest === 'function') { // you can use this hook to change every thing. args.beforeRequest(options); } - var connectTimer = null; var responseTimer = null; var __err = null; var connected = false; // socket connected or not - var keepAliveSocket = false; // request with keepalive socket - var responseSize = 0; var statusCode = -1; var responseAborted = false; var remoteAddress = ''; var remotePort = ''; var timing = null; - if (args.timing) { timing = { // socket assigned @@ -42082,42 +43545,37 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) contentDownload: 0 }; } - function cancelConnectTimer() { if (connectTimer) { clearTimeout(connectTimer); connectTimer = null; } } - function cancelResponseTimer() { if (responseTimer) { clearTimeout(responseTimer); responseTimer = null; } } - function done(err, data, res) { cancelResponseTimer(); - if (!callback) { - console.warn('[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!', Date(), reqId, process.pid, options.method, url); // https://github.com/node-modules/urllib/pull/30 - + console.warn('[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!', Date(), reqId, process.pid, options.method, url); + // https://github.com/node-modules/urllib/pull/30 if (err) { console.warn('[urllib:warn] [%s] [%s] [worker:%s] %s: %s\nstack: %s', Date(), reqId, process.pid, err.name, err.message, err.stack); } - return; } - var cb = callback; callback = null; var headers = {}; - if (res) { statusCode = res.statusCode; headers = res.headers; - } // handle digest auth + } + + // handle digest auth // if (statusCode === 401 && headers['www-authenticate'] // && (!args.headers || !args.headers.Authorization) && args.digestAuth) { // const authenticate = headers['www-authenticate']; @@ -42133,13 +43591,10 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // } // } - var requestUseTime = Date.now() - requestStartTime; - if (timing) { timing.contentDownload = requestUseTime; } - debug('[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j', requestUseTime, responseSize, statusCode, options.method, options.host, options.path, keepAliveSocket, timing); var response = { status: statusCode, @@ -42155,15 +43610,12 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) remoteAddress: remoteAddress, remotePort: remotePort }; - if (err) { var agentStatus = ''; - if (agent && typeof agent.getCurrentStatus === 'function') { // add current agent status to error message for logging and debug agentStatus = ', agent status: ' + JSON.stringify(agent.getCurrentStatus()); } - err.message += ', ' + options.method + ' ' + url + ' ' + statusCode + ' (connected: ' + connected + ', keepalive socket: ' + keepAliveSocket + agentStatus + ')' + '\nheaders: ' + JSON.stringify(headers); err.data = data; err.path = options.path; @@ -42171,9 +43623,7 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) err.headers = headers; err.res = response; } - cb(err, data, args.streaming ? res : response); - if (args.emitter) { // keep to use the same reqMeta object on request event before reqMeta.url = url; @@ -42189,15 +43639,12 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) }); } } - function handleRedirect(res) { var err = null; - if (args.followRedirect && statuses.redirect[res.statusCode]) { // handle redirect args._followRedirectCount = (args._followRedirectCount || 0) + 1; var location = res.headers.location; - if (!location) { err = new Error('Got statusCode ' + res.statusCode + ' but cannot resolve next location from headers'); err.name = 'FollowRedirectError'; @@ -42206,15 +43653,14 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) err.name = 'MaxRedirectError'; } else { var newUrl = args.formatRedirectUrl ? args.formatRedirectUrl(url, location) : urlutil.resolve(url, location); - debug('Request#%d %s: `redirected` from %s to %s', reqId, options.path, url, newUrl); // make sure timer stop - - cancelResponseTimer(); // should clean up headers.Host on `location: http://other-domain/url` - + debug('Request#%d %s: `redirected` from %s to %s', reqId, options.path, url, newUrl); + // make sure timer stop + cancelResponseTimer(); + // should clean up headers.Host on `location: http://other-domain/url` if (args.headers && args.headers.Host && PROTO_RE.test(location)) { args.headers.Host = null; - } // avoid done will be execute in the future change. - - + } + // avoid done will be execute in the future change. var cb = callback; callback = null; exports.requestWithCallback(newUrl, args, cb); @@ -42224,57 +43670,49 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) }; } } - return { redirect: false, error: err }; } - if (args.gzip) { if (!options.headers['Accept-Encoding'] && !options.headers['accept-encoding']) { options.headers['Accept-Encoding'] = 'gzip'; } } - function decodeContent(res, body, cb) { - var encoding = res.headers['content-encoding']; // if (body.length === 0) { + var encoding = res.headers['content-encoding']; + // if (body.length === 0) { // return cb(null, body, encoding); // } + // if (!encoding || encoding.toLowerCase() !== 'gzip') { + return cb(null, body, encoding); + // } - return cb(null, body, encoding); // } // debug('gunzip %d length body', body.length); // zlib.gunzip(body, cb); } - var writeStream = args.writeStream; debug('Request#%d %s %s with headers %j, options.path: %s', reqId, method, url, options.headers, options.path); args.requestUrls.push(url); - function onResponse(res) { if (timing) { timing.waiting = Date.now() - requestStartTime; } - debug('Request#%d %s `req response` event emit: status %d, headers: %j', reqId, url, res.statusCode, res.headers); - if (args.streaming) { var result = handleRedirect(res); - if (result.redirect) { res.resume(); return; } - if (result.error) { res.resume(); return done(result.error, null, res); } - return done(null, null, res); } - res.on('close', function () { debug('Request#%d %s: `res close` event emit, total size %d', reqId, url, responseSize); }); @@ -42285,7 +43723,6 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) responseAborted = true; debug('Request#%d %s: `res aborted` event emit, total size %d', reqId, url, responseSize); }); - if (writeStream) { // If there's a writable stream to recieve the response data, just pipe the // response stream to that writable stream and call the callback when it has @@ -42304,20 +43741,17 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // - http://nodejs.org/api/stream.html#stream_event_end // - http://nodejs.org/api/stream.html#stream_event_close_1 var _result = handleRedirect(res); - if (_result.redirect) { res.resume(); return; } - if (_result.error) { - res.resume(); // end ths stream first - + res.resume(); + // end ths stream first writeStream.end(); return done(_result.error, null, res); - } // you can set consumeWriteStream false that only wait response end - - + } + // you can set consumeWriteStream false that only wait response end if (args.consumeWriteStream === false) { res.on('end', done.bind(null, null, null, res)); } else { @@ -42337,9 +43771,10 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) }); } } - return res.pipe(writeStream); - } // Otherwise, just concat those buffers. + } + + // Otherwise, just concat those buffers. // // NOTE that the `chunk` is not a String but a Buffer. It means that if // you simply concat two chunk with `+` you're actually converting both @@ -42352,7 +43787,6 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // See also: // http://cnodejs.org/topic/4faf65852e8fb5bc65113403 - var chunks = []; res.on('data', function (chunk) { debug('Request#%d %s: `res data` event emit, size %d', reqId, url, chunk.length); @@ -42362,44 +43796,36 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) res.on('end', function () { var body = Buffer.concat(chunks, responseSize); debug('Request#%d %s: `res end` event emit, total size %d, _dumped: %s', reqId, url, responseSize, res._dumped); - if (__err) { // req.abort() after `res data` event emit. return done(__err, body, res); } - var result = handleRedirect(res); - if (result.error) { return done(result.error, body, res); } - if (result.redirect) { return; } - decodeContent(res, body, function (err, data, encoding) { if (err) { return done(err, body, res); - } // if body not decode, dont touch it - - + } + // if body not decode, dont touch it if (!encoding && TEXT_DATA_TYPES.indexOf(args.dataType) >= 0) { // try to decode charset try { data = decodeBodyByCharset(data, res); } catch (e) { - debug('decodeBodyByCharset error: %s', e); // if error, dont touch it - + debug('decodeBodyByCharset error: %s', e); + // if error, dont touch it return done(null, data, res); } - if (args.dataType === 'json') { if (responseSize === 0) { data = null; } else { var r = parseJSON(data, fixJSONCtlChars); - if (r.error) { err = r.error; } else { @@ -42408,20 +43834,16 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) } } } - if (responseAborted) { // err = new Error('Remote socket was terminated before `response.end()` was called'); // err.name = 'RemoteSocketClosedError'; debug('Request#%d %s: Remote socket was terminated before `response.end()` was called', reqId, url); } - done(err, data, res); }); }); } - var connectTimeout, responseTimeout; - if (Array.isArray(args.timeout)) { connectTimeout = ms(args.timeout[0]); responseTimeout = ms(args.timeout[1]); @@ -42429,26 +43851,20 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) // set both timeout equal connectTimeout = responseTimeout = ms(args.timeout); } - debug('ConnectTimeout: %d, ResponseTimeout: %d', connectTimeout, responseTimeout); - function startConnectTimer() { debug('Connect timer ticking, timeout: %d', connectTimeout); connectTimer = setTimeout(function () { connectTimer = null; - if (statusCode === -1) { statusCode = -2; } - var msg = 'Connect timeout for ' + connectTimeout + 'ms'; var errorName = 'ConnectionTimeoutError'; - if (!req.socket) { errorName = 'SocketAssignTimeoutError'; msg += ', working sockets is full'; } - __err = new Error(msg); __err.name = errorName; __err.requestId = reqId; @@ -42456,7 +43872,6 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) abortRequest(); }, connectTimeout); } - function startResposneTimer() { debug('Response timer ticking, timeout: %d', responseTimeout); responseTimer = setTimeout(function () { @@ -42470,18 +43885,16 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) abortRequest(); }, responseTimeout); } - - var req; // request headers checker will throw error - + var req; + // request headers checker will throw error options.mode = args.mode ? args.mode : ''; - try { req = httplib.request(options, onResponse); } catch (err) { return done(err); - } // environment detection: browser or nodejs - + } + // environment detection: browser or nodejs if (typeof window === 'undefined') { // start connect timer just after `request` return, and just in nodejs environment startConnectTimer(); @@ -42490,7 +43903,6 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) if (statusCode === -1) { statusCode = -2; } - var msg = 'Connect timeout for ' + connectTimeout + 'ms'; var errorName = 'ConnectionTimeoutError'; __err = new Error(msg); @@ -42499,47 +43911,41 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) abortRequest(); }); } - function abortRequest() { - debug('Request#%d %s abort, connected: %s', reqId, url, connected); // it wont case error event when req haven't been assigned a socket yet. - + debug('Request#%d %s abort, connected: %s', reqId, url, connected); + // it wont case error event when req haven't been assigned a socket yet. if (!req.socket) { __err.noSocket = true; done(__err); } - req.abort(); } - if (timing) { // request sent req.on('finish', function () { timing.requestSent = Date.now() - requestStartTime; }); } - req.once('socket', function (socket) { if (timing) { // socket queuing time timing.queuing = Date.now() - requestStartTime; - } // https://github.com/nodejs/node/blob/master/lib/net.js#L377 + } + + // 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; // } - var readyState = socket.readyState; - if (readyState === 'opening') { socket.once('lookup', function (err, ip, addressType) { debug('Request#%d %s lookup: %s, %s, %s', reqId, url, err, ip, addressType); - if (timing) { timing.dnslookup = Date.now() - requestStartTime; } - if (ip) { remoteAddress = ip; } @@ -42548,33 +43954,29 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) if (timing) { // socket connected timing.connected = Date.now() - requestStartTime; - } // cancel socket timer at first and start tick for TTFB - + } + // cancel socket timer at first and start tick for TTFB cancelConnectTimer(); startResposneTimer(); debug('Request#%d %s new socket connected', reqId, url); connected = true; - if (!remoteAddress) { remoteAddress = socket.remoteAddress; } - remotePort = socket.remotePort; }); return; } - debug('Request#%d %s reuse socket connected, readyState: %s', reqId, url, readyState); connected = true; keepAliveSocket = true; - if (!remoteAddress) { remoteAddress = socket.remoteAddress; } + remotePort = socket.remotePort; - remotePort = socket.remotePort; // reuse socket, timer should be canceled. - + // reuse socket, timer should be canceled. cancelConnectTimer(); startResposneTimer(); }); @@ -42583,12 +43985,10 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) if (err.name === 'Error' || err.name === 'TypeError') { err.name = connected ? 'ResponseError' : 'RequestError'; } - err.message += ' (req "error")'; debug('Request#%d %s `req error` event emit, %s: %s', reqId, url, err.name, err.message); done(__err || err); }); - if (writeStream) { writeStream.once('error', function (err) { err.message += ' (writeStream "error")'; @@ -42597,7 +43997,6 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) abortRequest(); }); } - if (args.stream) { args.stream.pipe(req); args.stream.once('error', function (err) { @@ -42609,12 +44008,11 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback) } else { req.end(body); } - req.requestId = reqId; return req; }; }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"_process":467,"buffer":90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.split.js":307,"core-js/modules/es.string.trim.js":308,"debug":465,"http":468,"https":355,"humanize-ms":356,"url":472,"util":419}]},{},[1])(1) +},{"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,"_process":540,"buffer":103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.trim.js":351,"debug":538,"http":541,"https":400,"humanize-ms":401,"url":545,"util":491}]},{},[1])(1) }); })(window) diff --git a/dist/aliyun-oss-sdk.min.js b/dist/aliyun-oss-sdk.min.js index aef59a8a..4a62ed36 100644 --- a/dist/aliyun-oss-sdk.min.js +++ b/dist/aliyun-oss-sdk.min.js @@ -1,4 +1,4 @@ -// Aliyun OSS SDK for JavaScript v6.19.0 +// Aliyun OSS SDK for JavaScript v6.20.0 // Copyright Aliyun.com, Inc. or its affiliates. All Rights Reserved. // License at https://github.com/ali-sdk/ali-oss/blob/master/LICENSE -(function(global){!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).OSS=e()}(function(){return function n(i,o,s){function a(t,e){if(!o[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=o[t]={exports:{}},i[t][0].call(r.exports,function(e){return a(i[t][1][e]||e)},r,r.exports,n,i,o,s)}return o[t].exports}for(var u="function"==typeof require&&require,e=0;e\n\n\n'.concat(t,"\n"),r&&(o+="".concat(r,"\n")),o+="\n",i.content=o,i.mime="xml",i.successStatuses=[200],e.next=9,this.request(i);case 9:return o=e.sent,e.abrupt("return",{res:o.res});case 11:case"end":return e.stop()}},e,this)}));return function(e,t,r){return n.apply(this,arguments)}}(),n.getBucketLogging=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n,i;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("GET",t,"logging",r)).successStatuses=[200],n.xmlResponse=!0,e.next=5,this.request(n);case 5:return n=e.sent,i=n.data.LoggingEnabled,e.abrupt("return",{enable:!!i,prefix:i&&i.TargetPrefix||null,res:n.res});case 8:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.deleteBucketLogging=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("DELETE",t,"logging",r)).successStatuses=[204,200],e.next=4,this.request(n);case 4:return n=e.sent,e.abrupt("return",{res:n.res});case 6:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.putBucketCORS=function(){var n=(0,o.default)(d.default.mark(function e(t,r,n){var i,o,s,a,u,l,c,f,p;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(h((r=r||[]).length,"rules is required"),r.forEach(function(e){h(e.allowedOrigin,"allowedOrigin is required"),h(e.allowedMethod,"allowedMethod is required")}),p=this._bucketRequestParams("PUT",t,"cors",n),i='\n',o=function(e){i+="".concat(e,"")},s=function(e){i+="".concat(e,"")},a=function(e){i+="".concat(e,"")},u=function(e){i+="".concat(e,"")},l=0,c=r.length;l",m(f.allowedOrigin).forEach(o),m(f.allowedMethod).forEach(s),m(f.allowedHeader).forEach(a),m(f.exposeHeader).forEach(u),f.maxAgeSeconds&&(i+="".concat(f.maxAgeSeconds,"")),i+="";return i+="",p.content=i,p.mime="xml",p.successStatuses=[200],e.next=16,this.request(p);case 16:return p=e.sent,e.abrupt("return",{res:p.res});case 18:case"end":return e.stop()}},e,this)}));return function(e,t,r){return n.apply(this,arguments)}}(),n.getBucketCORS=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n,i,o;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("GET",t,"cors",r)).successStatuses=[200],n.xmlResponse=!0,e.next=5,this.request(n);case 5:return n=e.sent,i=[],n.data&&n.data.CORSRule&&(o=s(o=n.data.CORSRule)?o:[o]).forEach(function(t){var r={};Object.keys(t).forEach(function(e){r[e.slice(0,1).toLowerCase()+e.slice(1,e.length)]=t[e]}),i.push(r)}),e.abrupt("return",{rules:i,res:n.res});case 9:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.deleteBucketCORS=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("DELETE",t,"cors",r)).successStatuses=[204],e.next=4,this.request(n);case 4:return n=e.sent,e.abrupt("return",{res:n.res});case 6:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.putBucketReferer=function(){var i=(0,o.default)(d.default.mark(function e(t,r,n,i){var o,s,a;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this._bucketRequestParams("PUT",t,"referer",i),o='\n\n',o+=" ".concat(r?"true":"false","\n"),n&&0\n",s=0;s".concat(n[s],"\n");o+=" \n"}else o+=" \n";return o+="",a.content=o,a.mime="xml",a.successStatuses=[200],e.next=10,this.request(a);case 10:return a=e.sent,e.abrupt("return",{res:a.res});case 12:case"end":return e.stop()}},e,this)}));return function(e,t,r,n){return i.apply(this,arguments)}}(),n.getBucketReferer=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n,i;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("GET",t,"referer",r)).successStatuses=[200],n.xmlResponse=!0,e.next=5,this.request(n);case 5:return n=e.sent,(i=n.data.RefererList.Referer||null)&&!s(i)&&(i=[i]),e.abrupt("return",{allowEmpty:"true"===n.data.AllowEmptyReferer,referers:i,res:n.res});case 9:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.deleteBucketReferer=function(){var r=(0,o.default)(d.default.mark(function e(t,r){return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.putBucketReferer(t,!0,null,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n._bucketRequestParams=function(e,t,r,n){return{method:e,bucket:t,subres:r,timeout:n&&n.timeout,ctx:n&&n.ctx}}},{"../common/utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,assert:82,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],3:[function(T,E,e){!function(k,_){!function(){"use strict";var e=T("@babel/runtime/helpers/interopRequireDefault"),u=e(T("@babel/runtime/regenerator")),r=e(T("@babel/runtime/helpers/asyncToGenerator")),e=(T("core-js/modules/es.function.name.js"),T("core-js/modules/es.regexp.exec.js"),T("core-js/modules/es.string.split.js"),T("core-js/modules/es.object.assign.js"),T("core-js/modules/es.array.includes.js"),T("core-js/modules/es.string.replace.js"),T("core-js/modules/es.array.concat.js"),T("core-js/modules/es.symbol.js"),T("core-js/modules/es.symbol.description.js"),T("core-js/modules/es.array.slice.js"),T("core-js/modules/es.object.to-string.js"),T("core-js/modules/es.promise.js"),T("core-js/modules/es.regexp.to-string.js"),T("debug")("ali-oss")),t=T("xml2js"),n=T("agentkeepalive"),i=T("merge-descriptors"),o=T("platform"),s=T("utility"),a=T("urllib"),l=T("./version"),c=T("bowser"),f=T("../common/signUtils"),p=T("../common/client/initOptions"),d=T("../common/utils/createRequest").createRequest,h=T("../common/utils/encoder").encoder,m=T("../common/client/getReqUrl").getReqUrl,y=T("../common/utils/setSTSToken").setSTSToken,b=T("../common/utils/retry").retry,g=T("../common/utils/isFunction").isFunction,v=new n;function w(e,t){var r,n;if(r=o.name,n=o.version,r&&r.toLowerCase&&"ie"===r.toLowerCase()&&n.split(".")[0]<10&&console.warn("ali-oss does not support the current browser"),!(this instanceof w))return new w(e,t);e&&e.inited?this.options=e:this.options=w.initOptions(e),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=a,this.agent=this.options.agent||v),this.ctx=t,this.userAgent=this._getUserAgent(),this.stsTokenFreshTime=new Date,this.options.amendTimeSkewed=0}(E.exports=w).initOptions=function(e){e.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");e=Object.assign({secure:location&&"https:"===location.protocol,useFetch:!1},e);return p(e)};n=w.prototype;function j(e){return x.apply(this,arguments)}function x(){return(x=(0,r.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:if(this.options.stsToken&&g(this.options.refreshSTSToken))return e.next=3,y.call(this);e.next=3;break;case 3:return r=d.call(this,t),this.options.useFetch||(r.params.mode="disable-fetch"),o=!!t.stream,e.prev=6,e.next=9,this.urllib.request(r.url,r.params);case 9:n=e.sent,this.debug("response %s %s, got %s, headers: %j",t.method,r.url,n.status,n.headers,"info"),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),i=e.t0;case 16:if(n&&t.successStatuses&&-1===t.successStatuses.indexOf(n.status))return e.next=19,this.requestError(n);e.next=28;break;case 19:if("RequestTimeTooSkewed"!==(s=e.sent).code||o){e.next=25;break}return this.options.amendTimeSkewed=+new Date(s.serverTime)-new Date,e.next=24,this.request(t);case 24:return e.abrupt("return",e.sent);case 25:s.params=t,e.next=32;break;case 28:if(i)return e.next=31,this.requestError(i);e.next=32;break;case 31:s=e.sent;case 32:if(s)throw s;e.next=34;break;case 34:if(t.xmlResponse)return e.next=37,this.parseXML(n.data);e.next=39;break;case 37:a=e.sent,n.data=a;case 39:return e.abrupt("return",n);case 40:case"end":return e.stop()}},e,this,[[6,13]])}))).apply(this,arguments)}n.debug=e,i(n,T("./object")),i(n,T("./bucket")),i(n,T("../common/bucket/getBucketWebsite")),i(n,T("../common/bucket/putBucketWebsite")),i(n,T("../common/bucket/deleteBucketWebsite")),i(n,T("../common/bucket/getBucketLifecycle")),i(n,T("../common/bucket/putBucketLifecycle")),i(n,T("../common/bucket/deleteBucketLifecycle")),i(n,T("../common/bucket/putBucketVersioning")),i(n,T("../common/bucket/getBucketVersioning")),i(n,T("../common/bucket/getBucketInventory")),i(n,T("../common/bucket/deleteBucketInventory")),i(n,T("../common/bucket/listBucketInventory")),i(n,T("../common/bucket/putBucketInventory")),i(n,T("../common/bucket/abortBucketWorm")),i(n,T("../common/bucket/completeBucketWorm")),i(n,T("../common/bucket/extendBucketWorm")),i(n,T("../common/bucket/getBucketWorm")),i(n,T("../common/bucket/initiateBucketWorm")),i(n,T("./managed-upload")),i(n,T("../common/multipart-copy")),i(n,T("../common/multipart")),i(n,T("../common/parallel")),n.signature=function(e){return this.debug("authorization stringToSign: %s",e,"info"),f.computeSignature(this.options.accessKeySecret,e,this.options.headerEncoding)},n._getReqUrl=m,n.authorization=function(e,t,r,n){e=f.buildCanonicalString(e.toUpperCase(),t,{headers:n,parameters:r});return f.authorization(this.options.accessKeyId,this.options.accessKeySecret,e,this.options.headerEncoding)},n.request=function(){var t=(0,r.default)(u.default.mark(function e(n){var i=this;return u.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.options.retryMax)return e.next=3,b(j.bind(this),this.options.retryMax,{errorHandler:function(e){return!!function(e){if(n.stream)return!1;var t=[-1,-2].includes(e.status),r=i.options.requestErrorRetryHandle||function(){return!0};return t&&r(e)}(e)}})(n);e.next=6;break;case 3:return e.abrupt("return",e.sent);case 6:return e.abrupt("return",j.call(this,n));case 7:case"end":return e.stop()}},e,this)}));return function(e){return t.apply(this,arguments)}}(),n._getResource=function(e){var t="/";return e.bucket&&(t+="".concat(e.bucket,"/")),e.object&&(t+=h(e.object,this.options.headerEncoding)),t},n._escape=function(e){return s.encodeURIComponent(e).replace(/%2F/g,"/")},n._getUserAgent=function(){var e=_&&_.browser?"js":"nodejs",e="aliyun-sdk-".concat(e,"/").concat(l.version),t=o.description;return!t&&_&&(t="Node.js ".concat(_.version.slice(1)," on ").concat(_.platform," ").concat(_.arch)),this._checkUserAgent("".concat(e," ").concat(t))},n._checkUserAgent=function(e){return e.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},n.checkBrowserAndVersion=function(e,t){return c.name===e&&c.version.split(".")[0]===t},n.parseXML=function(e){return new Promise(function(r,n){k.isBuffer(e)&&(e=e.toString()),t.parseString(e,{explicitRoot:!1,explicitArray:!1},function(e,t){e?n(e):r(t)})})},n.requestError=function(){var t=(0,r.default)(u.default.mark(function e(t){var r,n,i,o;return u.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,t.data&&t.data.length){e.next=5;break}-1===t.status||-2===t.status?((r=new Error(t.message)).name=t.name,r.status=t.status,r.code=t.name):(404===t.status?((r=new Error("Object not exists")).name="NoSuchKeyError",r.status=404,r.code="NoSuchKey"):412===t.status?((r=new Error("Pre condition failed")).name="PreconditionFailedError",r.status=412,r.code="PreconditionFailed"):((r=new Error("Unknow error, status: ".concat(t.status))).name="UnknownError",r.status=t.status),r.requestId=t.headers["x-oss-request-id"],r.host=""),e.next=32;break;case 5:return n=String(t.data),this.debug("request response error data: %s",n,"error"),e.prev=7,e.next=10,this.parseXML(n);case 10:if(e.t0=e.sent,e.t0){e.next=13;break}e.t0={};case 13:i=e.t0,e.next=23;break;case 16:return e.prev=16,e.t1=e.catch(7),this.debug(n,"error"),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 23:o=i.Message||"unknow request error, status: ".concat(t.status),i.Condition&&(o+=" (condition: ".concat(i.Condition,")")),(r=new Error(o)).name=i.Code?"".concat(i.Code,"Error"):"UnknownError",r.status=t.status,r.code=i.Code,r.requestId=i.RequestId,r.hostId=i.HostId,r.serverTime=i.ServerTime;case 32:return this.debug("generate error %j",r,"error"),e.abrupt("return",r);case 34:case"end":return e.stop()}},e,this,[[7,16]])}));return function(e){return t.apply(this,arguments)}}()}.call(this)}.call(this,{isBuffer:T("../../node_modules/is-buffer/index.js")},T("_process"))},{"../../node_modules/is-buffer/index.js":366,"../common/bucket/abortBucketWorm":7,"../common/bucket/completeBucketWorm":8,"../common/bucket/deleteBucketInventory":9,"../common/bucket/deleteBucketLifecycle":10,"../common/bucket/deleteBucketWebsite":11,"../common/bucket/extendBucketWorm":12,"../common/bucket/getBucketInventory":13,"../common/bucket/getBucketLifecycle":14,"../common/bucket/getBucketVersioning":15,"../common/bucket/getBucketWebsite":16,"../common/bucket/getBucketWorm":17,"../common/bucket/initiateBucketWorm":18,"../common/bucket/listBucketInventory":19,"../common/bucket/putBucketInventory":20,"../common/bucket/putBucketLifecycle":21,"../common/bucket/putBucketVersioning":22,"../common/bucket/putBucketWebsite":23,"../common/client/getReqUrl":25,"../common/client/initOptions":26,"../common/multipart":30,"../common/multipart-copy":29,"../common/parallel":49,"../common/signUtils":50,"../common/utils/createRequest":56,"../common/utils/encoder":59,"../common/utils/isFunction":68,"../common/utils/retry":74,"../common/utils/setSTSToken":76,"./bucket":2,"./managed-upload":4,"./object":5,"./version":6,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,_process:467,agentkeepalive:81,bowser:88,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/es.string.split.js":307,"core-js/modules/es.symbol.description.js":310,"core-js/modules/es.symbol.js":313,debug:465,"merge-descriptors":372,platform:379,urllib:475,utility:474,xml2js:426}],4:[function(i,e,o){!function(s){!function(){"use strict";var e=i("@babel/runtime/helpers/interopRequireDefault"),b=e(i("@babel/runtime/regenerator")),g=(i("core-js/modules/es.function.name.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.array.from.js"),i("core-js/modules/es.string.iterator.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.array.filter.js"),i("core-js/modules/es.array.find.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.array.iterator.js"),i("core-js/modules/es.array-buffer.slice.js"),i("core-js/modules/es.typed-array.uint8-array.js"),i("core-js/modules/es.typed-array.copy-within.js"),i("core-js/modules/es.typed-array.every.js"),i("core-js/modules/es.typed-array.fill.js"),i("core-js/modules/es.typed-array.filter.js"),i("core-js/modules/es.typed-array.find.js"),i("core-js/modules/es.typed-array.find-index.js"),i("core-js/modules/es.typed-array.for-each.js"),i("core-js/modules/es.typed-array.includes.js"),i("core-js/modules/es.typed-array.index-of.js"),i("core-js/modules/es.typed-array.iterator.js"),i("core-js/modules/es.typed-array.join.js"),i("core-js/modules/es.typed-array.last-index-of.js"),i("core-js/modules/es.typed-array.map.js"),i("core-js/modules/es.typed-array.reduce.js"),i("core-js/modules/es.typed-array.reduce-right.js"),i("core-js/modules/es.typed-array.reverse.js"),i("core-js/modules/es.typed-array.set.js"),i("core-js/modules/es.typed-array.slice.js"),i("core-js/modules/es.typed-array.some.js"),i("core-js/modules/es.typed-array.sort.js"),i("core-js/modules/es.typed-array.subarray.js"),i("core-js/modules/es.typed-array.to-locale-string.js"),i("core-js/modules/es.typed-array.to-string.js"),e(i("@babel/runtime/helpers/asyncToGenerator"))),e=i("util"),f=i("path"),p=i("mime"),v=i("copy-to"),d=i("../common/utils/isBlob").isBlob,h=i("../common/utils/isFile").isFile,m=i("../common/utils/isBuffer").isBuffer,t=o;t.multipartUpload=function(){var r=(0,g.default)(b.default.mark(function e(t,r){var n,i,o,s,a,u,l,c=arguments;return b.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=2this.fileBuffer.length?this.fileBuffer.length:n;this.start=n,t=this.push(this.fileBuffer.slice(r,n))}},n.prototype._read=function(t){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);t=t||16384;var r=this;this.reader.onload=function(e){r.fileBuffer=s.from(new Uint8Array(e.target.result)),r.file=null,r.readFileAndPush(t)},0===this.start?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(t)},t._createBuffer=function(){var n=(0,g.default)(b.default.mark(function e(t,r,i){var o;return b.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!d(t)&&!h(t)){e.next=8;break}o=t.slice(r,i),e.next=4;var n=o;return n.arrayBuffer?n.arrayBuffer():new Promise(function(t,r){var e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=function(e){r(e)},e.readAsArrayBuffer(n)});case 4:return o=e.sent,e.abrupt("return",s.from(o));case 8:if(m(t))return e.abrupt("return",t.subarray(r,i));e.next=12;break;case 12:throw new Error("_createBuffer requires File/Blob/Buffer.");case 13:case"end":return e.stop()}},e)}));return function(e,t,r){return n.apply(this,arguments)}}(),t._getPartSize=function(e,t){t=t||1048576;e=Math.ceil(e/1e4);return t\n\n',a=0;a\n")+"".concat(u.number,"\n"))+"".concat(u.etag,"\n")+"\n";return s+="",f={},(f=h(i=i||{},function(e){if(m(e))return null})).subres={uploadId:r},f.headers=y(f.headers,["x-oss-server-side-encryption","x-oss-storage-class"]),l=this._objectRequestParams("POST",t,f),d.encodeCallback(l,f),l.mime="xml",l.content=s,l.headers&&l.headers["x-oss-callback"]||(l.xmlResponse=!0),l.successStatuses=[200],e.next=17,this.request(l);case 17:if(c=e.sent,i.progress)return e.next=21,i.progress(1,null,c.res);e.next=21;break;case 21:return f={res:c.res,bucket:l.bucket,name:t,etag:c.res.headers.etag},l.headers&&l.headers["x-oss-callback"]&&(f.data=JSON.parse(c.data.toString())),e.abrupt("return",f);case 24:case"end":return e.stop()}},e,this)}));return function(e,t,r,n){return i.apply(this,arguments)}}(),e._uploadPart=function(){var o=(0,t.default)(p.default.mark(function e(t,r,n,i,o){var s,a,u;return p.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s={},l(o=o||{}).to(s),s.headers=s.headers||{},s.headers["Content-Length"]=i.size,s.headers=y(s.headers,["x-oss-server-side-encryption"]),s.subres={partNumber:n,uploadId:r},(a=this._objectRequestParams("PUT",t,s)).mime=s.mime,c&&c.browser?a.content=i.content:a.stream=i.stream,a.successStatuses=[200],a.disabledMD5=o.disabledMD5,e.next=15,this.request(a);case 15:if((u=e.sent).res.headers.etag){e.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 18:return i.stream&&(i.stream=null,a.stream=null),e.abrupt("return",{name:t,etag:u.res.headers.etag,res:u.res});case 20:case"end":return e.stop()}},e,this)}));return function(e,t,r,n,i){return o.apply(this,arguments)}}()}.call(this)}.call(this,r("_process"))},{"./callback":24,"./utils/deepCopy":58,"./utils/isBuffer":65,"./utils/omit":73,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,_process:467,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.map.js":280,"core-js/modules/es.array.sort.js":282,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],31:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault"),c=n(e("@babel/runtime/regenerator")),i=(e("core-js/modules/es.regexp.exec.js"),n(e("@babel/runtime/helpers/asyncToGenerator"))),f=e("url"),p=e("utility"),d=e("copy-to"),h=e("../../common/signUtils"),m=e("../utils/isIP").isIP,y=e("../utils/setSTSToken").setSTSToken,b=e("../utils/isFunction").isFunction;r.asyncSignatureUrl=function(){var r=(0,i.default)(c.default.mark(function e(t,r){var n,i,o,s,a,u,l=arguments;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(2t[0]?1:e[0]").concat(e[t],""):"object"===o(e[t])?n+="<".concat(t,">").concat(r(e[t]),""):"array"===o(e[t])?n+=e[t].map(function(e){return"<".concat(t,">").concat(r(e),"")}).join(""):n+="<".concat(t,">").concat(e[t].toString(),""))}):n+=e.toString(),n}},{"./formatObjKey":61,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.map.js":280,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],73:[function(e,t,r){"use strict";function o(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};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 i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.options.refreshSTSTokenInterval)return this.stsTokenFreshTime=t,e.next=7,this.options.refreshSTSToken();e.next=12;break;case 7:r=e.sent,(r=s.formatObjKey(r,"firstLowerCase")).securityToken&&(r.stsToken=r.securityToken),u(r),Object.assign(this.options,r);case 12:e.next=15;break;case 14:this.stsTokenFreshTime=t;case 15:return e.abrupt("return",null);case 16:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function u(e){var r=Object.keys(e);["accessKeySecret","accessKeyId","stsToken"].forEach(function(t){if(!r.find(function(e){return e===t}))throw Error("refreshSTSToken must return contains ".concat(t))})}r.setSTSToken=function(){return a.apply(this,arguments)},r.checkCredentials=u},{"./formatObjKey":61,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.find.js":275,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291}],77:[function(e,t,r){function u(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,i)}t.exports=function(a){return function(){var e=this,s=arguments;return new Promise(function(t,r){var n=a.apply(e,s);function i(e){u(n,t,r,i,o,"next",e)}function o(e){u(n,t,r,i,o,"throw",e)}i(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports},{}],78:[function(e,t,r){t.exports=function(e){return e&&e.__esModule?e:{default:e}},t.exports.__esModule=!0,t.exports.default=t.exports},{}],79:[function(e,t,r){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},{}],80:[function(e,t,r){t.exports=e("regenerator-runtime")},{"regenerator-runtime":395}],81:[function(e,t,r){function n(){}t.exports=n,t.exports.HttpsAgent=n},{}],82:[function(x,k,e){!function(p){!function(){"use strict";var e=x("object-assign");function d(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===n&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,o[s++]=255&t);1===n&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return i.join("")}(e,o,s>2]+a[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],u=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;it[1][r])return 1;if(t[0][r]!==t[1][r])return-1;if(0===r)return 0}}function o(e,t,r){var n,i=a,o=("string"==typeof t&&(r=t,t=void 0),void 0===t&&(t=!1),""+(i=r?s(r):i).version);for(n in e)if(e.hasOwnProperty(n)&&i[n]){if("string"!=typeof e[n])throw new Error("Browser version in the minVersion map should be a string: "+n+": "+String(e));return x([o,e[n]])<0}return t}return a.test=function(e){for(var t=0;t>>1;case"base64":return S(e).length;default:if(i)return n?-1:E(e).length;t=(""+t).toLowerCase(),i=!0}}function r(e,t,r){var n,i=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var o=this,s=t,a=r,u=o.length;(!a||a<0||u=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:h(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):h(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,n,i){var o=1,s=e.length,a=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/=o=2,a/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var l=-1,c=r;c>8,n=n%256,i.push(n),i.push(r);return i}(t,e.length-r),e,r,n)}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}var p=n,d=p.length;if(d<=g)return String.fromCharCode.apply(String,p);for(var h="",m=0;mt&&(e+=" ... "),""},f.prototype.compare=function(e,t,r,n,i){if(A(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.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=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||ithis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u=!1;;)switch(n){case"hex":var l=this,c=e,f=t,p=r,d=(f=Number(f)||0,l.length-f);(!p||d<(p=Number(p)))&&(p=d),(d=c.length)/2e.length)throw new RangeError("Index out of range")}function w(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return t=+t,r>>>=0,i||w(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,i){return t=+t,r>>>=0,i||w(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||m(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||m(e,t,this.length);for(var n=this[e+--t],i=1;0>>=0,t||m(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||m(e,t,this.length);for(var n=t,i=1,o=this[e+--n];0>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},f.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},f.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||v(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||v(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,255,0),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(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},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(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},f.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||v(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||v(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(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},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},f.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(!f.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var i=(n=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>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 S(e){return _.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}}.call(this)}.call(this,D("buffer").Buffer)},{"base64-js":87,buffer:90,ieee754:357}],91:[function(e,t,r){t.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"}},{}],92:[function(e,t,r){"use strict";var n=e("get-intrinsic"),i=e("./"),o=i(n("String.prototype.indexOf"));t.exports=function(e,t){t=n(e,!!t);return"function"==typeof t&&-1>8&255]}function i(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function t(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function B(e){return R(e,23,4)}function F(e){return R(e,52,8)}function o(e,t){V(e[k],t,{get:function(){return j(this)[t]}})}function s(e,t,r,n){if(r=y(r),e=j(e),r+t>e.byteLength)throw D(_);var i=j(e.buffer).bytes,r=r+e.byteOffset,e=H(i,r,r+t);return n?e:J(e)}function a(e,t,r,n,i,o){if(r=y(r),e=j(e),r+t>e.byteLength)throw D(_);for(var s=j(e.buffer).bytes,a=r+e.byteOffset,u=n(+i),l=0;lQ;)(P=Z[Q++])in E||p(E,P,T[P]);S.constructor=E}g&&W(A)!==I&&g(A,I);var u=new O(new E(2)),ee=l(A.setInt8);u.setInt8(0,2147483648),u.setInt8(1,2147483649),!u.getInt8(0)&&u.getInt8(1)||d(A,{setInt8:function(e,t){ee(this,e,t<<24>>24)},setUint8:function(e,t){ee(this,e,t<<24>>24)}},{unsafe:!0})}else S=(E=function(e){m(this,S);e=y(e);x(this,{bytes:Y($(e),0),byteLength:e}),c||(this.byteLength=e)})[k],A=(O=function(e,t,r){m(this,A),m(e,S);var n=j(e).byteLength,t=U(t);if(t<0||n>24},getUint8:function(e){return s(this,1,e)[0]},getInt16:function(e){e=s(this,2,e,1>16},getUint16:function(e){e=s(this,2,e,1>>0},getFloat32:function(e){return C(s(this,4,e,1]*>)/g,b=/\$([$&'`]|\d{1,2})/g;t.exports=function(o,s,a,u,l,e){var c=a+o.length,f=u.length,t=b;return void 0!==l&&(l=i(l),t=y),h(e,t,function(e,t){var r;switch(d(t,0)){case"$":return"$";case"&":return o;case"`":return m(s,0,a);case"'":return m(s,c);case"<":r=l[m(t,1,-1)];break;default:var n,i=+t;if(0==i)return e;if(f>1,l=23===t?h(2,-24)-h(2,-77):0,c=e<0||0===e&&1/e<0?1:0,f=0;for((e=d(e))!=e||e===1/0?(i=e!=e?1:0,n=r):(n=m(y(e)/b),e*(o=h(2,-n))<1&&(n--,o*=2),2<=(e+=1<=n+u?l/o:l*h(2,1-u))*o&&(n++,o/=2),r<=n+u?(i=0,n=r):1<=n+u?(i=(e*o-1)*h(2,t),n+=u):(i=e*h(2,u-1)*h(2,t),n=0));8<=t;)s[f++]=255&i,i/=256,t-=8;for(n=n<>1,a=i-7,u=n-1,i=e[u--],l=127&i;for(i>>=7;0>=-a,a+=t;0"+e+""},y=function(){try{o=new ActiveXObject("htmlfile")}catch(e){}y="undefined"==typeof document||document.domain&&o?i(o):(e=f("iframe"),t="java"+d+":",e.style.display="none",c.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F);for(var e,t,r=u.length;r--;)delete y[p][u[r]];return y()};l[h]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(n[p]=s(e),r=new n,n[p]=null,r[h]=e):r=y(),void 0===t?r:a.f(r,t)}},{"../internals/an-object":101,"../internals/document-create-element":135,"../internals/enum-bug-keys":148,"../internals/hidden-keys":165,"../internals/html":167,"../internals/object-define-properties":197,"../internals/shared-key":235}],197:[function(e,t,r){var n=e("../internals/descriptors"),i=e("../internals/v8-prototype-define-bug"),a=e("../internals/object-define-property"),u=e("../internals/an-object"),l=e("../internals/to-indexed-object"),c=e("../internals/object-keys");r.f=n&&!i?Object.defineProperties:function(e,t){u(e);for(var r,n=l(t),i=c(t),o=i.length,s=0;si;)!s(n,r=t[i++])||~u(o,r)||c(o,r);return o}},{"../internals/array-includes":110,"../internals/function-uncurry-this":157,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/to-indexed-object":247}],206:[function(e,t,r){var n=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return n(e,i)}},{"../internals/enum-bug-keys":148,"../internals/object-keys-internal":205}],207:[function(e,t,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);r.f=o?function(e){e=i(this,e);return!!e&&e.enumerable}:n},{}],208:[function(e,t,r){var i=e("../internals/function-uncurry-this"),o=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return o(e),s(t),n?r(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":97,"../internals/an-object":101,"../internals/function-uncurry-this":157}],209:[function(e,t,r){function n(a){return function(e){for(var t,r=c(e),n=l(r),i=n.length,o=0,s=[];ob)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})},{"../internals/fails":150,"../internals/global":163}],230:[function(e,t,r){var n=e("../internals/global").TypeError;t.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},{"../internals/global":163}],231:[function(e,t,r){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},{}],232:[function(e,t,r){var n=e("../internals/global"),i=Object.defineProperty;t.exports=function(t,r){try{i(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},{"../internals/global":163}],233:[function(e,t,r){"use strict";var n=e("../internals/get-built-in"),i=e("../internals/object-define-property"),o=e("../internals/well-known-symbol"),s=e("../internals/descriptors"),a=o("species");t.exports=function(e){var e=n(e),t=i.f;s&&e&&!e[a]&&t(e,a,{configurable:!0,get:function(){return this}})}},{"../internals/descriptors":134,"../internals/get-built-in":158,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],234:[function(e,t,r){var n=e("../internals/object-define-property").f,i=e("../internals/has-own-property"),o=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,r){(e=e&&!r?e.prototype:e)&&!i(e,o)&&n(e,o,{configurable:!0,value:t})}},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],235:[function(e,t,r){var n=e("../internals/shared"),i=e("../internals/uid"),o=n("keys");t.exports=function(e){return o[e]||(o[e]=i(e))}},{"../internals/shared":237,"../internals/uid":263}],236:[function(e,t,r){var n=e("../internals/global"),e=e("../internals/set-global"),i="__core-js_shared__",n=n[i]||e(i,{});t.exports=n},{"../internals/global":163,"../internals/set-global":232}],237:[function(e,t,r){var n=e("../internals/is-pure"),i=e("../internals/shared-store");(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.22.1",mode:n?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":181,"../internals/shared-store":236}],238:[function(e,t,r){var n=e("../internals/an-object"),i=e("../internals/a-constructor"),o=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var e=n(e).constructor;return void 0===e||null==(e=n(e)[o])?t:i(e)}},{"../internals/a-constructor":96,"../internals/an-object":101,"../internals/well-known-symbol":268}],239:[function(e,t,r){function n(i){return function(e,t){var r,e=s(a(e)),t=o(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=l(e,t))<55296||56319=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),o.Arguments=o.Array);if(i("keys"),i("values"),i("entries"),!l&&e&&"values"!==s.name)try{a(s,"name",{value:"values"})}catch(e){}},{"../internals/add-to-unscopables":98,"../internals/define-iterator":132,"../internals/descriptors":134,"../internals/internal-state":173,"../internals/is-pure":181,"../internals/iterators":187,"../internals/object-define-property":198,"../internals/to-indexed-object":247}],279:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/function-uncurry-this"),o=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),a=i([].join),i=o!=Object,o=e("join",",");n({target:"Array",proto:!0,forced:i||!o},{join:function(e){return a(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":114,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/to-indexed-object":247}],280:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").map;n({target:"Array",proto:!0,forced:!e("../internals/array-method-has-species-support")("map")},{map:function(e){return i(this,e,1c(t)?1:-1})),r=i.length,s=0;sO;O++)u(v,T=S[O])&&!u(E,T)&&y(E,T,m(v,T));a(i,e,(E.prototype=w).constructor=E)}},{"../internals/descriptors":134,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/is-forced":178,"../internals/is-symbol":183,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/redefine":222,"../internals/string-trim":241,"../internals/this-number-value":244,"../internals/to-primitive":253}],287:[function(e,t,r){var n=e("../internals/export"),e=e("../internals/object-assign");n({target:"Object",stat:!0,forced:Object.assign!==e},{assign:e})},{"../internals/export":149,"../internals/object-assign":195}],288:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/object-to-array").entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},{"../internals/export":149,"../internals/object-to-array":209}],289:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/native-symbol"),o=e("../internals/fails"),s=e("../internals/object-get-own-property-symbols"),a=e("../internals/to-object");n({target:"Object",stat:!0,forced:!i||o(function(){s.f(1)})},{getOwnPropertySymbols:function(e){var t=s.f;return t?t(a(e)):[]}})},{"../internals/export":149,"../internals/fails":150,"../internals/native-symbol":191,"../internals/object-get-own-property-symbols":202,"../internals/to-object":250}],290:[function(e,t,r){var n=e("../internals/export"),i=e("../internals/to-object"),o=e("../internals/object-keys");n({target:"Object",stat:!0,forced:e("../internals/fails")(function(){o(1)})},{keys:function(e){return o(i(e))}})},{"../internals/export":149,"../internals/fails":150,"../internals/object-keys":206,"../internals/to-object":250}],291:[function(e,t,r){var n=e("../internals/to-string-tag-support"),i=e("../internals/redefine"),e=e("../internals/object-to-string");n||i(Object.prototype,"toString",e,{unsafe:!0})},{"../internals/object-to-string":210,"../internals/redefine":222,"../internals/to-string-tag-support":255}],292:[function(e,t,r){"use strict";var n=e("../internals/export"),c=e("../internals/function-call"),f=e("../internals/a-callable"),i=e("../internals/new-promise-capability"),o=e("../internals/perform"),p=e("../internals/iterate");n({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{all:function(e){var a=this,t=i.f(a),u=t.resolve,l=t.reject,r=o(function(){var n=f(a.resolve),i=[],o=0,s=1;p(e,function(e){var t=o++,r=!1;s++,c(n,a,e).then(function(e){r||(r=!0,i[t]=e,--s||u(i))},l)}),--s||u(i)});return r.error&&l(r.value),t.promise}})},{"../internals/a-callable":95,"../internals/export":149,"../internals/function-call":155,"../internals/iterate":184,"../internals/new-promise-capability":193,"../internals/perform":214,"../internals/promise-statics-incorrect-iteration":218}],293:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/is-pure"),o=e("../internals/promise-constructor-detection").CONSTRUCTOR,s=e("../internals/promise-native-constructor"),a=e("../internals/get-built-in"),u=e("../internals/is-callable"),e=e("../internals/redefine"),l=s&&s.prototype;n({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(s)&&(n=a("Promise").prototype.catch,l.catch!==n&&e(l,"catch",n,{unsafe:!0}))},{"../internals/export":149,"../internals/get-built-in":158,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/redefine":222}],294:[function(e,N,L){"use strict";function o(e,t){var r,n,i,o,s=t.value,a=t.state==E,u=a?e.ok:e.fail,l=e.resolve,c=e.reject,f=e.domain;try{u?(a||(t.rejection===O&&(o=t,h(m,d,function(){var e=o.facade;p?k.emit("rejectionHandled",e):D(ee,e,o.value)})),t.rejection=S),!0===u?r=s:(f&&f.enter(),r=u(s),f&&(f.exit(),i=!0)),r===e.promise?c(j("Promise-chain cycle")):(n=A(r))?h(n,r,l,c):l(r)):c(s)}catch(e){f&&!i&&f.exit(),c(e)}}var r,t,n,i=e("../internals/export"),B=e("../internals/is-pure"),p=e("../internals/engine-is-node"),d=e("../internals/global"),h=e("../internals/function-call"),F=e("../internals/redefine"),q=e("../internals/redefine-all"),s=e("../internals/object-set-prototype-of"),U=e("../internals/set-to-string-tag"),G=e("../internals/set-species"),W=e("../internals/a-callable"),a=e("../internals/is-callable"),X=e("../internals/is-object"),V=e("../internals/an-instance"),z=e("../internals/species-constructor"),m=e("../internals/task").set,u=e("../internals/microtask"),H=e("../internals/host-report-errors"),K=e("../internals/perform"),$=e("../internals/queue"),l=e("../internals/internal-state"),c=e("../internals/promise-native-constructor"),f=e("../internals/promise-constructor-detection"),e=e("../internals/new-promise-capability"),y="Promise",b=f.CONSTRUCTOR,Y=f.REJECTION_EVENT,f=f.SUBCLASSING,g=l.getterFor(y),J=l.set,l=c&&c.prototype,v=c,w=l,j=d.TypeError,x=d.document,k=d.process,_=e.f,Z=_,Q=!!(x&&x.createEvent&&d.dispatchEvent),T="unhandledrejection",ee="rejectionhandled",E=1,te=2,S=1,O=2,A=function(e){var t;return!(!X(e)||!a(t=e.then))&&t},I=function(r,i){r.notified||(r.notified=!0,u(function(){for(var e,n,t=r.reactions;e=t.get();)o(e,r);r.notified=!1,i&&!r.rejection&&(n=r,h(m,d,function(){var e=n.facade,t=n.value,r=R(n);if(r&&(r=K(function(){p?k.emit("unhandledRejection",t,e):D(T,e,t)}),n.rejection=p||R(n)?O:S,r.error))throw r.value}))}))},D=function(e,t,r){var n;Q?((n=x.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),d.dispatchEvent(n)):n={promise:t,reason:r},!Y&&(t=d["on"+e])?t(n):e===T&&H("Unhandled promise rejection",r)},R=function(e){return e.rejection!==S&&!e.parent},C=function(t,r,n){return function(e){t(r,e,n)}},M=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=te,I(e,!0))},P=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw j("Promise can't be resolved itself");var n=A(e);n?u(function(){var t={done:!1};try{h(n,e,C(P,t,r),C(M,t,r))}catch(e){M(t,e,r)}}):(r.value=e,r.state=E,I(r,!1))}catch(e){M({done:!1},e,r)}}};if(b&&(w=(v=function(e){V(this,w),W(e),h(r,this);var t=g(this);try{e(C(P,t),C(M,t))}catch(e){M(t,e)}}).prototype,(r=function(e){J(this,{type:y,done:!1,notified:!1,parent:!1,reactions:new $,rejection:!1,state:0,value:void 0})}).prototype=q(w,{then:function(e,t){var r=g(this),n=_(z(this,v));return r.parent=!0,n.ok=!a(e)||e,n.fail=a(t)&&t,n.domain=p?k.domain:void 0,0==r.state?r.reactions.add(n):u(function(){o(n,r)}),n.promise}}),t=function(){var e=new r,t=g(e);this.promise=e,this.resolve=C(P,t),this.reject=C(M,t)},e.f=_=function(e){return e===v||void 0===e?new t:Z(e)},!B&&a(c)&&l!==Object.prototype)){n=l.then,f||F(l,"then",function(e,t){var r=this;return new v(function(e,t){h(n,r,e,t)}).then(e,t)},{unsafe:!0});try{delete l.constructor}catch(e){}s&&s(l,w)}i({global:!0,wrap:!0,forced:b},{Promise:v}),U(v,y,!1,!0),G(y)},{"../internals/a-callable":95,"../internals/an-instance":100,"../internals/engine-is-node":143,"../internals/export":149,"../internals/function-call":155,"../internals/global":163,"../internals/host-report-errors":166,"../internals/internal-state":173,"../internals/is-callable":176,"../internals/is-object":180,"../internals/is-pure":181,"../internals/microtask":189,"../internals/new-promise-capability":193,"../internals/object-set-prototype-of":208,"../internals/perform":214,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/queue":220,"../internals/redefine":222,"../internals/redefine-all":221,"../internals/set-species":233,"../internals/set-to-string-tag":234,"../internals/species-constructor":238,"../internals/task":243}],295:[function(e,t,r){e("../modules/es.promise.constructor"),e("../modules/es.promise.all"),e("../modules/es.promise.catch"),e("../modules/es.promise.race"),e("../modules/es.promise.reject"),e("../modules/es.promise.resolve")},{"../modules/es.promise.all":292,"../modules/es.promise.catch":293,"../modules/es.promise.constructor":294,"../modules/es.promise.race":296,"../modules/es.promise.reject":297,"../modules/es.promise.resolve":298}],296:[function(e,t,r){"use strict";var n=e("../internals/export"),o=e("../internals/function-call"),s=e("../internals/a-callable"),a=e("../internals/new-promise-capability"),u=e("../internals/perform"),l=e("../internals/iterate");n({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{race:function(e){var r=this,n=a.f(r),i=n.reject,t=u(function(){var t=s(r.resolve);l(e,function(e){o(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}})},{"../internals/a-callable":95,"../internals/export":149,"../internals/function-call":155,"../internals/iterate":184,"../internals/new-promise-capability":193,"../internals/perform":214,"../internals/promise-statics-incorrect-iteration":218}],297:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/function-call"),o=e("../internals/new-promise-capability");n({target:"Promise",stat:!0,forced:e("../internals/promise-constructor-detection").CONSTRUCTOR},{reject:function(e){var t=o.f(this);return i(t.reject,void 0,e),t.promise}})},{"../internals/export":149,"../internals/function-call":155,"../internals/new-promise-capability":193,"../internals/promise-constructor-detection":215}],298:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/get-built-in"),o=e("../internals/is-pure"),s=e("../internals/promise-native-constructor"),a=e("../internals/promise-constructor-detection").CONSTRUCTOR,u=e("../internals/promise-resolve"),l=i("Promise"),c=o&&!a;n({target:"Promise",stat:!0,forced:o||a},{resolve:function(e){return u(c&&this===l?s:this,e)}})},{"../internals/export":149,"../internals/get-built-in":158,"../internals/is-pure":181,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/promise-resolve":217}],299:[function(e,N,L){var t=e("../internals/descriptors"),r=e("../internals/global"),n=e("../internals/function-uncurry-this"),i=e("../internals/is-forced"),l=e("../internals/inherit-if-required"),c=e("../internals/create-non-enumerable-property"),o=e("../internals/object-get-own-property-names").f,f=e("../internals/object-is-prototype-of"),p=e("../internals/is-regexp"),d=e("../internals/to-string"),h=e("../internals/regexp-get-flags"),s=e("../internals/regexp-sticky-helpers"),a=e("../internals/proxy-accessor"),u=e("../internals/redefine"),m=e("../internals/fails"),y=e("../internals/has-own-property"),b=e("../internals/internal-state").enforce,g=e("../internals/set-species"),v=e("../internals/well-known-symbol"),w=e("../internals/regexp-unsupported-dot-all"),j=e("../internals/regexp-unsupported-ncg"),x=v("match"),k=r.RegExp,_=k.prototype,T=r.SyntaxError,E=n(_.exec),S=n("".charAt),O=n("".replace),A=n("".indexOf),B=n("".slice),F=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,D=/a/g,e=new k(I)!==I,R=s.MISSED_STICKY,q=s.UNSUPPORTED_Y,v=t&&(!e||R||w||j||m(function(){return D[x]=!1,k(I)!=I||k(D)==D||"/a/i"!=k(I,"i")}));if(i("RegExp",v)){function C(e,t){var r,n,i=f(_,this),o=p(e),s=void 0===t,a=[],u=e;if(!i&&o&&s&&e.constructor===C)return e;if((o||f(_,e))&&(e=e.source,s&&(t=h(u))),e=void 0===e?"":d(e),t=void 0===t?"":d(t),u=e,o=t=w&&"dotAll"in I&&(r=!!t&&-1"===t&&u:if(""===c||y(s,c))throw new T("Invalid capture group name");s[c]=!0,u=!(o[o.length]=[c,l]),c="";continue}u?c+=t:i+=t}return[i,o]}(e))[0],a=s[1]),s=l(k(e,t),i?this:_,C),(r||n||a.length)&&(t=b(s),r&&(t.dotAll=!0,t.raw=C(function(e){for(var t,r=e.length,n=0,i="",o=!1;n<=r;n++)"\\"===(t=S(e,n))?i+=t+S(e,++n):o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]";return i}(e),o)),n&&(t.sticky=!0),a.length&&(t.groups=a)),e!==u)try{c(s,"source",""===u?"(?:)":u)}catch(e){}return s}for(var M=o(k),P=0;M.length>P;)a(C,k,M[P++]);(_.constructor=C).prototype=_,u(r,"RegExp",C)}g("RegExp")},{"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/internal-state":173,"../internals/is-forced":178,"../internals/is-regexp":182,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/proxy-accessor":219,"../internals/redefine":222,"../internals/regexp-get-flags":226,"../internals/regexp-sticky-helpers":227,"../internals/regexp-unsupported-dot-all":228,"../internals/regexp-unsupported-ncg":229,"../internals/set-species":233,"../internals/to-string":256,"../internals/well-known-symbol":268}],300:[function(e,t,r){"use strict";var n=e("../internals/export"),e=e("../internals/regexp-exec");n({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":149,"../internals/regexp-exec":224}],301:[function(e,t,r){"use strict";var n=e("../internals/function-name").PROPER,i=e("../internals/redefine"),o=e("../internals/an-object"),s=e("../internals/to-string"),a=e("../internals/fails"),u=e("../internals/regexp-get-flags"),e="toString",l=RegExp.prototype[e],a=a(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),n=n&&l.name!=e;(a||n)&&i(RegExp.prototype,e,function(){var e=o(this);return"/"+s(e.source)+"/"+s(u(e))},{unsafe:!0})},{"../internals/an-object":101,"../internals/fails":150,"../internals/function-name":156,"../internals/redefine":222,"../internals/regexp-get-flags":226,"../internals/to-string":256}],302:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/function-uncurry-this"),o=e("../internals/not-a-regexp"),s=e("../internals/require-object-coercible"),a=e("../internals/to-string"),e=e("../internals/correct-is-regexp-logic"),u=i("".indexOf);n({target:"String",proto:!0,forced:!e("includes")},{includes:function(e){return!!~u(a(s(this)),a(o(e)),1=t.length?{value:void 0,done:!0}:(t=n(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":132,"../internals/internal-state":173,"../internals/string-multibyte":239,"../internals/to-string":256}],304:[function(e,t,r){"use strict";var i=e("../internals/function-call"),n=e("../internals/fix-regexp-well-known-symbol-logic"),l=e("../internals/an-object"),c=e("../internals/to-length"),f=e("../internals/to-string"),o=e("../internals/require-object-coercible"),s=e("../internals/get-method"),p=e("../internals/advance-string-index"),d=e("../internals/regexp-exec-abstract");n("match",function(n,a,u){return[function(e){var t=o(this),r=null==e?void 0:s(e,n);return r?i(r,e,t):new RegExp(e)[n](f(t))},function(e){var t=l(this),r=f(e),e=u(a,t,r);if(e.done)return e.value;if(!t.global)return d(t,r);for(var n=t.unicode,i=[],o=t.lastIndex=0;null!==(s=d(t,r));){var s=f(s[0]);""===(i[o]=s)&&(t.lastIndex=p(r,c(t.lastIndex),n)),o++}return 0===o?null:i}]})},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-call":155,"../internals/get-method":161,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/to-length":249,"../internals/to-string":256}],305:[function(e,t,r){"use strict";var x=e("../internals/function-apply"),i=e("../internals/function-call"),n=e("../internals/function-uncurry-this"),o=e("../internals/fix-regexp-well-known-symbol-logic"),s=e("../internals/fails"),k=e("../internals/an-object"),_=e("../internals/is-callable"),T=e("../internals/to-integer-or-infinity"),E=e("../internals/to-length"),S=e("../internals/to-string"),a=e("../internals/require-object-coercible"),O=e("../internals/advance-string-index"),u=e("../internals/get-method"),A=e("../internals/get-substitution"),I=e("../internals/regexp-exec-abstract"),l=e("../internals/well-known-symbol")("replace"),D=Math.max,R=Math.min,C=n([].concat),M=n([].push),P=n("".indexOf),N=n("".slice),e="$0"==="a".replace(/./,"$0"),c=!!/./[l]&&""===/./[l]("a","$0");o("replace",function(e,v,w){var j=c?"$":"$0";return[function(e,t){var r=a(this),n=null==e?void 0:u(e,l);return n?i(n,e,r,t):i(v,S(r),e,t)},function(e,t){var r=k(this),n=S(e);if("string"==typeof t&&-1===P(t,j)&&-1===P(t,"$<")){e=w(v,r,n,t);if(e.done)return e.value}for(var i,o=_(t),s=(o||(t=S(t)),r.global),a=(s&&(i=r.unicode,r.lastIndex=0),[]);null!==(p=I(r,n))&&(M(a,p),s);)""===S(p[0])&&(r.lastIndex=O(n,E(r.lastIndex),i));for(var u,l="",c=0,f=0;f")})||!e||c)},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/fails":150,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-method":161,"../internals/get-substitution":162,"../internals/is-callable":176,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/to-integer-or-infinity":248,"../internals/to-length":249,"../internals/to-string":256,"../internals/well-known-symbol":268}],306:[function(e,t,r){"use strict";var s=e("../internals/function-call"),n=e("../internals/fix-regexp-well-known-symbol-logic"),a=e("../internals/an-object"),u=e("../internals/require-object-coercible"),l=e("../internals/same-value"),c=e("../internals/to-string"),f=e("../internals/get-method"),p=e("../internals/regexp-exec-abstract");n("search",function(n,i,o){return[function(e){var t=u(this),r=null==e?void 0:f(e,n);return r?s(r,e,t):new RegExp(e)[n](c(t))},function(e){var t=a(this),e=c(e),r=o(i,t,e);if(r.done)return r.value;r=t.lastIndex,l(r,0)||(t.lastIndex=0),e=p(t,e);return l(t.lastIndex,r)||(t.lastIndex=r),null===e?-1:e.index}]})},{"../internals/an-object":101,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-call":155,"../internals/get-method":161,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/same-value":231,"../internals/to-string":256}],307:[function(e,t,r){"use strict";var c=e("../internals/function-apply"),f=e("../internals/function-call"),n=e("../internals/function-uncurry-this"),i=e("../internals/fix-regexp-well-known-symbol-logic"),p=e("../internals/is-regexp"),b=e("../internals/an-object"),d=e("../internals/require-object-coercible"),g=e("../internals/species-constructor"),v=e("../internals/advance-string-index"),w=e("../internals/to-length"),j=e("../internals/to-string"),o=e("../internals/get-method"),x=e("../internals/array-slice-simple"),k=e("../internals/regexp-exec-abstract"),_=e("../internals/regexp-exec"),s=e("../internals/regexp-sticky-helpers"),e=e("../internals/fails"),T=s.UNSUPPORTED_Y,E=Math.min,S=[].push,O=n(/./.exec),A=n(S),I=n("".slice);i("split",function(i,h,m){var y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,t){var r=j(d(this)),n=void 0===t?4294967295:t>>>0;if(0==n)return[];if(void 0===e)return[r];if(!p(e))return f(h,r,e,n);for(var i,o,s,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,t+"g");(i=f(_,l,r))&&!(u<(o=l.lastIndex)&&(A(a,I(r,u,i.index)),1>>0;if(0==a)return[];if(0===n.length)return null===k(s,n)?[n]:[];for(var u=0,l=0,c=[];l]/;t.exports=function(e){var t,r=""+e,e=s.exec(r);if(!e)return r;var n="",i=0,o=0;for(i=e.index;ii&&!o.warned&&(o.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=o.length,r=n,console&&console.warn&&console.warn(r))),e}function p(e,t,r){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e);return t.listener=r,e.wrapFn=t}function d(e,t,r){e=e._events;if(void 0===e)return[];e=e[t];{if(void 0===e)return[];if("function"==typeof e)return r?[e.listener||e]:[e];if(r){for(var n=e,i=new Array(n.length),o=0;o=r.length?(u=!!(f=h(o,l)))&&"get"in f&&!("originalValue"in f.get)?f.get:o[l]:(u=v(o,l),o[l]),u&&!s&&(y[c]=o)}}return o}},{"function-bind":347,has:354,"has-proto":350,"has-symbols":351}],349:[function(t,e,r){"use strict";t=t("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch(e){t=null}e.exports=t},{"get-intrinsic":348}],350:[function(e,t,r){"use strict";var n={foo:{}},i=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof i)}},{}],351:[function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=e("./shams");t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},{"./shams":352}],352:[function(e,t,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){r=Object.getOwnPropertyDescriptor(e,t);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],353:[function(e,t,r){"use strict";var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":352}],354:[function(e,t,r){"use strict";e=e("function-bind");t.exports=e.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":347}],355:[function(e,t,r){var n,i=e("http"),o=e("url"),s=t.exports;for(n in i)i.hasOwnProperty(n)&&(s[n]=i[n]);function a(e){if((e="string"==typeof e?o.parse(e):e).protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}s.request=function(e,t){return e=a(e),i.request.call(this,e,t)},s.get=function(e,t){return e=a(e),i.get.call(this,e,t)}},{http:468,url:472}],356:[function(e,t,r){"use strict";var n=e("util"),i=e("ms");t.exports=function(e){if("number"==typeof e)return e;var t=i(e);return void 0===t&&(e=new Error(n.format("humanize-ms(%j) result undefined",e)),console.warn(e.stack)),t}},{ms:376,util:419}],357:[function(e,t,r){r.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,p=r?-1:1,i=e[t+f];for(f+=p,o=i&(1<<-c)-1,i>>=-c,c+=a;0>=-c,c+=n;0>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(t+=1<=s+c?f/n:f*Math.pow(2,1-c))*n&&(s++,n/=2),l<=s+c?(a=0,s=l):1<=s+c?(a=(t*n-1)*Math.pow(2,i),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,i),s=0));8<=i;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<>>6)+b(128|63&t):b(224|t>>>12&15)+b(128|t>>>6&63)+b(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),b(240|t>>>18&7)+b(128|t>>>12&63)+b(128|t>>>6&63)+b(128|63&t))}function n(e){var t=[0,2,1][e.length%3],e=e.charCodeAt(0)<<16|(1>>18),m.charAt(e>>>12&63),2<=t?"=":m.charAt(e>>>6&63),1<=t?"=":m.charAt(63&e)].join("")}function i(e){return w(v(String(e)))}function u(e){return e.replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,"")}function o(e,t){return t?u(i(e)):i(e)}function s(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return b(55296+(t>>>10))+b(56320+(1023&t));case 3:return b((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return b((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}}function a(e){var t=(r=e.length)%4,r=(0>>16),b(r>>>8&255),b(255&r)]).length-=[0,0,2,1][t],e.join("")}function l(e){return k(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))}function c(e){return String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")}function e(e){return e=c(e),x(k(e))}var f,p,d,h=(t=t||{}).Base64,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=function(e){for(var t={},r=0,n=e.length;r>>18)+m.charAt(o>>>12&63)+(void 0!==s?m.charAt(o>>>6&63):"=")+(void 0!==a?m.charAt(63&o):"=")}return t?u(r):r}),/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g),x=function(e){return e.replace(j,s)},k=t.atob&&"function"==typeof t.atob?function(e){return t.atob(e)}:function(e){return e.replace(/\S{1,4}/g,a)};t.Uint8Array&&(p=function(e){return Uint8Array.from(l(c(e)),function(e){return e.charCodeAt(0)})});return t.Base64={VERSION:"2.6.4",atob:l,btoa:w,fromBase64:e,toBase64:o,utob:v,encode:o,encodeURI:function(e){return o(e,!0)},btou:x,decode:e,noConflict:function(){var e=t.Base64;return t.Base64=h,e},fromUint8Array:f,toUint8Array:p},"function"==typeof Object.defineProperty&&(d=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},t.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",d(function(){return e(this)})),Object.defineProperty(String.prototype,"toBase64",d(function(e){return o(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",d(function(){return o(this,!0)}))}),t.Meteor&&(Base64=t.Base64),void 0!==_&&_.exports&&(_.exports.Base64=t.Base64),{Base64:t.Base64}},"object"==typeof n&&void 0!==_?_.exports=t(e):t(e)}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],372:[function(e,t,r){"use strict";t.exports=function(r,n,i){if(!r)throw new TypeError("argument dest is required");if(!n)throw new TypeError("argument src is required");void 0===i&&(i=!0);return Object.getOwnPropertyNames(n).forEach(function(e){var t;!i&&o.call(r,e)||(t=Object.getOwnPropertyDescriptor(n,e),Object.defineProperty(r,e,t))}),r};var o=Object.prototype.hasOwnProperty},{}],373:[function(e,t,r){"use strict";function n(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;e= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=b-1,v=Math.floor,w=String.fromCharCode;function j(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function h(e,t){var r=e.split("@"),n="",r=(1>>10&1023|55296),e=56320|1023&e),t+=w(e)}).join("")}function k(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,r){var n=0;for(e=r?v(e/a):e>>1,e+=v(e/t);p*g>>1v((y-c)/o))&&j("overflow"),c+=a*o,!(a<(a=s<=p?1:p+g<=s?g:s-p));s+=b)o>v(y/(a=b-a))&&j("overflow"),o*=a;p=_(c-i,t=u.length+1,0==i),v(c/t)>y-f&&j("overflow"),f+=v(c/t),c%=t,u.splice(c++,0,f)}return m(u)}function E(e){for(var t,r,n,i,o,s,a,u,l,c,f=[],p=(e=x(e)).length,d=128,h=72,m=t=0;mv((y-t)/(u=r+1))&&j("overflow"),t+=(i-d)*u,d=i,m=0;my&&j("overflow"),a==d){for(o=t,s=b;!(o<(l=s<=h?1:h+g<=s?g:s-h));s+=b)f.push(w(k(l+(c=o-l)%(l=b-l),0))),o=v(c/l);f.push(w(k(o,0))),h=_(t,u,r==n),t=0,++r}++t,++d}return f.join("")}if(i={version:"1.4.1",ucs2:{decode:x,encode:m},decode:T,encode:E,toASCII:function(e){return h(e,function(e){return l.test(e)?"xn--"+E(e):e})},toUnicode:function(e){return h(e,function(e){return u.test(e)?T(e.slice(4).toLowerCase()):e})}},t&&r)if(O.exports==t)r.exports=i;else for(o in i)i.hasOwnProperty(o)&&(t[o]=i[o]);else e.punycode=i}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],383:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g,t=(e=e.split(t=t||"&"),1e3),s=(n&&"number"==typeof n.maxKeys&&(t=n.maxKeys),e.length);0t.highWaterMark&&(t.highWaterMark=(d<=(r=e)?r=d:(r--,r=(r=(r=(r=(r|=r>>>1)|r>>>2)|r>>>4)|r>>>8)|r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?y.nextTick(w,e):w(e))}function w(e){g("emit readable"),e.emit("readable"),T(e)}function j(e,t){t.readingMore||(t.readingMore=!0,y.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(s);break}++n}return t.length-=n,i}:function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(s);break}++i}return t.length-=i,r})(e,t);return n}(e,t.buffer,t.decoder),r);var r}function S(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?S:v)(this),null;if(0===(e=h(e,t))&&t.ended)return 0===t.length&&S(this),null;var n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e>>0),i=this.head,o=0;i;)t=i.data,r=o,t.copy(n,r),o+=i.data.length,i=i.next;return n},i),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":396,util:89}],392:[function(e,t,r){"use strict";var o=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||o.nextTick(s,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(o.nextTick(s,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){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.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":380}],393:[function(e,t,r){t.exports=e("events").EventEmitter},{events:344}],394:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=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")},{"./lib/_stream_duplex.js":386,"./lib/_stream_passthrough.js":387,"./lib/_stream_readable.js":388,"./lib/_stream_transform.js":389,"./lib/_stream_writable.js":390}],395:[function(e,t,r){t=function(s){"use strict";var u,e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function a(e,t,r,n){var i,o,s,a,t=t&&t.prototype instanceof y?t:y,t=Object.create(t.prototype),n=new T(n||[]);return t._invoke=(i=e,o=r,s=n,a=f,function(e,t){if(a===d)throw new Error("Generator is already running");if(a===h){if("throw"===e)throw t;return S()}for(s.method=e,s.arg=t;;){var r=s.delegate;if(r){r=function e(t,r){var n=t.iterator[r.method];if(n===u){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=u,e(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}n=c(n,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,m;n=n.arg;if(!n)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m;{if(!n.done)return n;r[t.resultName]=n.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u)}r.delegate=null;return m}(r,s);if(r){if(r===m)continue;return r}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(a===f)throw a=h,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a=d;r=c(i,o,s);if("normal"===r.type){if(a=s.done?h:p,r.arg!==m)return{value:r.arg,done:s.done}}else"throw"===r.type&&(a=h,s.method="throw",s.arg=r.arg)}}),t}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}s.wrap=a;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",m={};function y(){}function b(){}function g(){}var t={},v=(o(t,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(E([]))),w=(v&&v!==e&&l.call(v,n)&&(t=v),g.prototype=y.prototype=Object.create(t));function j(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function x(s,a){var t;this._invoke=function(r,n){function e(){return new a(function(e,t){!function t(e,r,n,i){var o,e=c(s[e],s,r);if("throw"!==e.type)return(r=(o=e.arg).value)&&"object"==typeof r&&l.call(r,"__await")?a.resolve(r.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):a.resolve(r).then(function(e){o.value=e,n(o)},function(e){return t("throw",e,n,i)});i(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function E(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r"===o?(T(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=k.TEXT):(v(o)&&(t.state=k.SGML_DECL_QUOTED),t.sgmlDecl+=o);continue;case k.SGML_DECL_QUOTED:o===t.q&&(t.state=k.SGML_DECL,t.q=""),t.sgmlDecl+=o;continue;case k.DOCTYPE:">"===o?(t.state=k.TEXT,T(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=o,"["===o?t.state=k.DOCTYPE_DTD:v(o)&&(t.state=k.DOCTYPE_QUOTED,t.q=o));continue;case k.DOCTYPE_QUOTED:t.doctype+=o,o===t.q&&(t.q="",t.state=k.DOCTYPE);continue;case k.DOCTYPE_DTD:t.doctype+=o,"]"===o?t.state=k.DOCTYPE:v(o)&&(t.state=k.DOCTYPE_DTD_QUOTED,t.q=o);continue;case k.DOCTYPE_DTD_QUOTED:t.doctype+=o,o===t.q&&(t.state=k.DOCTYPE_DTD,t.q="");continue;case k.COMMENT:"-"===o?t.state=k.COMMENT_ENDING:t.comment+=o;continue;case k.COMMENT_ENDING:"-"===o?(t.state=k.COMMENT_ENDED,t.comment=S(t.opt,t.comment),t.comment&&T(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+o,t.state=k.COMMENT);continue;case k.COMMENT_ENDED:">"!==o?(I(t,"Malformed comment"),t.comment+="--"+o,t.state=k.COMMENT):t.state=k.TEXT;continue;case k.CDATA:"]"===o?t.state=k.CDATA_ENDING:t.cdata+=o;continue;case k.CDATA_ENDING:"]"===o?t.state=k.CDATA_ENDING_2:(t.cdata+="]"+o,t.state=k.CDATA);continue;case k.CDATA_ENDING_2:">"===o?(t.cdata&&T(t,"oncdata",t.cdata),T(t,"onclosecdata"),t.cdata="",t.state=k.TEXT):"]"===o?t.cdata+="]":(t.cdata+="]]"+o,t.state=k.CDATA);continue;case k.PROC_INST:"?"===o?t.state=k.PROC_INST_ENDING:g(o)?t.state=k.PROC_INST_BODY:t.procInstName+=o;continue;case k.PROC_INST_BODY:if(!t.procInstBody&&g(o))continue;"?"===o?t.state=k.PROC_INST_ENDING:t.procInstBody+=o;continue;case k.PROC_INST_ENDING:">"===o?(T(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=k.TEXT):(t.procInstBody+="?"+o,t.state=k.PROC_INST_BODY);continue;case k.OPEN_TAG:w(m,o)?t.tagName+=o:(function(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns);e.attribList.length=0,T(e,"onopentagstart",r)}(t),">"===o?C(t):"/"===o?t.state=k.OPEN_TAG_SLASH:(g(o)||I(t,"Invalid character in tag name"),t.state=k.ATTRIB));continue;case k.OPEN_TAG_SLASH:">"===o?(C(t,!0),M(t)):(I(t,"Forward-slash in opening tag not followed by >"),t.state=k.ATTRIB);continue;case k.ATTRIB:if(g(o))continue;">"===o?C(t):"/"===o?t.state=k.OPEN_TAG_SLASH:w(h,o)?(t.attribName=o,t.attribValue="",t.state=k.ATTRIB_NAME):I(t,"Invalid attribute name");continue;case k.ATTRIB_NAME:"="===o?t.state=k.ATTRIB_VALUE:">"===o?(I(t,"Attribute without value"),t.attribValue=t.attribName,R(t),C(t)):g(o)?t.state=k.ATTRIB_NAME_SAW_WHITE:w(m,o)?t.attribName+=o:I(t,"Invalid attribute name");continue;case k.ATTRIB_NAME_SAW_WHITE:if("="===o)t.state=k.ATTRIB_VALUE;else{if(g(o))continue;I(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",T(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===o?C(t):w(h,o)?(t.attribName=o,t.state=k.ATTRIB_NAME):(I(t,"Invalid attribute name"),t.state=k.ATTRIB)}continue;case k.ATTRIB_VALUE:if(g(o))continue;v(o)?(t.q=o,t.state=k.ATTRIB_VALUE_QUOTED):(I(t,"Unquoted attribute value"),t.state=k.ATTRIB_VALUE_UNQUOTED,t.attribValue=o);continue;case k.ATTRIB_VALUE_QUOTED:if(o!==t.q){"&"===o?t.state=k.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=o;continue}R(t),t.q="",t.state=k.ATTRIB_VALUE_CLOSED;continue;case k.ATTRIB_VALUE_CLOSED:g(o)?t.state=k.ATTRIB:">"===o?C(t):"/"===o?t.state=k.OPEN_TAG_SLASH:w(h,o)?(I(t,"No whitespace between attributes"),t.attribName=o,t.attribValue="",t.state=k.ATTRIB_NAME):I(t,"Invalid attribute name");continue;case k.ATTRIB_VALUE_UNQUOTED:if(!function(e){return">"===e||g(e)}(o)){"&"===o?t.state=k.ATTRIB_VALUE_ENTITY_U:t.attribValue+=o;continue}R(t),">"===o?C(t):t.state=k.ATTRIB;continue;case k.CLOSE_TAG:if(t.tagName)">"===o?M(t):w(m,o)?t.tagName+=o:t.script?(t.script+=""===o?M(t):I(t,"Invalid characters in closing tag");continue;case k.TEXT_ENTITY:case k.ATTRIB_VALUE_ENTITY_Q:case k.ATTRIB_VALUE_ENTITY_U:switch(t.state){case k.TEXT_ENTITY:r=k.TEXT,n="textNode";break;case k.ATTRIB_VALUE_ENTITY_Q:r=k.ATTRIB_VALUE_QUOTED,n="attribValue";break;case k.ATTRIB_VALUE_ENTITY_U:r=k.ATTRIB_VALUE_UNQUOTED,n="attribValue"}";"===o?(t[n]+=function(e){var t,r=e.entity,n=r.toLowerCase(),i="";if(e.ENTITIES[r])return e.ENTITIES[r];if(e.ENTITIES[n])return e.ENTITIES[n];"#"===(r=n).charAt(0)&&(i="x"===r.charAt(1)?(r=r.slice(2),(t=parseInt(r,16)).toString(16)):(r=r.slice(1),(t=parseInt(r,10)).toString(10)));if(r=r.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==r)return I(e,"Invalid character entity"),"&"+e.entity+";";return String.fromCodePoint(t)}(t),t.entity="",t.state=r):w(t.entity.length?b:y,o)?t.entity+=o:(I(t,"Invalid character in entity name"),t[n]+="&"+t.entity+o,t.entity="",t.state=r);continue;default:throw new Error(t,"Unknown state: "+t.state)}}t.position>=t.bufferCheckPosition&&!function(e){for(var t=Math.max(a.MAX_BUFFER_LENGTH,10),r=0,n=0,i=u.length;n",lt:"<",quot:'"',apos:"'"},a.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(a.ENTITIES).forEach(function(e){var t=a.ENTITIES[e],t="number"==typeof t?String.fromCharCode(t):t;a.ENTITIES[e]=t}),a.STATE)a.STATE[a.STATE[e]]=e;function _(e,t,r){e[t]&&e[t](r)}function T(e,t,r){e.textNode&&E(e),_(e,t,r)}function E(e){e.textNode=S(e.opt,e.textNode),e.textNode&&_(e,"ontext",e.textNode),e.textNode=""}function S(e,t){return e.trim&&(t=t.trim()),t=e.normalize?t.replace(/\s+/g," "):t}function O(e,t){return E(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,_(e,"onerror",t),e}function A(e){return e.sawRoot&&!e.closedRoot&&I(e,"Unclosed root tag"),e.state!==k.BEGIN&&e.state!==k.BEGIN_WHITESPACE&&e.state!==k.TEXT&&O(e,"Unexpected end"),E(e),e.c="",e.closed=!0,_(e,"onend"),s.call(e,e.strict,e.opt),e}function I(e,t){if("object"!=typeof e||!(e instanceof s))throw new Error("bad call to strictFail");e.strict&&O(e,t)}function D(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],r=r[1];return t&&"xmlns"===e&&(n="xmlns",r=""),{prefix:n,local:r}}function R(e){var t,r,n;e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName)||(e.opt.xmlns?(r=(t=D(e.attribName,!0)).prefix,t=t.local,"xmlns"===r&&("xml"===t&&e.attribValue!==f?I(e,"xml: prefix must be bound to "+f+"\nActual: "+e.attribValue):"xmlns"===t&&e.attribValue!==p?I(e,"xmlns: prefix must be bound to "+p+"\nActual: "+e.attribValue):(r=e.tag,n=e.tags[e.tags.length-1]||e,r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[t]=e.attribValue)),e.attribList.push([e.attribName,e.attribValue])):(e.tag.attributes[e.attribName]=e.attribValue,T(e,"onattribute",{name:e.attribName,value:e.attribValue}))),e.attribName=e.attribValue=""}function C(t,e){if(t.opt.xmlns){var r=t.tag,n=D(t.tagName),n=(r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(I(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),r.uri=n.prefix),t.tags[t.tags.length-1]||t);r.ns&&n.ns!==r.ns&&Object.keys(r.ns).forEach(function(e){T(t,"onopennamespace",{prefix:e,uri:r.ns[e]})});for(var i=0,o=t.attribList.length;i",r.tagName="",void(r.state=k.SCRIPT);T(r,"onscript",r.script),r.script=""}for(var e=r.tags.length,t=r.tagName,n=t=r.strict?t:t[r.looseCase]();e--&&r.tags[e].name!==n;)I(r,"Unexpected close tag");if(e<0)return I(r,"Unmatched closing tag: "+r.tagName),r.textNode+="",void(r.state=k.TEXT);r.tagName=t;for(var i=r.tags.length;i-- >e;){var o,s=r.tag=r.tags.pop(),a=(r.tagName=r.tag.name,T(r,"onclosetag",r.tagName),{});for(o in s.ns)a[o]=s.ns[o];var u=r.tags[r.tags.length-1]||r;r.opt.xmlns&&s.ns!==u.ns&&Object.keys(s.ns).forEach(function(e){var t=s.ns[e];T(r,"onclosenamespace",{prefix:e,uri:t})})}0===e&&(r.closedRoot=!0),r.tagName=r.attribValue=r.attribName="",r.attribList.length=0,r.state=k.TEXT}function P(e,t){"<"===t?(e.state=k.OPEN_WAKA,e.startTagPosition=e.position):g(t)||(I(e,"Non-whitespace before first tag."),e.textNode=t,e.state=k.TEXT)}function N(e,t){var r="";return r=t>10),i%1024+56320)),(t+1===r||16384o.length)&&(a=o.length),o=o.substring(a-s.length,a)===s?"The ".concat(e," ").concat(n," ").concat(u(t,"type")):(a=(i="number"!=typeof i?0:i)+(o=".").length>(a=e).length||-1===a.indexOf(o,i)?"argument":"property",'The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(u(t,"type"))),o+=". 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=n},{}],400:[function(c,f,e){!function(l){!function(){"use strict";var e=Object.keys||function(e){var t,r=[];for(t in e)r.push(t);return r},t=(f.exports=s,c("./_stream_readable")),r=c("./_stream_writable");c("inherits")(s,t);for(var n=e(r.prototype),i=0;it.highWaterMark&&(t.highWaterMark=(k<=(r=e)?r=k:(r--,r=(r=(r=(r=(r|=r>>>1)|r>>>2)|r>>>4)|r>>>8)|r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function T(e){var t=e._readableState;m("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,L.nextTick(E,e))}function E(e){var t=e._readableState;m("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,R(e)}function S(e,t){t.readingMore||(t.readingMore=!0,L.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length=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);var r}function M(e){var t=e._readableState;m("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,L.nextTick(N,t,e))}function N(e,t){m("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy&&(!(e=t._writableState)||e.autoDestroy&&e.finished)&&t.destroy())}function P(e,t){for(var r=0,n=e.length;r=t.highWaterMark:0>>0),i=this.head,o=0;i;)t=i.data,r=o,u.prototype.copy.call(t,n,r),o+=i.data.length,i=i.next;return n}},{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).data=i.slice(o);break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.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).data=i.slice(o);break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:90,util:89}],407:[function(e,t,r){!function(u){!function(){"use strict";function o(e,t){a(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(a,this,e)):u.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?u.nextTick(s,r):(r._writableState.errorEmitted=!0,u.nextTick(o,r,e)):u.nextTick(o,r,e):t?(u.nextTick(s,r),t(e)):u.nextTick(s,r)})),this},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}.call(this)}.call(this,e("_process"))},{_process:467}],408:[function(e,t,r){"use strict";var b=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function g(){}t.exports=function e(t,r,n){if("function"==typeof r)return e(t,null,r);function i(){t.writable||o()}function o(){m=!(h=!1),d||n.call(t)}function s(){y=!(d=!1),h||n.call(t)}function a(e){n.call(t,e)}function u(){var e;return d&&!y?(t._readableState&&t._readableState.ended||(e=new b),n.call(t,e)):h&&!m?(t._writableState&&t._writableState.ended||(e=new b),n.call(t,e)):void 0}function l(){t.req.on("finish",o)}c=n||g,f=!1,n=function(){if(!f){f=!0;for(var e=arguments.length,t=new Array(e),r=0;r>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t,r=this.lastTotal-this.lastNeed,n=(t=this,128!=(192&(n=e)[0])?(t.lastNeed=0,"\ufffd"):1")||0<=e.indexOf("<"))},d=function(e){return""},t=function(e){return e.replace("]]>","]]]]>")},o.Builder=(e.prototype.buildObject=function(e){var u,t,l,c=this.options.attrkey,f=this.options.charkey;return 1===Object.keys(e).length&&this.options.rootName===i[.2].rootName?e=e[t=Object.keys(e)[0]]:t=this.options.rootName,l=this,u=function(e,t){var r,n,i,o,s,a;if("object"!=typeof t)l.options.cdata&&p(t)?e.raw(d(t)):e.txt(t);else if(Array.isArray(t)){for(o in t)if(h.call(t,o))for(s in n=t[o])i=n[s],e=u(e.ele(s),i).up()}else for(s in t)if(h.call(t,s))if(n=t[s],s===c){if("object"==typeof n)for(r in n)a=n[r],e=e.att(r,a)}else if(s===f)e=l.options.cdata&&p(n)?e.raw(d(n)):e.txt(n);else if(Array.isArray(n))for(o in n)h.call(n,o)&&(e=("string"==typeof(i=n[o])?l.options.cdata&&p(i)?e.ele(s).raw(d(i)):e.ele(s,i):u(e.ele(s),i)).up());else e="object"==typeof n?u(e.ele(s),n).up():"string"==typeof n&&l.options.cdata&&p(n)?e.ele(s).raw(d(n)).up():(null==n&&(n=""),e.ele(s,n.toString()).up());return e},t=r.create(t,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),u(t,e).end(this.options.renderOpts)},e)}.call(this)},{"./defaults":423,xmlbuilder:459}],423:[function(e,t,r){!function(){r.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}.call(this)},{}],424:[function(e,t,y){!function(){"use strict";function o(e,t){return function(){return e.apply(t,arguments)}}var p={}.hasOwnProperty,u=e("sax"),s=e("events"),a=e("./bom"),l=e("./processors"),c=e("timers").setImmediate,f=e("./defaults").defaults,d=function(e){return"object"==typeof e&&null!=e&&0===Object.keys(e).length},h=function(e,t,r){for(var n=0,i=e.length;n":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},e.prototype.isEqualNode=function(e){return e.namespaceURI===this.namespaceURI&&(e.prefix===this.prefix&&(e.localName===this.localName&&e.value===this.value))},e)}.call(this)},{"./NodeType":428,"./XMLNode":450}],432:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./NodeType"),a=e("./XMLCharacterData");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=s.CData,this.value=this.stringify.cdata(t)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":428,"./XMLCharacterData":433}],433:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e){i.__super__.constructor.call(this,e),this.value=""}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,Object.defineProperty(i.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(i.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(i.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(e){return!!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.data===this.data},i}()}.call(this)},{"./XMLNode":450}],434:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./NodeType"),a=e("./XMLCharacterData");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=s.Comment,this.value=this.stringify.comment(t)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":428,"./XMLCharacterData":433}],435:[function(n,i,e){!function(){var e,t;function r(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}e=n("./XMLDOMErrorHandler"),t=n("./XMLDOMStringList"),i.exports=(Object.defineProperty(r.prototype,"parameterNames",{get:function(){return new t(Object.keys(this.defaultParams))}}),r.prototype.getParameter=function(e){return this.params.hasOwnProperty(e)?this.params[e]:null},r.prototype.canSetParameter=function(e,t){return!0},r.prototype.setParameter=function(e,t){return null!=t?this.params[e]=t:delete this.params[e]},r)}.call(this)},{"./XMLDOMErrorHandler":436,"./XMLDOMStringList":438}],436:[function(e,t,r){!function(){function e(){}t.exports=(e.prototype.handleError=function(e){throw new Error(e)},e)}.call(this)},{}],437:[function(e,t,r){!function(){function e(){}t.exports=(e.prototype.hasFeature=function(e,t){return!0},e.prototype.createDocumentType=function(e,t,r){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(e,t,r){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")},e)}.call(this)},{}],438:[function(e,t,r){!function(){function e(e){this.arr=e||[]}t.exports=(Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}}),e.prototype.item=function(e){return this.arr[e]||null},e.prototype.contains=function(e){return-1!==this.arr.indexOf(e)},e)}.call(this)},{}],439:[function(e,t,r){!function(){var i={}.hasOwnProperty,o=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=s,r=o;for(e in r)i.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function s(e,t,r,n,i,o){if(s.__super__.constructor.call(this,e),null==t)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==r)throw new Error("Missing DTD attribute name. "+this.debugInfo(t));if(!n)throw new Error("Missing DTD attribute type. "+this.debugInfo(t));if(!i)throw new Error("Missing DTD attribute default. "+this.debugInfo(t));if(!(i=0!==i.indexOf("#")?"#"+i:i).match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(t));if(o&&!i.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(t));this.elementName=this.stringify.name(t),this.type=a.AttributeDeclaration,this.attributeName=this.stringify.name(r),this.attributeType=this.stringify.dtdAttType(n),o&&(this.defaultValue=this.stringify.dtdAttDefault(o)),this.defaultValueType=i}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,s.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))},s}()}.call(this)},{"./NodeType":428,"./XMLNode":450}],440:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing DTD element name. "+this.debugInfo());r=r||"(#PCDATA)",Array.isArray(r)&&(r="("+r.join(",")+")"),this.name=this.stringify.name(t),this.type=a.ElementDeclaration,this.value=this.stringify.dtdElementValue(r)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":428,"./XMLNode":450}],441:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./Utility").isObject,a=e("./XMLNode"),u=e("./NodeType");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r,n){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(null==n)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!t,this.name=this.stringify.name(r),this.type=u.EntityDeclaration,s(n)){if(!n.pubID&&!n.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(n.pubID&&!n.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,null!=n.pubID&&(this.pubID=this.stringify.dtdPubID(n.pubID)),null!=n.sysID&&(this.sysID=this.stringify.dtdSysID(n.sysID)),null!=n.nData&&(this.nData=this.stringify.dtdNData(n.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}else this.value=this.stringify.dtdEntityValue(n),this.internal=!0}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return null}}),i.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":428,"./Utility":429,"./XMLNode":450}],442:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing DTD notation name. "+this.debugInfo(t));if(!r.pubID&&!r.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(t));this.name=this.stringify.name(t),this.type=a.NotationDeclaration,null!=r.pubID&&(this.pubID=this.stringify.dtdPubID(r.pubID)),null!=r.sysID&&(this.sysID=this.stringify.dtdSysID(r.sysID))}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":428,"./XMLNode":450}],443:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./Utility").isObject,a=e("./XMLNode"),u=e("./NodeType");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r,n){i.__super__.constructor.call(this,e),s(t)&&(t=(e=t).version,r=e.encoding,n=e.standalone),t=t||"1.0",this.type=u.Declaration,this.version=this.stringify.xmlVersion(t),null!=r&&(this.encoding=this.stringify.xmlEncoding(r)),null!=n&&(this.standalone=this.stringify.xmlStandalone(n))}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":428,"./Utility":429,"./XMLNode":450}],444:[function(e,t,r){!function(){var i={}.hasOwnProperty,u=e("./Utility").isObject,o=e("./XMLNode"),l=e("./NodeType"),s=e("./XMLDTDAttList"),c=e("./XMLDTDEntity"),f=e("./XMLDTDElement"),p=e("./XMLDTDNotation"),d=e("./XMLNamedNodeMap");t.exports=function(){var e,t=a,r=o;for(e in r)i.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function a(e,t,r){var n,i,o,s;if(a.__super__.constructor.call(this,e),this.type=l.DocType,e.children)for(i=0,o=(s=e.children).length;i":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel),this.writerOptions.state=o.InsideTag}else this.writerOptions.state=o.OpenTag,r=this.writer.indent(e,this.writerOptions,this.currentLevel)+""),r+=this.writer.endline(e,this.writerOptions,this.currentLevel);return this.onData(r,this.currentLevel),e.isOpen=!0}},_.prototype.closeNode=function(e){var t;if(!e.isClosed)return t="",this.writerOptions.state=o.CloseTag,t=e.type===l.Element?this.writer.indent(e,this.writerOptions,this.currentLevel)+""+this.writer.endline(e,this.writerOptions,this.currentLevel):this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel),this.writerOptions.state=o.None,this.onData(t,this.currentLevel),e.isClosed=!0},_.prototype.onData=function(e,t){return this.documentStarted=!0,this.onDataCallback(e,t+1)},_.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},_.prototype.debugInfo=function(e){return null==e?"":"node: <"+e+">"},_.prototype.ele=function(){return this.element.apply(this,arguments)},_.prototype.nod=function(e,t,r){return this.node(e,t,r)},_.prototype.txt=function(e){return this.text(e)},_.prototype.dat=function(e){return this.cdata(e)},_.prototype.com=function(e){return this.comment(e)},_.prototype.ins=function(e,t){return this.instruction(e,t)},_.prototype.dec=function(e,t,r){return this.declaration(e,t,r)},_.prototype.dtd=function(e,t,r){return this.doctype(e,t,r)},_.prototype.e=function(e,t,r){return this.element(e,t,r)},_.prototype.n=function(e,t,r){return this.node(e,t,r)},_.prototype.t=function(e){return this.text(e)},_.prototype.d=function(e){return this.cdata(e)},_.prototype.c=function(e){return this.comment(e)},_.prototype.r=function(e){return this.raw(e)},_.prototype.i=function(e,t){return this.instruction(e,t)},_.prototype.att=function(){return(this.currentNode&&this.currentNode.type===l.DocType?this.attList:this.attribute).apply(this,arguments)},_.prototype.a=function(){return(this.currentNode&&this.currentNode.type===l.DocType?this.attList:this.attribute).apply(this,arguments)},_.prototype.ent=function(e,t){return this.entity(e,t)},_.prototype.pent=function(e,t){return this.pEntity(e,t)},_.prototype.not=function(e,t){return this.notation(e,t)},_)}.call(this)},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLAttribute":431,"./XMLCData":432,"./XMLComment":434,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDocument":445,"./XMLElement":448,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLStringWriter":455,"./XMLStringifier":456,"./XMLText":457}],447:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e){i.__super__.constructor.call(this,e),this.type=a.Dummy}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return""},i}()}.call(this)},{"./NodeType":428,"./XMLNode":450}],448:[function(t,r,e){!function(){var i={}.hasOwnProperty,e=t("./Utility"),o=e.isObject,s=e.isFunction,u=e.getValue,l=t("./XMLNode"),c=t("./NodeType"),f=t("./XMLAttribute"),p=t("./XMLNamedNodeMap");r.exports=function(){var e,t=a,r=l;for(e in r)i.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function a(e,t,r){var n,i,o,s;if(a.__super__.constructor.call(this,e),null==t)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(t),this.type=c.Element,this.attribs={},(this.schemaTypeInfo=null)!=r&&this.attribute(r),e.type===c.Document&&(this.isRoot=!0,(this.documentObject=e).rootObject=this,e.children))for(i=0,o=(s=e.children).length;i":null!=(t=this.parent)&&t.name?"node: <"+e+">, parent: <"+this.parent.name+">":"node: <"+e+">":""},g.prototype.ele=function(e,t,r){return this.element(e,t,r)},g.prototype.nod=function(e,t,r){return this.node(e,t,r)},g.prototype.txt=function(e){return this.text(e)},g.prototype.dat=function(e){return this.cdata(e)},g.prototype.com=function(e){return this.comment(e)},g.prototype.ins=function(e,t){return this.instruction(e,t)},g.prototype.doc=function(){return this.document()},g.prototype.dec=function(e,t,r){return this.declaration(e,t,r)},g.prototype.e=function(e,t,r){return this.element(e,t,r)},g.prototype.n=function(e,t,r){return this.node(e,t,r)},g.prototype.t=function(e){return this.text(e)},g.prototype.d=function(e){return this.cdata(e)},g.prototype.c=function(e){return this.comment(e)},g.prototype.r=function(e){return this.raw(e)},g.prototype.i=function(e,t){return this.instruction(e,t)},g.prototype.u=function(){return this.up()},g.prototype.importXMLBuilder=function(e){return this.importDocument(e)},g.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasChildNodes=function(){return 0!==this.children.length},g.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isSupported=function(e,t){return!0},g.prototype.hasAttributes=function(){return 0!==this.attribs.length},g.prototype.compareDocumentPosition=function(e){var t;return this===e?0:this.document()!==e.document()?(t=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?t|=r.Preceding:t|=r.Following,t):this.isAncestor(e)?r.Contains|r.Preceding:this.isDescendant(e)?r.Contains|r.Following:this.isPreceding(e)?r.Preceding:r.Following},g.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(e){var t,r,n;if(e.nodeType!==this.nodeType)return!1;if(e.children.length!==this.children.length)return!1;for(t=r=0,n=this.children.length-1;0<=n?r<=n:n<=r;t=0<=n?++r:--r)if(!this.children[t].isEqualNode(e.children[t]))return!1;return!0},g.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setUserData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.contains=function(e){return!!e&&(e===this||this.isDescendant(e))},g.prototype.isDescendant=function(e){for(var t,r=this.children,n=0,i=r.length;n"),this.stream.write(this.endline(e,t,r)),t.state=h.None,this.closeNode(e,t,r)},i.prototype.element=function(e,t,r){var n,i,o,s,a,u,l,c,f;for(l in this.openNode(e,t,r=r||0),t.state=h.OpenTag,this.stream.write(this.indent(e,t,r)+"<"+e.name),c=e.attribs)p.call(c,l)&&(n=c[l],this.attribute(n,t,r));if(s=0===(o=e.children.length)?null:e.children[0],0===o||e.children.every(function(e){return(e.type===d.Text||e.type===d.Raw)&&""===e.value}))t.allowEmpty?(this.stream.write(">"),t.state=h.CloseTag,this.stream.write("")):(t.state=h.CloseTag,this.stream.write(t.spaceBeforeSlash+"/>"));else if(!t.pretty||1!==o||s.type!==d.Text&&s.type!==d.Raw||null==s.value){for(this.stream.write(">"+this.endline(e,t,r)),t.state=h.InsideTag,a=0,u=(f=e.children).length;a")}else this.stream.write(">"),t.state=h.InsideTag,t.suppressPrettyCount++,this.writeChildNode(s,t,r+1),t.suppressPrettyCount--,t.state=h.CloseTag,this.stream.write("");return this.stream.write(this.endline(e,t,r)),t.state=h.None,this.closeNode(e,t,r)},i.prototype.processingInstruction=function(e,t,r){return this.stream.write(i.__super__.processingInstruction.call(this,e,t,r))},i.prototype.raw=function(e,t,r){return this.stream.write(i.__super__.raw.call(this,e,t,r))},i.prototype.text=function(e,t,r){return this.stream.write(i.__super__.text.call(this,e,t,r))},i.prototype.dtdAttList=function(e,t,r){return this.stream.write(i.__super__.dtdAttList.call(this,e,t,r))},i.prototype.dtdElement=function(e,t,r){return this.stream.write(i.__super__.dtdElement.call(this,e,t,r))},i.prototype.dtdEntity=function(e,t,r){return this.stream.write(i.__super__.dtdEntity.call(this,e,t,r))},i.prototype.dtdNotation=function(e,t,r){return this.stream.write(i.__super__.dtdNotation.call(this,e,t,r))},i}()}.call(this)},{"./NodeType":428,"./WriterState":430,"./XMLWriterBase":458}],455:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLWriterBase");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e){i.__super__.constructor.call(this,e)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.document=function(e,t){var r,n,i,o,s;for(t=this.filterOptions(t),o="",n=0,i=(s=e.children).length;n","]]]]>"),this.assertLegalChar(e))},e.prototype.comment=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+e);return this.assertLegalChar(e)},e.prototype.raw=function(e){return this.options.noValidation?e:""+e||""},e.prototype.attValue=function(e){return this.options.noValidation?e:this.assertLegalChar(this.attEscape(e=""+e||""))},e.prototype.insTarget=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.insValue=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+e);return this.assertLegalChar(e)},e.prototype.xmlVersion=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/1\.[0-9]+/))return e;throw new Error("Invalid version number: "+e)},e.prototype.xmlEncoding=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))return this.assertLegalChar(e);throw new Error("Invalid encoding: "+e)},e.prototype.xmlStandalone=function(e){return this.options.noValidation?e:e?"yes":"no"},e.prototype.dtdPubID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdSysID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdElementValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdAttType=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdAttDefault=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdEntityValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdNData=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(e){var t;if(this.options.noValidation)return e;if("1.0"===this.options.version){if(t=e.match(/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+e+" at index "+t.index)}else if("1.1"===this.options.version&&(t=e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)))throw new Error("Invalid character in string: "+e+" at index "+t.index);return e},e.prototype.assertLegalName=function(e){if(this.options.noValidation)return e;if(this.assertLegalChar(e),e.match(/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/))return e;throw new Error("Invalid character in name")},e.prototype.textEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(//g,">").replace(/\r/g," "))},e.prototype.attEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(/"+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.comment=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+"\x3c!-- ",t.state=g.InsideTag,n+=e.value,t.state=g.CloseTag,n+=" --\x3e"+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.declaration=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+"")+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.docType=function(e,t,r){var n,i,o,s,a;if(this.openNode(e,t,r=r||0),t.state=g.OpenTag,s=this.indent(e,t,r),s+="")+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),s},e.prototype.element=function(e,t,r){var n,i,o,s,a,u,l,c,f,p,d,h,m=!1,y="";for(f in this.openNode(e,t,r=r||0),t.state=g.OpenTag,y+=this.indent(e,t,r)+"<"+e.name,p=e.attribs)v.call(p,f)&&(n=p[f],y+=this.attribute(n,t,r));if(s=0===(o=e.children.length)?null:e.children[0],0===o||e.children.every(function(e){return(e.type===b.Text||e.type===b.Raw)&&""===e.value}))t.allowEmpty?(y+=">",t.state=g.CloseTag,y+=""+this.endline(e,t,r)):(t.state=g.CloseTag,y+=t.spaceBeforeSlash+"/>"+this.endline(e,t,r));else if(!t.pretty||1!==o||s.type!==b.Text&&s.type!==b.Raw||null==s.value){if(t.dontPrettyTextNodes)for(a=0,l=(d=e.children).length;a"+this.endline(e,t,r),t.state=g.InsideTag,u=0,c=(h=e.children).length;u",m&&t.suppressPrettyCount--,y+=this.endline(e,t,r),t.state=g.None}else y+=">",t.state=g.InsideTag,t.suppressPrettyCount++,m=!0,y+=this.writeChildNode(s,t,r+1),t.suppressPrettyCount--,m=!1,t.state=g.CloseTag,y+=""+this.endline(e,t,r);return this.closeNode(e,t,r),y},e.prototype.writeChildNode=function(e,t,r){switch(e.type){case b.CData:return this.cdata(e,t,r);case b.Comment:return this.comment(e,t,r);case b.Element:return this.element(e,t,r);case b.Raw:return this.raw(e,t,r);case b.Text:return this.text(e,t,r);case b.ProcessingInstruction:return this.processingInstruction(e,t,r);case b.Dummy:return"";case b.Declaration:return this.declaration(e,t,r);case b.DocType:return this.docType(e,t,r);case b.AttributeDeclaration:return this.dtdAttList(e,t,r);case b.ElementDeclaration:return this.dtdElement(e,t,r);case b.EntityDeclaration:return this.dtdEntity(e,t,r);case b.NotationDeclaration:return this.dtdNotation(e,t,r);default:throw new Error("Unknown XML node type: "+e.constructor.name)}},e.prototype.processingInstruction=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+"")+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.raw=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r),t.state=g.InsideTag,n+=e.value,t.state=g.CloseTag,n+=this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.text=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r),t.state=g.InsideTag,n+=e.value,t.state=g.CloseTag,n+=this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdAttList=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdElement=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdEntity=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdNotation=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.openNode=function(e,t,r){},e.prototype.closeNode=function(e,t,r){},e.prototype.openAttribute=function(e,t,r){},e.prototype.closeAttribute=function(e,t,r){},e)}.call(this)},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLCData":432,"./XMLComment":434,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDummy":447,"./XMLElement":448,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLText":457}],459:[function(l,c,e){!function(){var e=l("./Utility"),i=e.assign,o=e.isFunction,e=l("./XMLDOMImplementation"),s=l("./XMLDocument"),a=l("./XMLDocumentCB"),t=l("./XMLStringWriter"),r=l("./XMLStreamWriter"),n=l("./NodeType"),u=l("./WriterState");c.exports.create=function(e,t,r,n){if(null==e)throw new Error("Root element needs a name.");return n=i({},t,r,n),r=(t=new s(n)).element(e),n.headless||(t.declaration(n),null==n.pubID&&null==n.sysID||t.dtd(n)),r},c.exports.begin=function(e,t,r){var n;return o(e)&&(t=(n=[e,t])[0],r=n[1],e={}),t?new a(e,t,r):new s(e)},c.exports.stringWriter=function(e){return new t(e)},c.exports.streamWriter=function(e,t){return new r(e,t)},c.exports.implementation=new e,c.exports.nodeType=n,c.exports.writerState=u}.call(this)},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLDOMImplementation":437,"./XMLDocument":445,"./XMLDocumentCB":446,"./XMLStreamWriter":454,"./XMLStringWriter":455}],460:[function(e,t,r){t.exports=function(){for(var e={},t=0;ta?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,s=0;s>>32-i,r)}function f(e,t,r,n,i,o,s){return a(t&r|~t&n,e,t,i,o,s)}function p(e,t,r,n,i,o,s){return a(t&n|r&~n,e,t,i,o,s)}function d(e,t,r,n,i,o,s){return a(t^r^n,e,t,i,o,s)}function h(e,t,r,n,i,o,s){return a(r^(t|~n),e,t,i,o,s)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return n.hash(e,i,16)}},{"./helpers":462}],464:[function(e,t,r){"use strict";var n=e("./helpers");function i(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,i,o=Array(80),s=1732584193,a=-271733879,u=-1732584194,l=271733878,c=-1009589776,f=0;f>16)+(t>>16)+(r>>16)<<16|65535&r}function w(e,t){return e<>>32-t}t.exports=function(e){return n.hash(e,i,20,!0)}},{"./helpers":462}],465:[function(e,t,r){"use strict";t.exports=function(){return function(){}}},{}],466:[function(i,o,e){!function(n){!function(){"use strict";var t=i("@babel/runtime/helpers/interopRequireDefault")(i("@babel/runtime/helpers/typeof")),r=i("stream").Stream,e=i("../lib/common/utils/isArray").isArray;o.exports.string=function(e){return"string"==typeof e},o.exports.array=e,o.exports.buffer=n.isBuffer,o.exports.writableStream=function(e){return e instanceof r&&"function"==typeof e._write&&"object"===(0,t.default)(e._writableState)}}.call(this)}.call(this,{isBuffer:i("../node_modules/is-buffer/index.js")})},{"../lib/common/utils/isArray":63,"../node_modules/is-buffer/index.js":366,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,stream:398}],467:[function(e,t,r){"use strict";e=e("immediate"),t=t.exports={};function n(){}t.nextTick=e,t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=n,t.addListener=n,t.once=n,t.off=n,t.removeListener=n,t.removeAllListeners=n,t.emit=n,t.prependListener=n,t.prependOnceListener=n,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{immediate:358}],468:[function(n,e,i){!function(l){!function(){"use strict";n("core-js/modules/es.regexp.exec.js"),n("core-js/modules/es.string.search.js");var s=n("./lib/request"),e=n("./lib/response"),a=n("xtend"),t=n("builtin-status-codes"),u=n("url"),r=i;r.request=function(e,t){e="string"==typeof e?u.parse(e):a(e);var r=-1===l.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||r,n=e.hostname||e.host,i=e.port,o=e.path||"/",r=(n&&-1!==n.indexOf(":")&&(n="["+n+"]"),e.url=(n?r+"//"+n:"")+(i?":"+i:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{},new s(e));return t&&r.on("response",t),r},r.get=function(e,t){e=r.request(e,t);return e.end(),e},r.ClientRequest=s,r.IncomingMessage=e.IncomingMessage,r.Agent=function(){},r.Agent.defaultMaxSockets=4,r.globalAgent=new r.Agent,r.STATUS_CODES=t,r.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,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":470,"./lib/response":471,"builtin-status-codes":91,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.search.js":306,url:472,xtend:460}],469:[function(a,e,u){!function(s){!function(){"use strict";a("core-js/modules/es.object.to-string.js"),a("core-js/modules/es.promise.js"),a("core-js/modules/es.array-buffer.constructor.js"),a("core-js/modules/es.array-buffer.slice.js"),a("core-js/modules/es.array.slice.js"),u.fetch=o(s.fetch)&&o(s.ReadableStream),u.writableStream=o(s.WritableStream),u.abortController=o(s.AbortController),u.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),u.blobConstructor=!0}catch(e){}var t;function r(){if(void 0!==t)return t;if(s.XMLHttpRequest){t=new s.XMLHttpRequest;try{t.open("GET",s.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function e(e){var t=r();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var n=void 0!==s.ArrayBuffer,i=n&&o(s.ArrayBuffer.prototype.slice);function o(e){return"function"==typeof e}u.arraybuffer=u.fetch||n&&e("arraybuffer"),u.msstream=!u.fetch&&i&&e("ms-stream"),u.mozchunkedarraybuffer=!u.fetch&&n&&e("moz-chunked-arraybuffer"),u.overrideMimeType=u.fetch||!!r()&&o(r().overrideMimeType),u.vbArray=o(s.VBArray),t=null}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"core-js/modules/es.array-buffer.constructor.js":270,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295}],470:[function(o,s,e){!function(f,p,d){!function(){"use strict";o("core-js/modules/es.object.to-string.js"),o("core-js/modules/es.regexp.to-string.js"),o("core-js/modules/web.dom-collections.for-each.js"),o("core-js/modules/es.object.keys.js"),o("core-js/modules/es.array.concat.js"),o("core-js/modules/es.array.map.js"),o("core-js/modules/es.function.name.js"),o("core-js/modules/es.promise.js"),o("core-js/modules/es.regexp.exec.js"),o("core-js/modules/es.string.split.js");var u=o("./capability"),e=o("inherits"),t=o("./response"),i=o("readable-stream"),l=o("to-arraybuffer"),r=t.IncomingMessage,c=t.readyStates;t=s.exports=function(t){var e,r=this,n=(i.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+new d(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){r.setHeader(e,t.headers[e])}),!0);if("disable-fetch"===t.mode||"requestTimeout"in t&&!u.abortController)e=!(n=!1);else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!u.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}r._mode=(e=e,n=n,u.fetch&&n?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&e?"arraybuffer":u.vbArray&&e?"text:vbarray":"text"),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};e(t,i.Writable),t.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===n.indexOf(r)&&(this._headers[r]={name:e,value:t})},t.prototype.getHeader=function(e){e=this._headers[e.toLowerCase()];return e?e.value:null},t.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},t.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts,r=t._headers,n=null,i=("GET"!==e.method&&"HEAD"!==e.method&&(n=u.arraybuffer?l(d.concat(t._body)):u.blobConstructor?new p.Blob(t._body.map(function(e){return l(e)}),{type:(r["content-type"]||{}).value||""}):d.concat(t._body).toString()),[]);if(Object.keys(r).forEach(function(e){var t=r[e].name,e=r[e].value;Array.isArray(e)?e.forEach(function(e){i.push([t,e])}):i.push([t,e])}),"fetch"===t._mode){var o,s=null;u.abortController&&(s=(o=new AbortController).signal,t._fetchAbortController=o,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=p.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))),p.fetch(t._opts.url,{method:t._opts.method,headers:i,body:n||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:s}).then(function(e){t._fetchResponse=e,t._connect()},function(e){p.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)})}else{var a=t._xhr=new p.XMLHttpRequest;try{a.open(t._opts.method,t._opts.url,!0)}catch(e){return void f.nextTick(function(){t.emit("error",e)})}"responseType"in a&&(a.responseType=t._mode.split(":")[0]),"withCredentials"in a&&(a.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(a.timeout=e.requestTimeout,a.ontimeout=function(){t.emit("requestTimeout")}),i.forEach(function(e){a.setRequestHeader(e[0],e[1])}),t._response=null,a.onreadystatechange=function(){switch(a.readyState){case c.LOADING:case c.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(a.onprogress=function(){t._onXHRProgress()}),a.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{a.send(n)}catch(e){return void f.nextTick(function(){t.emit("error",e)})}}}},t.prototype._onXHRProgress=function(){!function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return}}(this._xhr)||this._destroyed||(this._response||this._connect(),this._response._onXHRProgress())},t.prototype._connect=function(){var t=this;t._destroyed||(t._response=new r(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},t.prototype._write=function(e,t,r){this._body.push(e),r()},t.prototype.abort=t.prototype.destroy=function(){this._destroyed=!0,p.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},t.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),i.Writable.prototype.end.call(this,e,t,r)},t.prototype.flushHeaders=function(){},t.prototype.setTimeout=function(){},t.prototype.setNoDelay=function(){},t.prototype.setSocketKeepAlive=function(){};var n=["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"]}.call(this)}.call(this,o("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},o("buffer").Buffer)},{"./capability":469,"./response":471,_process:467,buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.split.js":307,"core-js/modules/web.dom-collections.for-each.js":339,inherits:364,"readable-stream":394,"to-arraybuffer":415}],471:[function(r,e,n){!function(c,f,p){!function(){"use strict";r("core-js/modules/es.object.to-string.js"),r("core-js/modules/web.dom-collections.for-each.js"),r("core-js/modules/es.promise.js"),r("core-js/modules/es.regexp.exec.js"),r("core-js/modules/es.string.split.js"),r("core-js/modules/es.string.match.js"),r("core-js/modules/es.array.iterator.js"),r("core-js/modules/es.array-buffer.slice.js"),r("core-js/modules/es.typed-array.uint8-array.js"),r("core-js/modules/es.typed-array.copy-within.js"),r("core-js/modules/es.typed-array.every.js"),r("core-js/modules/es.typed-array.fill.js"),r("core-js/modules/es.typed-array.filter.js"),r("core-js/modules/es.typed-array.find.js"),r("core-js/modules/es.typed-array.find-index.js"),r("core-js/modules/es.typed-array.for-each.js"),r("core-js/modules/es.typed-array.includes.js"),r("core-js/modules/es.typed-array.index-of.js"),r("core-js/modules/es.typed-array.iterator.js"),r("core-js/modules/es.typed-array.join.js"),r("core-js/modules/es.typed-array.last-index-of.js"),r("core-js/modules/es.typed-array.map.js"),r("core-js/modules/es.typed-array.reduce.js"),r("core-js/modules/es.typed-array.reduce-right.js"),r("core-js/modules/es.typed-array.reverse.js"),r("core-js/modules/es.typed-array.set.js"),r("core-js/modules/es.typed-array.slice.js"),r("core-js/modules/es.typed-array.some.js"),r("core-js/modules/es.typed-array.sort.js"),r("core-js/modules/es.typed-array.subarray.js"),r("core-js/modules/es.typed-array.to-locale-string.js"),r("core-js/modules/es.typed-array.to-string.js"),r("core-js/modules/es.array.slice.js");var a=r("./capability"),e=r("inherits"),u=r("readable-stream"),l=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},t=n.IncomingMessage=function(e,t,r,n){var i=this;if(u.Readable.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",function(){c.nextTick(function(){i.emit("close")})}),"fetch"===r){r=function t(){s.read().then(function(e){if(!i._destroyed){if(e.done)return f.clearTimeout(n),void i.push(null);i.push(new p(e.value)),t()}}).catch(function(e){f.clearTimeout(n),i._destroyed||i.emit("error",e)})};if(i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText,t.headers.forEach(function(e,t){i.headers[t.toLowerCase()]=e,i.rawHeaders.push(t,e)}),a.writableStream){var o=new WritableStream({write:function(r){return new Promise(function(e,t){i._destroyed?t():i.push(new p(r))?e():i._resumeFetch=e})},close:function(){f.clearTimeout(n),i._destroyed||i.push(null)},abort:function(e){i._destroyed||i.emit("error",e)}});try{return void t.body.pipeTo(o).catch(function(e){f.clearTimeout(n),i._destroyed||i.emit("error",e)})}catch(e){}}var s=t.body.getReader();r()}else i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t,e=e.match(/^([^:]+):\s*(.*)/);e&&("set-cookie"===(t=e[1].toLowerCase())?(void 0===i.headers[t]&&(i.headers[t]=[]),i.headers[t].push(e[2])):void 0!==i.headers[t]?i.headers[t]+=", "+e[2]:i.headers[t]=e[2],i.rawHeaders.push(e[1],e[2]))}),i._charset="x-user-defined",a.overrideMimeType||((o=i.rawHeaders["mime-type"])&&(t=o.match(/;\s*charset=([^;])(;|$)/))&&(i._charset=t[1].toLowerCase()),i._charset||(i._charset="utf-8"))};e(t,u.Readable),t.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},t.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==l.DONE)break;try{r=new f.VBArray(e.responseBody).toArray()}catch(e){}if(null!==r){t.push(new p(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var n=r.substr(t._pos);if("x-user-defined"===t._charset){for(var i=new p(n.length),o=0;ot._pos&&(t.push(new p(new Uint8Array(s.result.slice(t._pos)))),t._pos=s.result.byteLength)},s.onload=function(){t.push(null)},s.readAsArrayBuffer(r)}t._xhr.readyState===l.DONE&&"ms-stream"!==t._mode&&t.push(null)}}.call(this)}.call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":469,_process:467,buffer:90,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.match.js":304,"core-js/modules/es.string.split.js":307,"core-js/modules/es.typed-array.copy-within.js":315,"core-js/modules/es.typed-array.every.js":316,"core-js/modules/es.typed-array.fill.js":317,"core-js/modules/es.typed-array.filter.js":318,"core-js/modules/es.typed-array.find-index.js":319,"core-js/modules/es.typed-array.find.js":320,"core-js/modules/es.typed-array.for-each.js":321,"core-js/modules/es.typed-array.includes.js":322,"core-js/modules/es.typed-array.index-of.js":323,"core-js/modules/es.typed-array.iterator.js":324,"core-js/modules/es.typed-array.join.js":325,"core-js/modules/es.typed-array.last-index-of.js":326,"core-js/modules/es.typed-array.map.js":327,"core-js/modules/es.typed-array.reduce-right.js":328,"core-js/modules/es.typed-array.reduce.js":329,"core-js/modules/es.typed-array.reverse.js":330,"core-js/modules/es.typed-array.set.js":331,"core-js/modules/es.typed-array.slice.js":332,"core-js/modules/es.typed-array.some.js":333,"core-js/modules/es.typed-array.sort.js":334,"core-js/modules/es.typed-array.subarray.js":335,"core-js/modules/es.typed-array.to-locale-string.js":336,"core-js/modules/es.typed-array.to-string.js":337,"core-js/modules/es.typed-array.uint8-array.js":338,"core-js/modules/web.dom-collections.for-each.js":339,inherits:364,"readable-stream":394}],472:[function(e,t,r){"use strict";var k=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof")),_=(e("core-js/modules/es.regexp.exec.js"),e("core-js/modules/es.string.search.js"),e("core-js/modules/es.array.concat.js"),e("core-js/modules/es.string.split.js"),e("core-js/modules/es.string.replace.js"),e("core-js/modules/es.array.join.js"),e("core-js/modules/es.string.trim.js"),e("core-js/modules/es.string.match.js"),e("core-js/modules/es.array.slice.js"),e("core-js/modules/es.object.keys.js"),e("core-js/modules/es.array.splice.js"),e("punycode")),T=e("./util");function j(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=i,r.resolve=function(e,t){return i(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?i(e,!1,!0).resolveObject(t):t},r.format=function(e){T.isString(e)&&(e=i(e));return e instanceof j?e.format():j.prototype.format.call(e)},r.Url=j;var E=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,S=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,r=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),O=["'"].concat(r),A=["%","/","?",";","#"].concat(O),I=["/","?","#"],D=/^[+a-z0-9A-Z_-]{0,63}$/,R=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},N=e("querystring");function i(e,t,r){if(e&&T.isObject(e)&&e instanceof j)return e;var n=new j;return n.parse(e,t,r),n}j.prototype.parse=function(e,t,r){if(!T.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(0,k.default)(e));var n=e.indexOf("?"),n=-1!==n&&nu.maxRedirects))return r=u.formatRedirectUrl?u.formatRedirectUrl(a,n):F.resolve(a,n),G("Request#%d %s: `redirected` from %s to %s",c,h.path,a,r),S(),u.headers&&u.headers.Host&&z.test(n)&&(u.headers.Host=null),n=l,l=null,J.requestWithCallback(r,u,n),{redirect:!0,error:null};(t=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+a)).name="MaxRedirectError"}else(t=new Error("Got statusCode "+e.statusCode+" but cannot resolve next location from headers")).name="FollowRedirectError"}return{redirect:!1,error:t}}u.timing&&(T={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),!u.gzip||h.headers["Accept-Encoding"]||h.headers["accept-encoding"]||(h.headers["Accept-Encoding"]="gzip");var I,D,R,C=u.writeStream;function M(){G("Response timer ticking, timeout: %d",D),y=setTimeout(function(){y=null;var e="Response timeout for "+D+"ms";(b=new Error(e)).name="ResponseTimeoutError",b.requestId=c,G("ResponseTimeout: Request#%d %s %s: %s, connected: %s",c,a,b.name,e,g),P()},D)}G("Request#%d %s %s with headers %j, options.path: %s",c,r,a,h.headers,h.path),u.requestUrls.push(a),Array.isArray(u.timeout)?(I=W(u.timeout[0]),D=W(u.timeout[1])):I=D=W(u.timeout),G("ConnectTimeout: %d, ResponseTimeout: %d",I,D),h.mode=u.mode||"";try{R=i.request(h,function(i){var e;if(T&&(T.waiting=Date.now()-p),G("Request#%d %s `req response` event emit: status %d, headers: %j",c,a,i.statusCode,i.headers),u.streaming)return(e=A(i)).redirect?void i.resume():e.error?(i.resume(),O(e.error,null,i)):O(null,null,i);if(i.on("close",function(){G("Request#%d %s: `res close` event emit, total size %d",c,a,w)}),i.on("error",function(){G("Request#%d %s: `res error` event emit, total size %d",c,a,w)}),i.on("aborted",function(){x=!0,G("Request#%d %s: `res aborted` event emit, total size %d",c,a,w)}),C)return(e=A(i)).redirect?void i.resume():e.error?(i.resume(),C.end(),O(e.error,null,i)):(!1===u.consumeWriteStream?i.on("end",O.bind(null,null,null,i)):C.on("close",function(){G("Request#%d %s: writeStream close event emitted",c,a),O(b||null,null,i)}),i.pipe(C));var t=[];i.on("data",function(e){G("Request#%d %s: `res data` event emit, size %d",c,a,e.length),w+=e.length,t.push(e)}),i.on("end",function(){var e,n=Y.concat(t,w);return G("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",c,a,w,i._dumped),b?O(b,n,i):(e=A(i)).error?O(e.error,n,i):void(e.redirect||function(e,t,r){if(e)return O(e,n,i);if(!r&&0<=K.indexOf(u.dataType)){try{t=decodeBodyByCharset(t,i)}catch(e){return G("decodeBodyByCharset error: %s",e),O(null,t,i)}"json"===u.dataType&&(0===w?t=null:(r=parseJSON(t,N)).error?e=r.error:t=r.data)}x&&G("Request#%d %s: Remote socket was terminated before `response.end()` was called",c,a),O(e,t,i)}(null,n,i.headers["content-encoding"]))})})}catch(e){return O(e)}function P(){G("Request#%d %s abort, connected: %s",c,a,g),R.socket||(b.noSocket=!0,O(b)),R.abort()}return"undefined"==typeof window?(G("Connect timer ticking, timeout: %d",I),s=setTimeout(function(){s=null,-1===j&&(j=-2);var e="Connect timeout for "+I+"ms",t="ConnectionTimeoutError";R.socket||(t="SocketAssignTimeoutError",e+=", working sockets is full"),(b=new Error(e)).name=t,b.requestId=c,G("ConnectTimeout: Request#%d %s %s: %s, connected: %s",c,a,b.name,e,g),P()},I)):R.on("requestTimeout",function(){-1===j&&(j=-2);(b=new Error("Connect timeout for "+I+"ms")).name="ConnectionTimeoutError",b.requestId=c,P()}),T&&R.on("finish",function(){T.requestSent=Date.now()-p}),R.once("socket",function(e){T&&(T.queuing=Date.now()-p);var t=e.readyState;if("opening"===t)return e.once("lookup",function(e,t,r){G("Request#%d %s lookup: %s, %s, %s",c,a,e,t,r),T&&(T.dnslookup=Date.now()-p),t&&(k=t)}),void e.once("connect",function(){T&&(T.connected=Date.now()-p),E(),M(),G("Request#%d %s new socket connected",c,a),g=!0,k=k||e.remoteAddress,_=e.remotePort});G("Request#%d %s reuse socket connected, readyState: %s",c,a,t),v=g=!0,k=k||e.remoteAddress,_=e.remotePort,E(),M()}),R.on("error",function(e){"Error"!==e.name&&"TypeError"!==e.name||(e.name=g?"ResponseError":"RequestError"),e.message+=' (req "error")',G("Request#%d %s `req error` event emit, %s: %s",c,a,e.name,e.message),O(b||e)}),C&&C.once("error",function(e){e.message+=' (writeStream "error")',G("Request#%d %s `writeStream error` event emit, %s: %s",c,a,(b=e).name,e.message),P()}),u.stream?(u.stream.pipe(R),u.stream.once("error",function(e){e.message+=' (stream "error")',G("Request#%d %s `readStream error` event emit, %s: %s",c,a,(b=e).name,e.message),P()})):R.end(n),R.requestId=c,R}}.call(this)}.call(this,e("_process"),e("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,_process:467,buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.split.js":307,"core-js/modules/es.string.trim.js":308,debug:465,http:468,https:355,"humanize-ms":356,url:472,util:419}]},{},[1])(1)});})(window) +(function(global){!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).OSS=e()}(function(){return function n(i,o,s){function a(t,e){if(!o[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(c)return c(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=o[t]={exports:{}},i[t][0].call(r.exports,function(e){return a(i[t][1][e]||e)},r,r.exports,n,i,o,s)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e\n\n\n'.concat(t,"\n"),r&&(o+="".concat(r,"\n")),o+="\n",i.content=o,i.mime="xml",i.successStatuses=[200],e.next=9,this.request(i);case 9:return o=e.sent,e.abrupt("return",{res:o.res});case 11:case"end":return e.stop()}},e,this)}));return function(e,t,r){return n.apply(this,arguments)}}(),n.getBucketLogging=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n,i;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("GET",t,"logging",r)).successStatuses=[200],n.xmlResponse=!0,e.next=5,this.request(n);case 5:return n=e.sent,i=n.data.LoggingEnabled,e.abrupt("return",{enable:!!i,prefix:i&&i.TargetPrefix||null,res:n.res});case 8:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.deleteBucketLogging=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("DELETE",t,"logging",r)).successStatuses=[204,200],e.next=4,this.request(n);case 4:return n=e.sent,e.abrupt("return",{res:n.res});case 6:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.putBucketCORS=function(){var n=(0,o.default)(d.default.mark(function e(t,r,n){var i,o,s,a,c,u,l,f,p;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(h((r=r||[]).length,"rules is required"),r.forEach(function(e){h(e.allowedOrigin,"allowedOrigin is required"),h(e.allowedMethod,"allowedMethod is required")}),p=this._bucketRequestParams("PUT",t,"cors",n),i='\n',o=function(e){i+="".concat(e,"")},s=function(e){i+="".concat(e,"")},a=function(e){i+="".concat(e,"")},c=function(e){i+="".concat(e,"")},u=0,l=r.length;u",y(f.allowedOrigin).forEach(o),y(f.allowedMethod).forEach(s),y(f.allowedHeader).forEach(a),y(f.exposeHeader).forEach(c),f.maxAgeSeconds&&(i+="".concat(f.maxAgeSeconds,"")),i+="";return i+="",p.content=i,p.mime="xml",p.successStatuses=[200],e.next=16,this.request(p);case 16:return p=e.sent,e.abrupt("return",{res:p.res});case 18:case"end":return e.stop()}},e,this)}));return function(e,t,r){return n.apply(this,arguments)}}(),n.getBucketCORS=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n,i,o;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("GET",t,"cors",r)).successStatuses=[200],n.xmlResponse=!0,e.next=5,this.request(n);case 5:return n=e.sent,i=[],n.data&&n.data.CORSRule&&(o=s(o=n.data.CORSRule)?o:[o]).forEach(function(t){var r={};Object.keys(t).forEach(function(e){r[e.slice(0,1).toLowerCase()+e.slice(1,e.length)]=t[e]}),i.push(r)}),e.abrupt("return",{rules:i,res:n.res});case 9:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.deleteBucketCORS=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("DELETE",t,"cors",r)).successStatuses=[204],e.next=4,this.request(n);case 4:return n=e.sent,e.abrupt("return",{res:n.res});case 6:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.putBucketReferer=function(){var i=(0,o.default)(d.default.mark(function e(t,r,n,i){var o,s,a;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this._bucketRequestParams("PUT",t,"referer",i),o='\n\n',o+=" ".concat(r?"true":"false","\n"),n&&0\n",s=0;s".concat(n[s],"\n");o+=" \n"}else o+=" \n";return o+="",a.content=o,a.mime="xml",a.successStatuses=[200],e.next=10,this.request(a);case 10:return a=e.sent,e.abrupt("return",{res:a.res});case 12:case"end":return e.stop()}},e,this)}));return function(e,t,r,n){return i.apply(this,arguments)}}(),n.getBucketReferer=function(){var r=(0,o.default)(d.default.mark(function e(t,r){var n,i;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=this._bucketRequestParams("GET",t,"referer",r)).successStatuses=[200],n.xmlResponse=!0,e.next=5,this.request(n);case 5:return n=e.sent,(i=n.data.RefererList.Referer||null)&&!s(i)&&(i=[i]),e.abrupt("return",{allowEmpty:"true"===n.data.AllowEmptyReferer,referers:i,res:n.res});case 9:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n.deleteBucketReferer=function(){var r=(0,o.default)(d.default.mark(function e(t,r){return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.putBucketReferer(t,!0,null,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(e,t){return r.apply(this,arguments)}}(),n._bucketRequestParams=function(e,t,r,n){return{method:e,bucket:t,subres:r,additionalHeaders:n&&n.additionalHeaders,timeout:n&&n.timeout,ctx:n&&n.ctx}}},{"../common/utils/checkBucketName":52,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,assert:95,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/web.dom-collections.for-each.js":382}],3:[function(T,E,e){!function(k,_){!function(){"use strict";var e=T("@babel/runtime/helpers/interopRequireDefault"),c=e(T("@babel/runtime/regenerator")),r=e(T("@babel/runtime/helpers/asyncToGenerator")),e=(T("core-js/modules/es.function.name.js"),T("core-js/modules/es.object.assign.js"),T("core-js/modules/es.array.includes.js"),T("core-js/modules/es.regexp.exec.js"),T("core-js/modules/es.string.replace.js"),T("core-js/modules/es.array.concat.js"),T("core-js/modules/es.symbol.js"),T("core-js/modules/es.symbol.description.js"),T("core-js/modules/es.array.slice.js"),T("core-js/modules/es.object.to-string.js"),T("core-js/modules/es.promise.js"),T("core-js/modules/es.regexp.to-string.js"),T("debug")("ali-oss")),t=T("xml2js"),n=T("agentkeepalive"),i=T("merge-descriptors"),o=T("platform"),s=T("utility"),a=T("urllib"),u=T("./version"),l=T("bowser"),f=T("../common/signUtils"),p=T("../common/client/initOptions"),d=T("../common/utils/createRequest").createRequest,h=T("../common/utils/encoder").encoder,y=T("../common/client/getReqUrl").getReqUrl,m=T("../common/utils/setSTSToken").setSTSToken,b=T("../common/utils/retry").retry,g=T("../common/utils/isFunction").isFunction,v=T("../common/utils/getStandardRegion").getStandardRegion,j=new n;function w(e,t){var r,n;if(r=o.name,n=o.version,r&&r.toLowerCase&&"ie"===r.toLowerCase()&&n.split(".")[0]<10&&console.warn("ali-oss does not support the current browser"),!(this instanceof w))return new w(e,t);e&&e.inited?this.options=e:this.options=w.initOptions(e),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=a,this.agent=this.options.agent||j),this.ctx=t,this.userAgent=this._getUserAgent(),this.stsTokenFreshTime=new Date,this.options.amendTimeSkewed=0}(E.exports=w).initOptions=function(e){e.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");e=Object.assign({secure:location&&"https:"===location.protocol,useFetch:!1},e);return p(e)};n=w.prototype;function x(e){return S.apply(this,arguments)}function S(){return(S=(0,r.default)(c.default.mark(function e(t){var r,n,i,o,s,a;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.options.stsToken&&g(this.options.refreshSTSToken))return e.next=3,m.call(this);e.next=3;break;case 3:return r=d.call(this,t),this.options.useFetch||(r.params.mode="disable-fetch"),o=!!t.stream,e.prev=6,e.next=9,this.urllib.request(r.url,r.params);case 9:n=e.sent,this.debug("response %s %s, got %s, headers: %j",t.method,r.url,n.status,n.headers,"info"),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),i=e.t0;case 16:if(n&&t.successStatuses&&-1===t.successStatuses.indexOf(n.status))return e.next=19,this.requestError(n);e.next=28;break;case 19:if("RequestTimeTooSkewed"!==(s=e.sent).code||o){e.next=25;break}return this.options.amendTimeSkewed=+new Date(s.serverTime)-new Date,e.next=24,this.request(t);case 24:return e.abrupt("return",e.sent);case 25:s.params=t,e.next=32;break;case 28:if(i)return e.next=31,this.requestError(i);e.next=32;break;case 31:s=e.sent;case 32:if(s)throw s;e.next=34;break;case 34:if(t.xmlResponse)return e.next=37,this.parseXML(n.data);e.next=39;break;case 37:a=e.sent,n.data=a;case 39:return e.abrupt("return",n);case 40:case"end":return e.stop()}},e,this,[[6,13]])}))).apply(this,arguments)}n.debug=e,i(n,T("./object")),i(n,T("./bucket")),i(n,T("../common/bucket/getBucketWebsite")),i(n,T("../common/bucket/putBucketWebsite")),i(n,T("../common/bucket/deleteBucketWebsite")),i(n,T("../common/bucket/getBucketLifecycle")),i(n,T("../common/bucket/putBucketLifecycle")),i(n,T("../common/bucket/deleteBucketLifecycle")),i(n,T("../common/bucket/putBucketVersioning")),i(n,T("../common/bucket/getBucketVersioning")),i(n,T("../common/bucket/getBucketInventory")),i(n,T("../common/bucket/deleteBucketInventory")),i(n,T("../common/bucket/listBucketInventory")),i(n,T("../common/bucket/putBucketInventory")),i(n,T("../common/bucket/abortBucketWorm")),i(n,T("../common/bucket/completeBucketWorm")),i(n,T("../common/bucket/extendBucketWorm")),i(n,T("../common/bucket/getBucketWorm")),i(n,T("../common/bucket/initiateBucketWorm")),i(n,T("./managed-upload")),i(n,T("../common/multipart-copy")),i(n,T("../common/multipart")),i(n,T("../common/parallel")),n.signature=function(e){return this.debug("authorization stringToSign: %s",e,"info"),f.computeSignature(this.options.accessKeySecret,e,this.options.headerEncoding)},n._getReqUrl=y,n.authorization=function(e,t,r,n){e=f.buildCanonicalString(e.toUpperCase(),t,{headers:n,parameters:r});return f.authorization(this.options.accessKeyId,this.options.accessKeySecret,e,this.options.headerEncoding)},n.authorizationV4=function(e,t,r,n,i){return f.authorizationV4(this.options.accessKeyId,this.options.accessKeySecret,v(this.options.region),e,t,r,n,i,this.options.headerEncoding)},n.request=function(){var t=(0,r.default)(c.default.mark(function e(n){var i=this;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.options.retryMax)return e.next=3,b(x.bind(this),this.options.retryMax,{errorHandler:function(e){var t,r;return e=e,!(n.stream||(t=[-1,-2].includes(e.status),r=i.options.requestErrorRetryHandle||function(){return!0},!t)||!r(e))}})(n);e.next=6;break;case 3:return e.abrupt("return",e.sent);case 6:return e.abrupt("return",x.call(this,n));case 7:case"end":return e.stop()}},e,this)}));return function(e){return t.apply(this,arguments)}}(),n._getResource=function(e){var t="/";return e.bucket&&(t+="".concat(e.bucket,"/")),e.object&&(t+=h(e.object,this.options.headerEncoding)),t},n._escape=function(e){return s.encodeURIComponent(e).replace(/%2F/g,"/")},n._getUserAgent=function(){var e=_&&_.browser?"js":"nodejs",e="aliyun-sdk-".concat(e,"/").concat(u.version),t=o.description;return!t&&_&&(t="Node.js ".concat(_.version.slice(1)," on ").concat(_.platform," ").concat(_.arch)),this._checkUserAgent("".concat(e," ").concat(t))},n._checkUserAgent=function(e){return e.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},n.checkBrowserAndVersion=function(e,t){return l.name===e&&l.version.split(".")[0]===t},n.parseXML=function(e){return new Promise(function(r,n){k.isBuffer(e)&&(e=e.toString()),t.parseString(e,{explicitRoot:!1,explicitArray:!1},function(e,t){e?n(e):r(t)})})},n.requestError=function(){var t=(0,r.default)(c.default.mark(function e(t){var r,n,i,o;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=null,t.data&&t.data.length?e.next=5:(-1===t.status||-2===t.status?((r=new Error(t.message)).name=t.name,r.status=t.status,r.code=t.name):(404===t.status?((r=new Error("Object not exists")).name="NoSuchKeyError",r.status=404,r.code="NoSuchKey"):412===t.status?((r=new Error("Pre condition failed")).name="PreconditionFailedError",r.status=412,r.code="PreconditionFailed"):((r=new Error("Unknow error, status: ".concat(t.status))).name="UnknownError",r.status=t.status),r.requestId=t.headers["x-oss-request-id"],r.host=""),e.next=32);break;case 5:return n=String(t.data),this.debug("request response error data: %s",n,"error"),e.prev=7,e.next=10,this.parseXML(n);case 10:if(e.t0=e.sent,e.t0){e.next=13;break}e.t0={};case 13:i=e.t0,e.next=23;break;case 16:return e.prev=16,e.t1=e.catch(7),this.debug(n,"error"),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 23:o=i.Message||"unknow request error, status: ".concat(t.status),i.Condition&&(o+=" (condition: ".concat(i.Condition,")")),(r=new Error(o)).name=i.Code?"".concat(i.Code,"Error"):"UnknownError",r.status=t.status,r.code=i.Code,r.requestId=i.RequestId,r.hostId=i.HostId,r.serverTime=i.ServerTime;case 32:return this.debug("generate error %j",r,"error"),e.abrupt("return",r);case 34:case"end":return e.stop()}},e,this,[[7,16]])}));return function(e){return t.apply(this,arguments)}}()}.call(this)}.call(this,{isBuffer:T("../../node_modules/is-buffer/index.js")},T("_process"))},{"../../node_modules/is-buffer/index.js":411,"../common/bucket/abortBucketWorm":7,"../common/bucket/completeBucketWorm":8,"../common/bucket/deleteBucketInventory":9,"../common/bucket/deleteBucketLifecycle":10,"../common/bucket/deleteBucketWebsite":11,"../common/bucket/extendBucketWorm":12,"../common/bucket/getBucketInventory":13,"../common/bucket/getBucketLifecycle":14,"../common/bucket/getBucketVersioning":15,"../common/bucket/getBucketWebsite":16,"../common/bucket/getBucketWorm":17,"../common/bucket/initiateBucketWorm":18,"../common/bucket/listBucketInventory":19,"../common/bucket/putBucketInventory":20,"../common/bucket/putBucketLifecycle":21,"../common/bucket/putBucketVersioning":22,"../common/bucket/putBucketWebsite":23,"../common/client/getReqUrl":25,"../common/client/initOptions":26,"../common/multipart":30,"../common/multipart-copy":29,"../common/parallel":50,"../common/signUtils":51,"../common/utils/createRequest":57,"../common/utils/encoder":61,"../common/utils/getStandardRegion":64,"../common/utils/isFunction":71,"../common/utils/retry":77,"../common/utils/setSTSToken":79,"./bucket":2,"./managed-upload":4,"./object":5,"./version":6,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,_process:540,agentkeepalive:94,bowser:101,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347,"core-js/modules/es.symbol.description.js":353,"core-js/modules/es.symbol.js":356,debug:538,"merge-descriptors":430,platform:442,urllib:548,utility:547,xml2js:498}],4:[function(i,e,o){!function(s){!function(){"use strict";var e=i("@babel/runtime/helpers/interopRequireDefault"),b=e(i("@babel/runtime/regenerator")),g=(i("core-js/modules/es.function.name.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.array.from.js"),i("core-js/modules/es.string.iterator.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.array.filter.js"),i("core-js/modules/es.array.find.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.array.iterator.js"),i("core-js/modules/es.array-buffer.slice.js"),i("core-js/modules/es.typed-array.uint8-array.js"),i("core-js/modules/es.typed-array.copy-within.js"),i("core-js/modules/es.typed-array.every.js"),i("core-js/modules/es.typed-array.fill.js"),i("core-js/modules/es.typed-array.filter.js"),i("core-js/modules/es.typed-array.find.js"),i("core-js/modules/es.typed-array.find-index.js"),i("core-js/modules/es.typed-array.for-each.js"),i("core-js/modules/es.typed-array.includes.js"),i("core-js/modules/es.typed-array.index-of.js"),i("core-js/modules/es.typed-array.iterator.js"),i("core-js/modules/es.typed-array.join.js"),i("core-js/modules/es.typed-array.last-index-of.js"),i("core-js/modules/es.typed-array.map.js"),i("core-js/modules/es.typed-array.reduce.js"),i("core-js/modules/es.typed-array.reduce-right.js"),i("core-js/modules/es.typed-array.reverse.js"),i("core-js/modules/es.typed-array.set.js"),i("core-js/modules/es.typed-array.slice.js"),i("core-js/modules/es.typed-array.some.js"),i("core-js/modules/es.typed-array.sort.js"),i("core-js/modules/es.typed-array.subarray.js"),i("core-js/modules/es.typed-array.to-locale-string.js"),i("core-js/modules/es.typed-array.to-string.js"),e(i("@babel/runtime/helpers/asyncToGenerator"))),e=i("util"),f=i("path"),p=i("mime"),v=i("copy-to"),d=i("../common/utils/isBlob").isBlob,h=i("../common/utils/isFile").isFile,y=i("../common/utils/isBuffer").isBuffer,t=o;t.multipartUpload=function(){var r=(0,g.default)(b.default.mark(function e(t,r){var n,i,o,s,a,c,u,l=arguments;return b.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=2this.fileBuffer.length?this.fileBuffer.length:n;this.start=n,t=this.push(this.fileBuffer.slice(r,n))}},n.prototype._read=function(t){var r;this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||0===this.start&&!this.file?(this.finish||(this.fileBuffer=null,this.finish=!0),this.push(null)):(t=t||16384,r=this,this.reader.onload=function(e){r.fileBuffer=s.from(new Uint8Array(e.target.result)),r.file=null,r.readFileAndPush(t)},0===this.start?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(t))},t._createBuffer=function(){var n=(0,g.default)(b.default.mark(function e(t,r,i){var o;return b.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!d(t)&&!h(t)){e.next=8;break}o=t.slice(r,i),e.next=4;var n=o;return n.arrayBuffer?n.arrayBuffer():new Promise(function(t,r){var e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=function(e){r(e)},e.readAsArrayBuffer(n)});case 4:return o=e.sent,e.abrupt("return",s.from(o));case 8:if(y(t))return e.abrupt("return",t.subarray(r,i));e.next=12;break;case 12:throw new Error("_createBuffer requires File/Blob/Buffer.");case 13:case"end":return e.stop()}},e)}));return function(e,t,r){return n.apply(this,arguments)}}(),t._getPartSize=function(e,t){t=t||1048576;e=Math.ceil(e/1e4);return t\n\n',a=0;a\n")+"".concat(c.number,"\n"))+"".concat(c.etag,"\n")+"\n";return s+="",f={},(f=h(i=i||{},function(e){if(y(e))return null})).subres={uploadId:r},f.headers=m(f.headers,["x-oss-server-side-encryption","x-oss-storage-class"]),u=this._objectRequestParams("POST",t,f),d.encodeCallback(u,f),u.mime="xml",u.content=s,u.headers&&u.headers["x-oss-callback"]||(u.xmlResponse=!0),u.successStatuses=[200],e.next=17,this.request(u);case 17:if(l=e.sent,i.progress)return e.next=21,i.progress(1,null,l.res);e.next=21;break;case 21:return f={res:l.res,bucket:u.bucket,name:t,etag:l.res.headers.etag},u.headers&&u.headers["x-oss-callback"]&&(f.data=JSON.parse(l.data.toString())),e.abrupt("return",f);case 24:case"end":return e.stop()}},e,this)}));return function(e,t,r,n){return i.apply(this,arguments)}}(),e._uploadPart=function(){var o=(0,t.default)(p.default.mark(function e(t,r,n,i,o){var s,a,c;return p.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s={},u(o=o||{}).to(s),s.headers=s.headers||{},s.headers["Content-Length"]=i.size,s.headers=m(s.headers,["x-oss-server-side-encryption"]),s.subres={partNumber:n,uploadId:r},(a=this._objectRequestParams("PUT",t,s)).mime=s.mime,l&&l.browser?a.content=i.content:a.stream=i.stream,a.successStatuses=[200],a.disabledMD5=o.disabledMD5,e.next=15,this.request(a);case 15:if((c=e.sent).res.headers.etag){e.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 18:return i.stream&&(i.stream=null,a.stream=null),e.abrupt("return",{name:t,etag:c.res.headers.etag,res:c.res});case 20:case"end":return e.stop()}},e,this)}));return function(e,t,r,n,i){return o.apply(this,arguments)}}()}.call(this)}.call(this,r("_process"))},{"./callback":24,"./utils/deepCopy":59,"./utils/isBuffer":68,"./utils/omit":76,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,_process:540,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.sort.js":320,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.to-string.js":341}],31:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault"),l=n(e("@babel/runtime/regenerator")),i=(e("core-js/modules/es.regexp.exec.js"),n(e("@babel/runtime/helpers/asyncToGenerator"))),f=e("url"),p=e("utility"),d=e("copy-to"),h=e("../../common/signUtils"),y=e("../utils/isIP").isIP,m=e("../utils/setSTSToken").setSTSToken,b=e("../utils/isFunction").isFunction;r.asyncSignatureUrl=function(){var r=(0,i.default)(l.default.mark(function e(t,r){var n,i,o,s,a,c,u=arguments;return l.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(2t[0]?1:e[0]").concat(e[t],""):"object"===o(e[t])?n+="<".concat(t,">").concat(r(e[t]),""):"array"===o(e[t])?n+=e[t].map(function(e){return"<".concat(t,">").concat(r(e),"")}).join(""):n+="<".concat(t,">").concat(e[t].toString(),""))}):n+=e.toString(),n}},{"./formatObjKey":63,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.map.js":318,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/es.string.replace.js":347,"core-js/modules/web.dom-collections.for-each.js":382}],76:[function(e,t,r){"use strict";function o(e,t){var r,n,i,o,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return n=!(r=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return r=e.done,e},e:function(e){n=!0,i=e},f:function(){try{r||null==s.return||s.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(s=function(e,t){var r;if(e)return"string"==typeof e?a(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.options.refreshSTSTokenInterval)return this.stsTokenFreshTime=t,e.next=7,this.options.refreshSTSToken();e.next=12}else e.next=14;break;case 7:r=e.sent,(r=s.formatObjKey(r,"firstLowerCase")).securityToken&&(r.stsToken=r.securityToken),c(r),Object.assign(this.options,r);case 12:e.next=15;break;case 14:this.stsTokenFreshTime=t;case 15:return e.abrupt("return",null);case 16:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function c(e){var r=Object.keys(e);["accessKeySecret","accessKeyId","stsToken"].forEach(function(t){if(!r.find(function(e){return e===t}))throw Error("refreshSTSToken must return contains ".concat(t))})}r.setSTSToken=function(){return a.apply(this,arguments)},r.checkCredentials=c},{"./formatObjKey":63,"@babel/runtime/helpers/asyncToGenerator":82,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/regenerator":93,"core-js/modules/es.array.find.js":313,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331}],80:[function(e,t,r){t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===n&&(t=c[e.charCodeAt(r)]<<2|c[e.charCodeAt(r+1)]>>4,o[s++]=255&t);1===n&&(t=c[e.charCodeAt(r)]<<10|c[e.charCodeAt(r+1)]<<4|c[e.charCodeAt(r+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return i.join("")}(e,o,s>2]+a[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;it[1][r])return 1;if(t[0][r]!==t[1][r])return-1;if(0===r)return 0}}function o(e,t,r){var n,i=a,o=("string"==typeof t&&(r=t,t=void 0),void 0===t&&(t=!1),""+(i=r?s(r):i).version);for(n in e)if(e.hasOwnProperty(n)&&i[n]){if("string"!=typeof e[n])throw new Error("Browser version in the minVersion map should be a string: "+n+": "+String(e));return x([o,e[n]])<0}return t}return a.test=function(e){for(var t=0;t>>1;case"base64":return E(e).length;default:if(i)return n?-1:T(e).length;t=(""+t).toLowerCase(),i=!0}}function r(e,t,r){var n,i=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var o=this,s=t,a=r,c=o.length;(!a||a<0||c=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:h(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):h(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,n,i){var o=1,s=e.length,a=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/=o=2,a/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var u=-1,l=r;l>8,i.push(r%256),i.push(n);return i}(t,e.length-r),e,r,n)}function _(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}var p=n,d=p.length;if(d<=g)return String.fromCharCode.apply(String,p);for(var h="",y=0;yt&&(e+=" ... "),""},f.prototype.compare=function(e,t,r,n,i){if(A(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.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=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),u=e.slice(t,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||ithis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,c=!1;;)switch(n){case"hex":var u=this,l=e,f=t,p=r,d=(f=Number(f)||0,u.length-f);(!p||d<(p=Number(p)))&&(p=d),(d=l.length)/2e.length)throw new RangeError("Index out of range")}function j(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function w(e,t,r,n,i){return t=+t,r>>>=0,i||j(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,i){return t=+t,r>>>=0,i||j(e,0,r,8),o.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e+--t],i=1;0>>=0,t||y(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||y(e,t,this.length);for(var n=t,i=1,o=this[e+--n];0>>=0,t||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},f.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},f.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||v(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||v(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,255,0),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(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},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(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},f.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||v(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||v(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||v(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},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||v(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},f.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(!f.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var i=(n=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>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 E(e){return k.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}}.call(this)}.call(this,D("buffer").Buffer)},{"base64-js":100,buffer:103,ieee754:402}],104:[function(e,t,r){t.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"}},{}],105:[function(e,t,r){"use strict";var n=e("get-intrinsic"),i=e("./"),o=i(n("String.prototype.indexOf"));t.exports=function(e,t){t=n(e,!!t);return"function"==typeof t&&-1>8&255]}function i(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function t(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function B(e){return M(V(e),23,4)}function q(e){return M(e,52,8)}function o(e,t,r){W(e[k],t,{configurable:!0,get:function(){return r(this)[t]}})}function s(e,t,r,n){if(e=E(e),r=b(r),n=!!n,r+t>e.byteLength)throw new C(_);var i=e.bytes,r=r+e.byteOffset,e=K(i,r,r+t);return n?e:ee(e)}function a(e,t,r,n,i,o){var e=E(e),r=b(r),s=n(+i),a=!!o;if(r+t>e.byteLength)throw new C(_);for(var c=e.bytes,u=r+e.byteOffset,l=0;l>24)},setUint8:function(e,t){u(this,e,t<<24>>24)}},{unsafe:!0})):(D=(I=function(e){m(this,D);e=b(e);O(this,{type:x,bytes:Q(Z(e),0),byteLength:e}),p||(this.byteLength=e,this.detached=!1)})[k],R=(d=function(e,t,r){m(this,R),m(e,D);var n=T(e),i=n.byteLength,t=G(t);if(t<0||i>24},getUint8:function(e){return s(this,1,e)[0]},getInt16:function(e){e=s(this,2,e,1>16},getUint16:function(e){e=s(this,2,e,1>>0},getFloat32:function(e){return P(s(this,4,e,1]*>)/g,b=/\$([$&'`]|\d{1,2})/g;t.exports=function(o,s,a,c,u,e){var l=a+o.length,f=c.length,t=b;return void 0!==u&&(u=i(u),t=m),h(e,t,function(e,t){var r;switch(d(t,0)){case"$":return"$";case"&":return o;case"`":return y(s,0,a);case"'":return y(s,l);case"<":r=u[y(t,1,-1)];break;default:var n,i=+t;if(0==i)return e;if(f>1,u=23===t?h(2,-24)-h(2,-77):0,l=e<0||0===e&&1/e<0?1:0,f=0;for((e=d(e))!=e||e===1/0?(i=e!=e?1:0,n=r):(n=y(m(e)/b),e*(o=h(2,-n))<1&&(n--,o*=2),2<=(e+=1<=n+c?u/o:u*h(2,1-c))*o&&(n++,o/=2),r<=n+c?(i=0,n=r):1<=n+c?(i=(e*o-1)*h(2,t),n+=c):(i=e*h(2,c-1)*h(2,t),n=0));8<=t;)s[f++]=255&i,i/=256,t-=8;for(n=n<>1,a=i-7,c=n-1,i=e[c--],u=127&i;for(i>>=7;0>=-a,a+=t;0"+e+""},m=function(){try{o=new ActiveXObject("htmlfile")}catch(e){}m="undefined"==typeof document||document.domain&&o?i(o):(e=f("iframe"),t="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(y("document.F=Object")),t.close(),t.F);for(var e,t,r=c.length;r--;)delete m[p][c[r]];return m()};u[h]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(n[p]=s(e),r=new n,n[p]=null,r[h]=e):r=m(),void 0===t?r:a.f(r,t)}},{"../internals/an-object":114,"../internals/document-create-element":154,"../internals/enum-bug-keys":169,"../internals/hidden-keys":190,"../internals/html":192,"../internals/object-define-properties":230,"../internals/shared-key":267}],230:[function(e,t,r){"use strict";var n=e("../internals/descriptors"),i=e("../internals/v8-prototype-define-bug"),a=e("../internals/object-define-property"),c=e("../internals/an-object"),u=e("../internals/to-indexed-object"),l=e("../internals/object-keys");r.f=n&&!i?Object.defineProperties:function(e,t){c(e);for(var r,n=u(t),i=l(t),o=i.length,s=0;si;)!s(n,r=t[i++])||~c(o,r)||l(o,r);return o}},{"../internals/array-includes":124,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/to-indexed-object":282}],240:[function(e,t,r){"use strict";var n=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return n(e,i)}},{"../internals/enum-bug-keys":169,"../internals/object-keys-internal":239}],241:[function(e,t,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);r.f=o?function(e){e=i(this,e);return!!e&&e.enumerable}:n},{}],242:[function(e,t,r){"use strict";var i=e("../internals/function-uncurry-this-accessor"),o=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=i(Object.prototype,"__proto__","set"))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return o(e),s(t),n?r(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":110,"../internals/an-object":114,"../internals/function-uncurry-this-accessor":179}],243:[function(e,t,r){"use strict";function n(c){return function(e){for(var t,r=p(e),n=f(r),i=y&&null===l(r),o=n.length,s=0,a=[];sb)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})},{"../internals/fails":171,"../internals/global":188}],262:[function(e,t,r){"use strict";var n=e("../internals/is-null-or-undefined"),i=TypeError;t.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},{"../internals/is-null-or-undefined":207}],263:[function(e,t,r){"use strict";var n=e("../internals/global"),i=e("../internals/descriptors"),o=Object.getOwnPropertyDescriptor;t.exports=function(e){var t;return i?(t=o(n,e))&&t.value:n[e]}},{"../internals/descriptors":153,"../internals/global":188}],264:[function(e,t,r){"use strict";t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},{}],265:[function(e,t,r){"use strict";var n=e("../internals/get-built-in"),i=e("../internals/define-built-in-accessor"),o=e("../internals/well-known-symbol"),s=e("../internals/descriptors"),a=o("species");t.exports=function(e){e=n(e);s&&e&&!e[a]&&i(e,a,{configurable:!0,get:function(){return this}})}},{"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/get-built-in":182,"../internals/well-known-symbol":306}],266:[function(e,t,r){"use strict";var n=e("../internals/object-define-property").f,i=e("../internals/has-own-property"),o=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,r){(e=e&&!r?e.prototype:e)&&!i(e,o)&&n(e,o,{configurable:!0,value:t})}},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/well-known-symbol":306}],267:[function(e,t,r){"use strict";var n=e("../internals/shared"),i=e("../internals/uid"),o=n("keys");t.exports=function(e){return o[e]||(o[e]=i(e))}},{"../internals/shared":269,"../internals/uid":299}],268:[function(e,t,r){"use strict";var n=e("../internals/global"),e=e("../internals/define-global-property"),i="__core-js_shared__",n=n[i]||e(i,{});t.exports=n},{"../internals/define-global-property":151,"../internals/global":188}],269:[function(e,t,r){"use strict";var n=e("../internals/is-pure"),i=e("../internals/shared-store");(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.35.0",mode:n?"pure":"global",copyright:"\xa9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":210,"../internals/shared-store":268}],270:[function(e,t,r){"use strict";var n=e("../internals/an-object"),i=e("../internals/a-constructor"),o=e("../internals/is-null-or-undefined"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var e=n(e).constructor;return void 0===e||o(e=n(e)[s])?t:i(e)}},{"../internals/a-constructor":109,"../internals/an-object":114,"../internals/is-null-or-undefined":207,"../internals/well-known-symbol":306}],271:[function(e,t,r){"use strict";function n(i){return function(e,t){var r,e=s(a(e)),t=o(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=u(e,t))<55296||56319=t.length)return e.target=void 0,u(void 0,!0);switch(e.kind){case"keys":return u(r,!1);case"values":return u(t[r],!1)}return u([r,t[r]],!1)},"values"),o.Arguments=o.Array);if(i("keys"),i("values"),i("entries"),!l&&e&&"values"!==s.name)try{a(s,"name",{value:"values"})}catch(e){}},{"../internals/add-to-unscopables":111,"../internals/create-iter-result-object":144,"../internals/descriptors":153,"../internals/internal-state":199,"../internals/is-pure":210,"../internals/iterator-define":216,"../internals/iterators":218,"../internals/object-define-property":231,"../internals/to-indexed-object":282}],317:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/function-uncurry-this"),o=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),a=i([].join);n({target:"Array",proto:!0,forced:o!==Object||!e("join",",")},{join:function(e){return a(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":128,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/to-indexed-object":282}],318:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/array-iteration").map;n({target:"Array",proto:!0,forced:!e("../internals/array-method-has-species-support")("map")},{map:function(e){return i(this,e,1f(t)?1:-1})),r=u(i),s=0;si;i++)p(t,r=n[i])&&!p(e,r)&&j(e,r,v(t,r))}var o=e("../internals/export"),s=e("../internals/is-pure"),a=e("../internals/descriptors"),c=e("../internals/global"),u=e("../internals/path"),l=e("../internals/function-uncurry-this"),f=e("../internals/is-forced"),p=e("../internals/has-own-property"),d=e("../internals/inherit-if-required"),h=e("../internals/object-is-prototype-of"),y=e("../internals/is-symbol"),m=e("../internals/to-primitive"),b=e("../internals/fails"),g=e("../internals/object-get-own-property-names").f,v=e("../internals/object-get-own-property-descriptor").f,j=e("../internals/object-define-property").f,w=e("../internals/this-number-value"),x=e("../internals/string-trim").trim,e="Number",S=c[e],k=u[e],_=S.prototype,T=c.TypeError,E=l("".slice),O=l("".charCodeAt),A=function(e){var t,r,n,i,o,s,a,c=m(e,"number");if(y(c))throw new T("Cannot convert a Symbol value to a number");if("string"==typeof c&&2a;)void 0!==(r=i(n,t=o[a++]))&&f(s,t,r);return s}})},{"../internals/create-property":147,"../internals/descriptors":153,"../internals/export":170,"../internals/object-get-own-property-descriptor":232,"../internals/own-keys":246,"../internals/to-indexed-object":282}],329:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/symbol-constructor-detection"),o=e("../internals/fails"),s=e("../internals/object-get-own-property-symbols"),a=e("../internals/to-object");n({target:"Object",stat:!0,forced:!i||o(function(){s.f(1)})},{getOwnPropertySymbols:function(e){var t=s.f;return t?t(a(e)):[]}})},{"../internals/export":170,"../internals/fails":171,"../internals/object-get-own-property-symbols":235,"../internals/symbol-constructor-detection":274,"../internals/to-object":285}],330:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/to-object"),o=e("../internals/object-keys");n({target:"Object",stat:!0,forced:e("../internals/fails")(function(){o(1)})},{keys:function(e){return o(i(e))}})},{"../internals/export":170,"../internals/fails":171,"../internals/object-keys":240,"../internals/to-object":285}],331:[function(e,t,r){"use strict";var n=e("../internals/to-string-tag-support"),i=e("../internals/define-built-in"),e=e("../internals/object-to-string");n||i(Object.prototype,"toString",e,{unsafe:!0})},{"../internals/define-built-in":149,"../internals/object-to-string":244,"../internals/to-string-tag-support":290}],332:[function(e,t,r){"use strict";var n=e("../internals/export"),l=e("../internals/function-call"),f=e("../internals/a-callable"),i=e("../internals/new-promise-capability"),o=e("../internals/perform"),p=e("../internals/iterate");n({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{all:function(e){var a=this,t=i.f(a),c=t.resolve,u=t.reject,r=o(function(){var n=f(a.resolve),i=[],o=0,s=1;p(e,function(e){var t=o++,r=!1;s++,l(n,a,e).then(function(e){r||(r=!0,i[t]=e,--s)||c(i)},u)}),--s||c(i)});return r.error&&u(r.value),t.promise}})},{"../internals/a-callable":108,"../internals/export":170,"../internals/function-call":177,"../internals/iterate":213,"../internals/new-promise-capability":226,"../internals/perform":248,"../internals/promise-statics-incorrect-iteration":252}],333:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/is-pure"),o=e("../internals/promise-constructor-detection").CONSTRUCTOR,s=e("../internals/promise-native-constructor"),a=e("../internals/get-built-in"),c=e("../internals/is-callable"),e=e("../internals/define-built-in"),u=s&&s.prototype;n({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&c(s)&&(n=a("Promise").prototype.catch,u.catch!==n)&&e(u,"catch",n,{unsafe:!0})},{"../internals/define-built-in":149,"../internals/export":170,"../internals/get-built-in":182,"../internals/is-callable":203,"../internals/is-pure":210,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250}],334:[function(e,N,L){"use strict";function o(e,t){var r,n,i,o,s=t.value,a=t.state===T,c=a?e.ok:e.fail,u=e.resolve,l=e.reject,f=e.domain;try{c?(a||(t.rejection===O&&(o=t,h(y,d,function(){var e=o.facade;p?S.emit("rejectionHandled",e):D(Q,e,o.value)})),t.rejection=E),!0===c?r=s:(f&&f.enter(),r=c(s),f&&(f.exit(),i=!0)),r===e.promise?l(new w("Promise-chain cycle")):(n=A(r))?h(n,r,u,l):u(r)):l(s)}catch(e){f&&!i&&f.exit(),l(e)}}var r,t,n,B=e("../internals/export"),q=e("../internals/is-pure"),p=e("../internals/engine-is-node"),d=e("../internals/global"),h=e("../internals/function-call"),i=e("../internals/define-built-in"),s=e("../internals/object-set-prototype-of"),F=e("../internals/set-to-string-tag"),U=e("../internals/set-species"),W=e("../internals/a-callable"),a=e("../internals/is-callable"),G=e("../internals/is-object"),z=e("../internals/an-instance"),V=e("../internals/species-constructor"),y=e("../internals/task").set,c=e("../internals/microtask"),X=e("../internals/host-report-errors"),H=e("../internals/perform"),K=e("../internals/queue"),u=e("../internals/internal-state"),l=e("../internals/promise-native-constructor"),f=e("../internals/promise-constructor-detection"),e=e("../internals/new-promise-capability"),m="Promise",b=f.CONSTRUCTOR,$=f.REJECTION_EVENT,f=f.SUBCLASSING,g=u.getterFor(m),Y=u.set,u=l&&l.prototype,v=l,j=u,w=d.TypeError,x=d.document,S=d.process,k=e.f,J=k,Z=!!(x&&x.createEvent&&d.dispatchEvent),_="unhandledrejection",Q="rejectionhandled",T=1,ee=2,E=1,O=2,A=function(e){var t;return!(!G(e)||!a(t=e.then))&&t},I=function(r,i){r.notified||(r.notified=!0,c(function(){for(var e,n,t=r.reactions;e=t.get();)o(e,r);r.notified=!1,i&&!r.rejection&&(n=r,h(y,d,function(){var e=n.facade,t=n.value,r=R(n);if(r&&(r=H(function(){p?S.emit("unhandledRejection",t,e):D(_,e,t)}),n.rejection=p||R(n)?O:E,r.error))throw r.value}))}))},D=function(e,t,r){var n;Z?((n=x.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),d.dispatchEvent(n)):n={promise:t,reason:r},!$&&(t=d["on"+e])?t(n):e===_&&X("Unhandled promise rejection",r)},R=function(e){return e.rejection!==E&&!e.parent},C=function(t,r,n){return function(e){t(r,e,n)}},M=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=ee,I(e,!0))},P=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new w("Promise can't be resolved itself");var n=A(e);n?c(function(){var t={done:!1};try{h(n,e,C(P,t,r),C(M,t,r))}catch(e){M(t,e,r)}}):(r.value=e,r.state=T,I(r,!1))}catch(e){M({done:!1},e,r)}}};if(b&&(j=(v=function(e){z(this,j),W(e),h(r,this);var t=g(this);try{e(C(P,t),C(M,t))}catch(e){M(t,e)}}).prototype,(r=function(e){Y(this,{type:m,done:!1,notified:!1,parent:!1,reactions:new K,rejection:!1,state:0,value:void 0})}).prototype=i(j,"then",function(e,t){var r=g(this),n=k(V(this,v));return r.parent=!0,n.ok=!a(e)||e,n.fail=a(t)&&t,n.domain=p?S.domain:void 0,0===r.state?r.reactions.add(n):c(function(){o(n,r)}),n.promise}),t=function(){var e=new r,t=g(e);this.promise=e,this.resolve=C(P,t),this.reject=C(M,t)},e.f=k=function(e){return e===v||void 0===e?new t:J(e)},!q)&&a(l)&&u!==Object.prototype){n=u.then,f||i(u,"then",function(e,t){var r=this;return new v(function(e,t){h(n,r,e,t)}).then(e,t)},{unsafe:!0});try{delete u.constructor}catch(e){}s&&s(u,j)}B({global:!0,constructor:!0,wrap:!0,forced:b},{Promise:v}),F(v,m,!1,!0),U(m)},{"../internals/a-callable":108,"../internals/an-instance":113,"../internals/define-built-in":149,"../internals/engine-is-node":164,"../internals/export":170,"../internals/function-call":177,"../internals/global":188,"../internals/host-report-errors":191,"../internals/internal-state":199,"../internals/is-callable":203,"../internals/is-object":208,"../internals/is-pure":210,"../internals/microtask":225,"../internals/new-promise-capability":226,"../internals/object-set-prototype-of":242,"../internals/perform":248,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250,"../internals/queue":254,"../internals/set-species":265,"../internals/set-to-string-tag":266,"../internals/species-constructor":270,"../internals/task":277}],335:[function(e,t,r){"use strict";e("../modules/es.promise.constructor"),e("../modules/es.promise.all"),e("../modules/es.promise.catch"),e("../modules/es.promise.race"),e("../modules/es.promise.reject"),e("../modules/es.promise.resolve")},{"../modules/es.promise.all":332,"../modules/es.promise.catch":333,"../modules/es.promise.constructor":334,"../modules/es.promise.race":336,"../modules/es.promise.reject":337,"../modules/es.promise.resolve":338}],336:[function(e,t,r){"use strict";var n=e("../internals/export"),o=e("../internals/function-call"),s=e("../internals/a-callable"),a=e("../internals/new-promise-capability"),c=e("../internals/perform"),u=e("../internals/iterate");n({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{race:function(e){var r=this,n=a.f(r),i=n.reject,t=c(function(){var t=s(r.resolve);u(e,function(e){o(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}})},{"../internals/a-callable":108,"../internals/export":170,"../internals/function-call":177,"../internals/iterate":213,"../internals/new-promise-capability":226,"../internals/perform":248,"../internals/promise-statics-incorrect-iteration":252}],337:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/new-promise-capability");n({target:"Promise",stat:!0,forced:e("../internals/promise-constructor-detection").CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},{"../internals/export":170,"../internals/new-promise-capability":226,"../internals/promise-constructor-detection":249}],338:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/get-built-in"),o=e("../internals/is-pure"),s=e("../internals/promise-native-constructor"),a=e("../internals/promise-constructor-detection").CONSTRUCTOR,c=e("../internals/promise-resolve"),u=i("Promise"),l=o&&!a;n({target:"Promise",stat:!0,forced:o||a},{resolve:function(e){return c(l&&this===u?s:this,e)}})},{"../internals/export":170,"../internals/get-built-in":182,"../internals/is-pure":210,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250,"../internals/promise-resolve":251}],339:[function(e,N,L){"use strict";var t=e("../internals/descriptors"),r=e("../internals/global"),n=e("../internals/function-uncurry-this"),i=e("../internals/is-forced"),u=e("../internals/inherit-if-required"),l=e("../internals/create-non-enumerable-property"),f=e("../internals/object-create"),o=e("../internals/object-get-own-property-names").f,p=e("../internals/object-is-prototype-of"),d=e("../internals/is-regexp"),h=e("../internals/to-string"),y=e("../internals/regexp-get-flags"),s=e("../internals/regexp-sticky-helpers"),a=e("../internals/proxy-accessor"),c=e("../internals/define-built-in"),m=e("../internals/fails"),b=e("../internals/has-own-property"),g=e("../internals/internal-state").enforce,v=e("../internals/set-species"),j=e("../internals/well-known-symbol"),w=e("../internals/regexp-unsupported-dot-all"),x=e("../internals/regexp-unsupported-ncg"),S=j("match"),k=r.RegExp,_=k.prototype,T=r.SyntaxError,B=n(_.exec),E=n("".charAt),O=n("".replace),A=n("".indexOf),q=n("".slice),F=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,D=/a/g,e=new k(I)!==I,R=s.MISSED_STICKY,U=s.UNSUPPORTED_Y,j=t&&(!e||R||w||x||m(function(){return D[S]=!1,k(I)!==I||k(D)===D||"/a/i"!==String(k(I,"i"))}));if(i("RegExp",j)){for(var C=function(e,t){var r,n,i=p(_,this),o=d(e),s=void 0===t,a=[],c=e;if(!i&&o&&s&&e.constructor===C)return e;if((o||p(_,e))&&(e=e.source,s)&&(t=y(c)),e=void 0===e?"":h(e),t=void 0===t?"":h(t),c=e,o=t=w&&"dotAll"in I&&(r=!!t&&-1"===t&&c:if(""===l||b(s,l))throw new T("Invalid capture group name");s[l]=!0,c=!(o[o.length]=[l,u]),l="";continue}c?l+=t:i+=t}return[i,o]}(e))[0],a=s[1]),s=u(k(e,t),i?this:_,C),(r||n||a.length)&&(t=g(s),r&&(t.dotAll=!0,t.raw=C(function(e){for(var t,r=e.length,n=0,i="",o=!1;n<=r;n++)"\\"===(t=E(e,n))?i+=t+E(e,++n):o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]";return i}(e),o)),n&&(t.sticky=!0),a.length)&&(t.groups=a),e!==c)try{l(s,"source",""===c?"(?:)":c)}catch(e){}return s},M=o(k),P=0;M.length>P;)a(C,k,M[P++]);(_.constructor=C).prototype=_,c(r,"RegExp",C,{constructor:!0})}v("RegExp")},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/descriptors":153,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/is-forced":205,"../internals/is-regexp":211,"../internals/object-create":229,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/proxy-accessor":253,"../internals/regexp-get-flags":258,"../internals/regexp-sticky-helpers":259,"../internals/regexp-unsupported-dot-all":260,"../internals/regexp-unsupported-ncg":261,"../internals/set-species":265,"../internals/to-string":291,"../internals/well-known-symbol":306}],340:[function(e,t,r){"use strict";var n=e("../internals/export"),e=e("../internals/regexp-exec");n({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":170,"../internals/regexp-exec":256}],341:[function(e,t,r){"use strict";var n=e("../internals/function-name").PROPER,i=e("../internals/define-built-in"),o=e("../internals/an-object"),s=e("../internals/to-string"),a=e("../internals/fails"),c=e("../internals/regexp-get-flags"),e="toString",u=RegExp.prototype,l=u[e],a=a(function(){return"/a/b"!==l.call({source:"a",flags:"b"})}),n=n&&l.name!==e;(a||n)&&i(u,e,function(){var e=o(this);return"/"+s(e.source)+"/"+s(c(e))},{unsafe:!0})},{"../internals/an-object":114,"../internals/define-built-in":149,"../internals/fails":171,"../internals/function-name":178,"../internals/regexp-get-flags":258,"../internals/to-string":291}],342:[function(e,t,r){"use strict";e("../internals/collection")("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e("../internals/collection-strong"))},{"../internals/collection":140,"../internals/collection-strong":139}],343:[function(e,t,r){"use strict";e("../modules/es.set.constructor")},{"../modules/es.set.constructor":342}],344:[function(e,t,r){"use strict";var n=e("../internals/export"),i=e("../internals/function-uncurry-this"),o=e("../internals/not-a-regexp"),s=e("../internals/require-object-coercible"),a=e("../internals/to-string"),e=e("../internals/correct-is-regexp-logic"),c=i("".indexOf);n({target:"String",proto:!0,forced:!e("includes")},{includes:function(e){return!!~c(a(s(this)),a(o(e)),1=t.length?a(void 0,!0):(t=n(t,r),e.index+=t.length,a(t,!1))})},{"../internals/create-iter-result-object":144,"../internals/internal-state":199,"../internals/iterator-define":216,"../internals/string-multibyte":271,"../internals/to-string":291}],346:[function(e,t,r){"use strict";var i=e("../internals/function-call"),n=e("../internals/fix-regexp-well-known-symbol-logic"),u=e("../internals/an-object"),o=e("../internals/is-null-or-undefined"),l=e("../internals/to-length"),f=e("../internals/to-string"),s=e("../internals/require-object-coercible"),p=e("../internals/get-method"),d=e("../internals/advance-string-index"),h=e("../internals/regexp-exec-abstract");n("match",function(n,a,c){return[function(e){var t=s(this),r=o(e)?void 0:p(e,n);return r?i(r,e,t):new RegExp(e)[n](f(t))},function(e){var t=u(this),r=f(e),e=c(a,t,r);if(e.done)return e.value;if(!t.global)return h(t,r);for(var n=t.unicode,i=[],o=t.lastIndex=0;null!==(s=h(t,r));){var s=f(s[0]);""===(i[o]=s)&&(t.lastIndex=d(r,l(t.lastIndex),n)),o++}return 0===o?null:i}]})},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-call":177,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/to-length":284,"../internals/to-string":291}],347:[function(e,t,r){"use strict";var x=e("../internals/function-apply"),i=e("../internals/function-call"),n=e("../internals/function-uncurry-this"),o=e("../internals/fix-regexp-well-known-symbol-logic"),s=e("../internals/fails"),S=e("../internals/an-object"),k=e("../internals/is-callable"),a=e("../internals/is-null-or-undefined"),_=e("../internals/to-integer-or-infinity"),T=e("../internals/to-length"),E=e("../internals/to-string"),c=e("../internals/require-object-coercible"),O=e("../internals/advance-string-index"),u=e("../internals/get-method"),A=e("../internals/get-substitution"),I=e("../internals/regexp-exec-abstract"),l=e("../internals/well-known-symbol")("replace"),D=Math.max,R=Math.min,C=n([].concat),M=n([].push),P=n("".indexOf),N=n("".slice),e="$0"==="a".replace(/./,"$0"),f=!!/./[l]&&""===/./[l]("a","$0");o("replace",function(e,v,j){var w=f?"$":"$0";return[function(e,t){var r=c(this),n=a(e)?void 0:u(e,l);return n?i(n,e,r,t):i(v,E(r),e,t)},function(e,t){var r=S(this),n=E(e);if("string"==typeof t&&-1===P(t,w)&&-1===P(t,"$<")){e=j(v,r,n,t);if(e.done)return e.value}for(var i,o=k(t),s=(o||(t=E(t)),r.global),a=(s&&(i=r.unicode,r.lastIndex=0),[]);null!==(p=I(r,n))&&(M(a,p),s);)""===E(p[0])&&(r.lastIndex=O(n,T(r.lastIndex),i));for(var c,u="",l=0,f=0;f")})||!e||f)},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/fails":171,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-method":186,"../internals/get-substitution":187,"../internals/is-callable":203,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/to-integer-or-infinity":283,"../internals/to-length":284,"../internals/to-string":291,"../internals/well-known-symbol":306}],348:[function(e,t,r){"use strict";var s=e("../internals/function-call"),n=e("../internals/fix-regexp-well-known-symbol-logic"),a=e("../internals/an-object"),c=e("../internals/is-null-or-undefined"),u=e("../internals/require-object-coercible"),l=e("../internals/same-value"),f=e("../internals/to-string"),p=e("../internals/get-method"),d=e("../internals/regexp-exec-abstract");n("search",function(n,i,o){return[function(e){var t=u(this),r=c(e)?void 0:p(e,n);return r?s(r,e,t):new RegExp(e)[n](f(t))},function(e){var t=a(this),e=f(e),r=o(i,t,e);return r.done?r.value:(r=t.lastIndex,l(r,0)||(t.lastIndex=0),e=d(t,e),l(t.lastIndex,r)||(t.lastIndex=r),null===e?-1:e.index)}]})},{"../internals/an-object":114,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-call":177,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/same-value":264,"../internals/to-string":291}],349:[function(e,t,r){"use strict";var l=e("../internals/function-apply"),f=e("../internals/function-call"),n=e("../internals/function-uncurry-this"),i=e("../internals/fix-regexp-well-known-symbol-logic"),b=e("../internals/an-object"),o=e("../internals/is-null-or-undefined"),p=e("../internals/is-regexp"),d=e("../internals/require-object-coercible"),g=e("../internals/species-constructor"),v=e("../internals/advance-string-index"),j=e("../internals/to-length"),w=e("../internals/to-string"),s=e("../internals/get-method"),x=e("../internals/array-slice"),S=e("../internals/regexp-exec-abstract"),k=e("../internals/regexp-exec"),a=e("../internals/regexp-sticky-helpers"),e=e("../internals/fails"),_=a.UNSUPPORTED_Y,T=Math.min,E=[].push,O=n(/./.exec),A=n(E),I=n("".slice);i("split",function(i,h,y){var m="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,t){var r=w(d(this)),n=void 0===t?4294967295:t>>>0;if(0==n)return[];if(void 0===e)return[r];if(!p(e))return f(h,r,e,n);for(var i,o,s,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,u=new RegExp(e.source,t+"g");(i=f(k,u,r))&&!(c<(o=u.lastIndex)&&(A(a,I(r,c,i.index)),1>>0;if(0==a)return[];if(0===n.length)return null===S(s,n)?[n]:[];for(var c=0,u=0,l=[];u]/;t.exports=function(e){var t,r=""+e,e=s.exec(r);if(!e)return r;var n="",i=0,o=0;for(i=e.index;ii&&!o.warned&&(o.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=o.length,r=n,console)&&console.warn&&console.warn(r)),e}function p(e,t,r){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},t=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e);return t.listener=r,e.wrapFn=t}function d(e,t,r){e=e._events;if(void 0===e)return[];e=e[t];if(void 0===e)return[];if("function"==typeof e)return r?[e.listener||e]:[e];if(r){for(var n=e,i=new Array(n.length),o=0;o=r.length?(c=!!(f=h(o,u)))&&"get"in f&&!("originalValue"in f.get)?f.get:o[u]:(c=v(o,u),o[u]),c&&!s&&(m[l]=o)}}return o}},{"function-bind":391,"has-proto":395,"has-symbols":396,hasown:399}],393:[function(t,e,r){"use strict";t=t("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch(e){t=null}e.exports=t},{"get-intrinsic":392}],394:[function(e,t,r){"use strict";function n(){if(i)try{return i({},"a",{value:1}),!0}catch(e){}return!1}var i=e("get-intrinsic")("%Object.defineProperty%",!0);n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==i([],"length",{value:1}).length}catch(e){return!0}},t.exports=n},{"get-intrinsic":392}],395:[function(e,t,r){"use strict";var n={foo:{}},i=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof i)}},{}],396:[function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=e("./shams");t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},{"./shams":397}],397:[function(e,t,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"!=typeof Symbol.iterator){var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){r=Object.getOwnPropertyDescriptor(e,t);if(42!==r.value||!0!==r.enumerable)return!1}}return!0}},{}],398:[function(e,t,r){"use strict";var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":397}],399:[function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,e=e("function-bind");t.exports=e.call(n,i)},{"function-bind":391}],400:[function(e,t,r){var n,i=e("http"),o=e("url"),s=t.exports;for(n in i)i.hasOwnProperty(n)&&(s[n]=i[n]);function a(e){if((e="string"==typeof e?o.parse(e):e).protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}s.request=function(e,t){return e=a(e),i.request.call(this,e,t)},s.get=function(e,t){return e=a(e),i.get.call(this,e,t)}},{http:541,url:545}],401:[function(e,t,r){"use strict";var n=e("util"),i=e("ms");t.exports=function(e){var t;return"number"==typeof e?e:(void 0===(t=i(e))&&(e=new Error(n.format("humanize-ms(%j) result undefined",e)),console.warn(e.stack)),t)}},{ms:434,util:491}],402:[function(e,t,r){r.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,f=r?i-1:0,p=r?-1:1,i=e[t+f];for(f+=p,o=i&(1<<-l)-1,i>>=-l,l+=a;0>=-l,l+=n;0>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(t+=1<=s+l?f/n:f*Math.pow(2,1-l))*n&&(s++,n/=2),u<=s+l?(a=0,s=u):1<=s+l?(a=(t*n-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));8<=i;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<>>6)+b(128|63&t):b(224|t>>>12&15)+b(128|t>>>6&63)+b(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),b(240|t>>>18&7)+b(128|t>>>12&63)+b(128|t>>>6&63)+b(128|63&t))}function n(e){var t=[0,2,1][e.length%3],e=e.charCodeAt(0)<<16|(1>>18),y.charAt(e>>>12&63),2<=t?"=":y.charAt(e>>>6&63),1<=t?"=":y.charAt(63&e)].join("")}function i(e){return j(v(String(e)))}function c(e){return e.replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,"")}function o(e,t){return t?c(i(e)):i(e)}function s(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return b(55296+(t>>>10))+b(56320+(1023&t));case 3:return b((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return b((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}}function a(e){var t=(r=e.length)%4,r=(0>>16),b(r>>>8&255),b(255&r)]).length-=[0,0,2,1][t],e.join("")}function u(e){return S(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))}function l(e){return String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")}function e(e){return e=l(e),x(S(e))}var f,p,d,h=(t=t||{}).Base64,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=function(e){for(var t={},r=0,n=e.length;r>>18)+y.charAt(o>>>12&63)+(void 0!==s?y.charAt(o>>>6&63):"=")+(void 0!==a?y.charAt(63&o):"=")}return t?c(r):r}),/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g),x=function(e){return e.replace(w,s)},S=t.atob&&"function"==typeof t.atob?function(e){return t.atob(e)}:function(e){return e.replace(/\S{1,4}/g,a)};t.Uint8Array&&(p=function(e){return Uint8Array.from(u(l(e)),function(e){return e.charCodeAt(0)})});return t.Base64={VERSION:"2.6.4",atob:u,btoa:j,fromBase64:e,toBase64:o,utob:v,encode:o,encodeURI:function(e){return o(e,!0)},btou:x,decode:e,noConflict:function(){var e=t.Base64;return t.Base64=h,e},fromUint8Array:f,toUint8Array:p},"function"==typeof Object.defineProperty&&(d=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},t.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",d(function(){return e(this)})),Object.defineProperty(String.prototype,"toBase64",d(function(e){return o(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",d(function(){return o(this,!0)}))}),t.Meteor&&(Base64=t.Base64),void 0!==k&&k.exports&&(k.exports.Base64=t.Base64),{Base64:t.Base64}},"object"==typeof n&&void 0!==k?k.exports=t(e):t(e)}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],416:[function(e,t,r){e=e("./_root").Symbol;t.exports=e},{"./_root":423}],417:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r 0, or `null`');if(z(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var t=s.numericSeparator;if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return function e(t,r){if(t.length>r.maxStringLength)return n=t.length-r.maxStringLength,n="... "+n+" more character"+(1"}if(U(r))return 0===r.length?"[]":(c=$(r,y),h&&!function(e){for(var t=0;t "+y(e,r))}),re("Map",v.call(r),u,h)):function(e){if(w&&e&&"object"==typeof e)try{w.call(e);try{v.call(e)}catch(e){return 1}return e instanceof Set}catch(e){}return}(r)?(l=[],x&&x.call(r,function(e){l.push(y(e,r))}),re("Set",w.call(r),l,h)):function(e){if(S&&e&&"object"==typeof e)try{S.call(e,S);try{k.call(e,k)}catch(e){return 1}return e instanceof WeakMap}catch(e){}return}(r)?H("WeakMap"):function(e){if(k&&e&&"object"==typeof e)try{k.call(e,k);try{S.call(e,S)}catch(e){return 1}return e instanceof WeakSet}catch(e){}return}(r)?H("WeakSet"):function(e){if(_&&e&&"object"==typeof e)try{return _.call(e),1}catch(e){}return}(r)?H("WeakRef"):"[object Number]"!==V(f=r)||M&&"object"==typeof f&&M in f?function(e){if(e&&"object"==typeof e&&D)try{return D.call(e),1}catch(e){}return}(r)?X(y(D.call(r))):"[object Boolean]"!==V(t=r)||M&&"object"==typeof t&&M in t?"[object String]"!==V(e=r)||M&&"object"==typeof e&&M in e?"undefined"!=typeof window&&r===window?"{ [object Window] }":r===ne?"{ [object globalThis] }":("[object Date]"!==V(t=r)||M&&"object"==typeof t&&M in t)&&!W(r)?(e=$(r,y),t=N?N(r)===Object.prototype:r instanceof Object||r.constructor===Object,p=r instanceof Object?"":"null prototype",d=!t&&M&&Object(r)===r&&M in r?T.call(V(r),8,-1):p?"Object":"",t=(!t&&"function"==typeof r.constructor&&r.constructor.name?r.constructor.name+" ":"")+(d||p?"["+I.call(A.call([],d||[],p||[]),": ")+"] ":""),0===e.length?t+"{}":h?t+"{"+K(e,h)+"}":t+"{ "+I.call(e,", ")+" }"):String(r):X(y(String(r))):X(Y.call(r)):X(y(Number(r)))};var o=Object.prototype.hasOwnProperty||function(e){return e in this};function z(e,t){return o.call(e,t)}function V(e){return r.call(e)}function ee(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=b-1,v=Math.floor,j=String.fromCharCode;function w(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function h(e,t){var r=e.split("@"),n="",r=(1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var n=0;for(e=r?v(e/a):e>>1,e+=v(e/t);p*g>>1v((m-l)/o))&&w("overflow"),l+=a*o,!(a<(a=s<=p?1:p+g<=s?g:s-p));s+=b)o>v(m/(a=b-a))&&w("overflow"),o*=a;p=k(l-i,t=c.length+1,0==i),v(l/t)>m-f&&w("overflow"),f+=v(l/t),l%=t,c.splice(l++,0,f)}return y(c)}function T(e){for(var t,r,n,i,o,s,a,c,u,l,f=[],p=(e=x(e)).length,d=128,h=72,y=t=0;yv((m-t)/(c=r+1))&&w("overflow"),t+=(i-d)*c,d=i,y=0;ym&&w("overflow"),a==d){for(o=t,s=b;!(o<(u=s<=h?1:h+g<=s?g:s-h));s+=b)f.push(j(S(u+(l=o-u)%(u=b-u),0))),o=v(l/u);f.push(j(S(o,0))),h=k(t,c,r==n),t=0,++r}++t,++d}return f.join("")}if(i={version:"1.4.1",ucs2:{decode:x,encode:y},decode:_,encode:T,toASCII:function(e){return h(e,function(e){return u.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return h(e,function(e){return c.test(e)?_(e.slice(4).toLowerCase()):e})}},t&&r)if(O.exports==t)r.exports=i;else for(o in i)i.hasOwnProperty(o)&&(t[o]=i[o]);else e.punycode=i}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],446:[function(e,t,r){"use strict";var n=String.prototype.replace,i=/%20/g,o="RFC1738",s="RFC3986";t.exports={default:s,formatters:{RFC1738:function(e){return n.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:s}},{}],447:[function(e,t,r){"use strict";var n=e("./stringify"),i=e("./parse"),e=e("./formats");t.exports={formats:e,parse:i,stringify:n}},{"./formats":446,"./parse":448,"./stringify":449}],448:[function(e,t,r){"use strict";function c(e,t){var r,n,i,o,s={__proto__:null},e=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,c=e.split(t.delimiter,a),u=-1,l=t.charset;if(t.charsetSentinel)for(r=0;r>6]+l[128|63&c]:c<55296||57344<=c?s+=l[224|c>>12]+l[128|c>>6&63]+l[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(a)),s+=l[240|c>>18]+l[128|c>>12&63]+l[128|c>>6&63]+l[128|63&c])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(y(e)){for(var r=[],n=0;nt.highWaterMark&&(t.highWaterMark=(d<=(r=e)?r=d:(r--,r=(r=(r=(r=(r|=r>>>1)|r>>>2)|r>>>4)|r>>>8)|r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?m.nextTick(j,e):j(e))}function j(e){g("emit readable"),e.emit("readable"),_(e)}function w(e,t){t.readingMore||(t.readingMore=!0,m.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(s);break}++n}return t.length-=n,i}:function(e,t){var r=l.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(s);break}++i}return t.length-=i,r})(e,t);return n}(e,t.buffer,t.decoder),r)}function E(e){var t=e._readableState;if(0=r.highWaterMark||r.ended)?(g("read: emitReadable",r.length,r.ended),(0===r.length&&r.ended?E:v)(this),null):0===(e=h(e,r))&&r.ended?(0===r.length&&E(this),null):(t=r.needReadable,g("need readable",t),(0===r.length||r.length-e>>0),i=this.head,o=0;i;)t=i.data,r=o,t.copy(n,r),o+=i.data.length,i=i.next;return n},i),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":463,util:102}],460:[function(e,t,r){"use strict";var o=e("process-nextick-args");function s(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,o.nextTick(s,this,e)):o.nextTick(s,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,o.nextTick(s,r,e)):o.nextTick(s,r,e):t&&t(e)})),this},undestroy:function(){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)}}},{"process-nextick-args":443}],461:[function(e,t,r){t.exports=e("events").EventEmitter},{events:388}],462:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],463:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,r),r.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=i(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:103}],464:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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!0;default:return!1}};function o(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"==typeof t||n.isEncoding!==i&&i(e))return t||e;throw new Error("Unknown encoding: "+e)}function s(e){var t;switch(this.encoding=o(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t,r=this.lastTotal-this.lastNeed,n=(t=this,128!=(192&(n=e)[0])?(t.lastNeed=0,"\ufffd"):1"===o?(k(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=x.TEXT):(g(o)&&(t.state=x.SGML_DECL_QUOTED),t.sgmlDecl+=o);continue;case x.SGML_DECL_QUOTED:o===t.q&&(t.state=x.SGML_DECL,t.q=""),t.sgmlDecl+=o;continue;case x.DOCTYPE:">"===o?(t.state=x.TEXT,k(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=o,"["===o?t.state=x.DOCTYPE_DTD:g(o)&&(t.state=x.DOCTYPE_QUOTED,t.q=o));continue;case x.DOCTYPE_QUOTED:t.doctype+=o,o===t.q&&(t.q="",t.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:t.doctype+=o,"]"===o?t.state=x.DOCTYPE:g(o)&&(t.state=x.DOCTYPE_DTD_QUOTED,t.q=o);continue;case x.DOCTYPE_DTD_QUOTED:t.doctype+=o,o===t.q&&(t.state=x.DOCTYPE_DTD,t.q="");continue;case x.COMMENT:"-"===o?t.state=x.COMMENT_ENDING:t.comment+=o;continue;case x.COMMENT_ENDING:"-"===o?(t.state=x.COMMENT_ENDED,t.comment=T(t.opt,t.comment),t.comment&&k(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+o,t.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==o?(A(t,"Malformed comment"),t.comment+="--"+o,t.state=x.COMMENT):t.state=x.TEXT;continue;case x.CDATA:"]"===o?t.state=x.CDATA_ENDING:t.cdata+=o;continue;case x.CDATA_ENDING:"]"===o?t.state=x.CDATA_ENDING_2:(t.cdata+="]"+o,t.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===o?(t.cdata&&k(t,"oncdata",t.cdata),k(t,"onclosecdata"),t.cdata="",t.state=x.TEXT):"]"===o?t.cdata+="]":(t.cdata+="]]"+o,t.state=x.CDATA);continue;case x.PROC_INST:"?"===o?t.state=x.PROC_INST_ENDING:b(o)?t.state=x.PROC_INST_BODY:t.procInstName+=o;continue;case x.PROC_INST_BODY:if(!t.procInstBody&&b(o))continue;"?"===o?t.state=x.PROC_INST_ENDING:t.procInstBody+=o;continue;case x.PROC_INST_ENDING:">"===o?(k(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=x.TEXT):(t.procInstBody+="?"+o,t.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:v(y,o)?t.tagName+=o:(function(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns);e.attribList.length=0,k(e,"onopentagstart",r)}(t),">"===o?R(t):"/"===o?t.state=x.OPEN_TAG_SLASH:(b(o)||A(t,"Invalid character in tag name"),t.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===o?(R(t,!0),C(t)):(A(t,"Forward-slash in opening tag not followed by >"),t.state=x.ATTRIB);continue;case x.ATTRIB:if(b(o))continue;">"===o?R(t):"/"===o?t.state=x.OPEN_TAG_SLASH:v(h,o)?(t.attribName=o,t.attribValue="",t.state=x.ATTRIB_NAME):A(t,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===o?t.state=x.ATTRIB_VALUE:">"===o?(A(t,"Attribute without value"),t.attribValue=t.attribName,D(t),R(t)):b(o)?t.state=x.ATTRIB_NAME_SAW_WHITE:v(y,o)?t.attribName+=o:A(t,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===o)t.state=x.ATTRIB_VALUE;else{if(b(o))continue;A(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",k(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===o?R(t):v(h,o)?(t.attribName=o,t.state=x.ATTRIB_NAME):(A(t,"Invalid attribute name"),t.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(b(o))continue;g(o)?(t.q=o,t.state=x.ATTRIB_VALUE_QUOTED):(A(t,"Unquoted attribute value"),t.state=x.ATTRIB_VALUE_UNQUOTED,t.attribValue=o);continue;case x.ATTRIB_VALUE_QUOTED:if(o!==t.q){"&"===o?t.state=x.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=o;continue}D(t),t.q="",t.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:b(o)?t.state=x.ATTRIB:">"===o?R(t):"/"===o?t.state=x.OPEN_TAG_SLASH:v(h,o)?(A(t,"No whitespace between attributes"),t.attribName=o,t.attribValue="",t.state=x.ATTRIB_NAME):A(t,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!function(e){return">"===e||b(e)}(o)){"&"===o?t.state=x.ATTRIB_VALUE_ENTITY_U:t.attribValue+=o;continue}D(t),">"===o?R(t):t.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(t.tagName)">"===o?C(t):v(y,o)?t.tagName+=o:t.script?(t.script+=""===o?C(t):A(t,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:switch(t.state){case x.TEXT_ENTITY:r=x.TEXT,n="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:r=x.ATTRIB_VALUE_QUOTED,n="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:r=x.ATTRIB_VALUE_UNQUOTED,n="attribValue"}var a;";"===o?t.opt.unparsedEntities?(a=M(t),t.entity="",t.state=r,t.write(a)):(t[n]+=M(t),t.entity="",t.state=r):v(t.entity.length?L:m,o)?t.entity+=o:(A(t,"Invalid character in entity name"),t[n]+="&"+t.entity+o,t.entity="",t.state=r);continue;default:throw new Error(t,"Unknown state: "+t.state)}}t.position>=t.bufferCheckPosition&&!function(e){for(var t=Math.max(c.MAX_BUFFER_LENGTH,10),r=0,n=0,i=u.length;n",lt:"<",quot:'"',apos:"'"},c.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(c.ENTITIES).forEach(function(e){var t=c.ENTITIES[e],t="number"==typeof t?String.fromCharCode(t):t;c.ENTITIES[e]=t}),c.STATE)c.STATE[c.STATE[e]]=e;function S(e,t,r){e[t]&&e[t](r)}function k(e,t,r){e.textNode&&_(e),S(e,t,r)}function _(e){e.textNode=T(e.opt,e.textNode),e.textNode&&S(e,"ontext",e.textNode),e.textNode=""}function T(e,t){return e.trim&&(t=t.trim()),t=e.normalize?t.replace(/\s+/g," "):t}function E(e,t){return _(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,S(e,"onerror",t),e}function O(e){return e.sawRoot&&!e.closedRoot&&A(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&E(e,"Unexpected end"),_(e),e.c="",e.closed=!0,S(e,"onend"),s.call(e,e.strict,e.opt),e}function A(e,t){if("object"!=typeof e||!(e instanceof s))throw new Error("bad call to strictFail");e.strict&&E(e,t)}function I(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],r=r[1];return t&&"xmlns"===e&&(n="xmlns",r=""),{prefix:n,local:r}}function D(e){var t,r,n;e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName)||(e.opt.xmlns?(r=(t=I(e.attribName,!0)).prefix,t=t.local,"xmlns"===r&&("xml"===t&&e.attribValue!==a?A(e,"xml: prefix must be bound to "+a+"\nActual: "+e.attribValue):"xmlns"===t&&e.attribValue!==p?A(e,"xmlns: prefix must be bound to "+p+"\nActual: "+e.attribValue):(r=e.tag,n=e.tags[e.tags.length-1]||e,r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[t]=e.attribValue)),e.attribList.push([e.attribName,e.attribValue])):(e.tag.attributes[e.attribName]=e.attribValue,k(e,"onattribute",{name:e.attribName,value:e.attribValue}))),e.attribName=e.attribValue=""}function R(t,e){if(t.opt.xmlns){var r=t.tag,n=I(t.tagName),n=(r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(A(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),r.uri=n.prefix),t.tags[t.tags.length-1]||t);r.ns&&n.ns!==r.ns&&Object.keys(r.ns).forEach(function(e){k(t,"onopennamespace",{prefix:e,uri:r.ns[e]})});for(var i=0,o=t.attribList.length;i",r.tagName="",void(r.state=x.SCRIPT);k(r,"onscript",r.script),r.script=""}for(var e=r.tags.length,t=r.tagName,n=t=r.strict?t:t[r.looseCase]();e--&&r.tags[e].name!==n;)A(r,"Unexpected close tag");if(e<0)A(r,"Unmatched closing tag: "+r.tagName),r.textNode+="";else{r.tagName=t;for(var i=r.tags.length;i-- >e;){var o,s=r.tag=r.tags.pop();r.tagName=r.tag.name,k(r,"onclosetag",r.tagName);for(o in s.ns)o,s.ns[o];var a=r.tags[r.tags.length-1]||r;r.opt.xmlns&&s.ns!==a.ns&&Object.keys(s.ns).forEach(function(e){var t=s.ns[e];k(r,"onclosenamespace",{prefix:e,uri:t})})}0===e&&(r.closedRoot=!0),r.tagName=r.attribValue=r.attribName="",r.attribList.length=0}}else A(r,"Weird empty close tag."),r.textNode+="";r.state=x.TEXT}function M(e){var t,r=e.entity,n=r.toLowerCase(),i="";return e.ENTITIES[r]||e.ENTITIES[n]||("#"===(r=n).charAt(0)&&(i="x"===r.charAt(1)?(r=r.slice(2),(t=parseInt(r,16)).toString(16)):(r=r.slice(1),(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==r?(A(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function P(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):b(t)||(A(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function N(e,t){var r="";return r=t>10),i%1024+56320),(t+1===r||16384o.length)&&(a=o.length),o=(o.substring(a-s.length,a)===s?"The ".concat(e," "):(a=(i="number"!=typeof i?0:i)+(o=".").length>(a=e).length||-1===a.indexOf(o,i)?"argument":"property",'The "'.concat(e,'" ').concat(a," "))).concat(n," ").concat(c(t,"type")),o+=". 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=n},{}],472:[function(l,f,e){!function(u){!function(){"use strict";var e=Object.keys||function(e){var t,r=[];for(t in e)r.push(t);return r},t=(f.exports=s,l("./_stream_readable")),r=l("./_stream_writable");l("inherits")(s,t);for(var n=e(r.prototype),i=0;it.highWaterMark&&(t.highWaterMark=(S<=(r=e)?r=S:(r--,r=(r=(r=(r=(r|=r>>>1)|r>>>2)|r>>>4)|r>>>8)|r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;y("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(y("emitReadable",t.flowing),t.emittedReadable=!0,L.nextTick(T,e))}function T(e){var t=e._readableState;y("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,R(e)}function E(e,t){t.readingMore||(t.readingMore=!0,L.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length=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 M(e){var t=e._readableState;y("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,L.nextTick(N,t,e))}function N(e,t){y("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy&&(!(e=t._writableState)||e.autoDestroy&&e.finished)&&t.destroy())}function P(e,t){for(var r=0,n=e.length;r=r.highWaterMark:0>>0),i=this.head,o=0;i;)t=i.data,r=o,c.prototype.copy.call(t,n,r),o+=i.data.length,i=i.next;return n}},{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).data=i.slice(o);break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.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).data=i.slice(o);break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:103,util:102}],479:[function(e,t,r){!function(c){!function(){"use strict";function o(e,t){a(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(a,this,e)):c.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?c.nextTick(s,r):(r._writableState.errorEmitted=!0,c.nextTick(o,r,e)):c.nextTick(o,r,e):t?(c.nextTick(s,r),t(e)):c.nextTick(s,r)})),this},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}.call(this)}.call(this,e("_process"))},{_process:540}],480:[function(e,t,r){"use strict";var b=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function g(){}t.exports=function e(t,r,n){var i,o,s,a,c,u,l,f,p,d,h,y,m;return"function"==typeof r?e(t,null,r):(i=n||g,o=!1,n=function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),r=0;r")||0<=e.indexOf("<"))},d=function(e){return""},t=function(e){return e.replace("]]>","]]]]>")},o.Builder=(e.prototype.buildObject=function(e){var c,t,u,l=this.options.attrkey,f=this.options.charkey;return 1===Object.keys(e).length&&this.options.rootName===i[.2].rootName?e=e[t=Object.keys(e)[0]]:t=this.options.rootName,u=this,c=function(e,t){var r,n,i,o,s,a;if("object"!=typeof t)u.options.cdata&&p(t)?e.raw(d(t)):e.txt(t);else if(Array.isArray(t)){for(o in t)if(h.call(t,o))for(s in n=t[o])i=n[s],e=c(e.ele(s),i).up()}else for(s in t)if(h.call(t,s))if(n=t[s],s===l){if("object"==typeof n)for(r in n)a=n[r],e=e.att(r,a)}else if(s===f)e=u.options.cdata&&p(n)?e.raw(d(n)):e.txt(n);else if(Array.isArray(n))for(o in n)h.call(n,o)&&(e=("string"==typeof(i=n[o])?u.options.cdata&&p(i)?e.ele(s).raw(d(i)):e.ele(s,i):c(e.ele(s),i)).up());else e=("object"==typeof n?c(e.ele(s),n):"string"==typeof n&&u.options.cdata&&p(n)?e.ele(s).raw(d(n)):(null==n&&(n=""),e.ele(s,n.toString()))).up();return e},t=r.create(t,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),c(t,e).end(this.options.renderOpts)},e)}.call(this)},{"./defaults":495,xmlbuilder:531}],495:[function(e,t,r){!function(){r.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}.call(this)},{}],496:[function(e,t,m){!function(){"use strict";function o(e,t){return function(){return e.apply(t,arguments)}}var p={}.hasOwnProperty,c=e("sax"),s=e("events"),a=e("./bom"),u=e("./processors"),l=e("timers").setImmediate,f=e("./defaults").defaults,d=function(e){return"object"==typeof e&&null!=e&&0===Object.keys(e).length},h=function(e,t,r){for(var n=0,i=e.length;n":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},e.prototype.isEqualNode=function(e){return e.namespaceURI===this.namespaceURI&&e.prefix===this.prefix&&e.localName===this.localName&&e.value===this.value},e)}.call(this)},{"./NodeType":500,"./XMLNode":522}],504:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./NodeType"),a=e("./XMLCharacterData");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=s.CData,this.value=this.stringify.cdata(t)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":500,"./XMLCharacterData":505}],505:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e){i.__super__.constructor.call(this,e),this.value=""}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,Object.defineProperty(i.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(i.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(i.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(e){return!!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.data===this.data},i}()}.call(this)},{"./XMLNode":522}],506:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./NodeType"),a=e("./XMLCharacterData");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=s.Comment,this.value=this.stringify.comment(t)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":500,"./XMLCharacterData":505}],507:[function(n,i,e){!function(){var e,t;function r(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}e=n("./XMLDOMErrorHandler"),t=n("./XMLDOMStringList"),i.exports=(Object.defineProperty(r.prototype,"parameterNames",{get:function(){return new t(Object.keys(this.defaultParams))}}),r.prototype.getParameter=function(e){return this.params.hasOwnProperty(e)?this.params[e]:null},r.prototype.canSetParameter=function(e,t){return!0},r.prototype.setParameter=function(e,t){return null!=t?this.params[e]=t:delete this.params[e]},r)}.call(this)},{"./XMLDOMErrorHandler":508,"./XMLDOMStringList":510}],508:[function(e,t,r){!function(){function e(){}t.exports=(e.prototype.handleError=function(e){throw new Error(e)},e)}.call(this)},{}],509:[function(e,t,r){!function(){function e(){}t.exports=(e.prototype.hasFeature=function(e,t){return!0},e.prototype.createDocumentType=function(e,t,r){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(e,t,r){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")},e)}.call(this)},{}],510:[function(e,t,r){!function(){function e(e){this.arr=e||[]}t.exports=(Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}}),e.prototype.item=function(e){return this.arr[e]||null},e.prototype.contains=function(e){return-1!==this.arr.indexOf(e)},e)}.call(this)},{}],511:[function(e,t,r){!function(){var i={}.hasOwnProperty,o=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=s,r=o;for(e in r)i.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function s(e,t,r,n,i,o){if(s.__super__.constructor.call(this,e),null==t)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==r)throw new Error("Missing DTD attribute name. "+this.debugInfo(t));if(!n)throw new Error("Missing DTD attribute type. "+this.debugInfo(t));if(!i)throw new Error("Missing DTD attribute default. "+this.debugInfo(t));if(!(i=0!==i.indexOf("#")?"#"+i:i).match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(t));if(o&&!i.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(t));this.elementName=this.stringify.name(t),this.type=a.AttributeDeclaration,this.attributeName=this.stringify.name(r),this.attributeType=this.stringify.dtdAttType(n),o&&(this.defaultValue=this.stringify.dtdAttDefault(o)),this.defaultValueType=i}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,s.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))},s}()}.call(this)},{"./NodeType":500,"./XMLNode":522}],512:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing DTD element name. "+this.debugInfo());r=r||"(#PCDATA)",Array.isArray(r)&&(r="("+r.join(",")+")"),this.name=this.stringify.name(t),this.type=a.ElementDeclaration,this.value=this.stringify.dtdElementValue(r)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":500,"./XMLNode":522}],513:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./Utility").isObject,a=e("./XMLNode"),c=e("./NodeType");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r,n){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(null==n)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!t,this.name=this.stringify.name(r),this.type=c.EntityDeclaration,s(n)){if(!n.pubID&&!n.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(n.pubID&&!n.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,null!=n.pubID&&(this.pubID=this.stringify.dtdPubID(n.pubID)),null!=n.sysID&&(this.sysID=this.stringify.dtdSysID(n.sysID)),null!=n.nData&&(this.nData=this.stringify.dtdNData(n.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}else this.value=this.stringify.dtdEntityValue(n),this.internal=!0}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return null}}),i.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":500,"./Utility":501,"./XMLNode":522}],514:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r){if(i.__super__.constructor.call(this,e),null==t)throw new Error("Missing DTD notation name. "+this.debugInfo(t));if(!r.pubID&&!r.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(t));this.name=this.stringify.name(t),this.type=a.NotationDeclaration,null!=r.pubID&&(this.pubID=this.stringify.dtdPubID(r.pubID)),null!=r.sysID&&(this.sysID=this.stringify.dtdSysID(r.sysID))}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":500,"./XMLNode":522}],515:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./Utility").isObject,a=e("./XMLNode"),c=e("./NodeType");t.exports=function(){var e,t=i,r=a;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e,t,r,n){i.__super__.constructor.call(this,e),s(t)&&(t=(e=t).version,r=e.encoding,n=e.standalone),t=t||"1.0",this.type=c.Declaration,this.version=this.stringify.xmlVersion(t),null!=r&&(this.encoding=this.stringify.xmlEncoding(r)),null!=n&&(this.standalone=this.stringify.xmlStandalone(n))}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))},i}()}.call(this)},{"./NodeType":500,"./Utility":501,"./XMLNode":522}],516:[function(e,t,r){!function(){var i={}.hasOwnProperty,c=e("./Utility").isObject,o=e("./XMLNode"),u=e("./NodeType"),s=e("./XMLDTDAttList"),l=e("./XMLDTDEntity"),f=e("./XMLDTDElement"),p=e("./XMLDTDNotation"),d=e("./XMLNamedNodeMap");t.exports=function(){var e,t=a,r=o;for(e in r)i.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function a(e,t,r){var n,i,o,s;if(a.__super__.constructor.call(this,e),this.type=u.DocType,e.children)for(i=0,o=(s=e.children).length;i":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel),this.writerOptions.state=o.InsideTag}else this.writerOptions.state=o.OpenTag,r=this.writer.indent(e,this.writerOptions,this.currentLevel)+""),r+=this.writer.endline(e,this.writerOptions,this.currentLevel);return this.onData(r,this.currentLevel),e.isOpen=!0}},k.prototype.closeNode=function(e){var t;if(!e.isClosed)return t="",this.writerOptions.state=o.CloseTag,t=e.type===u.Element?this.writer.indent(e,this.writerOptions,this.currentLevel)+""+this.writer.endline(e,this.writerOptions,this.currentLevel):this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel),this.writerOptions.state=o.None,this.onData(t,this.currentLevel),e.isClosed=!0},k.prototype.onData=function(e,t){return this.documentStarted=!0,this.onDataCallback(e,t+1)},k.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},k.prototype.debugInfo=function(e){return null==e?"":"node: <"+e+">"},k.prototype.ele=function(){return this.element.apply(this,arguments)},k.prototype.nod=function(e,t,r){return this.node(e,t,r)},k.prototype.txt=function(e){return this.text(e)},k.prototype.dat=function(e){return this.cdata(e)},k.prototype.com=function(e){return this.comment(e)},k.prototype.ins=function(e,t){return this.instruction(e,t)},k.prototype.dec=function(e,t,r){return this.declaration(e,t,r)},k.prototype.dtd=function(e,t,r){return this.doctype(e,t,r)},k.prototype.e=function(e,t,r){return this.element(e,t,r)},k.prototype.n=function(e,t,r){return this.node(e,t,r)},k.prototype.t=function(e){return this.text(e)},k.prototype.d=function(e){return this.cdata(e)},k.prototype.c=function(e){return this.comment(e)},k.prototype.r=function(e){return this.raw(e)},k.prototype.i=function(e,t){return this.instruction(e,t)},k.prototype.att=function(){return(this.currentNode&&this.currentNode.type===u.DocType?this.attList:this.attribute).apply(this,arguments)},k.prototype.a=function(){return(this.currentNode&&this.currentNode.type===u.DocType?this.attList:this.attribute).apply(this,arguments)},k.prototype.ent=function(e,t){return this.entity(e,t)},k.prototype.pent=function(e,t){return this.pEntity(e,t)},k.prototype.not=function(e,t){return this.notation(e,t)},k)}.call(this)},{"./NodeType":500,"./Utility":501,"./WriterState":502,"./XMLAttribute":503,"./XMLCData":504,"./XMLComment":506,"./XMLDTDAttList":511,"./XMLDTDElement":512,"./XMLDTDEntity":513,"./XMLDTDNotation":514,"./XMLDeclaration":515,"./XMLDocType":516,"./XMLDocument":517,"./XMLElement":520,"./XMLProcessingInstruction":524,"./XMLRaw":525,"./XMLStringWriter":527,"./XMLStringifier":528,"./XMLText":529}],519:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLNode"),a=e("./NodeType");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e){i.__super__.constructor.call(this,e),this.type=a.Dummy}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return""},i}()}.call(this)},{"./NodeType":500,"./XMLNode":522}],520:[function(t,r,e){!function(){var i={}.hasOwnProperty,e=t("./Utility"),o=e.isObject,s=e.isFunction,c=e.getValue,u=t("./XMLNode"),l=t("./NodeType"),f=t("./XMLAttribute"),p=t("./XMLNamedNodeMap");r.exports=function(){var e,t=a,r=u;for(e in r)i.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function a(e,t,r){var n,i,o,s;if(a.__super__.constructor.call(this,e),null==t)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(t),this.type=l.Element,this.attribs={},(this.schemaTypeInfo=null)!=r&&this.attribute(r),e.type===l.Document&&(this.isRoot=!0,(this.documentObject=e).rootObject=this,e.children))for(i=0,o=(s=e.children).length;i":null!=(t=this.parent)&&t.name?"node: <"+e+">, parent: <"+this.parent.name+">":"node: <"+e+">":""},g.prototype.ele=function(e,t,r){return this.element(e,t,r)},g.prototype.nod=function(e,t,r){return this.node(e,t,r)},g.prototype.txt=function(e){return this.text(e)},g.prototype.dat=function(e){return this.cdata(e)},g.prototype.com=function(e){return this.comment(e)},g.prototype.ins=function(e,t){return this.instruction(e,t)},g.prototype.doc=function(){return this.document()},g.prototype.dec=function(e,t,r){return this.declaration(e,t,r)},g.prototype.e=function(e,t,r){return this.element(e,t,r)},g.prototype.n=function(e,t,r){return this.node(e,t,r)},g.prototype.t=function(e){return this.text(e)},g.prototype.d=function(e){return this.cdata(e)},g.prototype.c=function(e){return this.comment(e)},g.prototype.r=function(e){return this.raw(e)},g.prototype.i=function(e,t){return this.instruction(e,t)},g.prototype.u=function(){return this.up()},g.prototype.importXMLBuilder=function(e){return this.importDocument(e)},g.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasChildNodes=function(){return 0!==this.children.length},g.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isSupported=function(e,t){return!0},g.prototype.hasAttributes=function(){return 0!==this.attribs.length},g.prototype.compareDocumentPosition=function(e){var t;return this===e?0:this.document()!==e.document()?(t=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?t|=r.Preceding:t|=r.Following,t):this.isAncestor(e)?r.Contains|r.Preceding:this.isDescendant(e)?r.Contains|r.Following:this.isPreceding(e)?r.Preceding:r.Following},g.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(e){var t,r,n;if(e.nodeType!==this.nodeType)return!1;if(e.children.length!==this.children.length)return!1;for(t=r=0,n=this.children.length-1;0<=n?r<=n:n<=r;t=0<=n?++r:--r)if(!this.children[t].isEqualNode(e.children[t]))return!1;return!0},g.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setUserData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.contains=function(e){return!!e&&(e===this||this.isDescendant(e))},g.prototype.isDescendant=function(e){for(var t,r=this.children,n=0,i=r.length;n"),this.stream.write(this.endline(e,t,r)),t.state=h.None,this.closeNode(e,t,r)},i.prototype.element=function(e,t,r){var n,i,o,s,a,c,u,l,f;for(u in this.openNode(e,t,r=r||0),t.state=h.OpenTag,this.stream.write(this.indent(e,t,r)+"<"+e.name),l=e.attribs)p.call(l,u)&&(n=l[u],this.attribute(n,t,r));if(s=0===(o=e.children.length)?null:e.children[0],0===o||e.children.every(function(e){return(e.type===d.Text||e.type===d.Raw)&&""===e.value}))t.allowEmpty?(this.stream.write(">"),t.state=h.CloseTag,this.stream.write("")):(t.state=h.CloseTag,this.stream.write(t.spaceBeforeSlash+"/>"));else if(!t.pretty||1!==o||s.type!==d.Text&&s.type!==d.Raw||null==s.value){for(this.stream.write(">"+this.endline(e,t,r)),t.state=h.InsideTag,a=0,c=(f=e.children).length;a")}else this.stream.write(">"),t.state=h.InsideTag,t.suppressPrettyCount++,this.writeChildNode(s,t,r+1),t.suppressPrettyCount--,t.state=h.CloseTag,this.stream.write("");return this.stream.write(this.endline(e,t,r)),t.state=h.None,this.closeNode(e,t,r)},i.prototype.processingInstruction=function(e,t,r){return this.stream.write(i.__super__.processingInstruction.call(this,e,t,r))},i.prototype.raw=function(e,t,r){return this.stream.write(i.__super__.raw.call(this,e,t,r))},i.prototype.text=function(e,t,r){return this.stream.write(i.__super__.text.call(this,e,t,r))},i.prototype.dtdAttList=function(e,t,r){return this.stream.write(i.__super__.dtdAttList.call(this,e,t,r))},i.prototype.dtdElement=function(e,t,r){return this.stream.write(i.__super__.dtdElement.call(this,e,t,r))},i.prototype.dtdEntity=function(e,t,r){return this.stream.write(i.__super__.dtdEntity.call(this,e,t,r))},i.prototype.dtdNotation=function(e,t,r){return this.stream.write(i.__super__.dtdNotation.call(this,e,t,r))},i}()}.call(this)},{"./NodeType":500,"./WriterState":502,"./XMLWriterBase":530}],527:[function(e,t,r){!function(){var o={}.hasOwnProperty,s=e("./XMLWriterBase");t.exports=function(){var e,t=i,r=s;for(e in r)o.call(r,e)&&(t[e]=r[e]);function n(){this.constructor=t}function i(e){i.__super__.constructor.call(this,e)}return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,i.prototype.document=function(e,t){var r,n,i,o,s;for(t=this.filterOptions(t),o="",n=0,i=(s=e.children).length;n","]]]]>"),this.assertLegalChar(e))},e.prototype.comment=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+e);return this.assertLegalChar(e)},e.prototype.raw=function(e){return this.options.noValidation?e:""+e||""},e.prototype.attValue=function(e){return this.options.noValidation?e:this.assertLegalChar(this.attEscape(e=""+e||""))},e.prototype.insTarget=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.insValue=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+e);return this.assertLegalChar(e)},e.prototype.xmlVersion=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/1\.[0-9]+/))return e;throw new Error("Invalid version number: "+e)},e.prototype.xmlEncoding=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))return this.assertLegalChar(e);throw new Error("Invalid encoding: "+e)},e.prototype.xmlStandalone=function(e){return this.options.noValidation?e:e?"yes":"no"},e.prototype.dtdPubID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdSysID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdElementValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdAttType=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdAttDefault=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdEntityValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdNData=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(e){var t;if(!this.options.noValidation)if("1.0"===this.options.version){if(t=e.match(/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+e+" at index "+t.index)}else if("1.1"===this.options.version&&(t=e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)))throw new Error("Invalid character in string: "+e+" at index "+t.index);return e},e.prototype.assertLegalName=function(e){if(this.options.noValidation)return e;if(this.assertLegalChar(e),e.match(/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/))return e;throw new Error("Invalid character in name")},e.prototype.textEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(//g,">").replace(/\r/g," "))},e.prototype.attEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(/"+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.comment=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+"\x3c!-- ",t.state=g.InsideTag,n+=e.value,t.state=g.CloseTag,n+=" --\x3e"+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.declaration=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+"")+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.docType=function(e,t,r){var n,i,o,s,a;if(this.openNode(e,t,r=r||0),t.state=g.OpenTag,s=this.indent(e,t,r),s+="")+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),s},e.prototype.element=function(e,t,r){var n,i,o,s,a,c,u,l,f,p,d,h,y=!1,m="";for(f in this.openNode(e,t,r=r||0),t.state=g.OpenTag,m+=this.indent(e,t,r)+"<"+e.name,p=e.attribs)v.call(p,f)&&(n=p[f],m+=this.attribute(n,t,r));if(s=0===(o=e.children.length)?null:e.children[0],0===o||e.children.every(function(e){return(e.type===b.Text||e.type===b.Raw)&&""===e.value}))t.allowEmpty?(m+=">",t.state=g.CloseTag,m+=""+this.endline(e,t,r)):(t.state=g.CloseTag,m+=t.spaceBeforeSlash+"/>"+this.endline(e,t,r));else if(!t.pretty||1!==o||s.type!==b.Text&&s.type!==b.Raw||null==s.value){if(t.dontPrettyTextNodes)for(a=0,u=(d=e.children).length;a"+this.endline(e,t,r),t.state=g.InsideTag,c=0,l=(h=e.children).length;c",y&&t.suppressPrettyCount--,m+=this.endline(e,t,r),t.state=g.None}else m+=">",t.state=g.InsideTag,t.suppressPrettyCount++,y=!0,m+=this.writeChildNode(s,t,r+1),t.suppressPrettyCount--,y=!1,t.state=g.CloseTag,m+=""+this.endline(e,t,r);return this.closeNode(e,t,r),m},e.prototype.writeChildNode=function(e,t,r){switch(e.type){case b.CData:return this.cdata(e,t,r);case b.Comment:return this.comment(e,t,r);case b.Element:return this.element(e,t,r);case b.Raw:return this.raw(e,t,r);case b.Text:return this.text(e,t,r);case b.ProcessingInstruction:return this.processingInstruction(e,t,r);case b.Dummy:return"";case b.Declaration:return this.declaration(e,t,r);case b.DocType:return this.docType(e,t,r);case b.AttributeDeclaration:return this.dtdAttList(e,t,r);case b.ElementDeclaration:return this.dtdElement(e,t,r);case b.EntityDeclaration:return this.dtdEntity(e,t,r);case b.NotationDeclaration:return this.dtdNotation(e,t,r);default:throw new Error("Unknown XML node type: "+e.constructor.name)}},e.prototype.processingInstruction=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+"")+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.raw=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r),t.state=g.InsideTag,n+=e.value,t.state=g.CloseTag,n+=this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.text=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r),t.state=g.InsideTag,n+=e.value,t.state=g.CloseTag,n+=this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdAttList=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdElement=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdEntity=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.dtdNotation=function(e,t,r){var n;return this.openNode(e,t,r),t.state=g.OpenTag,n=this.indent(e,t,r)+""+this.endline(e,t,r),t.state=g.None,this.closeNode(e,t,r),n},e.prototype.openNode=function(e,t,r){},e.prototype.closeNode=function(e,t,r){},e.prototype.openAttribute=function(e,t,r){},e.prototype.closeAttribute=function(e,t,r){},e)}.call(this)},{"./NodeType":500,"./Utility":501,"./WriterState":502,"./XMLCData":504,"./XMLComment":506,"./XMLDTDAttList":511,"./XMLDTDElement":512,"./XMLDTDEntity":513,"./XMLDTDNotation":514,"./XMLDeclaration":515,"./XMLDocType":516,"./XMLDummy":519,"./XMLElement":520,"./XMLProcessingInstruction":524,"./XMLRaw":525,"./XMLText":529}],531:[function(u,l,e){!function(){var e=u("./Utility"),i=e.assign,o=e.isFunction,e=u("./XMLDOMImplementation"),s=u("./XMLDocument"),a=u("./XMLDocumentCB"),t=u("./XMLStringWriter"),r=u("./XMLStreamWriter"),n=u("./NodeType"),c=u("./WriterState");l.exports.create=function(e,t,r,n){if(null==e)throw new Error("Root element needs a name.");return n=i({},t,r,n),r=(t=new s(n)).element(e),n.headless||(t.declaration(n),null==n.pubID&&null==n.sysID)||t.dtd(n),r},l.exports.begin=function(e,t,r){var n;return o(e)&&(t=(n=[e,t])[0],r=n[1],e={}),t?new a(e,t,r):new s(e)},l.exports.stringWriter=function(e){return new t(e)},l.exports.streamWriter=function(e,t){return new r(e,t)},l.exports.implementation=new e,l.exports.nodeType=n,l.exports.writerState=c}.call(this)},{"./NodeType":500,"./Utility":501,"./WriterState":502,"./XMLDOMImplementation":509,"./XMLDocument":517,"./XMLDocumentCB":518,"./XMLStreamWriter":526,"./XMLStringWriter":527}],532:[function(e,t,r){t.exports=function(){for(var e={},t=0;ta?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,s=0;s>>32-i,r)}function f(e,t,r,n,i,o,s){return a(t&r|~t&n,e,t,i,o,s)}function p(e,t,r,n,i,o,s){return a(t&n|r&~n,e,t,i,o,s)}function d(e,t,r,n,i,o,s){return a(t^r^n,e,t,i,o,s)}function h(e,t,r,n,i,o,s){return a(r^(t|~n),e,t,i,o,s)}function y(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return n.hash(e,i,16)}},{"./helpers":534}],536:[function(e,t,r){"use strict";var n=e("./helpers");function i(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,i,o=Array(80),s=1732584193,a=-271733879,c=-1732584194,u=271733878,l=-1009589776,f=0;f>16)+(t>>16)+(r>>16)<<16|65535&r}function j(e,t){return e<>>32-t}t.exports=function(e){return n.hash(e,i,20,!0)}},{"./helpers":534}],537:[function(e,t,r){"use strict";function g(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function n(e,t){var r,n=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),i=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),o=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var s,a,c=0;c>>t|e<<32-t},j=function(e,t){return e>>>t};t.exports=function(e){return i.hash(e,n,32,!0)}},{"./helpers":534}],538:[function(e,t,r){"use strict";t.exports=function(){return function(){}}},{}],539:[function(i,o,e){!function(n){!function(){"use strict";var t=i("@babel/runtime/helpers/interopRequireDefault")(i("@babel/runtime/helpers/typeof")),r=i("stream").Stream,e=i("../lib/common/utils/isArray").isArray;o.exports.string=function(e){return"string"==typeof e},o.exports.array=e,o.exports.buffer=n.isBuffer,o.exports.writableStream=function(e){return e instanceof r&&"function"==typeof e._write&&"object"===(0,t.default)(e._writableState)}}.call(this)}.call(this,{isBuffer:i("../node_modules/is-buffer/index.js")})},{"../lib/common/utils/isArray":66,"../node_modules/is-buffer/index.js":411,"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,stream:470}],540:[function(e,t,r){"use strict";e=e("immediate"),t=t.exports={};function n(){}t.nextTick=e,t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=n,t.addListener=n,t.once=n,t.off=n,t.removeListener=n,t.removeAllListeners=n,t.emit=n,t.prependListener=n,t.prependOnceListener=n,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{immediate:403}],541:[function(n,e,i){!function(u){!function(){"use strict";n("core-js/modules/es.regexp.exec.js"),n("core-js/modules/es.string.search.js");var s=n("./lib/request"),e=n("./lib/response"),a=n("xtend"),t=n("builtin-status-codes"),c=n("url"),r=i;r.request=function(e,t){e="string"==typeof e?c.parse(e):a(e);var r=-1===u.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||r,n=e.hostname||e.host,i=e.port,o=e.path||"/",r=(n&&-1!==n.indexOf(":")&&(n="["+n+"]"),e.url=(n?r+"//"+n:"")+(i?":"+i:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{},new s(e));return t&&r.on("response",t),r},r.get=function(e,t){e=r.request(e,t);return e.end(),e},r.ClientRequest=s,r.IncomingMessage=e.IncomingMessage,r.Agent=function(){},r.Agent.defaultMaxSockets=4,r.globalAgent=new r.Agent,r.STATUS_CODES=t,r.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,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":543,"./lib/response":544,"builtin-status-codes":104,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.search.js":348,url:545,xtend:532}],542:[function(a,e,c){!function(s){!function(){"use strict";a("core-js/modules/es.object.to-string.js"),a("core-js/modules/es.promise.js"),a("core-js/modules/es.array-buffer.constructor.js"),a("core-js/modules/es.array-buffer.slice.js"),a("core-js/modules/es.array.slice.js"),c.fetch=o(s.fetch)&&o(s.ReadableStream),c.writableStream=o(s.WritableStream),c.abortController=o(s.AbortController),c.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),c.blobConstructor=!0}catch(e){}var t;function r(){if(void 0===t)if(s.XMLHttpRequest){t=new s.XMLHttpRequest;try{t.open("GET",s.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function e(e){var t=r();if(t)try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var n=void 0!==s.ArrayBuffer,i=n&&o(s.ArrayBuffer.prototype.slice);function o(e){return"function"==typeof e}c.arraybuffer=c.fetch||n&&e("arraybuffer"),c.msstream=!c.fetch&&i&&e("ms-stream"),c.mozchunkedarraybuffer=!c.fetch&&n&&e("moz-chunked-arraybuffer"),c.overrideMimeType=c.fetch||!!r()&&o(r().overrideMimeType),c.vbArray=o(s.VBArray),t=null}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"core-js/modules/es.array-buffer.constructor.js":308,"core-js/modules/es.array-buffer.slice.js":309,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335}],543:[function(o,s,e){!function(f,p,d){!function(){"use strict";o("core-js/modules/es.object.to-string.js"),o("core-js/modules/es.regexp.to-string.js"),o("core-js/modules/web.dom-collections.for-each.js"),o("core-js/modules/es.object.keys.js"),o("core-js/modules/es.array.concat.js"),o("core-js/modules/es.array.map.js"),o("core-js/modules/es.function.name.js"),o("core-js/modules/es.promise.js");var c=o("./capability"),e=o("inherits"),t=o("./response"),i=o("readable-stream"),u=o("to-arraybuffer"),r=t.IncomingMessage,l=t.readyStates;t=s.exports=function(t){var e,r=this,n=(i.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+new d(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){r.setHeader(e,t.headers[e])}),!0);if("disable-fetch"===t.mode||"requestTimeout"in t&&!c.abortController)e=!(n=!1);else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!c.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}r._mode=(e=e,n=n,c.fetch&&n?"fetch":c.mozchunkedarraybuffer?"moz-chunked-arraybuffer":c.msstream?"ms-stream":c.arraybuffer&&e?"arraybuffer":c.vbArray&&e?"text:vbarray":"text"),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};e(t,i.Writable),t.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===n.indexOf(r)&&(this._headers[r]={name:e,value:t})},t.prototype.getHeader=function(e){e=this._headers[e.toLowerCase()];return e?e.value:null},t.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},t.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts,r=t._headers,n=null,i=("GET"!==e.method&&"HEAD"!==e.method&&(n=c.arraybuffer?u(d.concat(t._body)):c.blobConstructor?new p.Blob(t._body.map(function(e){return u(e)}),{type:(r["content-type"]||{}).value||""}):d.concat(t._body).toString()),[]);if(Object.keys(r).forEach(function(e){var t=r[e].name,e=r[e].value;Array.isArray(e)?e.forEach(function(e){i.push([t,e])}):i.push([t,e])}),"fetch"===t._mode){var o,s=null;c.abortController&&(s=(o=new AbortController).signal,t._fetchAbortController=o,"requestTimeout"in e)&&0!==e.requestTimeout&&(t._fetchTimer=p.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout)),p.fetch(t._opts.url,{method:t._opts.method,headers:i,body:n||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:s}).then(function(e){t._fetchResponse=e,t._connect()},function(e){p.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)})}else{var a=t._xhr=new p.XMLHttpRequest;try{a.open(t._opts.method,t._opts.url,!0)}catch(e){return void f.nextTick(function(){t.emit("error",e)})}"responseType"in a&&(a.responseType=t._mode.split(":")[0]),"withCredentials"in a&&(a.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in a&&a.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(a.timeout=e.requestTimeout,a.ontimeout=function(){t.emit("requestTimeout")}),i.forEach(function(e){a.setRequestHeader(e[0],e[1])}),t._response=null,a.onreadystatechange=function(){switch(a.readyState){case l.LOADING:case l.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(a.onprogress=function(){t._onXHRProgress()}),a.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{a.send(n)}catch(e){f.nextTick(function(){t.emit("error",e)})}}}},t.prototype._onXHRProgress=function(){!function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){}}(this._xhr)||this._destroyed||(this._response||this._connect(),this._response._onXHRProgress())},t.prototype._connect=function(){var t=this;t._destroyed||(t._response=new r(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},t.prototype._write=function(e,t,r){this._body.push(e),r()},t.prototype.abort=t.prototype.destroy=function(){this._destroyed=!0,p.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},t.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),i.Writable.prototype.end.call(this,e,t,r)},t.prototype.flushHeaders=function(){},t.prototype.setTimeout=function(){},t.prototype.setNoDelay=function(){},t.prototype.setSocketKeepAlive=function(){};var n=["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"]}.call(this)}.call(this,o("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},o("buffer").Buffer)},{"./capability":542,"./response":544,_process:540,buffer:103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.map.js":318,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.keys.js":330,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.to-string.js":341,"core-js/modules/web.dom-collections.for-each.js":382,inherits:409,"readable-stream":465,"to-arraybuffer":487}],544:[function(r,e,n){!function(l,f,p){!function(){"use strict";r("core-js/modules/es.object.to-string.js"),r("core-js/modules/web.dom-collections.for-each.js"),r("core-js/modules/es.promise.js"),r("core-js/modules/es.regexp.exec.js"),r("core-js/modules/es.string.split.js"),r("core-js/modules/es.string.match.js"),r("core-js/modules/es.array.iterator.js"),r("core-js/modules/es.array-buffer.slice.js"),r("core-js/modules/es.typed-array.uint8-array.js"),r("core-js/modules/es.typed-array.copy-within.js"),r("core-js/modules/es.typed-array.every.js"),r("core-js/modules/es.typed-array.fill.js"),r("core-js/modules/es.typed-array.filter.js"),r("core-js/modules/es.typed-array.find.js"),r("core-js/modules/es.typed-array.find-index.js"),r("core-js/modules/es.typed-array.for-each.js"),r("core-js/modules/es.typed-array.includes.js"),r("core-js/modules/es.typed-array.index-of.js"),r("core-js/modules/es.typed-array.iterator.js"),r("core-js/modules/es.typed-array.join.js"),r("core-js/modules/es.typed-array.last-index-of.js"),r("core-js/modules/es.typed-array.map.js"),r("core-js/modules/es.typed-array.reduce.js"),r("core-js/modules/es.typed-array.reduce-right.js"),r("core-js/modules/es.typed-array.reverse.js"),r("core-js/modules/es.typed-array.set.js"),r("core-js/modules/es.typed-array.slice.js"),r("core-js/modules/es.typed-array.some.js"),r("core-js/modules/es.typed-array.sort.js"),r("core-js/modules/es.typed-array.subarray.js"),r("core-js/modules/es.typed-array.to-locale-string.js"),r("core-js/modules/es.typed-array.to-string.js"),r("core-js/modules/es.array.slice.js");var a=r("./capability"),e=r("inherits"),c=r("readable-stream"),u=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},t=n.IncomingMessage=function(e,t,r,n){var i=this;if(c.Readable.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",function(){l.nextTick(function(){i.emit("close")})}),"fetch"===r){r=function t(){s.read().then(function(e){i._destroyed||(e.done?(f.clearTimeout(n),i.push(null)):(i.push(new p(e.value)),t()))}).catch(function(e){f.clearTimeout(n),i._destroyed||i.emit("error",e)})};if(i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText,t.headers.forEach(function(e,t){i.headers[t.toLowerCase()]=e,i.rawHeaders.push(t,e)}),a.writableStream){var o=new WritableStream({write:function(r){return new Promise(function(e,t){i._destroyed?t():i.push(new p(r))?e():i._resumeFetch=e})},close:function(){f.clearTimeout(n),i._destroyed||i.push(null)},abort:function(e){i._destroyed||i.emit("error",e)}});try{return void t.body.pipeTo(o).catch(function(e){f.clearTimeout(n),i._destroyed||i.emit("error",e)})}catch(e){}}var s=t.body.getReader();r()}else i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t,e=e.match(/^([^:]+):\s*(.*)/);e&&("set-cookie"===(t=e[1].toLowerCase())?(void 0===i.headers[t]&&(i.headers[t]=[]),i.headers[t].push(e[2])):void 0!==i.headers[t]?i.headers[t]+=", "+e[2]:i.headers[t]=e[2],i.rawHeaders.push(e[1],e[2]))}),i._charset="x-user-defined",a.overrideMimeType||((o=i.rawHeaders["mime-type"])&&(t=o.match(/;\s*charset=([^;])(;|$)/))&&(i._charset=t[1].toLowerCase()),i._charset)||(i._charset="utf-8")};e(t,c.Readable),t.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},t.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==u.DONE)break;try{r=new f.VBArray(e.responseBody).toArray()}catch(e){}if(null!==r){t.push(new p(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var n=r.substr(t._pos);if("x-user-defined"===t._charset){for(var i=new p(n.length),o=0;ot._pos&&(t.push(new p(new Uint8Array(s.result.slice(t._pos)))),t._pos=s.result.byteLength)},s.onload=function(){t.push(null)},s.readAsArrayBuffer(r))}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&t.push(null)}}.call(this)}.call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":542,_process:540,buffer:103,"core-js/modules/es.array-buffer.slice.js":309,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.match.js":346,"core-js/modules/es.string.split.js":349,"core-js/modules/es.typed-array.copy-within.js":358,"core-js/modules/es.typed-array.every.js":359,"core-js/modules/es.typed-array.fill.js":360,"core-js/modules/es.typed-array.filter.js":361,"core-js/modules/es.typed-array.find-index.js":362,"core-js/modules/es.typed-array.find.js":363,"core-js/modules/es.typed-array.for-each.js":364,"core-js/modules/es.typed-array.includes.js":365,"core-js/modules/es.typed-array.index-of.js":366,"core-js/modules/es.typed-array.iterator.js":367,"core-js/modules/es.typed-array.join.js":368,"core-js/modules/es.typed-array.last-index-of.js":369,"core-js/modules/es.typed-array.map.js":370,"core-js/modules/es.typed-array.reduce-right.js":371,"core-js/modules/es.typed-array.reduce.js":372,"core-js/modules/es.typed-array.reverse.js":373,"core-js/modules/es.typed-array.set.js":374,"core-js/modules/es.typed-array.slice.js":375,"core-js/modules/es.typed-array.some.js":376,"core-js/modules/es.typed-array.sort.js":377,"core-js/modules/es.typed-array.subarray.js":378,"core-js/modules/es.typed-array.to-locale-string.js":379,"core-js/modules/es.typed-array.to-string.js":380,"core-js/modules/es.typed-array.uint8-array.js":381,"core-js/modules/web.dom-collections.for-each.js":382,inherits:409,"readable-stream":465}],545:[function(e,t,r){"use strict";var S=e("@babel/runtime/helpers/interopRequireDefault")(e("@babel/runtime/helpers/typeof")),k=(e("core-js/modules/es.regexp.exec.js"),e("core-js/modules/es.string.search.js"),e("core-js/modules/es.array.concat.js"),e("core-js/modules/es.string.split.js"),e("core-js/modules/es.string.replace.js"),e("core-js/modules/es.array.join.js"),e("core-js/modules/es.string.trim.js"),e("core-js/modules/es.string.match.js"),e("core-js/modules/es.array.slice.js"),e("core-js/modules/es.object.keys.js"),e("core-js/modules/es.array.splice.js"),e("punycode")),_=e("./util");function w(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=i,r.resolve=function(e,t){return i(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?i(e,!1,!0).resolveObject(t):t},r.format=function(e){_.isString(e)&&(e=i(e));return e instanceof w?e.format():w.prototype.format.call(e)},r.Url=w;var T=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,E=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,r=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),O=["'"].concat(r),A=["%","/","?",";","#"].concat(O),I=["/","?","#"],D=/^[+a-z0-9A-Z_-]{0,63}$/,R=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},N=e("querystring");function i(e,t,r){var n;return e&&_.isObject(e)&&e instanceof w?e:((n=new w).parse(e,t,r),n)}w.prototype.parse=function(e,t,r){if(!_.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(0,S.default)(e));var n=e.indexOf("?"),n=-1!==n&&nc.maxRedirects))return r=c.formatRedirectUrl?c.formatRedirectUrl(a,n):q.resolve(a,n),W("Request#%d %s: `redirected` from %s to %s",l,h.path,a,r),E(),c.headers&&c.headers.Host&&X.test(n)&&(c.headers.Host=null),n=u,u=null,J.requestWithCallback(r,c,n),{redirect:!0,error:null};(t=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+a)).name="MaxRedirectError"}else(t=new Error("Got statusCode "+e.statusCode+" but cannot resolve next location from headers")).name="FollowRedirectError"}return{redirect:!1,error:t}}c.timing&&(_={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),!c.gzip||h.headers["Accept-Encoding"]||h.headers["accept-encoding"]||(h.headers["Accept-Encoding"]="gzip");var I,D,R,C=c.writeStream;function M(){W("Response timer ticking, timeout: %d",D),m=setTimeout(function(){m=null;var e="Response timeout for "+D+"ms";(b=new Error(e)).name="ResponseTimeoutError",b.requestId=l,W("ResponseTimeout: Request#%d %s %s: %s, connected: %s",l,a,b.name,e,g),P()},D)}W("Request#%d %s %s with headers %j, options.path: %s",l,r,a,h.headers,h.path),c.requestUrls.push(a),Array.isArray(c.timeout)?(I=G(c.timeout[0]),D=G(c.timeout[1])):I=D=G(c.timeout),W("ConnectTimeout: %d, ResponseTimeout: %d",I,D),h.mode=c.mode||"";try{R=i.request(h,function(i){var e,t;return _&&(_.waiting=Date.now()-p),W("Request#%d %s `req response` event emit: status %d, headers: %j",l,a,i.statusCode,i.headers),c.streaming?(e=A(i)).redirect?void i.resume():e.error?(i.resume(),O(e.error,null,i)):O(null,null,i):(i.on("close",function(){W("Request#%d %s: `res close` event emit, total size %d",l,a,j)}),i.on("error",function(){W("Request#%d %s: `res error` event emit, total size %d",l,a,j)}),i.on("aborted",function(){x=!0,W("Request#%d %s: `res aborted` event emit, total size %d",l,a,j)}),C?(e=A(i)).redirect?void i.resume():e.error?(i.resume(),C.end(),O(e.error,null,i)):(!1===c.consumeWriteStream?i.on("end",O.bind(null,null,null,i)):C.on("close",function(){W("Request#%d %s: writeStream close event emitted",l,a),O(b||null,null,i)}),i.pipe(C)):(t=[],i.on("data",function(e){W("Request#%d %s: `res data` event emit, size %d",l,a,e.length),j+=e.length,t.push(e)}),void i.on("end",function(){var e,n=Y.concat(t,j);return W("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",l,a,j,i._dumped),b?O(b,n,i):(e=A(i)).error?O(e.error,n,i):void(e.redirect||function(e,t,r){if(e)return O(e,n,i);if(!r&&0<=K.indexOf(c.dataType)){try{t=decodeBodyByCharset(t,i)}catch(e){return W("decodeBodyByCharset error: %s",e),O(null,t,i)}"json"===c.dataType&&(0===j?t=null:(r=parseJSON(t,N)).error?e=r.error:t=r.data)}x&&W("Request#%d %s: Remote socket was terminated before `response.end()` was called",l,a),O(e,t,i)}(null,n,i.headers["content-encoding"]))})))})}catch(e){return O(e)}function P(){W("Request#%d %s abort, connected: %s",l,a,g),R.socket||(b.noSocket=!0,O(b)),R.abort()}return"undefined"==typeof window?(W("Connect timer ticking, timeout: %d",I),s=setTimeout(function(){s=null,-1===w&&(w=-2);var e="Connect timeout for "+I+"ms",t="ConnectionTimeoutError";R.socket||(t="SocketAssignTimeoutError",e+=", working sockets is full"),(b=new Error(e)).name=t,b.requestId=l,W("ConnectTimeout: Request#%d %s %s: %s, connected: %s",l,a,b.name,e,g),P()},I)):R.on("requestTimeout",function(){-1===w&&(w=-2);(b=new Error("Connect timeout for "+I+"ms")).name="ConnectionTimeoutError",b.requestId=l,P()}),_&&R.on("finish",function(){_.requestSent=Date.now()-p}),R.once("socket",function(e){_&&(_.queuing=Date.now()-p);var t=e.readyState;"opening"===t?(e.once("lookup",function(e,t,r){W("Request#%d %s lookup: %s, %s, %s",l,a,e,t,r),_&&(_.dnslookup=Date.now()-p),t&&(S=t)}),e.once("connect",function(){_&&(_.connected=Date.now()-p),T(),M(),W("Request#%d %s new socket connected",l,a),g=!0,S=S||e.remoteAddress,k=e.remotePort})):(W("Request#%d %s reuse socket connected, readyState: %s",l,a,t),v=g=!0,S=S||e.remoteAddress,k=e.remotePort,T(),M())}),R.on("error",function(e){"Error"!==e.name&&"TypeError"!==e.name||(e.name=g?"ResponseError":"RequestError"),e.message+=' (req "error")',W("Request#%d %s `req error` event emit, %s: %s",l,a,e.name,e.message),O(b||e)}),C&&C.once("error",function(e){e.message+=' (writeStream "error")',W("Request#%d %s `writeStream error` event emit, %s: %s",l,a,(b=e).name,e.message),P()}),c.stream?(c.stream.pipe(R),c.stream.once("error",function(e){e.message+=' (stream "error")',W("Request#%d %s `readStream error` event emit, %s: %s",l,a,(b=e).name,e.message),P()})):R.end(n),R.requestId=l,R}}.call(this)}.call(this,e("_process"),e("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":84,"@babel/runtime/helpers/typeof":91,_process:540,buffer:103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":331,"core-js/modules/es.promise.js":335,"core-js/modules/es.regexp.exec.js":340,"core-js/modules/es.string.trim.js":351,debug:538,http:541,https:400,"humanize-ms":401,url:545,util:491}]},{},[1])(1)});})(window) diff --git a/lib/browser/version.js b/lib/browser/version.js index e0edadec..40400612 100644 --- a/lib/browser/version.js +++ b/lib/browser/version.js @@ -1 +1 @@ -exports.version = '6.19.0'; +exports.version = '6.20.0'; diff --git a/package.json b/package.json index 3c26738e..336992ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ali-oss", - "version": "6.19.0", + "version": "6.20.0", "description": "aliyun oss(object storage service) node client", "main": "./lib/client.js", "files": [