UNPKG

prettier

Version:

Prettier is an opinionated code formatter

1,704 lines (1,377 loc) 1.72 MB
'use strict'; var require$$0$6 = require('fs'); var require$$0$8 = require('path'); var require$$0$7 = require('os'); var require$$1$3 = require('tty'); var require$$0$9 = require('assert'); var require$$0$a = require('util'); var require$$0$b = require('stream'); var require$$0$c = require('events'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$6); var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$8); var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$7); var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$3); var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$9); var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$a); var require$$0__default$5 = /*#__PURE__*/_interopDefaultLegacy(require$$0$b); var require$$0__default$6 = /*#__PURE__*/_interopDefaultLegacy(require$$0$c); function getDefaultExportFromNamespaceIfPresent (n) { return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n; } var require$$0$5 = require("./package.json"); var lib$6 = {}; var base$1 = {}; /*istanbul ignore start*/ (function (exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = Diff; /*istanbul ignore end*/ function Diff() {} Diff.prototype = { /*istanbul ignore start*/ /*istanbul ignore end*/ diff: function diff(oldString, newString) { /*istanbul ignore start*/ var /*istanbul ignore end*/ options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var callback = options.callback; if (typeof options === 'function') { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function () { callback(undefined, value); }, 0); return true; } else { return value; } } // Allow subclasses to massage the input prior to running oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { // Identity per the equality and tokenizer return done([{ value: this.join(newString), count: newString.length }]); } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = /*istanbul ignore start*/ void 0 /*istanbul ignore end*/ ; var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value // is produced. if (callback) { (function exec() { setTimeout(function () { // This should not happen, but we want to be safe. /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, /*istanbul ignore start*/ /*istanbul ignore end*/ pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; } else { components.push({ count: 1, added: added, removed: removed }); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, /*istanbul ignore start*/ /*istanbul ignore end*/ equals: function equals(left, right) { if (this.options.comparator) { return this.options.comparator(left, right); } else { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ removeEmpty: function removeEmpty(array) { var ret = []; for (var i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; }, /*istanbul ignore start*/ /*istanbul ignore end*/ castInput: function castInput(value) { return value; }, /*istanbul ignore start*/ /*istanbul ignore end*/ tokenize: function tokenize(value) { return value.split(''); }, /*istanbul ignore start*/ /*istanbul ignore end*/ join: function join(chars) { return chars.join(''); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function (value, i) { var oldValue = oldString[oldPos + i]; return oldValue.length > value.length ? oldValue : value; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; // Reverse add and remove so removes are output first to match common convention // The diffing algorithm is tied to add then remove output and this is the simplest // route to get the desired output with minimal overhead. if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } // Special case handle for when one terminal is ignored (i.e. whitespace). // For this case we merge the terminal into the prior string and drop the change. // This is only available for string mode. var lastComponent = components[componentLen - 1]; if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } })(base$1); var character = {}; /*istanbul ignore start*/ Object.defineProperty(character, "__esModule", { value: true }); character.diffChars = diffChars; character.characterDiff = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ _base$6 = _interopRequireDefault$8(base$1) /*istanbul ignore end*/ ; /*istanbul ignore start*/ function _interopRequireDefault$8(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /*istanbul ignore end*/ var characterDiff = new /*istanbul ignore start*/ _base$6 /*istanbul ignore end*/ [ /*istanbul ignore start*/ "default" /*istanbul ignore end*/ ](); /*istanbul ignore start*/ character.characterDiff = characterDiff; /*istanbul ignore end*/ function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } var word = {}; var params = {}; /*istanbul ignore start*/ Object.defineProperty(params, "__esModule", { value: true }); params.generateOptions = generateOptions; /*istanbul ignore end*/ function generateOptions(options, defaults) { if (typeof options === 'function') { defaults.callback = options; } else if (options) { for (var name in options) { /* istanbul ignore else */ if (options.hasOwnProperty(name)) { defaults[name] = options[name]; } } } return defaults; } /*istanbul ignore start*/ Object.defineProperty(word, "__esModule", { value: true }); word.diffWords = diffWords; word.diffWordsWithSpace = diffWordsWithSpace; word.wordDiff = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ _base$5 = _interopRequireDefault$7(base$1) /*istanbul ignore end*/ ; var /*istanbul ignore start*/ _params$1 = params /*istanbul ignore end*/ ; /*istanbul ignore start*/ function _interopRequireDefault$7(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode // // Ranges and exceptions: // Latin-1 Supplement, 0080–00FF // - U+00D7 × Multiplication sign // - U+00F7 ÷ Division sign // Latin Extended-A, 0100–017F // Latin Extended-B, 0180–024F // IPA Extensions, 0250–02AF // Spacing Modifier Letters, 02B0–02FF // - U+02C7 ˇ &#711; Caron // - U+02D8 ˘ &#728; Breve // - U+02D9 ˙ &#729; Dot Above // - U+02DA ˚ &#730; Ring Above // - U+02DB ˛ &#731; Ogonek // - U+02DC ˜ &#732; Small Tilde // - U+02DD ˝ &#733; Double Acute Accent // Latin Extended Additional, 1E00–1EFF var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; var reWhitespace = /\S/; var wordDiff = new /*istanbul ignore start*/ _base$5 /*istanbul ignore end*/ [ /*istanbul ignore start*/ "default" /*istanbul ignore end*/ ](); /*istanbul ignore start*/ word.wordDiff = wordDiff; /*istanbul ignore end*/ wordDiff.equals = function (left, right) { if (this.options.ignoreCase) { left = left.toLowerCase(); right = right.toLowerCase(); } return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); }; wordDiff.tokenize = function (value) { // All whitespace symbols except newline group into one token, each newline - in separate token var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. for (var i = 0; i < tokens.length - 1; i++) { // If we have an empty string in the next field and we have only word chars before and after, merge if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { tokens[i] += tokens[i + 2]; tokens.splice(i + 1, 2); i--; } } return tokens; }; function diffWords(oldStr, newStr, options) { options = /*istanbul ignore start*/ (/*istanbul ignore end*/ /*istanbul ignore start*/ 0, _params$1 /*istanbul ignore end*/ . /*istanbul ignore start*/ generateOptions /*istanbul ignore end*/ )(options, { ignoreWhitespace: true }); return wordDiff.diff(oldStr, newStr, options); } function diffWordsWithSpace(oldStr, newStr, options) { return wordDiff.diff(oldStr, newStr, options); } var line$B = {}; /*istanbul ignore start*/ Object.defineProperty(line$B, "__esModule", { value: true }); line$B.diffLines = diffLines; line$B.diffTrimmedLines = diffTrimmedLines; line$B.lineDiff = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ _base$4 = _interopRequireDefault$6(base$1) /*istanbul ignore end*/ ; var /*istanbul ignore start*/ _params = params /*istanbul ignore end*/ ; /*istanbul ignore start*/ function _interopRequireDefault$6(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /*istanbul ignore end*/ var lineDiff = new /*istanbul ignore start*/ _base$4 /*istanbul ignore end*/ [ /*istanbul ignore start*/ "default" /*istanbul ignore end*/ ](); /*istanbul ignore start*/ line$B.lineDiff = lineDiff; /*istanbul ignore end*/ lineDiff.tokenize = function (value) { var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } // Merge the content and line separators into single tokens for (var i = 0; i < linesAndNewlines.length; i++) { var line = linesAndNewlines[i]; if (i % 2 && !this.options.newlineIsToken) { retLines[retLines.length - 1] += line; } else { if (this.options.ignoreWhitespace) { line = line.trim(); } retLines.push(line); } } return retLines; }; function diffLines(oldStr, newStr, callback) { return lineDiff.diff(oldStr, newStr, callback); } function diffTrimmedLines(oldStr, newStr, callback) { var options = /*istanbul ignore start*/ (/*istanbul ignore end*/ /*istanbul ignore start*/ 0, _params /*istanbul ignore end*/ . /*istanbul ignore start*/ generateOptions /*istanbul ignore end*/ )(callback, { ignoreWhitespace: true }); return lineDiff.diff(oldStr, newStr, options); } var sentence = {}; /*istanbul ignore start*/ Object.defineProperty(sentence, "__esModule", { value: true }); sentence.diffSentences = diffSentences; sentence.sentenceDiff = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ _base$3 = _interopRequireDefault$5(base$1) /*istanbul ignore end*/ ; /*istanbul ignore start*/ function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /*istanbul ignore end*/ var sentenceDiff = new /*istanbul ignore start*/ _base$3 /*istanbul ignore end*/ [ /*istanbul ignore start*/ "default" /*istanbul ignore end*/ ](); /*istanbul ignore start*/ sentence.sentenceDiff = sentenceDiff; /*istanbul ignore end*/ sentenceDiff.tokenize = function (value) { return value.split(/(\S.+?[.!?])(?=\s+|$)/); }; function diffSentences(oldStr, newStr, callback) { return sentenceDiff.diff(oldStr, newStr, callback); } var css$1 = {}; /*istanbul ignore start*/ Object.defineProperty(css$1, "__esModule", { value: true }); css$1.diffCss = diffCss; css$1.cssDiff = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ _base$2 = _interopRequireDefault$4(base$1) /*istanbul ignore end*/ ; /*istanbul ignore start*/ function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /*istanbul ignore end*/ var cssDiff = new /*istanbul ignore start*/ _base$2 /*istanbul ignore end*/ [ /*istanbul ignore start*/ "default" /*istanbul ignore end*/ ](); /*istanbul ignore start*/ css$1.cssDiff = cssDiff; /*istanbul ignore end*/ cssDiff.tokenize = function (value) { return value.split(/([{}:;,]|\s+)/); }; function diffCss(oldStr, newStr, callback) { return cssDiff.diff(oldStr, newStr, callback); } var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global$s = // 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$s == 'object' && global$s) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); var objectGetOwnPropertyDescriptor = {}; var fails$8 = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var fails$7 = fails$8; // Detect IE8's incomplete defineProperty implementation var descriptors$1 = !fails$7(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); var call$7 = Function.prototype.call; var functionCall = call$7.bind ? call$7.bind(call$7) : function () { return call$7.apply(call$7, arguments); }; var objectPropertyIsEnumerable = {}; var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor$1(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; var createPropertyDescriptor$3 = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var FunctionPrototype$1 = Function.prototype; var bind$4 = FunctionPrototype$1.bind; var call$6 = FunctionPrototype$1.call; var callBind = bind$4 && bind$4.bind(call$6); var functionUncurryThis = bind$4 ? function (fn) { return fn && callBind(call$6, fn); } : function (fn) { return fn && function () { return call$6.apply(fn, arguments); }; }; var uncurryThis$c = functionUncurryThis; var toString$5 = uncurryThis$c({}.toString); var stringSlice = uncurryThis$c(''.slice); var classofRaw$1 = function (it) { return stringSlice(toString$5(it), 8, -1); }; var global$r = global$s; var uncurryThis$b = functionUncurryThis; var fails$6 = fails$8; var classof$5 = classofRaw$1; var Object$4 = global$r.Object; var split = uncurryThis$b(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$6(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !Object$4('z').propertyIsEnumerable(0); }) ? function (it) { return classof$5(it) == 'String' ? split(it, '') : Object$4(it); } : Object$4; var global$q = global$s; var TypeError$a = global$q.TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$2 = function (it) { if (it == undefined) throw TypeError$a("Can't call method on " + it); return it; }; // toObject with fallback for non-array-like ES3 strings var IndexedObject = indexedObject; var requireObjectCoercible$1 = requireObjectCoercible$2; var toIndexedObject$4 = function (it) { return IndexedObject(requireObjectCoercible$1(it)); }; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable var isCallable$b = function (argument) { return typeof argument == 'function'; }; var isCallable$a = isCallable$b; var isObject$c = function (it) { return typeof it == 'object' ? it !== null : isCallable$a(it); }; var global$p = global$s; var isCallable$9 = isCallable$b; var aFunction = function (argument) { return isCallable$9(argument) ? argument : undefined; }; var getBuiltIn$5 = function (namespace, method) { return arguments.length < 2 ? aFunction(global$p[namespace]) : global$p[namespace] && global$p[namespace][method]; }; var uncurryThis$a = functionUncurryThis; var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf); var getBuiltIn$4 = getBuiltIn$5; var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || ''; var global$o = global$s; var userAgent$2 = engineUserAgent; var process$3 = global$o.process; var Deno = global$o.Deno; var versions = process$3 && process$3.versions || Deno && Deno.version; var v8$2 = versions && versions.v8; var match$1, version$2; if (v8$2) { match$1 = v8$2.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version$2 = match$1[0] > 0 && match$1[0] < 4 ? 1 : +(match$1[0] + match$1[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version$2 && userAgent$2) { match$1 = userAgent$2.match(/Edge\/(\d+)/); if (!match$1 || match$1[1] >= 74) { match$1 = userAgent$2.match(/Chrome\/(\d+)/); if (match$1) version$2 = +match$1[1]; } } var engineV8Version = version$2; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = engineV8Version; var fails$5 = fails$8; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(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; }); /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL$1 = nativeSymbol; var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var global$n = global$s; var getBuiltIn$3 = getBuiltIn$5; var isCallable$8 = isCallable$b; var isPrototypeOf$1 = objectIsPrototypeOf; var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; var Object$3 = global$n.Object; var isSymbol$6 = USE_SYMBOL_AS_UID$1 ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn$3('Symbol'); return isCallable$8($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$3(it)); }; var global$m = global$s; var String$3 = global$m.String; var tryToString$3 = function (argument) { try { return String$3(argument); } catch (error) { return 'Object'; } }; var global$l = global$s; var isCallable$7 = isCallable$b; var tryToString$2 = tryToString$3; var TypeError$9 = global$l.TypeError; // `Assert: IsCallable(argument) is true` var aCallable$5 = function (argument) { if (isCallable$7(argument)) return argument; throw TypeError$9(tryToString$2(argument) + ' is not a function'); }; var aCallable$4 = aCallable$5; // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod var getMethod$3 = function (V, P) { var func = V[P]; return func == null ? undefined : aCallable$4(func); }; var global$k = global$s; var call$5 = functionCall; var isCallable$6 = isCallable$b; var isObject$b = isObject$c; var TypeError$8 = global$k.TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive$1 = function (input, pref) { var fn, val; if (pref === 'string' && isCallable$6(fn = input.toString) && !isObject$b(val = call$5(fn, input))) return val; if (isCallable$6(fn = input.valueOf) && !isObject$b(val = call$5(fn, input))) return val; if (pref !== 'string' && isCallable$6(fn = input.toString) && !isObject$b(val = call$5(fn, input))) return val; throw TypeError$8("Can't convert object to primitive value"); }; var shared$3 = {exports: {}}; var global$j = global$s; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$1 = Object.defineProperty; var setGlobal$3 = function (key, value) { try { defineProperty$1(global$j, key, { value: value, configurable: true, writable: true }); } catch (error) { global$j[key] = value; } return value; }; var global$i = global$s; var setGlobal$2 = setGlobal$3; var SHARED = '__core-js_shared__'; var store$3 = global$i[SHARED] || setGlobal$2(SHARED, {}); var sharedStore = store$3; var store$2 = sharedStore; (shared$3.exports = function (key, value) { return store$2[key] || (store$2[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.19.1', mode: 'global', copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); var global$h = global$s; var requireObjectCoercible = requireObjectCoercible$2; var Object$2 = global$h.Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject$4 = function (argument) { return Object$2(requireObjectCoercible(argument)); }; var uncurryThis$9 = functionUncurryThis; var toObject$3 = toObject$4; var hasOwnProperty$b = uncurryThis$9({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty$b(toObject$3(it), key); }; var uncurryThis$8 = functionUncurryThis; var id = 0; var postfix = Math.random(); var toString$4 = uncurryThis$8(1.0.toString); var uid$3 = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36); }; var global$g = global$s; var shared$2 = shared$3.exports; var hasOwn$6 = hasOwnProperty_1; var uid$2 = uid$3; var NATIVE_SYMBOL = nativeSymbol; var USE_SYMBOL_AS_UID = useSymbolAsUid; var WellKnownSymbolsStore = shared$2('wks'); var Symbol$6 = global$g.Symbol; var symbolFor = Symbol$6 && Symbol$6['for']; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$6 : Symbol$6 && Symbol$6.withoutSetter || uid$2; var wellKnownSymbol$7 = function (name) { if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { var description = 'Symbol.' + name; if (NATIVE_SYMBOL && hasOwn$6(Symbol$6, name)) { WellKnownSymbolsStore[name] = Symbol$6[name]; } else if (USE_SYMBOL_AS_UID && symbolFor) { WellKnownSymbolsStore[name] = symbolFor(description); } else { WellKnownSymbolsStore[name] = createWellKnownSymbol(description); } } return WellKnownSymbolsStore[name]; }; var global$f = global$s; var call$4 = functionCall; var isObject$a = isObject$c; var isSymbol$5 = isSymbol$6; var getMethod$2 = getMethod$3; var ordinaryToPrimitive = ordinaryToPrimitive$1; var wellKnownSymbol$6 = wellKnownSymbol$7; var TypeError$7 = global$f.TypeError; var TO_PRIMITIVE = wellKnownSymbol$6('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive var toPrimitive$1 = function (input, pref) { if (!isObject$a(input) || isSymbol$5(input)) return input; var exoticToPrim = getMethod$2(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call$4(exoticToPrim, input, pref); if (!isObject$a(result) || isSymbol$5(result)) return result; throw TypeError$7("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; var toPrimitive = toPrimitive$1; var isSymbol$4 = isSymbol$6; // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey var toPropertyKey$3 = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol$4(key) ? key : key + ''; }; var global$e = global$s; var isObject$9 = isObject$c; var document$1 = global$e.document; // typeof document.createElement is 'object' in old IE var EXISTS$1 = isObject$9(document$1) && isObject$9(document$1.createElement); var documentCreateElement$1 = function (it) { return EXISTS$1 ? document$1.createElement(it) : {}; }; var DESCRIPTORS$5 = descriptors$1; var fails$4 = fails$8; var createElement = documentCreateElement$1; // Thank's IE8 for his funny defineProperty var ie8DomDefine = !DESCRIPTORS$5 && !fails$4(function () { // eslint-disable-next-line es/no-object-defineproperty -- requied for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); var DESCRIPTORS$4 = descriptors$1; var call$3 = functionCall; var propertyIsEnumerableModule = objectPropertyIsEnumerable; var createPropertyDescriptor$2 = createPropertyDescriptor$3; var toIndexedObject$3 = toIndexedObject$4; var toPropertyKey$2 = toPropertyKey$3; var hasOwn$5 = hasOwnProperty_1; var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject$3(O); P = toPropertyKey$2(P); if (IE8_DOM_DEFINE$1) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (hasOwn$5(O, P)) return createPropertyDescriptor$2(!call$3(propertyIsEnumerableModule.f, O, P), O[P]); }; var objectDefineProperty = {}; var global$d = global$s; var isObject$8 = isObject$c; var String$2 = global$d.String; var TypeError$6 = global$d.TypeError; // `Assert: Type(argument) is Object` var anObject$7 = function (argument) { if (isObject$8(argument)) return argument; throw TypeError$6(String$2(argument) + ' is not an object'); }; var global$c = global$s; var DESCRIPTORS$3 = descriptors$1; var IE8_DOM_DEFINE = ie8DomDefine; var anObject$6 = anObject$7; var toPropertyKey$1 = toPropertyKey$3; var TypeError$5 = global$c.TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty objectDefineProperty.f = DESCRIPTORS$3 ? $defineProperty : function defineProperty(O, P, Attributes) { anObject$6(O); P = toPropertyKey$1(P); anObject$6(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError$5('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var DESCRIPTORS$2 = descriptors$1; var definePropertyModule$4 = objectDefineProperty; var createPropertyDescriptor$1 = createPropertyDescriptor$3; var createNonEnumerableProperty$3 = DESCRIPTORS$2 ? function (object, key, value) { return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var redefine$1 = {exports: {}}; var uncurryThis$7 = functionUncurryThis; var isCallable$5 = isCallable$b; var store$1 = sharedStore; var functionToString = uncurryThis$7(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable$5(store$1.inspectSource)) { store$1.inspectSource = function (it) { return functionToString(it); }; } var inspectSource$3 = store$1.inspectSource; var global$b = global$s; var isCallable$4 = isCallable$b; var inspectSource$2 = inspectSource$3; var WeakMap$4 = global$b.WeakMap; var nativeWeakMap = isCallable$4(WeakMap$4) && /native code/.test(inspectSource$2(WeakMap$4)); var shared$1 = shared$3.exports; var uid$1 = uid$3; var keys$4 = shared$1('keys'); var sharedKey$2 = function (key) { return keys$4[key] || (keys$4[key] = uid$1(key)); }; var hiddenKeys$4 = {}; var NATIVE_WEAK_MAP = nativeWeakMap; var global$a = global$s; var uncurryThis$6 = functionUncurryThis; var isObject$7 = isObject$c; var createNonEnumerableProperty$2 = createNonEnumerableProperty$3; var hasOwn$4 = hasOwnProperty_1; var shared = sharedStore; var sharedKey$1 = sharedKey$2; var hiddenKeys$3 = hiddenKeys$4; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError$4 = global$a.TypeError; var WeakMap$3 = global$a.WeakMap; var set$1, get$3, has$1; var enforce = function (it) { return has$1(it) ? get$3(it) : set$1(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject$7(it) || (state = get$3(it)).type !== TYPE) { throw TypeError$4('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap$3()); var wmget = uncurryThis$6(store.get); var wmhas = uncurryThis$6(store.has); var wmset = uncurryThis$6(store.set); set$1 = function (it, metadata) { if (wmhas(store, it)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; wmset(store, it, metadata); return metadata; }; get$3 = function (it) { return wmget(store, it) || {}; }; has$1 = function (it) { return wmhas(store, it); }; } else { var STATE = sharedKey$1('state'); hiddenKeys$3[STATE] = true; set$1 = function (it, metadata) { if (hasOwn$4(it, STATE)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$2(it, STATE, metadata); return metadata; }; get$3 = function (it) { return hasOwn$4(it, STATE) ? it[STATE] : {}; }; has$1 = function (it) { return hasOwn$4(it, STATE); }; } var internalState = { set: set$1, get: get$3, has: has$1, enforce: enforce, getterFor: getterFor }; var DESCRIPTORS$1 = descriptors$1; var hasOwn$3 = hasOwnProperty_1; var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn$3(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable)); var functionName = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; var global$9 = global$s; var isCallable$3 = isCallable$b; var hasOwn$2 = hasOwnProperty_1; var createNonEnumerableProperty$1 = createNonEnumerableProperty$3; var setGlobal$1 = setGlobal$3; var inspectSource$1 = inspectSource$3; var InternalStateModule = internalState; var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE; var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(String).split('String'); (redefine$1.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$3(value)) { if (String(name).slice(0, 7) === 'Symbol(') { name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']'; } if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { createNonEnumerableProperty$1(value, 'name', name); } state = enforceInternalState(value); if (!state.source) { state.source = TEMPLATE.join(typeof name == 'string' ? name : ''); } } if (O === global$9) { if (simple) O[key] = value; else setGlobal$1(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else createNonEnumerableProperty$1(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$3(this) && getInternalState(this).source || inspectSource$1(this); }); var objectGetOwnPropertyNames = {}; var ceil = Math.ceil; var floor$1 = Math.floor; // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity var toIntegerOrInfinity$3 = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- safe return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number); }; var toIntegerOrInfinity$2 = toIntegerOrInfinity$3; var max = Math.max; var min$1 = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). var toAbsoluteIndex$1 = function (index, length) { var integer = toIntegerOrInfinity$2(index); return integer < 0 ? max(integer + length, 0) : min$1(integer, length); }; var toIntegerOrInfinity$1 = toIntegerOrInfinity$3; var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength$1 = function (argument) { return argument > 0 ? min(toIntegerOrInfinity$1(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var toLength = toLength$1; // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike var lengthOfArrayLike$6 = function (obj) { return toLength(obj.length); }; var toIndexedObject$2 = toIndexedObject$4; var toAbsoluteIndex = toAbsoluteIndex$1; var lengthOfArrayLike$5 = lengthOfArrayLike$6; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject$2($this); var length = lengthOfArrayLike$5(O); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; var arrayIncludes$2 = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; var uncurryThis$5 = functionUncurryThis; var hasOwn$1 = hasOwnProperty_1; var toIndexedObject$1 = toIndexedObject$4; var indexOf = arrayIncludes$2.indexOf; var hiddenKeys$2 = hiddenKeys$4; var push$3 = uncurryThis$5([].push); var objectKeysInternal = function (object, names) { var O = toIndexedObject$1(object); var i = 0; var result = []; var key; for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$3(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn$1(O, key = names[i++])) { ~indexOf(result, key) || push$3(result, key); } return result; }; // IE8- don't enum bug keys var enumBugKeys$3 = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var internalObjectKeys$1 = objectKeysInternal; var enumBugKeys$2 = enumBugKeys$3; var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys$1(O, hiddenKeys$1); }; var objectGetOwnPropertySymbols = {}; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; var getBuiltIn$2 = getBuiltIn$5; var uncurryThis$4 = functionUncurryThis; var getOwnPropertyNamesModule = objectGetOwnPropertyNames; var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; var anObject$5 = anObject$7; var concat = uncurryThis$4([].concat); // all object keys, includes non-enumerable and symbols var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject$5(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; var hasOwn = hasOwnProperty_1; var ownKeys = ownKeys$1; var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor; var definePropertyModule$3 = objectDefineProperty; var copyConstructorProperties$1 = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule$3.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; var fails$3 = fails$8; var isCallable$2 = isCallable$b; var replacement = /#|\.prototype\./; var isForced$1 = function (feature, detection) { var value = data$3[normalize$3(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : isCallable$2(detection) ? fails$3(detection) : !!detection; }; var normalize$3 = isForced$1.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data$3 = isForced$1.data = {}; var NATIVE = isForced$1.NATIVE = 'N'; var POLYFILL = isForced$1.POLYFILL = 'P'; var isForced_1 = isForced$1; var global$8 = global$s; var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; var createNonEnumerableProperty = createNonEnumerableProperty$3; var redefine = redefine$1.exports; var setGlobal = setGlobal$3; var copyConstructorProperties = copyConstructorProperties$1; var isForced = isForced_1; /* 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 */ var _export = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global$8; } else if (STATIC) { target = global$8[TARGET] || setGlobal(TARGET, {}); } else { target = (global$8[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; var wellKnownSymbol$5 = wellKnownSymbol$7; var TO_STRING_TAG$1 = wellKnownSymbol$5('toStringTag'); var test$1 = {}; test$1[TO_STRING_TAG$1] = 'z'; var toStringTagSupport = String(test$1) === '[object z]'; var global$7 = global$s; var TO_STRING_TAG_SUPPORT = toStringTagSupport; var isCallable$1 = isCallable$b; var classofRaw = classofRaw$1; var wellKnownSymbol$4 = wellKnownSymbol$7; var TO_STRING_TAG = wellKnownSymbol$4('toStringTag'); var Object$1 = global$7.Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` var classof$4 = 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$1(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result; }; var global$6 = global$s; var classof$3 = classof$4; var String$1 = global$6.String; var toString$3 = function (argument) { if (classof$3(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); return String$1(argument); }; var uncurryThis$3 = functionUncurryThis; var arraySlice$1 = uncurryThis$3([].slice); var arraySlice = arraySlice$1; var floor = Math.floor; var mergeSort = function (array, comparefn) { var length = array.length; var middle = floor(length / 2); return length < 8 ? insertionSort(array, comparefn) : merge$3( 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; while (i < length) { j = i; element = array[i]; while (j && comparefn(array[j - 1], element) > 0) { array[j] = array[--j]; } if (j !== i++) array[j] = element; } return array; }; var merge$3 = 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 && r