basant307/AI_Governance_Project
045
1/**2 * @license3 * Lodash <https://lodash.com/>4 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>5 * Released under MIT license <https://lodash.com/license>6 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>7 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors8 */9;(function() {10 11 /** Used as a safe reference for `undefined` in pre-ES5 environments. */12 var undefined;13 14 /** Used as the semantic version number. */15 var VERSION = '4.17.21';16 17 /** Used as the size to enable large array optimizations. */18 var LARGE_ARRAY_SIZE = 200;19 20 /** Error message constants. */21 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',22 FUNC_ERROR_TEXT = 'Expected a function',23 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';24 25 /** Used to stand-in for `undefined` hash values. */26 var HASH_UNDEFINED = '__lodash_hash_undefined__';27 28 /** Used as the maximum memoize cache size. */29 var MAX_MEMOIZE_SIZE = 500;30 31 /** Used as the internal argument placeholder. */32 var PLACEHOLDER = '__lodash_placeholder__';33 34 /** Used to compose bitmasks for cloning. */35 var CLONE_DEEP_FLAG = 1,36 CLONE_FLAT_FLAG = 2,37 CLONE_SYMBOLS_FLAG = 4;38 39 /** Used to compose bitmasks for value comparisons. */40 var COMPARE_PARTIAL_FLAG = 1,41 COMPARE_UNORDERED_FLAG = 2;42 43 /** Used to compose bitmasks for function metadata. */44 var WRAP_BIND_FLAG = 1,45 WRAP_BIND_KEY_FLAG = 2,46 WRAP_CURRY_BOUND_FLAG = 4,47 WRAP_CURRY_FLAG = 8,48 WRAP_CURRY_RIGHT_FLAG = 16,49 WRAP_PARTIAL_FLAG = 32,50 WRAP_PARTIAL_RIGHT_FLAG = 64,51 WRAP_ARY_FLAG = 128,52 WRAP_REARG_FLAG = 256,53 WRAP_FLIP_FLAG = 512;54 55 /** Used as default options for `_.truncate`. */56 var DEFAULT_TRUNC_LENGTH = 30,57 DEFAULT_TRUNC_OMISSION = '...';58 59 /** Used to detect hot functions by number of calls within a span of milliseconds. */60 var HOT_COUNT = 800,61 HOT_SPAN = 16;62 63 /** Used to indicate the type of lazy iteratees. */64 var LAZY_FILTER_FLAG = 1,65 LAZY_MAP_FLAG = 2,66 LAZY_WHILE_FLAG = 3;67 68 /** Used as references for various `Number` constants. */69 var INFINITY = 1 / 0,70 MAX_SAFE_INTEGER = 9007199254740991,71 MAX_INTEGER = 1.7976931348623157e+308,72 NAN = 0 / 0;73 74 /** Used as references for the maximum length and index of an array. */75 var MAX_ARRAY_LENGTH = 4294967295,76 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,77 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;78 79 /** Used to associate wrap methods with their bit flags. */80 var wrapFlags = [81 ['ary', WRAP_ARY_FLAG],82 ['bind', WRAP_BIND_FLAG],83 ['bindKey', WRAP_BIND_KEY_FLAG],84 ['curry', WRAP_CURRY_FLAG],85 ['curryRight', WRAP_CURRY_RIGHT_FLAG],86 ['flip', WRAP_FLIP_FLAG],87 ['partial', WRAP_PARTIAL_FLAG],88 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],89 ['rearg', WRAP_REARG_FLAG]90 ];91 92 /** `Object#toString` result references. */93 var argsTag = '[object Arguments]',94 arrayTag = '[object Array]',95 asyncTag = '[object AsyncFunction]',96 boolTag = '[object Boolean]',97 dateTag = '[object Date]',98 domExcTag = '[object DOMException]',99 errorTag = '[object Error]',100 funcTag = '[object Function]',101 genTag = '[object GeneratorFunction]',102 mapTag = '[object Map]',103 numberTag = '[object Number]',104 nullTag = '[object Null]',105 objectTag = '[object Object]',106 promiseTag = '[object Promise]',107 proxyTag = '[object Proxy]',108 regexpTag = '[object RegExp]',109 setTag = '[object Set]',110 stringTag = '[object String]',111 symbolTag = '[object Symbol]',112 undefinedTag = '[object Undefined]',113 weakMapTag = '[object WeakMap]',114 weakSetTag = '[object WeakSet]';115 116 var arrayBufferTag = '[object ArrayBuffer]',117 dataViewTag = '[object DataView]',118 float32Tag = '[object Float32Array]',119 float64Tag = '[object Float64Array]',120 int8Tag = '[object Int8Array]',121 int16Tag = '[object Int16Array]',122 int32Tag = '[object Int32Array]',123 uint8Tag = '[object Uint8Array]',124 uint8ClampedTag = '[object Uint8ClampedArray]',125 uint16Tag = '[object Uint16Array]',126 uint32Tag = '[object Uint32Array]';127 128 /** Used to match empty string literals in compiled template source. */129 var reEmptyStringLeading = /\b__p \+= '';/g,130 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,131 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;132 133 /** Used to match HTML entities and HTML characters. */134 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,135 reUnescapedHtml = /[&<>"']/g,136 reHasEscapedHtml = RegExp(reEscapedHtml.source),137 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);138 139 /** Used to match template delimiters. */140 var reEscape = /<%-([\s\S]+?)%>/g,141 reEvaluate = /<%([\s\S]+?)%>/g,142 reInterpolate = /<%=([\s\S]+?)%>/g;143 144 /** Used to match property names within property paths. */145 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,146 reIsPlainProp = /^\w*$/,147 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;148 149 /**150 * Used to match `RegExp`151 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).152 */153 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,154 reHasRegExpChar = RegExp(reRegExpChar.source);155 156 /** Used to match leading whitespace. */157 var reTrimStart = /^\s+/;158 159 /** Used to match a single whitespace character. */160 var reWhitespace = /\s/;161 162 /** Used to match wrap detail comments. */163 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,164 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,165 reSplitDetails = /,? & /;166 167 /** Used to match words composed of alphanumeric characters. */168 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;169 170 /**171 * Used to validate the `validate` option in `_.template` variable.172 *173 * Forbids characters which could potentially change the meaning of the function argument definition:174 * - "()," (modification of function parameters)175 * - "=" (default value)176 * - "[]{}" (destructuring of function parameters)177 * - "/" (beginning of a comment)178 * - whitespace179 */180 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;181 182 /** Used to match backslashes in property paths. */183 var reEscapeChar = /\\(\\)?/g;184 185 /**186 * Used to match187 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).188 */189 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;190 191 /** Used to match `RegExp` flags from their coerced string values. */192 var reFlags = /\w*$/;193 194 /** Used to detect bad signed hexadecimal string values. */195 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;196 197 /** Used to detect binary string values. */198 var reIsBinary = /^0b[01]+$/i;199 200 /** Used to detect host constructors (Safari). */201 var reIsHostCtor = /^\[object .+?Constructor\]$/;202 203 /** Used to detect octal string values. */204 var reIsOctal = /^0o[0-7]+$/i;205 206 /** Used to detect unsigned integer values. */207 var reIsUint = /^(?:0|[1-9]\d*)$/;208 209 /** Used to match Latin Unicode letters (excluding mathematical operators). */210 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;211 212 /** Used to ensure capturing order of template delimiters. */213 var reNoMatch = /($^)/;214 215 /** Used to match unescaped characters in compiled string literals. */216 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;217 218 /** Used to compose unicode character classes. */219 var rsAstralRange = '\\ud800-\\udfff',220 rsComboMarksRange = '\\u0300-\\u036f',221 reComboHalfMarksRange = '\\ufe20-\\ufe2f',222 rsComboSymbolsRange = '\\u20d0-\\u20ff',223 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,224 rsDingbatRange = '\\u2700-\\u27bf',225 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',226 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',227 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',228 rsPunctuationRange = '\\u2000-\\u206f',229 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',230 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',231 rsVarRange = '\\ufe0e\\ufe0f',232 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;233 234 /** Used to compose unicode capture groups. */235 var rsApos = "['\u2019]",236 rsAstral = '[' + rsAstralRange + ']',237 rsBreak = '[' + rsBreakRange + ']',238 rsCombo = '[' + rsComboRange + ']',239 rsDigits = '\\d+',240 rsDingbat = '[' + rsDingbatRange + ']',241 rsLower = '[' + rsLowerRange + ']',242 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',243 rsFitz = '\\ud83c[\\udffb-\\udfff]',244 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',245 rsNonAstral = '[^' + rsAstralRange + ']',246 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',247 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',248 rsUpper = '[' + rsUpperRange + ']',249 rsZWJ = '\\u200d';250 251 /** Used to compose unicode regexes. */252 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',253 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',254 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',255 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',256 reOptMod = rsModifier + '?',257 rsOptVar = '[' + rsVarRange + ']?',258 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',259 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',260 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',261 rsSeq = rsOptVar + reOptMod + rsOptJoin,262 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,263 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';264 265 /** Used to match apostrophes. */266 var reApos = RegExp(rsApos, 'g');267 268 /**269 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and270 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).271 */272 var reComboMark = RegExp(rsCombo, 'g');273 274 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */275 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');276 277 /** Used to match complex or compound words. */278 var reUnicodeWord = RegExp([279 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',280 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',281 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,282 rsUpper + '+' + rsOptContrUpper,283 rsOrdUpper,284 rsOrdLower,285 rsDigits,286 rsEmoji287 ].join('|'), 'g');288 289 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */290 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');291 292 /** Used to detect strings that need a more robust regexp to match words. */293 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;294 295 /** Used to assign default `context` object properties. */296 var contextProps = [297 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',298 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',299 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',300 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',301 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'302 ];303 304 /** Used to make template sourceURLs easier to identify. */305 var templateCounter = -1;306 307 /** Used to identify `toStringTag` values of typed arrays. */308 var typedArrayTags = {};309 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =310 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =311 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =312 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =313 typedArrayTags[uint32Tag] = true;314 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =315 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =316 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =317 typedArrayTags[errorTag] = typedArrayTags[funcTag] =318 typedArrayTags[mapTag] = typedArrayTags[numberTag] =319 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =320 typedArrayTags[setTag] = typedArrayTags[stringTag] =321 typedArrayTags[weakMapTag] = false;322 323 /** Used to identify `toStringTag` values supported by `_.clone`. */324 var cloneableTags = {};325 cloneableTags[argsTag] = cloneableTags[arrayTag] =326 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =327 cloneableTags[boolTag] = cloneableTags[dateTag] =328 cloneableTags[float32Tag] = cloneableTags[float64Tag] =329 cloneableTags[int8Tag] = cloneableTags[int16Tag] =330 cloneableTags[int32Tag] = cloneableTags[mapTag] =331 cloneableTags[numberTag] = cloneableTags[objectTag] =332 cloneableTags[regexpTag] = cloneableTags[setTag] =333 cloneableTags[stringTag] = cloneableTags[symbolTag] =334 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =335 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;336 cloneableTags[errorTag] = cloneableTags[funcTag] =337 cloneableTags[weakMapTag] = false;338 339 /** Used to map Latin Unicode letters to basic Latin letters. */340 var deburredLetters = {341 // Latin-1 Supplement block.342 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',343 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',344 '\xc7': 'C', '\xe7': 'c',345 '\xd0': 'D', '\xf0': 'd',346 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',347 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',348 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',349 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',350 '\xd1': 'N', '\xf1': 'n',351 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',352 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',353 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',354 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',355 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',356 '\xc6': 'Ae', '\xe6': 'ae',357 '\xde': 'Th', '\xfe': 'th',358 '\xdf': 'ss',359 // Latin Extended-A block.360 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',361 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',362 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',363 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',364 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',365 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',366 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',367 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',368 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',369 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',370 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',371 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',372 '\u0134': 'J', '\u0135': 'j',373 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',374 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',375 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',376 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',377 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',378 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',379 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',380 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',381 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',382 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',383 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',384 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',385 '\u0163': 't', '\u0165': 't', '\u0167': 't',386 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',387 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',388 '\u0174': 'W', '\u0175': 'w',389 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',390 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',391 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',392 '\u0132': 'IJ', '\u0133': 'ij',393 '\u0152': 'Oe', '\u0153': 'oe',394 '\u0149': "'n", '\u017f': 's'395 };396 397 /** Used to map characters to HTML entities. */398 var htmlEscapes = {399 '&': '&',400 '<': '<',401 '>': '>',402 '"': '"',403 "'": '''404 };405 406 /** Used to map HTML entities to characters. */407 var htmlUnescapes = {408 '&': '&',409 '<': '<',410 '>': '>',411 '"': '"',412 ''': "'"413 };414 415 /** Used to escape characters for inclusion in compiled string literals. */416 var stringEscapes = {417 '\\': '\\',418 "'": "'",419 '\n': 'n',420 '\r': 'r',421 '\u2028': 'u2028',422 '\u2029': 'u2029'423 };424 425 /** Built-in method references without a dependency on `root`. */426 var freeParseFloat = parseFloat,427 freeParseInt = parseInt;428 429 /** Detect free variable `global` from Node.js. */430 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;431 432 /** Detect free variable `self`. */433 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;434 435 /** Used as a reference to the global object. */436 var root = freeGlobal || freeSelf || Function('return this')();437 438 /** Detect free variable `exports`. */439 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;440 441 /** Detect free variable `module`. */442 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;443 444 /** Detect the popular CommonJS extension `module.exports`. */445 var moduleExports = freeModule && freeModule.exports === freeExports;446 447 /** Detect free variable `process` from Node.js. */448 var freeProcess = moduleExports && freeGlobal.process;449 450 /** Used to access faster Node.js helpers. */451 var nodeUtil = (function() {452 try {453 // Use `util.types` for Node.js 10+.454 var types = freeModule && freeModule.require && freeModule.require('util').types;455 456 if (types) {457 return types;458 }459 460 // Legacy `process.binding('util')` for Node.js < 10.461 return freeProcess && freeProcess.binding && freeProcess.binding('util');462 } catch (e) {}463 }());464 465 /* Node.js helper references. */466 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,467 nodeIsDate = nodeUtil && nodeUtil.isDate,468 nodeIsMap = nodeUtil && nodeUtil.isMap,469 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,470 nodeIsSet = nodeUtil && nodeUtil.isSet,471 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;472 473 /*--------------------------------------------------------------------------*/474 475 /**476 * A faster alternative to `Function#apply`, this function invokes `func`477 * with the `this` binding of `thisArg` and the arguments of `args`.478 *479 * @private480 * @param {Function} func The function to invoke.481 * @param {*} thisArg The `this` binding of `func`.482 * @param {Array} args The arguments to invoke `func` with.483 * @returns {*} Returns the result of `func`.484 */485 function apply(func, thisArg, args) {486 switch (args.length) {487 case 0: return func.call(thisArg);488 case 1: return func.call(thisArg, args[0]);489 case 2: return func.call(thisArg, args[0], args[1]);490 case 3: return func.call(thisArg, args[0], args[1], args[2]);491 }492 return func.apply(thisArg, args);493 }494 495 /**496 * A specialized version of `baseAggregator` for arrays.497 *498 * @private499 * @param {Array} [array] The array to iterate over.500 * @param {Function} setter The function to set `accumulator` values.501 * @param {Function} iteratee The iteratee to transform keys.502 * @param {Object} accumulator The initial aggregated object.503 * @returns {Function} Returns `accumulator`.504 */505 function arrayAggregator(array, setter, iteratee, accumulator) {506 var index = -1,507 length = array == null ? 0 : array.length;508 509 while (++index < length) {510 var value = array[index];511 setter(accumulator, value, iteratee(value), array);512 }513 return accumulator;514 }515 516 /**517 * A specialized version of `_.forEach` for arrays without support for518 * iteratee shorthands.519 *520 * @private521 * @param {Array} [array] The array to iterate over.522 * @param {Function} iteratee The function invoked per iteration.523 * @returns {Array} Returns `array`.524 */525 function arrayEach(array, iteratee) {526 var index = -1,527 length = array == null ? 0 : array.length;528 529 while (++index < length) {530 if (iteratee(array[index], index, array) === false) {531 break;532 }533 }534 return array;535 }536 537 /**538 * A specialized version of `_.forEachRight` for arrays without support for539 * iteratee shorthands.540 *541 * @private542 * @param {Array} [array] The array to iterate over.543 * @param {Function} iteratee The function invoked per iteration.544 * @returns {Array} Returns `array`.545 */546 function arrayEachRight(array, iteratee) {547 var length = array == null ? 0 : array.length;548 549 while (length--) {550 if (iteratee(array[length], length, array) === false) {551 break;552 }553 }554 return array;555 }556 557 /**558 * A specialized version of `_.every` for arrays without support for559 * iteratee shorthands.560 *561 * @private562 * @param {Array} [array] The array to iterate over.563 * @param {Function} predicate The function invoked per iteration.564 * @returns {boolean} Returns `true` if all elements pass the predicate check,565 * else `false`.566 */567 function arrayEvery(array, predicate) {568 var index = -1,569 length = array == null ? 0 : array.length;570 571 while (++index < length) {572 if (!predicate(array[index], index, array)) {573 return false;574 }575 }576 return true;577 }578 579 /**580 * A specialized version of `_.filter` for arrays without support for581 * iteratee shorthands.582 *583 * @private584 * @param {Array} [array] The array to iterate over.585 * @param {Function} predicate The function invoked per iteration.586 * @returns {Array} Returns the new filtered array.587 */588 function arrayFilter(array, predicate) {589 var index = -1,590 length = array == null ? 0 : array.length,591 resIndex = 0,592 result = [];593 594 while (++index < length) {595 var value = array[index];596 if (predicate(value, index, array)) {597 result[resIndex++] = value;598 }599 }600 return result;601 }602 603 /**604 * A specialized version of `_.includes` for arrays without support for605 * specifying an index to search from.606 *607 * @private608 * @param {Array} [array] The array to inspect.609 * @param {*} target The value to search for.610 * @returns {boolean} Returns `true` if `target` is found, else `false`.611 */612 function arrayIncludes(array, value) {613 var length = array == null ? 0 : array.length;614 return !!length && baseIndexOf(array, value, 0) > -1;615 }616 617 /**618 * This function is like `arrayIncludes` except that it accepts a comparator.619 *620 * @private621 * @param {Array} [array] The array to inspect.622 * @param {*} target The value to search for.623 * @param {Function} comparator The comparator invoked per element.624 * @returns {boolean} Returns `true` if `target` is found, else `false`.625 */626 function arrayIncludesWith(array, value, comparator) {627 var index = -1,628 length = array == null ? 0 : array.length;629 630 while (++index < length) {631 if (comparator(value, array[index])) {632 return true;633 }634 }635 return false;636 }637 638 /**639 * A specialized version of `_.map` for arrays without support for iteratee640 * shorthands.641 *642 * @private643 * @param {Array} [array] The array to iterate over.644 * @param {Function} iteratee The function invoked per iteration.645 * @returns {Array} Returns the new mapped array.646 */647 function arrayMap(array, iteratee) {648 var index = -1,649 length = array == null ? 0 : array.length,650 result = Array(length);651 652 while (++index < length) {653 result[index] = iteratee(array[index], index, array);654 }655 return result;656 }657 658 /**659 * Appends the elements of `values` to `array`.660 *661 * @private662 * @param {Array} array The array to modify.663 * @param {Array} values The values to append.664 * @returns {Array} Returns `array`.665 */666 function arrayPush(array, values) {667 var index = -1,668 length = values.length,669 offset = array.length;670 671 while (++index < length) {672 array[offset + index] = values[index];673 }674 return array;675 }676 677 /**678 * A specialized version of `_.reduce` for arrays without support for679 * iteratee shorthands.680 *681 * @private682 * @param {Array} [array] The array to iterate over.683 * @param {Function} iteratee The function invoked per iteration.684 * @param {*} [accumulator] The initial value.685 * @param {boolean} [initAccum] Specify using the first element of `array` as686 * the initial value.687 * @returns {*} Returns the accumulated value.688 */689 function arrayReduce(array, iteratee, accumulator, initAccum) {690 var index = -1,691 length = array == null ? 0 : array.length;692 693 if (initAccum && length) {694 accumulator = array[++index];695 }696 while (++index < length) {697 accumulator = iteratee(accumulator, array[index], index, array);698 }699 return accumulator;700 }701 702 /**703 * A specialized version of `_.reduceRight` for arrays without support for704 * iteratee shorthands.705 *706 * @private707 * @param {Array} [array] The array to iterate over.708 * @param {Function} iteratee The function invoked per iteration.709 * @param {*} [accumulator] The initial value.710 * @param {boolean} [initAccum] Specify using the last element of `array` as711 * the initial value.712 * @returns {*} Returns the accumulated value.713 */714 function arrayReduceRight(array, iteratee, accumulator, initAccum) {715 var length = array == null ? 0 : array.length;716 if (initAccum && length) {717 accumulator = array[--length];718 }719 while (length--) {720 accumulator = iteratee(accumulator, array[length], length, array);721 }722 return accumulator;723 }724 725 /**726 * A specialized version of `_.some` for arrays without support for iteratee727 * shorthands.728 *729 * @private730 * @param {Array} [array] The array to iterate over.731 * @param {Function} predicate The function invoked per iteration.732 * @returns {boolean} Returns `true` if any element passes the predicate check,733 * else `false`.734 */735 function arraySome(array, predicate) {736 var index = -1,737 length = array == null ? 0 : array.length;738 739 while (++index < length) {740 if (predicate(array[index], index, array)) {741 return true;742 }743 }744 return false;745 }746 747 /**748 * Gets the size of an ASCII `string`.749 *750 * @private751 * @param {string} string The string inspect.752 * @returns {number} Returns the string size.753 */754 var asciiSize = baseProperty('length');755 756 /**757 * Converts an ASCII `string` to an array.758 *759 * @private760 * @param {string} string The string to convert.761 * @returns {Array} Returns the converted array.762 */763 function asciiToArray(string) {764 return string.split('');765 }766 767 /**768 * Splits an ASCII `string` into an array of its words.769 *770 * @private771 * @param {string} The string to inspect.772 * @returns {Array} Returns the words of `string`.773 */774 function asciiWords(string) {775 return string.match(reAsciiWord) || [];776 }777 778 /**779 * The base implementation of methods like `_.findKey` and `_.findLastKey`,780 * without support for iteratee shorthands, which iterates over `collection`781 * using `eachFunc`.782 *783 * @private784 * @param {Array|Object} collection The collection to inspect.785 * @param {Function} predicate The function invoked per iteration.786 * @param {Function} eachFunc The function to iterate over `collection`.787 * @returns {*} Returns the found element or its key, else `undefined`.788 */789 function baseFindKey(collection, predicate, eachFunc) {790 var result;791 eachFunc(collection, function(value, key, collection) {792 if (predicate(value, key, collection)) {793 result = key;794 return false;795 }796 });797 return result;798 }799 800 /**801 * The base implementation of `_.findIndex` and `_.findLastIndex` without802 * support for iteratee shorthands.803 *804 * @private805 * @param {Array} array The array to inspect.806 * @param {Function} predicate The function invoked per iteration.807 * @param {number} fromIndex The index to search from.808 * @param {boolean} [fromRight] Specify iterating from right to left.809 * @returns {number} Returns the index of the matched value, else `-1`.810 */811 function baseFindIndex(array, predicate, fromIndex, fromRight) {812 var length = array.length,813 index = fromIndex + (fromRight ? 1 : -1);814 815 while ((fromRight ? index-- : ++index < length)) {816 if (predicate(array[index], index, array)) {817 return index;818 }819 }820 return -1;821 }822 823 /**824 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.825 *826 * @private827 * @param {Array} array The array to inspect.828 * @param {*} value The value to search for.829 * @param {number} fromIndex The index to search from.830 * @returns {number} Returns the index of the matched value, else `-1`.831 */832 function baseIndexOf(array, value, fromIndex) {833 return value === value834 ? strictIndexOf(array, value, fromIndex)835 : baseFindIndex(array, baseIsNaN, fromIndex);836 }837 838 /**839 * This function is like `baseIndexOf` except that it accepts a comparator.840 *841 * @private842 * @param {Array} array The array to inspect.843 * @param {*} value The value to search for.844 * @param {number} fromIndex The index to search from.845 * @param {Function} comparator The comparator invoked per element.846 * @returns {number} Returns the index of the matched value, else `-1`.847 */848 function baseIndexOfWith(array, value, fromIndex, comparator) {849 var index = fromIndex - 1,850 length = array.length;851 852 while (++index < length) {853 if (comparator(array[index], value)) {854 return index;855 }856 }857 return -1;858 }859 860 /**861 * The base implementation of `_.isNaN` without support for number objects.862 *863 * @private864 * @param {*} value The value to check.865 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.866 */867 function baseIsNaN(value) {868 return value !== value;869 }870 871 /**872 * The base implementation of `_.mean` and `_.meanBy` without support for873 * iteratee shorthands.874 *875 * @private876 * @param {Array} array The array to iterate over.877 * @param {Function} iteratee The function invoked per iteration.878 * @returns {number} Returns the mean.879 */880 function baseMean(array, iteratee) {881 var length = array == null ? 0 : array.length;882 return length ? (baseSum(array, iteratee) / length) : NAN;883 }884 885 /**886 * The base implementation of `_.property` without support for deep paths.887 *888 * @private889 * @param {string} key The key of the property to get.890 * @returns {Function} Returns the new accessor function.891 */892 function baseProperty(key) {893 return function(object) {894 return object == null ? undefined : object[key];895 };896 }897 898 /**899 * The base implementation of `_.propertyOf` without support for deep paths.900 *901 * @private902 * @param {Object} object The object to query.903 * @returns {Function} Returns the new accessor function.904 */905 function basePropertyOf(object) {906 return function(key) {907 return object == null ? undefined : object[key];908 };909 }910 911 /**912 * The base implementation of `_.reduce` and `_.reduceRight`, without support913 * for iteratee shorthands, which iterates over `collection` using `eachFunc`.914 *915 * @private916 * @param {Array|Object} collection The collection to iterate over.917 * @param {Function} iteratee The function invoked per iteration.918 * @param {*} accumulator The initial value.919 * @param {boolean} initAccum Specify using the first or last element of920 * `collection` as the initial value.921 * @param {Function} eachFunc The function to iterate over `collection`.922 * @returns {*} Returns the accumulated value.923 */924 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {925 eachFunc(collection, function(value, index, collection) {926 accumulator = initAccum927 ? (initAccum = false, value)928 : iteratee(accumulator, value, index, collection);929 });930 return accumulator;931 }932 933 /**934 * The base implementation of `_.sortBy` which uses `comparer` to define the935 * sort order of `array` and replaces criteria objects with their corresponding936 * values.937 *938 * @private939 * @param {Array} array The array to sort.940 * @param {Function} comparer The function to define sort order.941 * @returns {Array} Returns `array`.942 */943 function baseSortBy(array, comparer) {944 var length = array.length;945 946 array.sort(comparer);947 while (length--) {948 array[length] = array[length].value;949 }950 return array;951 }952 953 /**954 * The base implementation of `_.sum` and `_.sumBy` without support for955 * iteratee shorthands.956 *957 * @private958 * @param {Array} array The array to iterate over.959 * @param {Function} iteratee The function invoked per iteration.960 * @returns {number} Returns the sum.961 */962 function baseSum(array, iteratee) {963 var result,964 index = -1,965 length = array.length;966 967 while (++index < length) {968 var current = iteratee(array[index]);969 if (current !== undefined) {970 result = result === undefined ? current : (result + current);971 }972 }973 return result;974 }975 976 /**977 * The base implementation of `_.times` without support for iteratee shorthands978 * or max array length checks.979 *980 * @private981 * @param {number} n The number of times to invoke `iteratee`.982 * @param {Function} iteratee The function invoked per iteration.983 * @returns {Array} Returns the array of results.984 */985 function baseTimes(n, iteratee) {986 var index = -1,987 result = Array(n);988 989 while (++index < n) {990 result[index] = iteratee(index);991 }992 return result;993 }994 995 /**996 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array997 * of key-value pairs for `object` corresponding to the property names of `props`.998 *999 * @private1000 * @param {Object} object The object to query.1001 * @param {Array} props The property names to get values for.1002 * @returns {Object} Returns the key-value pairs.1003 */1004 function baseToPairs(object, props) {1005 return arrayMap(props, function(key) {1006 return [key, object[key]];1007 });1008 }1009 1010 /**1011 * The base implementation of `_.trim`.1012 *1013 * @private1014 * @param {string} string The string to trim.1015 * @returns {string} Returns the trimmed string.1016 */1017 function baseTrim(string) {1018 return string1019 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')1020 : string;1021 }1022 1023 /**1024 * The base implementation of `_.unary` without support for storing metadata.1025 *1026 * @private1027 * @param {Function} func The function to cap arguments for.1028 * @returns {Function} Returns the new capped function.1029 */1030 function baseUnary(func) {1031 return function(value) {1032 return func(value);1033 };1034 }1035 1036 /**1037 * The base implementation of `_.values` and `_.valuesIn` which creates an1038 * array of `object` property values corresponding to the property names1039 * of `props`.1040 *1041 * @private1042 * @param {Object} object The object to query.1043 * @param {Array} props The property names to get values for.1044 * @returns {Object} Returns the array of property values.1045 */1046 function baseValues(object, props) {1047 return arrayMap(props, function(key) {1048 return object[key];1049 });1050 }1051 1052 /**1053 * Checks if a `cache` value for `key` exists.1054 *1055 * @private1056 * @param {Object} cache The cache to query.1057 * @param {string} key The key of the entry to check.1058 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.1059 */1060 function cacheHas(cache, key) {1061 return cache.has(key);1062 }1063 1064 /**1065 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol1066 * that is not found in the character symbols.1067 *1068 * @private1069 * @param {Array} strSymbols The string symbols to inspect.1070 * @param {Array} chrSymbols The character symbols to find.1071 * @returns {number} Returns the index of the first unmatched string symbol.1072 */1073 function charsStartIndex(strSymbols, chrSymbols) {1074 var index = -1,1075 length = strSymbols.length;1076 1077 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}1078 return index;1079 }1080 1081 /**1082 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol1083 * that is not found in the character symbols.1084 *1085 * @private1086 * @param {Array} strSymbols The string symbols to inspect.1087 * @param {Array} chrSymbols The character symbols to find.1088 * @returns {number} Returns the index of the last unmatched string symbol.1089 */1090 function charsEndIndex(strSymbols, chrSymbols) {1091 var index = strSymbols.length;1092 1093 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}1094 return index;1095 }1096 1097 /**1098 * Gets the number of `placeholder` occurrences in `array`.1099 *1100 * @private1101 * @param {Array} array The array to inspect.1102 * @param {*} placeholder The placeholder to search for.1103 * @returns {number} Returns the placeholder count.1104 */1105 function countHolders(array, placeholder) {1106 var length = array.length,1107 result = 0;1108 1109 while (length--) {1110 if (array[length] === placeholder) {1111 ++result;1112 }1113 }1114 return result;1115 }1116 1117 /**1118 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A1119 * letters to basic Latin letters.1120 *1121 * @private1122 * @param {string} letter The matched letter to deburr.1123 * @returns {string} Returns the deburred letter.1124 */1125 var deburrLetter = basePropertyOf(deburredLetters);1126 1127 /**1128 * Used by `_.escape` to convert characters to HTML entities.1129 *1130 * @private1131 * @param {string} chr The matched character to escape.1132 * @returns {string} Returns the escaped character.1133 */1134 var escapeHtmlChar = basePropertyOf(htmlEscapes);1135 1136 /**1137 * Used by `_.template` to escape characters for inclusion in compiled string literals.1138 *1139 * @private1140 * @param {string} chr The matched character to escape.1141 * @returns {string} Returns the escaped character.1142 */1143 function escapeStringChar(chr) {1144 return '\\' + stringEscapes[chr];1145 }1146 1147 /**1148 * Gets the value at `key` of `object`.1149 *1150 * @private1151 * @param {Object} [object] The object to query.1152 * @param {string} key The key of the property to get.1153 * @returns {*} Returns the property value.1154 */1155 function getValue(object, key) {1156 return object == null ? undefined : object[key];1157 }1158 1159 /**1160 * Checks if `string` contains Unicode symbols.1161 *1162 * @private1163 * @param {string} string The string to inspect.1164 * @returns {boolean} Returns `true` if a symbol is found, else `false`.1165 */1166 function hasUnicode(string) {1167 return reHasUnicode.test(string);1168 }1169 1170 /**1171 * Checks if `string` contains a word composed of Unicode symbols.1172 *1173 * @private1174 * @param {string} string The string to inspect.1175 * @returns {boolean} Returns `true` if a word is found, else `false`.1176 */1177 function hasUnicodeWord(string) {1178 return reHasUnicodeWord.test(string);1179 }1180 1181 /**1182 * Converts `iterator` to an array.1183 *1184 * @private1185 * @param {Object} iterator The iterator to convert.1186 * @returns {Array} Returns the converted array.1187 */1188 function iteratorToArray(iterator) {1189 var data,1190 result = [];1191 1192 while (!(data = iterator.next()).done) {1193 result.push(data.value);1194 }1195 return result;1196 }1197 1198 /**1199 * Converts `map` to its key-value pairs.1200 *