Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

underscore.js 63KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  3. typeof define === 'function' && define.amd ? define('underscore', factory) :
  4. (global = global || self, (function () {
  5. var current = global._;
  6. var exports = global._ = factory();
  7. exports.noConflict = function () { global._ = current; return exports; };
  8. }()));
  9. }(this, (function () {
  10. // Underscore.js 1.11.0
  11. // https://underscorejs.org
  12. // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13. // Underscore may be freely distributed under the MIT license.
  14. // Current version.
  15. var VERSION = '1.11.0';
  16. // Establish the root object, `window` (`self`) in the browser, `global`
  17. // on the server, or `this` in some virtual machines. We use `self`
  18. // instead of `window` for `WebWorker` support.
  19. var root = typeof self == 'object' && self.self === self && self ||
  20. typeof global == 'object' && global.global === global && global ||
  21. Function('return this')() ||
  22. {};
  23. // Save bytes in the minified (but not gzipped) version:
  24. var ArrayProto = Array.prototype, ObjProto = Object.prototype;
  25. var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
  26. // Create quick reference variables for speed access to core prototypes.
  27. var push = ArrayProto.push,
  28. slice = ArrayProto.slice,
  29. toString = ObjProto.toString,
  30. hasOwnProperty = ObjProto.hasOwnProperty;
  31. // Modern feature detection.
  32. var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined';
  33. // All **ECMAScript 5+** native function implementations that we hope to use
  34. // are declared here.
  35. var nativeIsArray = Array.isArray,
  36. nativeKeys = Object.keys,
  37. nativeCreate = Object.create,
  38. nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
  39. // Create references to these builtin functions because we override them.
  40. var _isNaN = isNaN,
  41. _isFinite = isFinite;
  42. // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
  43. var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
  44. var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
  45. 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
  46. // The largest integer that can be represented exactly.
  47. var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
  48. // Some functions take a variable number of arguments, or a few expected
  49. // arguments at the beginning and then a variable number of values to operate
  50. // on. This helper accumulates all remaining arguments past the function’s
  51. // argument length (or an explicit `startIndex`), into an array that becomes
  52. // the last argument. Similar to ES6’s "rest parameter".
  53. function restArguments(func, startIndex) {
  54. startIndex = startIndex == null ? func.length - 1 : +startIndex;
  55. return function() {
  56. var length = Math.max(arguments.length - startIndex, 0),
  57. rest = Array(length),
  58. index = 0;
  59. for (; index < length; index++) {
  60. rest[index] = arguments[index + startIndex];
  61. }
  62. switch (startIndex) {
  63. case 0: return func.call(this, rest);
  64. case 1: return func.call(this, arguments[0], rest);
  65. case 2: return func.call(this, arguments[0], arguments[1], rest);
  66. }
  67. var args = Array(startIndex + 1);
  68. for (index = 0; index < startIndex; index++) {
  69. args[index] = arguments[index];
  70. }
  71. args[startIndex] = rest;
  72. return func.apply(this, args);
  73. };
  74. }
  75. // Is a given variable an object?
  76. function isObject(obj) {
  77. var type = typeof obj;
  78. return type === 'function' || type === 'object' && !!obj;
  79. }
  80. // Is a given value equal to null?
  81. function isNull(obj) {
  82. return obj === null;
  83. }
  84. // Is a given variable undefined?
  85. function isUndefined(obj) {
  86. return obj === void 0;
  87. }
  88. // Is a given value a boolean?
  89. function isBoolean(obj) {
  90. return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
  91. }
  92. // Is a given value a DOM element?
  93. function isElement(obj) {
  94. return !!(obj && obj.nodeType === 1);
  95. }
  96. // Internal function for creating a `toString`-based type tester.
  97. function tagTester(name) {
  98. return function(obj) {
  99. return toString.call(obj) === '[object ' + name + ']';
  100. };
  101. }
  102. var isString = tagTester('String');
  103. var isNumber = tagTester('Number');
  104. var isDate = tagTester('Date');
  105. var isRegExp = tagTester('RegExp');
  106. var isError = tagTester('Error');
  107. var isSymbol = tagTester('Symbol');
  108. var isMap = tagTester('Map');
  109. var isWeakMap = tagTester('WeakMap');
  110. var isSet = tagTester('Set');
  111. var isWeakSet = tagTester('WeakSet');
  112. var isArrayBuffer = tagTester('ArrayBuffer');
  113. var isDataView = tagTester('DataView');
  114. // Is a given value an array?
  115. // Delegates to ECMA5's native `Array.isArray`.
  116. var isArray = nativeIsArray || tagTester('Array');
  117. var isFunction = tagTester('Function');
  118. // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
  119. // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
  120. var nodelist = root.document && root.document.childNodes;
  121. if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
  122. isFunction = function(obj) {
  123. return typeof obj == 'function' || false;
  124. };
  125. }
  126. var isFunction$1 = isFunction;
  127. // Internal function to check whether `key` is an own property name of `obj`.
  128. function has(obj, key) {
  129. return obj != null && hasOwnProperty.call(obj, key);
  130. }
  131. var isArguments = tagTester('Arguments');
  132. // Define a fallback version of the method in browsers (ahem, IE < 9), where
  133. // there isn't any inspectable "Arguments" type.
  134. (function() {
  135. if (!isArguments(arguments)) {
  136. isArguments = function(obj) {
  137. return has(obj, 'callee');
  138. };
  139. }
  140. }());
  141. var isArguments$1 = isArguments;
  142. // Is a given object a finite number?
  143. function isFinite$1(obj) {
  144. return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
  145. }
  146. // Is the given value `NaN`?
  147. function isNaN$1(obj) {
  148. return isNumber(obj) && _isNaN(obj);
  149. }
  150. // Predicate-generating function. Often useful outside of Underscore.
  151. function constant(value) {
  152. return function() {
  153. return value;
  154. };
  155. }
  156. // Common internal logic for `isArrayLike` and `isBufferLike`.
  157. function createSizePropertyCheck(getSizeProperty) {
  158. return function(collection) {
  159. var sizeProperty = getSizeProperty(collection);
  160. return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
  161. }
  162. }
  163. // Internal helper to generate a function to obtain property `key` from `obj`.
  164. function shallowProperty(key) {
  165. return function(obj) {
  166. return obj == null ? void 0 : obj[key];
  167. };
  168. }
  169. // Internal helper to obtain the `byteLength` property of an object.
  170. var getByteLength = shallowProperty('byteLength');
  171. // Internal helper to determine whether we should spend extensive checks against
  172. // `ArrayBuffer` et al.
  173. var isBufferLike = createSizePropertyCheck(getByteLength);
  174. // Is a given value a typed array?
  175. var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
  176. function isTypedArray(obj) {
  177. // `ArrayBuffer.isView` is the most future-proof, so use it when available.
  178. // Otherwise, fall back on the above regular expression.
  179. return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) :
  180. isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
  181. }
  182. var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
  183. // Internal helper to obtain the `length` property of an object.
  184. var getLength = shallowProperty('length');
  185. // Internal helper for collection methods to determine whether a collection
  186. // should be iterated as an array or as an object.
  187. // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
  188. // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
  189. var isArrayLike = createSizePropertyCheck(getLength);
  190. // Internal helper to create a simple lookup structure.
  191. // `collectNonEnumProps` used to depend on `_.contains`, but this led to
  192. // circular imports. `emulatedSet` is a one-off solution that only works for
  193. // arrays of strings.
  194. function emulatedSet(keys) {
  195. var hash = {};
  196. for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
  197. return {
  198. contains: function(key) { return hash[key]; },
  199. push: function(key) {
  200. hash[key] = true;
  201. return keys.push(key);
  202. }
  203. };
  204. }
  205. // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
  206. // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
  207. // needed.
  208. function collectNonEnumProps(obj, keys) {
  209. keys = emulatedSet(keys);
  210. var nonEnumIdx = nonEnumerableProps.length;
  211. var constructor = obj.constructor;
  212. var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;
  213. // Constructor is a special case.
  214. var prop = 'constructor';
  215. if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);
  216. while (nonEnumIdx--) {
  217. prop = nonEnumerableProps[nonEnumIdx];
  218. if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
  219. keys.push(prop);
  220. }
  221. }
  222. }
  223. // Retrieve the names of an object's own properties.
  224. // Delegates to **ECMAScript 5**'s native `Object.keys`.
  225. function keys(obj) {
  226. if (!isObject(obj)) return [];
  227. if (nativeKeys) return nativeKeys(obj);
  228. var keys = [];
  229. for (var key in obj) if (has(obj, key)) keys.push(key);
  230. // Ahem, IE < 9.
  231. if (hasEnumBug) collectNonEnumProps(obj, keys);
  232. return keys;
  233. }
  234. // Is a given array, string, or object empty?
  235. // An "empty" object has no enumerable own-properties.
  236. function isEmpty(obj) {
  237. if (obj == null) return true;
  238. // Skip the more expensive `toString`-based type checks if `obj` has no
  239. // `.length`.
  240. if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments$1(obj))) return obj.length === 0;
  241. return keys(obj).length === 0;
  242. }
  243. // Returns whether an object has a given set of `key:value` pairs.
  244. function isMatch(object, attrs) {
  245. var _keys = keys(attrs), length = _keys.length;
  246. if (object == null) return !length;
  247. var obj = Object(object);
  248. for (var i = 0; i < length; i++) {
  249. var key = _keys[i];
  250. if (attrs[key] !== obj[key] || !(key in obj)) return false;
  251. }
  252. return true;
  253. }
  254. // If Underscore is called as a function, it returns a wrapped object that can
  255. // be used OO-style. This wrapper holds altered versions of all functions added
  256. // through `_.mixin`. Wrapped objects may be chained.
  257. function _(obj) {
  258. if (obj instanceof _) return obj;
  259. if (!(this instanceof _)) return new _(obj);
  260. this._wrapped = obj;
  261. }
  262. _.VERSION = VERSION;
  263. // Extracts the result from a wrapped and chained object.
  264. _.prototype.value = function() {
  265. return this._wrapped;
  266. };
  267. // Provide unwrapping proxies for some methods used in engine operations
  268. // such as arithmetic and JSON stringification.
  269. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
  270. _.prototype.toString = function() {
  271. return String(this._wrapped);
  272. };
  273. // Internal recursive comparison function for `_.isEqual`.
  274. function eq(a, b, aStack, bStack) {
  275. // Identical objects are equal. `0 === -0`, but they aren't identical.
  276. // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
  277. if (a === b) return a !== 0 || 1 / a === 1 / b;
  278. // `null` or `undefined` only equal to itself (strict comparison).
  279. if (a == null || b == null) return false;
  280. // `NaN`s are equivalent, but non-reflexive.
  281. if (a !== a) return b !== b;
  282. // Exhaust primitive checks
  283. var type = typeof a;
  284. if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
  285. return deepEq(a, b, aStack, bStack);
  286. }
  287. // Internal recursive comparison function for `_.isEqual`.
  288. function deepEq(a, b, aStack, bStack) {
  289. // Unwrap any wrapped objects.
  290. if (a instanceof _) a = a._wrapped;
  291. if (b instanceof _) b = b._wrapped;
  292. // Compare `[[Class]]` names.
  293. var className = toString.call(a);
  294. if (className !== toString.call(b)) return false;
  295. switch (className) {
  296. // These types are compared by value.
  297. case '[object RegExp]':
  298. // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
  299. case '[object String]':
  300. // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
  301. // equivalent to `new String("5")`.
  302. return '' + a === '' + b;
  303. case '[object Number]':
  304. // `NaN`s are equivalent, but non-reflexive.
  305. // Object(NaN) is equivalent to NaN.
  306. if (+a !== +a) return +b !== +b;
  307. // An `egal` comparison is performed for other numeric values.
  308. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  309. case '[object Date]':
  310. case '[object Boolean]':
  311. // Coerce dates and booleans to numeric primitive values. Dates are compared by their
  312. // millisecond representations. Note that invalid dates with millisecond representations
  313. // of `NaN` are not equivalent.
  314. return +a === +b;
  315. case '[object Symbol]':
  316. return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
  317. case '[object ArrayBuffer]':
  318. // Coerce to `DataView` so we can fall through to the next case.
  319. return deepEq(new DataView(a), new DataView(b), aStack, bStack);
  320. case '[object DataView]':
  321. var byteLength = getByteLength(a);
  322. if (byteLength !== getByteLength(b)) {
  323. return false;
  324. }
  325. while (byteLength--) {
  326. if (a.getUint8(byteLength) !== b.getUint8(byteLength)) {
  327. return false;
  328. }
  329. }
  330. return true;
  331. }
  332. if (isTypedArray$1(a)) {
  333. // Coerce typed arrays to `DataView`.
  334. return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack);
  335. }
  336. var areArrays = className === '[object Array]';
  337. if (!areArrays) {
  338. if (typeof a != 'object' || typeof b != 'object') return false;
  339. // Objects with different constructors are not equivalent, but `Object`s or `Array`s
  340. // from different frames are.
  341. var aCtor = a.constructor, bCtor = b.constructor;
  342. if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
  343. isFunction$1(bCtor) && bCtor instanceof bCtor)
  344. && ('constructor' in a && 'constructor' in b)) {
  345. return false;
  346. }
  347. }
  348. // Assume equality for cyclic structures. The algorithm for detecting cyclic
  349. // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
  350. // Initializing stack of traversed objects.
  351. // It's done here since we only need them for objects and arrays comparison.
  352. aStack = aStack || [];
  353. bStack = bStack || [];
  354. var length = aStack.length;
  355. while (length--) {
  356. // Linear search. Performance is inversely proportional to the number of
  357. // unique nested structures.
  358. if (aStack[length] === a) return bStack[length] === b;
  359. }
  360. // Add the first object to the stack of traversed objects.
  361. aStack.push(a);
  362. bStack.push(b);
  363. // Recursively compare objects and arrays.
  364. if (areArrays) {
  365. // Compare array lengths to determine if a deep comparison is necessary.
  366. length = a.length;
  367. if (length !== b.length) return false;
  368. // Deep compare the contents, ignoring non-numeric properties.
  369. while (length--) {
  370. if (!eq(a[length], b[length], aStack, bStack)) return false;
  371. }
  372. } else {
  373. // Deep compare objects.
  374. var _keys = keys(a), key;
  375. length = _keys.length;
  376. // Ensure that both objects contain the same number of properties before comparing deep equality.
  377. if (keys(b).length !== length) return false;
  378. while (length--) {
  379. // Deep compare each member
  380. key = _keys[length];
  381. if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
  382. }
  383. }
  384. // Remove the first object from the stack of traversed objects.
  385. aStack.pop();
  386. bStack.pop();
  387. return true;
  388. }
  389. // Perform a deep comparison to check if two objects are equal.
  390. function isEqual(a, b) {
  391. return eq(a, b);
  392. }
  393. // Retrieve all the enumerable property names of an object.
  394. function allKeys(obj) {
  395. if (!isObject(obj)) return [];
  396. var keys = [];
  397. for (var key in obj) keys.push(key);
  398. // Ahem, IE < 9.
  399. if (hasEnumBug) collectNonEnumProps(obj, keys);
  400. return keys;
  401. }
  402. // Retrieve the values of an object's properties.
  403. function values(obj) {
  404. var _keys = keys(obj);
  405. var length = _keys.length;
  406. var values = Array(length);
  407. for (var i = 0; i < length; i++) {
  408. values[i] = obj[_keys[i]];
  409. }
  410. return values;
  411. }
  412. // Convert an object into a list of `[key, value]` pairs.
  413. // The opposite of `_.object` with one argument.
  414. function pairs(obj) {
  415. var _keys = keys(obj);
  416. var length = _keys.length;
  417. var pairs = Array(length);
  418. for (var i = 0; i < length; i++) {
  419. pairs[i] = [_keys[i], obj[_keys[i]]];
  420. }
  421. return pairs;
  422. }
  423. // Invert the keys and values of an object. The values must be serializable.
  424. function invert(obj) {
  425. var result = {};
  426. var _keys = keys(obj);
  427. for (var i = 0, length = _keys.length; i < length; i++) {
  428. result[obj[_keys[i]]] = _keys[i];
  429. }
  430. return result;
  431. }
  432. // Return a sorted list of the function names available on the object.
  433. function functions(obj) {
  434. var names = [];
  435. for (var key in obj) {
  436. if (isFunction$1(obj[key])) names.push(key);
  437. }
  438. return names.sort();
  439. }
  440. // An internal function for creating assigner functions.
  441. function createAssigner(keysFunc, defaults) {
  442. return function(obj) {
  443. var length = arguments.length;
  444. if (defaults) obj = Object(obj);
  445. if (length < 2 || obj == null) return obj;
  446. for (var index = 1; index < length; index++) {
  447. var source = arguments[index],
  448. keys = keysFunc(source),
  449. l = keys.length;
  450. for (var i = 0; i < l; i++) {
  451. var key = keys[i];
  452. if (!defaults || obj[key] === void 0) obj[key] = source[key];
  453. }
  454. }
  455. return obj;
  456. };
  457. }
  458. // Extend a given object with all the properties in passed-in object(s).
  459. var extend = createAssigner(allKeys);
  460. // Assigns a given object with all the own properties in the passed-in
  461. // object(s).
  462. // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
  463. var extendOwn = createAssigner(keys);
  464. // Fill in a given object with default properties.
  465. var defaults = createAssigner(allKeys, true);
  466. // Create a naked function reference for surrogate-prototype-swapping.
  467. function ctor() {
  468. return function(){};
  469. }
  470. // An internal function for creating a new object that inherits from another.
  471. function baseCreate(prototype) {
  472. if (!isObject(prototype)) return {};
  473. if (nativeCreate) return nativeCreate(prototype);
  474. var Ctor = ctor();
  475. Ctor.prototype = prototype;
  476. var result = new Ctor;
  477. Ctor.prototype = null;
  478. return result;
  479. }
  480. // Creates an object that inherits from the given prototype object.
  481. // If additional properties are provided then they will be added to the
  482. // created object.
  483. function create(prototype, props) {
  484. var result = baseCreate(prototype);
  485. if (props) extendOwn(result, props);
  486. return result;
  487. }
  488. // Create a (shallow-cloned) duplicate of an object.
  489. function clone(obj) {
  490. if (!isObject(obj)) return obj;
  491. return isArray(obj) ? obj.slice() : extend({}, obj);
  492. }
  493. // Invokes `interceptor` with the `obj` and then returns `obj`.
  494. // The primary purpose of this method is to "tap into" a method chain, in
  495. // order to perform operations on intermediate results within the chain.
  496. function tap(obj, interceptor) {
  497. interceptor(obj);
  498. return obj;
  499. }
  500. // Shortcut function for checking if an object has a given property directly on
  501. // itself (in other words, not on a prototype). Unlike the internal `has`
  502. // function, this public version can also traverse nested properties.
  503. function has$1(obj, path) {
  504. if (!isArray(path)) {
  505. return has(obj, path);
  506. }
  507. var length = path.length;
  508. for (var i = 0; i < length; i++) {
  509. var key = path[i];
  510. if (obj == null || !hasOwnProperty.call(obj, key)) {
  511. return false;
  512. }
  513. obj = obj[key];
  514. }
  515. return !!length;
  516. }
  517. // Keep the identity function around for default iteratees.
  518. function identity(value) {
  519. return value;
  520. }
  521. // Returns a predicate for checking whether an object has a given set of
  522. // `key:value` pairs.
  523. function matcher(attrs) {
  524. attrs = extendOwn({}, attrs);
  525. return function(obj) {
  526. return isMatch(obj, attrs);
  527. };
  528. }
  529. // Internal function to obtain a nested property in `obj` along `path`.
  530. function deepGet(obj, path) {
  531. var length = path.length;
  532. for (var i = 0; i < length; i++) {
  533. if (obj == null) return void 0;
  534. obj = obj[path[i]];
  535. }
  536. return length ? obj : void 0;
  537. }
  538. // Creates a function that, when passed an object, will traverse that object’s
  539. // properties down the given `path`, specified as an array of keys or indices.
  540. function property(path) {
  541. if (!isArray(path)) {
  542. return shallowProperty(path);
  543. }
  544. return function(obj) {
  545. return deepGet(obj, path);
  546. };
  547. }
  548. // Internal function that returns an efficient (for current engines) version
  549. // of the passed-in callback, to be repeatedly applied in other Underscore
  550. // functions.
  551. function optimizeCb(func, context, argCount) {
  552. if (context === void 0) return func;
  553. switch (argCount == null ? 3 : argCount) {
  554. case 1: return function(value) {
  555. return func.call(context, value);
  556. };
  557. // The 2-argument case is omitted because we’re not using it.
  558. case 3: return function(value, index, collection) {
  559. return func.call(context, value, index, collection);
  560. };
  561. case 4: return function(accumulator, value, index, collection) {
  562. return func.call(context, accumulator, value, index, collection);
  563. };
  564. }
  565. return function() {
  566. return func.apply(context, arguments);
  567. };
  568. }
  569. // An internal function to generate callbacks that can be applied to each
  570. // element in a collection, returning the desired result — either `_.identity`,
  571. // an arbitrary callback, a property matcher, or a property accessor.
  572. function baseIteratee(value, context, argCount) {
  573. if (value == null) return identity;
  574. if (isFunction$1(value)) return optimizeCb(value, context, argCount);
  575. if (isObject(value) && !isArray(value)) return matcher(value);
  576. return property(value);
  577. }
  578. // External wrapper for our callback generator. Users may customize
  579. // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
  580. // This abstraction hides the internal-only `argCount` argument.
  581. function iteratee(value, context) {
  582. return baseIteratee(value, context, Infinity);
  583. }
  584. _.iteratee = iteratee;
  585. // The function we call internally to generate a callback. It invokes
  586. // `_.iteratee` if overridden, otherwise `baseIteratee`.
  587. function cb(value, context, argCount) {
  588. if (_.iteratee !== iteratee) return _.iteratee(value, context);
  589. return baseIteratee(value, context, argCount);
  590. }
  591. // Returns the results of applying the `iteratee` to each element of `obj`.
  592. // In contrast to `_.map` it returns an object.
  593. function mapObject(obj, iteratee, context) {
  594. iteratee = cb(iteratee, context);
  595. var _keys = keys(obj),
  596. length = _keys.length,
  597. results = {};
  598. for (var index = 0; index < length; index++) {
  599. var currentKey = _keys[index];
  600. results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
  601. }
  602. return results;
  603. }
  604. // Predicate-generating function. Often useful outside of Underscore.
  605. function noop(){}
  606. // Generates a function for a given object that returns a given property.
  607. function propertyOf(obj) {
  608. if (obj == null) {
  609. return function(){};
  610. }
  611. return function(path) {
  612. return !isArray(path) ? obj[path] : deepGet(obj, path);
  613. };
  614. }
  615. // Run a function **n** times.
  616. function times(n, iteratee, context) {
  617. var accum = Array(Math.max(0, n));
  618. iteratee = optimizeCb(iteratee, context, 1);
  619. for (var i = 0; i < n; i++) accum[i] = iteratee(i);
  620. return accum;
  621. }
  622. // Return a random integer between `min` and `max` (inclusive).
  623. function random(min, max) {
  624. if (max == null) {
  625. max = min;
  626. min = 0;
  627. }
  628. return min + Math.floor(Math.random() * (max - min + 1));
  629. }
  630. // A (possibly faster) way to get the current timestamp as an integer.
  631. var now = Date.now || function() {
  632. return new Date().getTime();
  633. };
  634. // Internal helper to generate functions for escaping and unescaping strings
  635. // to/from HTML interpolation.
  636. function createEscaper(map) {
  637. var escaper = function(match) {
  638. return map[match];
  639. };
  640. // Regexes for identifying a key that needs to be escaped.
  641. var source = '(?:' + keys(map).join('|') + ')';
  642. var testRegexp = RegExp(source);
  643. var replaceRegexp = RegExp(source, 'g');
  644. return function(string) {
  645. string = string == null ? '' : '' + string;
  646. return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
  647. };
  648. }
  649. // Internal list of HTML entities for escaping.
  650. var escapeMap = {
  651. '&': '&amp;',
  652. '<': '&lt;',
  653. '>': '&gt;',
  654. '"': '&quot;',
  655. "'": '&#x27;',
  656. '`': '&#x60;'
  657. };
  658. // Function for escaping strings to HTML interpolation.
  659. var _escape = createEscaper(escapeMap);
  660. // Internal list of HTML entities for unescaping.
  661. var unescapeMap = invert(escapeMap);
  662. // Function for unescaping strings from HTML interpolation.
  663. var _unescape = createEscaper(unescapeMap);
  664. // By default, Underscore uses ERB-style template delimiters. Change the
  665. // following template settings to use alternative delimiters.
  666. var templateSettings = _.templateSettings = {
  667. evaluate: /<%([\s\S]+?)%>/g,
  668. interpolate: /<%=([\s\S]+?)%>/g,
  669. escape: /<%-([\s\S]+?)%>/g
  670. };
  671. // When customizing `_.templateSettings`, if you don't want to define an
  672. // interpolation, evaluation or escaping regex, we need one that is
  673. // guaranteed not to match.
  674. var noMatch = /(.)^/;
  675. // Certain characters need to be escaped so that they can be put into a
  676. // string literal.
  677. var escapes = {
  678. "'": "'",
  679. '\\': '\\',
  680. '\r': 'r',
  681. '\n': 'n',
  682. '\u2028': 'u2028',
  683. '\u2029': 'u2029'
  684. };
  685. var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
  686. function escapeChar(match) {
  687. return '\\' + escapes[match];
  688. }
  689. // JavaScript micro-templating, similar to John Resig's implementation.
  690. // Underscore templating handles arbitrary delimiters, preserves whitespace,
  691. // and correctly escapes quotes within interpolated code.
  692. // NB: `oldSettings` only exists for backwards compatibility.
  693. function template(text, settings, oldSettings) {
  694. if (!settings && oldSettings) settings = oldSettings;
  695. settings = defaults({}, settings, _.templateSettings);
  696. // Combine delimiters into one regular expression via alternation.
  697. var matcher = RegExp([
  698. (settings.escape || noMatch).source,
  699. (settings.interpolate || noMatch).source,
  700. (settings.evaluate || noMatch).source
  701. ].join('|') + '|$', 'g');
  702. // Compile the template source, escaping string literals appropriately.
  703. var index = 0;
  704. var source = "__p+='";
  705. text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
  706. source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
  707. index = offset + match.length;
  708. if (escape) {
  709. source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
  710. } else if (interpolate) {
  711. source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
  712. } else if (evaluate) {
  713. source += "';\n" + evaluate + "\n__p+='";
  714. }
  715. // Adobe VMs need the match returned to produce the correct offset.
  716. return match;
  717. });
  718. source += "';\n";
  719. // If a variable is not specified, place data values in local scope.
  720. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
  721. source = "var __t,__p='',__j=Array.prototype.join," +
  722. "print=function(){__p+=__j.call(arguments,'');};\n" +
  723. source + 'return __p;\n';
  724. var render;
  725. try {
  726. render = new Function(settings.variable || 'obj', '_', source);
  727. } catch (e) {
  728. e.source = source;
  729. throw e;
  730. }
  731. var template = function(data) {
  732. return render.call(this, data, _);
  733. };
  734. // Provide the compiled source as a convenience for precompilation.
  735. var argument = settings.variable || 'obj';
  736. template.source = 'function(' + argument + '){\n' + source + '}';
  737. return template;
  738. }
  739. // Traverses the children of `obj` along `path`. If a child is a function, it
  740. // is invoked with its parent as context. Returns the value of the final
  741. // child, or `fallback` if any child is undefined.
  742. function result(obj, path, fallback) {
  743. if (!isArray(path)) path = [path];
  744. var length = path.length;
  745. if (!length) {
  746. return isFunction$1(fallback) ? fallback.call(obj) : fallback;
  747. }
  748. for (var i = 0; i < length; i++) {
  749. var prop = obj == null ? void 0 : obj[path[i]];
  750. if (prop === void 0) {
  751. prop = fallback;
  752. i = length; // Ensure we don't continue iterating.
  753. }
  754. obj = isFunction$1(prop) ? prop.call(obj) : prop;
  755. }
  756. return obj;
  757. }
  758. // Generate a unique integer id (unique within the entire client session).
  759. // Useful for temporary DOM ids.
  760. var idCounter = 0;
  761. function uniqueId(prefix) {
  762. var id = ++idCounter + '';
  763. return prefix ? prefix + id : id;
  764. }
  765. // Start chaining a wrapped Underscore object.
  766. function chain(obj) {
  767. var instance = _(obj);
  768. instance._chain = true;
  769. return instance;
  770. }
  771. // Internal function to execute `sourceFunc` bound to `context` with optional
  772. // `args`. Determines whether to execute a function as a constructor or as a
  773. // normal function.
  774. function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
  775. if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
  776. var self = baseCreate(sourceFunc.prototype);
  777. var result = sourceFunc.apply(self, args);
  778. if (isObject(result)) return result;
  779. return self;
  780. }
  781. // Partially apply a function by creating a version that has had some of its
  782. // arguments pre-filled, without changing its dynamic `this` context. `_` acts
  783. // as a placeholder by default, allowing any combination of arguments to be
  784. // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
  785. var partial = restArguments(function(func, boundArgs) {
  786. var placeholder = partial.placeholder;
  787. var bound = function() {
  788. var position = 0, length = boundArgs.length;
  789. var args = Array(length);
  790. for (var i = 0; i < length; i++) {
  791. args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
  792. }
  793. while (position < arguments.length) args.push(arguments[position++]);
  794. return executeBound(func, bound, this, this, args);
  795. };
  796. return bound;
  797. });
  798. partial.placeholder = _;
  799. // Create a function bound to a given object (assigning `this`, and arguments,
  800. // optionally).
  801. var bind = restArguments(function(func, context, args) {
  802. if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
  803. var bound = restArguments(function(callArgs) {
  804. return executeBound(func, bound, context, this, args.concat(callArgs));
  805. });
  806. return bound;
  807. });
  808. // Internal implementation of a recursive `flatten` function.
  809. function flatten(input, depth, strict, output) {
  810. output = output || [];
  811. if (!depth && depth !== 0) {
  812. depth = Infinity;
  813. } else if (depth <= 0) {
  814. return output.concat(input);
  815. }
  816. var idx = output.length;
  817. for (var i = 0, length = getLength(input); i < length; i++) {
  818. var value = input[i];
  819. if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
  820. // Flatten current level of array or arguments object.
  821. if (depth > 1) {
  822. flatten(value, depth - 1, strict, output);
  823. idx = output.length;
  824. } else {
  825. var j = 0, len = value.length;
  826. while (j < len) output[idx++] = value[j++];
  827. }
  828. } else if (!strict) {
  829. output[idx++] = value;
  830. }
  831. }
  832. return output;
  833. }
  834. // Bind a number of an object's methods to that object. Remaining arguments
  835. // are the method names to be bound. Useful for ensuring that all callbacks
  836. // defined on an object belong to it.
  837. var bindAll = restArguments(function(obj, keys) {
  838. keys = flatten(keys, false, false);
  839. var index = keys.length;
  840. if (index < 1) throw new Error('bindAll must be passed function names');
  841. while (index--) {
  842. var key = keys[index];
  843. obj[key] = bind(obj[key], obj);
  844. }
  845. return obj;
  846. });
  847. // Memoize an expensive function by storing its results.
  848. function memoize(func, hasher) {
  849. var memoize = function(key) {
  850. var cache = memoize.cache;
  851. var address = '' + (hasher ? hasher.apply(this, arguments) : key);
  852. if (!has(cache, address)) cache[address] = func.apply(this, arguments);
  853. return cache[address];
  854. };
  855. memoize.cache = {};
  856. return memoize;
  857. }
  858. // Delays a function for the given number of milliseconds, and then calls
  859. // it with the arguments supplied.
  860. var delay = restArguments(function(func, wait, args) {
  861. return setTimeout(function() {
  862. return func.apply(null, args);
  863. }, wait);
  864. });
  865. // Defers a function, scheduling it to run after the current call stack has
  866. // cleared.
  867. var defer = partial(delay, _, 1);
  868. // Returns a function, that, when invoked, will only be triggered at most once
  869. // during a given window of time. Normally, the throttled function will run
  870. // as much as it can, without ever going more than once per `wait` duration;
  871. // but if you'd like to disable the execution on the leading edge, pass
  872. // `{leading: false}`. To disable execution on the trailing edge, ditto.
  873. function throttle(func, wait, options) {
  874. var timeout, context, args, result;
  875. var previous = 0;
  876. if (!options) options = {};
  877. var later = function() {
  878. previous = options.leading === false ? 0 : now();
  879. timeout = null;
  880. result = func.apply(context, args);
  881. if (!timeout) context = args = null;
  882. };
  883. var throttled = function() {
  884. var _now = now();
  885. if (!previous && options.leading === false) previous = _now;
  886. var remaining = wait - (_now - previous);
  887. context = this;
  888. args = arguments;
  889. if (remaining <= 0 || remaining > wait) {
  890. if (timeout) {
  891. clearTimeout(timeout);
  892. timeout = null;
  893. }
  894. previous = _now;
  895. result = func.apply(context, args);
  896. if (!timeout) context = args = null;
  897. } else if (!timeout && options.trailing !== false) {
  898. timeout = setTimeout(later, remaining);
  899. }
  900. return result;
  901. };
  902. throttled.cancel = function() {
  903. clearTimeout(timeout);
  904. previous = 0;
  905. timeout = context = args = null;
  906. };
  907. return throttled;
  908. }
  909. // When a sequence of calls of the returned function ends, the argument
  910. // function is triggered. The end of a sequence is defined by the `wait`
  911. // parameter. If `immediate` is passed, the argument function will be
  912. // triggered at the beginning of the sequence instead of at the end.
  913. function debounce(func, wait, immediate) {
  914. var timeout, result;
  915. var later = function(context, args) {
  916. timeout = null;
  917. if (args) result = func.apply(context, args);
  918. };
  919. var debounced = restArguments(function(args) {
  920. if (timeout) clearTimeout(timeout);
  921. if (immediate) {
  922. var callNow = !timeout;
  923. timeout = setTimeout(later, wait);
  924. if (callNow) result = func.apply(this, args);
  925. } else {
  926. timeout = delay(later, wait, this, args);
  927. }
  928. return result;
  929. });
  930. debounced.cancel = function() {
  931. clearTimeout(timeout);
  932. timeout = null;
  933. };
  934. return debounced;
  935. }
  936. // Returns the first function passed as an argument to the second,
  937. // allowing you to adjust arguments, run code before and after, and
  938. // conditionally execute the original function.
  939. function wrap(func, wrapper) {
  940. return partial(wrapper, func);
  941. }
  942. // Returns a negated version of the passed-in predicate.
  943. function negate(predicate) {
  944. return function() {
  945. return !predicate.apply(this, arguments);
  946. };
  947. }
  948. // Returns a function that is the composition of a list of functions, each
  949. // consuming the return value of the function that follows.
  950. function compose() {
  951. var args = arguments;
  952. var start = args.length - 1;
  953. return function() {
  954. var i = start;
  955. var result = args[start].apply(this, arguments);
  956. while (i--) result = args[i].call(this, result);
  957. return result;
  958. };
  959. }
  960. // Returns a function that will only be executed on and after the Nth call.
  961. function after(times, func) {
  962. return function() {
  963. if (--times < 1) {
  964. return func.apply(this, arguments);
  965. }
  966. };
  967. }
  968. // Returns a function that will only be executed up to (but not including) the
  969. // Nth call.
  970. function before(times, func) {
  971. var memo;
  972. return function() {
  973. if (--times > 0) {
  974. memo = func.apply(this, arguments);
  975. }
  976. if (times <= 1) func = null;
  977. return memo;
  978. };
  979. }
  980. // Returns a function that will be executed at most one time, no matter how
  981. // often you call it. Useful for lazy initialization.
  982. var once = partial(before, 2);
  983. // Returns the first key on an object that passes a truth test.
  984. function findKey(obj, predicate, context) {
  985. predicate = cb(predicate, context);
  986. var _keys = keys(obj), key;
  987. for (var i = 0, length = _keys.length; i < length; i++) {
  988. key = _keys[i];
  989. if (predicate(obj[key], key, obj)) return key;
  990. }
  991. }
  992. // Internal function to generate `_.findIndex` and `_.findLastIndex`.
  993. function createPredicateIndexFinder(dir) {
  994. return function(array, predicate, context) {
  995. predicate = cb(predicate, context);
  996. var length = getLength(array);
  997. var index = dir > 0 ? 0 : length - 1;
  998. for (; index >= 0 && index < length; index += dir) {
  999. if (predicate(array[index], index, array)) return index;
  1000. }
  1001. return -1;
  1002. };
  1003. }
  1004. // Returns the first index on an array-like that passes a truth test.
  1005. var findIndex = createPredicateIndexFinder(1);
  1006. // Returns the last index on an array-like that passes a truth test.
  1007. var findLastIndex = createPredicateIndexFinder(-1);
  1008. // Use a comparator function to figure out the smallest index at which
  1009. // an object should be inserted so as to maintain order. Uses binary search.
  1010. function sortedIndex(array, obj, iteratee, context) {
  1011. iteratee = cb(iteratee, context, 1);
  1012. var value = iteratee(obj);
  1013. var low = 0, high = getLength(array);
  1014. while (low < high) {
  1015. var mid = Math.floor((low + high) / 2);
  1016. if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
  1017. }
  1018. return low;
  1019. }
  1020. // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
  1021. function createIndexFinder(dir, predicateFind, sortedIndex) {
  1022. return function(array, item, idx) {
  1023. var i = 0, length = getLength(array);
  1024. if (typeof idx == 'number') {
  1025. if (dir > 0) {
  1026. i = idx >= 0 ? idx : Math.max(idx + length, i);
  1027. } else {
  1028. length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
  1029. }
  1030. } else if (sortedIndex && idx && length) {
  1031. idx = sortedIndex(array, item);
  1032. return array[idx] === item ? idx : -1;
  1033. }
  1034. if (item !== item) {
  1035. idx = predicateFind(slice.call(array, i, length), isNaN$1);
  1036. return idx >= 0 ? idx + i : -1;
  1037. }
  1038. for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
  1039. if (array[idx] === item) return idx;
  1040. }
  1041. return -1;
  1042. };
  1043. }
  1044. // Return the position of the first occurrence of an item in an array,
  1045. // or -1 if the item is not included in the array.
  1046. // If the array is large and already in sort order, pass `true`
  1047. // for **isSorted** to use binary search.
  1048. var indexOf = createIndexFinder(1, findIndex, sortedIndex);
  1049. // Return the position of the last occurrence of an item in an array,
  1050. // or -1 if the item is not included in the array.
  1051. var lastIndexOf = createIndexFinder(-1, findLastIndex);
  1052. // Return the first value which passes a truth test.
  1053. function find(obj, predicate, context) {
  1054. var keyFinder = isArrayLike(obj) ? findIndex : findKey;
  1055. var key = keyFinder(obj, predicate, context);
  1056. if (key !== void 0 && key !== -1) return obj[key];
  1057. }
  1058. // Convenience version of a common use case of `_.find`: getting the first
  1059. // object containing specific `key:value` pairs.
  1060. function findWhere(obj, attrs) {
  1061. return find(obj, matcher(attrs));
  1062. }
  1063. // The cornerstone for collection functions, an `each`
  1064. // implementation, aka `forEach`.
  1065. // Handles raw objects in addition to array-likes. Treats all
  1066. // sparse array-likes as if they were dense.
  1067. function each(obj, iteratee, context) {
  1068. iteratee = optimizeCb(iteratee, context);
  1069. var i, length;
  1070. if (isArrayLike(obj)) {
  1071. for (i = 0, length = obj.length; i < length; i++) {
  1072. iteratee(obj[i], i, obj);
  1073. }
  1074. } else {
  1075. var _keys = keys(obj);
  1076. for (i = 0, length = _keys.length; i < length; i++) {
  1077. iteratee(obj[_keys[i]], _keys[i], obj);
  1078. }
  1079. }
  1080. return obj;
  1081. }
  1082. // Return the results of applying the iteratee to each element.
  1083. function map(obj, iteratee, context) {
  1084. iteratee = cb(iteratee, context);
  1085. var _keys = !isArrayLike(obj) && keys(obj),
  1086. length = (_keys || obj).length,
  1087. results = Array(length);
  1088. for (var index = 0; index < length; index++) {
  1089. var currentKey = _keys ? _keys[index] : index;
  1090. results[index] = iteratee(obj[currentKey], currentKey, obj);
  1091. }
  1092. return results;
  1093. }
  1094. // Internal helper to create a reducing function, iterating left or right.
  1095. function createReduce(dir) {
  1096. // Wrap code that reassigns argument variables in a separate function than
  1097. // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
  1098. var reducer = function(obj, iteratee, memo, initial) {
  1099. var _keys = !isArrayLike(obj) && keys(obj),
  1100. length = (_keys || obj).length,
  1101. index = dir > 0 ? 0 : length - 1;
  1102. if (!initial) {
  1103. memo = obj[_keys ? _keys[index] : index];
  1104. index += dir;
  1105. }
  1106. for (; index >= 0 && index < length; index += dir) {
  1107. var currentKey = _keys ? _keys[index] : index;
  1108. memo = iteratee(memo, obj[currentKey], currentKey, obj);
  1109. }
  1110. return memo;
  1111. };
  1112. return function(obj, iteratee, memo, context) {
  1113. var initial = arguments.length >= 3;
  1114. return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
  1115. };
  1116. }
  1117. // **Reduce** builds up a single result from a list of values, aka `inject`,
  1118. // or `foldl`.
  1119. var reduce = createReduce(1);
  1120. // The right-associative version of reduce, also known as `foldr`.
  1121. var reduceRight = createReduce(-1);
  1122. // Return all the elements that pass a truth test.
  1123. function filter(obj, predicate, context) {
  1124. var results = [];
  1125. predicate = cb(predicate, context);
  1126. each(obj, function(value, index, list) {
  1127. if (predicate(value, index, list)) results.push(value);
  1128. });
  1129. return results;
  1130. }
  1131. // Return all the elements for which a truth test fails.
  1132. function reject(obj, predicate, context) {
  1133. return filter(obj, negate(cb(predicate)), context);
  1134. }
  1135. // Determine whether all of the elements pass a truth test.
  1136. function every(obj, predicate, context) {
  1137. predicate = cb(predicate, context);
  1138. var _keys = !isArrayLike(obj) && keys(obj),
  1139. length = (_keys || obj).length;
  1140. for (var index = 0; index < length; index++) {
  1141. var currentKey = _keys ? _keys[index] : index;
  1142. if (!predicate(obj[currentKey], currentKey, obj)) return false;
  1143. }
  1144. return true;
  1145. }
  1146. // Determine if at least one element in the object passes a truth test.
  1147. function some(obj, predicate, context) {
  1148. predicate = cb(predicate, context);
  1149. var _keys = !isArrayLike(obj) && keys(obj),
  1150. length = (_keys || obj).length;
  1151. for (var index = 0; index < length; index++) {
  1152. var currentKey = _keys ? _keys[index] : index;
  1153. if (predicate(obj[currentKey], currentKey, obj)) return true;
  1154. }
  1155. return false;
  1156. }
  1157. // Determine if the array or object contains a given item (using `===`).
  1158. function contains(obj, item, fromIndex, guard) {
  1159. if (!isArrayLike(obj)) obj = values(obj);
  1160. if (typeof fromIndex != 'number' || guard) fromIndex = 0;
  1161. return indexOf(obj, item, fromIndex) >= 0;
  1162. }
  1163. // Invoke a method (with arguments) on every item in a collection.
  1164. var invoke = restArguments(function(obj, path, args) {
  1165. var contextPath, func;
  1166. if (isFunction$1(path)) {
  1167. func = path;
  1168. } else if (isArray(path)) {
  1169. contextPath = path.slice(0, -1);
  1170. path = path[path.length - 1];
  1171. }
  1172. return map(obj, function(context) {
  1173. var method = func;
  1174. if (!method) {
  1175. if (contextPath && contextPath.length) {
  1176. context = deepGet(context, contextPath);
  1177. }
  1178. if (context == null) return void 0;
  1179. method = context[path];
  1180. }
  1181. return method == null ? method : method.apply(context, args);
  1182. });
  1183. });
  1184. // Convenience version of a common use case of `_.map`: fetching a property.
  1185. function pluck(obj, key) {
  1186. return map(obj, property(key));
  1187. }
  1188. // Convenience version of a common use case of `_.filter`: selecting only
  1189. // objects containing specific `key:value` pairs.
  1190. function where(obj, attrs) {
  1191. return filter(obj, matcher(attrs));
  1192. }
  1193. // Return the maximum element (or element-based computation).
  1194. function max(obj, iteratee, context) {
  1195. var result = -Infinity, lastComputed = -Infinity,
  1196. value, computed;
  1197. if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
  1198. obj = isArrayLike(obj) ? obj : values(obj);
  1199. for (var i = 0, length = obj.length; i < length; i++) {
  1200. value = obj[i];
  1201. if (value != null && value > result) {
  1202. result = value;
  1203. }
  1204. }
  1205. } else {
  1206. iteratee = cb(iteratee, context);
  1207. each(obj, function(v, index, list) {
  1208. computed = iteratee(v, index, list);
  1209. if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
  1210. result = v;
  1211. lastComputed = computed;
  1212. }
  1213. });
  1214. }
  1215. return result;
  1216. }
  1217. // Return the minimum element (or element-based computation).
  1218. function min(obj, iteratee, context) {
  1219. var result = Infinity, lastComputed = Infinity,
  1220. value, computed;
  1221. if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
  1222. obj = isArrayLike(obj) ? obj : values(obj);
  1223. for (var i = 0, length = obj.length; i < length; i++) {
  1224. value = obj[i];
  1225. if (value != null && value < result) {
  1226. result = value;
  1227. }
  1228. }
  1229. } else {
  1230. iteratee = cb(iteratee, context);
  1231. each(obj, function(v, index, list) {
  1232. computed = iteratee(v, index, list);
  1233. if (computed < lastComputed || computed === Infinity && result === Infinity) {
  1234. result = v;
  1235. lastComputed = computed;
  1236. }
  1237. });
  1238. }
  1239. return result;
  1240. }
  1241. // Sample **n** random values from a collection using the modern version of the
  1242. // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
  1243. // If **n** is not specified, returns a single random element.
  1244. // The internal `guard` argument allows it to work with `_.map`.
  1245. function sample(obj, n, guard) {
  1246. if (n == null || guard) {
  1247. if (!isArrayLike(obj)) obj = values(obj);
  1248. return obj[random(obj.length - 1)];
  1249. }
  1250. var sample = isArrayLike(obj) ? clone(obj) : values(obj);
  1251. var length = getLength(sample);
  1252. n = Math.max(Math.min(n, length), 0);
  1253. var last = length - 1;
  1254. for (var index = 0; index < n; index++) {
  1255. var rand = random(index, last);
  1256. var temp = sample[index];
  1257. sample[index] = sample[rand];
  1258. sample[rand] = temp;
  1259. }
  1260. return sample.slice(0, n);
  1261. }
  1262. // Shuffle a collection.
  1263. function shuffle(obj) {
  1264. return sample(obj, Infinity);
  1265. }
  1266. // Sort the object's values by a criterion produced by an iteratee.
  1267. function sortBy(obj, iteratee, context) {
  1268. var index = 0;
  1269. iteratee = cb(iteratee, context);
  1270. return pluck(map(obj, function(value, key, list) {
  1271. return {
  1272. value: value,
  1273. index: index++,
  1274. criteria: iteratee(value, key, list)
  1275. };
  1276. }).sort(function(left, right) {
  1277. var a = left.criteria;
  1278. var b = right.criteria;
  1279. if (a !== b) {
  1280. if (a > b || a === void 0) return 1;
  1281. if (a < b || b === void 0) return -1;
  1282. }
  1283. return left.index - right.index;
  1284. }), 'value');
  1285. }
  1286. // An internal function used for aggregate "group by" operations.
  1287. function group(behavior, partition) {
  1288. return function(obj, iteratee, context) {
  1289. var result = partition ? [[], []] : {};
  1290. iteratee = cb(iteratee, context);
  1291. each(obj, function(value, index) {
  1292. var key = iteratee(value, index, obj);
  1293. behavior(result, value, key);
  1294. });
  1295. return result;
  1296. };
  1297. }
  1298. // Groups the object's values by a criterion. Pass either a string attribute
  1299. // to group by, or a function that returns the criterion.
  1300. var groupBy = group(function(result, value, key) {
  1301. if (has(result, key)) result[key].push(value); else result[key] = [value];
  1302. });
  1303. // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
  1304. // when you know that your index values will be unique.
  1305. var indexBy = group(function(result, value, key) {
  1306. result[key] = value;
  1307. });
  1308. // Counts instances of an object that group by a certain criterion. Pass
  1309. // either a string attribute to count by, or a function that returns the
  1310. // criterion.
  1311. var countBy = group(function(result, value, key) {
  1312. if (has(result, key)) result[key]++; else result[key] = 1;
  1313. });
  1314. // Split a collection into two arrays: one whose elements all pass the given
  1315. // truth test, and one whose elements all do not pass the truth test.
  1316. var partition = group(function(result, value, pass) {
  1317. result[pass ? 0 : 1].push(value);
  1318. }, true);
  1319. // Safely create a real, live array from anything iterable.
  1320. var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
  1321. function toArray(obj) {
  1322. if (!obj) return [];
  1323. if (isArray(obj)) return slice.call(obj);
  1324. if (isString(obj)) {
  1325. // Keep surrogate pair characters together.
  1326. return obj.match(reStrSymbol);
  1327. }
  1328. if (isArrayLike(obj)) return map(obj, identity);
  1329. return values(obj);
  1330. }
  1331. // Return the number of elements in a collection.
  1332. function size(obj) {
  1333. if (obj == null) return 0;
  1334. return isArrayLike(obj) ? obj.length : keys(obj).length;
  1335. }
  1336. // Internal `_.pick` helper function to determine whether `key` is an enumerable
  1337. // property name of `obj`.
  1338. function keyInObj(value, key, obj) {
  1339. return key in obj;
  1340. }
  1341. // Return a copy of the object only containing the allowed properties.
  1342. var pick = restArguments(function(obj, keys) {
  1343. var result = {}, iteratee = keys[0];
  1344. if (obj == null) return result;
  1345. if (isFunction$1(iteratee)) {
  1346. if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
  1347. keys = allKeys(obj);
  1348. } else {
  1349. iteratee = keyInObj;
  1350. keys = flatten(keys, false, false);
  1351. obj = Object(obj);
  1352. }
  1353. for (var i = 0, length = keys.length; i < length; i++) {
  1354. var key = keys[i];
  1355. var value = obj[key];
  1356. if (iteratee(value, key, obj)) result[key] = value;
  1357. }
  1358. return result;
  1359. });
  1360. // Return a copy of the object without the disallowed properties.
  1361. var omit = restArguments(function(obj, keys) {
  1362. var iteratee = keys[0], context;
  1363. if (isFunction$1(iteratee)) {
  1364. iteratee = negate(iteratee);
  1365. if (keys.length > 1) context = keys[1];
  1366. } else {
  1367. keys = map(flatten(keys, false, false), String);
  1368. iteratee = function(value, key) {
  1369. return !contains(keys, key);
  1370. };
  1371. }
  1372. return pick(obj, iteratee, context);
  1373. });
  1374. // Returns everything but the last entry of the array. Especially useful on
  1375. // the arguments object. Passing **n** will return all the values in
  1376. // the array, excluding the last N.
  1377. function initial(array, n, guard) {
  1378. return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
  1379. }
  1380. // Get the first element of an array. Passing **n** will return the first N
  1381. // values in the array. The **guard** check allows it to work with `_.map`.
  1382. function first(array, n, guard) {
  1383. if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
  1384. if (n == null || guard) return array[0];
  1385. return initial(array, array.length - n);
  1386. }
  1387. // Returns everything but the first entry of the `array`. Especially useful on
  1388. // the `arguments` object. Passing an **n** will return the rest N values in the
  1389. // `array`.
  1390. function rest(array, n, guard) {
  1391. return slice.call(array, n == null || guard ? 1 : n);
  1392. }
  1393. // Get the last element of an array. Passing **n** will return the last N
  1394. // values in the array.
  1395. function last(array, n, guard) {
  1396. if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
  1397. if (n == null || guard) return array[array.length - 1];
  1398. return rest(array, Math.max(0, array.length - n));
  1399. }
  1400. // Trim out all falsy values from an array.
  1401. function compact(array) {
  1402. return filter(array, Boolean);
  1403. }
  1404. // Flatten out an array, either recursively (by default), or up to `depth`.
  1405. // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
  1406. function flatten$1(array, depth) {
  1407. return flatten(array, depth, false);
  1408. }
  1409. // Take the difference between one array and a number of other arrays.
  1410. // Only the elements present in just the first array will remain.
  1411. var difference = restArguments(function(array, rest) {
  1412. rest = flatten(rest, true, true);
  1413. return filter(array, function(value){
  1414. return !contains(rest, value);
  1415. });
  1416. });
  1417. // Return a version of the array that does not contain the specified value(s).
  1418. var without = restArguments(function(array, otherArrays) {
  1419. return difference(array, otherArrays);
  1420. });
  1421. // Produce a duplicate-free version of the array. If the array has already
  1422. // been sorted, you have the option of using a faster algorithm.
  1423. // The faster algorithm will not work with an iteratee if the iteratee
  1424. // is not a one-to-one function, so providing an iteratee will disable
  1425. // the faster algorithm.
  1426. function uniq(array, isSorted, iteratee, context) {
  1427. if (!isBoolean(isSorted)) {
  1428. context = iteratee;
  1429. iteratee = isSorted;
  1430. isSorted = false;
  1431. }
  1432. if (iteratee != null) iteratee = cb(iteratee, context);
  1433. var result = [];
  1434. var seen = [];
  1435. for (var i = 0, length = getLength(array); i < length; i++) {
  1436. var value = array[i],
  1437. computed = iteratee ? iteratee(value, i, array) : value;
  1438. if (isSorted && !iteratee) {
  1439. if (!i || seen !== computed) result.push(value);
  1440. seen = computed;
  1441. } else if (iteratee) {
  1442. if (!contains(seen, computed)) {
  1443. seen.push(computed);
  1444. result.push(value);
  1445. }
  1446. } else if (!contains(result, value)) {
  1447. result.push(value);
  1448. }
  1449. }
  1450. return result;
  1451. }
  1452. // Produce an array that contains the union: each distinct element from all of
  1453. // the passed-in arrays.
  1454. var union = restArguments(function(arrays) {
  1455. return uniq(flatten(arrays, true, true));
  1456. });
  1457. // Produce an array that contains every item shared between all the
  1458. // passed-in arrays.
  1459. function intersection(array) {
  1460. var result = [];
  1461. var argsLength = arguments.length;
  1462. for (var i = 0, length = getLength(array); i < length; i++) {
  1463. var item = array[i];
  1464. if (contains(result, item)) continue;
  1465. var j;
  1466. for (j = 1; j < argsLength; j++) {
  1467. if (!contains(arguments[j], item)) break;
  1468. }
  1469. if (j === argsLength) result.push(item);
  1470. }
  1471. return result;
  1472. }
  1473. // Complement of zip. Unzip accepts an array of arrays and groups
  1474. // each array's elements on shared indices.
  1475. function unzip(array) {
  1476. var length = array && max(array, getLength).length || 0;
  1477. var result = Array(length);
  1478. for (var index = 0; index < length; index++) {
  1479. result[index] = pluck(array, index);
  1480. }
  1481. return result;
  1482. }
  1483. // Zip together multiple lists into a single array -- elements that share
  1484. // an index go together.
  1485. var zip = restArguments(unzip);
  1486. // Converts lists into objects. Pass either a single array of `[key, value]`
  1487. // pairs, or two parallel arrays of the same length -- one of keys, and one of
  1488. // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
  1489. function object(list, values) {
  1490. var result = {};
  1491. for (var i = 0, length = getLength(list); i < length; i++) {
  1492. if (values) {
  1493. result[list[i]] = values[i];
  1494. } else {
  1495. result[list[i][0]] = list[i][1];
  1496. }
  1497. }
  1498. return result;
  1499. }
  1500. // Generate an integer Array containing an arithmetic progression. A port of
  1501. // the native Python `range()` function. See
  1502. // [the Python documentation](https://docs.python.org/library/functions.html#range).
  1503. function range(start, stop, step) {
  1504. if (stop == null) {
  1505. stop = start || 0;
  1506. start = 0;
  1507. }
  1508. if (!step) {
  1509. step = stop < start ? -1 : 1;
  1510. }
  1511. var length = Math.max(Math.ceil((stop - start) / step), 0);
  1512. var range = Array(length);
  1513. for (var idx = 0; idx < length; idx++, start += step) {
  1514. range[idx] = start;
  1515. }
  1516. return range;
  1517. }
  1518. // Chunk a single array into multiple arrays, each containing `count` or fewer
  1519. // items.
  1520. function chunk(array, count) {
  1521. if (count == null || count < 1) return [];
  1522. var result = [];
  1523. var i = 0, length = array.length;
  1524. while (i < length) {
  1525. result.push(slice.call(array, i, i += count));
  1526. }
  1527. return result;
  1528. }
  1529. // Helper function to continue chaining intermediate results.
  1530. function chainResult(instance, obj) {
  1531. return instance._chain ? _(obj).chain() : obj;
  1532. }
  1533. // Add your own custom functions to the Underscore object.
  1534. function mixin(obj) {
  1535. each(functions(obj), function(name) {
  1536. var func = _[name] = obj[name];
  1537. _.prototype[name] = function() {
  1538. var args = [this._wrapped];
  1539. push.apply(args, arguments);
  1540. return chainResult(this, func.apply(_, args));
  1541. };
  1542. });
  1543. return _;
  1544. }
  1545. // Add all mutator `Array` functions to the wrapper.
  1546. each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
  1547. var method = ArrayProto[name];
  1548. _.prototype[name] = function() {
  1549. var obj = this._wrapped;
  1550. if (obj != null) {
  1551. method.apply(obj, arguments);
  1552. if ((name === 'shift' || name === 'splice') && obj.length === 0) {
  1553. delete obj[0];
  1554. }
  1555. }
  1556. return chainResult(this, obj);
  1557. };
  1558. });
  1559. // Add all accessor `Array` functions to the wrapper.
  1560. each(['concat', 'join', 'slice'], function(name) {
  1561. var method = ArrayProto[name];
  1562. _.prototype[name] = function() {
  1563. var obj = this._wrapped;
  1564. if (obj != null) obj = method.apply(obj, arguments);
  1565. return chainResult(this, obj);
  1566. };
  1567. });
  1568. // Named Exports
  1569. var allExports = {
  1570. __proto__: null,
  1571. VERSION: VERSION,
  1572. restArguments: restArguments,
  1573. isObject: isObject,
  1574. isNull: isNull,
  1575. isUndefined: isUndefined,
  1576. isBoolean: isBoolean,
  1577. isElement: isElement,
  1578. isString: isString,
  1579. isNumber: isNumber,
  1580. isDate: isDate,
  1581. isRegExp: isRegExp,
  1582. isError: isError,
  1583. isSymbol: isSymbol,
  1584. isMap: isMap,
  1585. isWeakMap: isWeakMap,
  1586. isSet: isSet,
  1587. isWeakSet: isWeakSet,
  1588. isArrayBuffer: isArrayBuffer,
  1589. isDataView: isDataView,
  1590. isArray: isArray,
  1591. isFunction: isFunction$1,
  1592. isArguments: isArguments$1,
  1593. isFinite: isFinite$1,
  1594. isNaN: isNaN$1,
  1595. isTypedArray: isTypedArray$1,
  1596. isEmpty: isEmpty,
  1597. isMatch: isMatch,
  1598. isEqual: isEqual,
  1599. keys: keys,
  1600. allKeys: allKeys,
  1601. values: values,
  1602. pairs: pairs,
  1603. invert: invert,
  1604. functions: functions,
  1605. methods: functions,
  1606. extend: extend,
  1607. extendOwn: extendOwn,
  1608. assign: extendOwn,
  1609. defaults: defaults,
  1610. create: create,
  1611. clone: clone,
  1612. tap: tap,
  1613. has: has$1,
  1614. mapObject: mapObject,
  1615. identity: identity,
  1616. constant: constant,
  1617. noop: noop,
  1618. property: property,
  1619. propertyOf: propertyOf,
  1620. matcher: matcher,
  1621. matches: matcher,
  1622. times: times,
  1623. random: random,
  1624. now: now,
  1625. escape: _escape,
  1626. unescape: _unescape,
  1627. templateSettings: templateSettings,
  1628. template: template,
  1629. result: result,
  1630. uniqueId: uniqueId,
  1631. chain: chain,
  1632. iteratee: iteratee,
  1633. partial: partial,
  1634. bind: bind,
  1635. bindAll: bindAll,
  1636. memoize: memoize,
  1637. delay: delay,
  1638. defer: defer,
  1639. throttle: throttle,
  1640. debounce: debounce,
  1641. wrap: wrap,
  1642. negate: negate,
  1643. compose: compose,
  1644. after: after,
  1645. before: before,
  1646. once: once,
  1647. findKey: findKey,
  1648. findIndex: findIndex,
  1649. findLastIndex: findLastIndex,
  1650. sortedIndex: sortedIndex,
  1651. indexOf: indexOf,
  1652. lastIndexOf: lastIndexOf,
  1653. find: find,
  1654. detect: find,
  1655. findWhere: findWhere,
  1656. each: each,
  1657. forEach: each,
  1658. map: map,
  1659. collect: map,
  1660. reduce: reduce,
  1661. foldl: reduce,
  1662. inject: reduce,
  1663. reduceRight: reduceRight,
  1664. foldr: reduceRight,
  1665. filter: filter,
  1666. select: filter,
  1667. reject: reject,
  1668. every: every,
  1669. all: every,
  1670. some: some,
  1671. any: some,
  1672. contains: contains,
  1673. includes: contains,
  1674. include: contains,
  1675. invoke: invoke,
  1676. pluck: pluck,
  1677. where: where,
  1678. max: max,
  1679. min: min,
  1680. shuffle: shuffle,
  1681. sample: sample,
  1682. sortBy: sortBy,
  1683. groupBy: groupBy,
  1684. indexBy: indexBy,
  1685. countBy: countBy,
  1686. partition: partition,
  1687. toArray: toArray,
  1688. size: size,
  1689. pick: pick,
  1690. omit: omit,
  1691. first: first,
  1692. head: first,
  1693. take: first,
  1694. initial: initial,
  1695. last: last,
  1696. rest: rest,
  1697. tail: rest,
  1698. drop: rest,
  1699. compact: compact,
  1700. flatten: flatten$1,
  1701. without: without,
  1702. uniq: uniq,
  1703. unique: uniq,
  1704. union: union,
  1705. intersection: intersection,
  1706. difference: difference,
  1707. unzip: unzip,
  1708. transpose: unzip,
  1709. zip: zip,
  1710. object: object,
  1711. range: range,
  1712. chunk: chunk,
  1713. mixin: mixin,
  1714. 'default': _
  1715. };
  1716. // Default Export
  1717. // Add all of the Underscore functions to the wrapper object.
  1718. var _$1 = mixin(allExports);
  1719. // Legacy Node.js API.
  1720. _$1._ = _$1;
  1721. return _$1;
  1722. })));
  1723. //# sourceMappingURL=underscore.js.map