Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
recline scope
This file has been truncated, but you can view the full file.
//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// //
// If you are using Chrome, open the Developer Tools and click the gear //
// icon in its lower right corner. In the General Settings panel, turn //
// on 'Enable source maps'. //
// //
// If you are using Firefox 23, go to `about:config` and set the //
// `devtools.debugger.source-maps-enabled` preference to true. //
// (The preference should be on by default in Firefox 24; versions //
// older than 23 do not support source maps.) //
// //
//////////////////////////////////////////////////////////////////////////
(function () {
/* Imports */
//var Meteor = Package.meteor.Meteor;
/* Package-scope variables */
var _, unit, times, duration, isVisible, animateTo, child, retval, matches, matches2, key, worksheet;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// packages/acouch:nvd3-recline/vendor/lodash/dist/lodash.js //
// This file is in bare mode and is not in its own closure. //
// //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
/** // 1
* @license // 2
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> // 3
* Build: `lodash modern -o ./dist/lodash.js` // 4
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> // 5
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> // 6
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // 7
* Available under MIT license <http://lodash.com/license> // 8
*/ // 9
;(function() { // 10
// 11
/** Used as a safe reference for `undefined` in pre ES5 environments */ // 12
var undefined; // 13
// 14
/** Used to pool arrays and objects used internally */ // 15
var arrayPool = [], // 16
objectPool = []; // 17
// 18
/** Used to generate unique IDs */ // 19
var idCounter = 0; // 20
// 21
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ // 22
var keyPrefix = +new Date + ''; // 23
// 24
/** Used as the size when optimizations are enabled for large arrays */ // 25
var largeArraySize = 75; // 26
// 27
/** Used as the max size of the `arrayPool` and `objectPool` */ // 28
var maxPoolSize = 40; // 29
// 30
/** Used to detect and test whitespace */ // 31
var whitespace = ( // 32
// whitespace // 33
' \t\x0B\f\xA0\ufeff' + // 34
// 35
// line terminators // 36
'\n\r\u2028\u2029' + // 37
// 38
// unicode category "Zs" space separators // 39
'\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' // 40
); // 41
// 42
/** Used to match empty string literals in compiled template source */ // 43
var reEmptyStringLeading = /\b__p \+= '';/g, // 44
reEmptyStringMiddle = /\b(__p \+=) '' \+/g, // 45
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; // 46
// 47
/** // 48
* Used to match ES6 template delimiters // 49
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals // 50
*/ // 51
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; // 52
// 53
/** Used to match regexp flags from their coerced string values */ // 54
var reFlags = /\w*$/; // 55
// 56
/** Used to detected named functions */ // 57
var reFuncName = /^\s*function[ \n\r\t]+\w/; // 58
// 59
/** Used to match "interpolate" template delimiters */ // 60
var reInterpolate = /<%=([\s\S]+?)%>/g; // 61
// 62
/** Used to match leading whitespace and zeros to be removed */ // 63
var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); // 64
// 65
/** Used to ensure capturing order of template delimiters */ // 66
var reNoMatch = /($^)/; // 67
// 68
/** Used to detect functions containing a `this` reference */ // 69
var reThis = /\bthis\b/; // 70
// 71
/** Used to match unescaped characters in compiled string literals */ // 72
var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; // 73
// 74
/** Used to assign default `context` object properties */ // 75
var contextProps = [ // 76
'Array', 'Boolean', 'Date', 'Function', 'Math', 'Number', 'Object', // 77
'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', // 78
'parseInt', 'setTimeout' // 79
]; // 80
// 81
/** Used to make template sourceURLs easier to identify */ // 82
var templateCounter = 0; // 83
// 84
/** `Object#toString` result shortcuts */ // 85
var argsClass = '[object Arguments]', // 86
arrayClass = '[object Array]', // 87
boolClass = '[object Boolean]', // 88
dateClass = '[object Date]', // 89
funcClass = '[object Function]', // 90
numberClass = '[object Number]', // 91
objectClass = '[object Object]', // 92
regexpClass = '[object RegExp]', // 93
stringClass = '[object String]'; // 94
// 95
/** Used to identify object classifications that `_.clone` supports */ // 96
var cloneableClasses = {}; // 97
cloneableClasses[funcClass] = false; // 98
cloneableClasses[argsClass] = cloneableClasses[arrayClass] = // 99
cloneableClasses[boolClass] = cloneableClasses[dateClass] = // 100
cloneableClasses[numberClass] = cloneableClasses[objectClass] = // 101
cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; // 102
// 103
/** Used as an internal `_.debounce` options object */ // 104
var debounceOptions = { // 105
'leading': false, // 106
'maxWait': 0, // 107
'trailing': false // 108
}; // 109
// 110
/** Used as the property descriptor for `__bindData__` */ // 111
var descriptor = { // 112
'configurable': false, // 113
'enumerable': false, // 114
'value': null, // 115
'writable': false // 116
}; // 117
// 118
/** Used to determine if values are of the language type Object */ // 119
var objectTypes = { // 120
'boolean': false, // 121
'function': true, // 122
'object': true, // 123
'number': false, // 124
'string': false, // 125
'undefined': false // 126
}; // 127
// 128
/** Used to escape characters for inclusion in compiled string literals */ // 129
var stringEscapes = { // 130
'\\': '\\', // 131
"'": "'", // 132
'\n': 'n', // 133
'\r': 'r', // 134
'\t': 't', // 135
'\u2028': 'u2028', // 136
'\u2029': 'u2029' // 137
}; // 138
// 139
/** Used as a reference to the global object */ // 140
var root = (objectTypes[typeof window] && window) || this; // 141
// 142
/** Detect free variable `exports` */ // 143
var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; // 144
// 145
/** Detect free variable `module` */ // 146
var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; // 147
// 148
/** Detect the popular CommonJS extension `module.exports` */ // 149
var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; // 150
// 151
/** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ // 152
var freeGlobal = objectTypes[typeof global] && global; // 153
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { // 154
root = freeGlobal; // 155
} // 156
// 157
/*--------------------------------------------------------------------------*/ // 158
// 159
/** // 160
* The base implementation of `_.indexOf` without support for binary searches // 161
* or `fromIndex` constraints. // 162
* // 163
* @private // 164
* @param {Array} array The array to search. // 165
* @param {*} value The value to search for. // 166
* @param {number} [fromIndex=0] The index to search from. // 167
* @returns {number} Returns the index of the matched value or `-1`. // 168
*/ // 169
function baseIndexOf(array, value, fromIndex) { // 170
var index = (fromIndex || 0) - 1, // 171
length = array ? array.length : 0; // 172
// 173
while (++index < length) { // 174
if (array[index] === value) { // 175
return index; // 176
} // 177
} // 178
return -1; // 179
} // 180
// 181
/** // 182
* An implementation of `_.contains` for cache objects that mimics the return // 183
* signature of `_.indexOf` by returning `0` if the value is found, else `-1`. // 184
* // 185
* @private // 186
* @param {Object} cache The cache object to inspect. // 187
* @param {*} value The value to search for. // 188
* @returns {number} Returns `0` if `value` is found, else `-1`. // 189
*/ // 190
function cacheIndexOf(cache, value) { // 191
var type = typeof value; // 192
cache = cache.cache; // 193
// 194
if (type == 'boolean' || value == null) { // 195
return cache[value] ? 0 : -1; // 196
} // 197
if (type != 'number' && type != 'string') { // 198
type = 'object'; // 199
} // 200
var key = type == 'number' ? value : keyPrefix + value; // 201
cache = (cache = cache[type]) && cache[key]; // 202
// 203
return type == 'object' // 204
? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1) // 205
: (cache ? 0 : -1); // 206
} // 207
// 208
/** // 209
* Adds a given value to the corresponding cache object. // 210
* // 211
* @private // 212
* @param {*} value The value to add to the cache. // 213
*/ // 214
function cachePush(value) { // 215
var cache = this.cache, // 216
type = typeof value; // 217
// 218
if (type == 'boolean' || value == null) { // 219
cache[value] = true; // 220
} else { // 221
if (type != 'number' && type != 'string') { // 222
type = 'object'; // 223
} // 224
var key = type == 'number' ? value : keyPrefix + value, // 225
typeCache = cache[type] || (cache[type] = {}); // 226
// 227
if (type == 'object') { // 228
(typeCache[key] || (typeCache[key] = [])).push(value); // 229
} else { // 230
typeCache[key] = true; // 231
} // 232
} // 233
} // 234
// 235
/** // 236
* Used by `_.max` and `_.min` as the default callback when a given // 237
* collection is a string value. // 238
* // 239
* @private // 240
* @param {string} value The character to inspect. // 241
* @returns {number} Returns the code unit of given character. // 242
*/ // 243
function charAtCallback(value) { // 244
return value.charCodeAt(0); // 245
} // 246
// 247
/** // 248
* Used by `sortBy` to compare transformed `collection` elements, stable sorting // 249
* them in ascending order. // 250
* // 251
* @private // 252
* @param {Object} a The object to compare to `b`. // 253
* @param {Object} b The object to compare to `a`. // 254
* @returns {number} Returns the sort order indicator of `1` or `-1`. // 255
*/ // 256
function compareAscending(a, b) { // 257
var ac = a.criteria, // 258
bc = b.criteria, // 259
index = -1, // 260
length = ac.length; // 261
// 262
while (++index < length) { // 263
var value = ac[index], // 264
other = bc[index]; // 265
// 266
if (value !== other) { // 267
if (value > other || typeof value == 'undefined') { // 268
return 1; // 269
} // 270
if (value < other || typeof other == 'undefined') { // 271
return -1; // 272
} // 273
} // 274
} // 275
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // 276
// that causes it, under certain circumstances, to return the same value for // 277
// `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247 // 278
// // 279
// This also ensures a stable sort in V8 and other engines. // 280
// See http://code.google.com/p/v8/issues/detail?id=90 // 281
return a.index - b.index; // 282
} // 283
// 284
/** // 285
* Creates a cache object to optimize linear searches of large arrays. // 286
* // 287
* @private // 288
* @param {Array} [array=[]] The array to search. // 289
* @returns {null|Object} Returns the cache object or `null` if caching should not be used. // 290
*/ // 291
function createCache(array) { // 292
var index = -1, // 293
length = array.length, // 294
first = array[0], // 295
mid = array[(length / 2) | 0], // 296
last = array[length - 1]; // 297
// 298
if (first && typeof first == 'object' && // 299
mid && typeof mid == 'object' && last && typeof last == 'object') { // 300
return false; // 301
} // 302
var cache = getObject(); // 303
cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; // 304
// 305
var result = getObject(); // 306
result.array = array; // 307
result.cache = cache; // 308
result.push = cachePush; // 309
// 310
while (++index < length) { // 311
result.push(array[index]); // 312
} // 313
return result; // 314
} // 315
// 316
/** // 317
* Used by `template` to escape characters for inclusion in compiled // 318
* string literals. // 319
* // 320
* @private // 321
* @param {string} match The matched character to escape. // 322
* @returns {string} Returns the escaped character. // 323
*/ // 324
function escapeStringChar(match) { // 325
return '\\' + stringEscapes[match]; // 326
} // 327
// 328
/** // 329
* Gets an array from the array pool or creates a new one if the pool is empty. // 330
* // 331
* @private // 332
* @returns {Array} The array from the pool. // 333
*/ // 334
function getArray() { // 335
return arrayPool.pop() || []; // 336
} // 337
// 338
/** // 339
* Gets an object from the object pool or creates a new one if the pool is empty. // 340
* // 341
* @private // 342
* @returns {Object} The object from the pool. // 343
*/ // 344
function getObject() { // 345
return objectPool.pop() || { // 346
'array': null, // 347
'cache': null, // 348
'criteria': null, // 349
'false': false, // 350
'index': 0, // 351
'null': false, // 352
'number': null, // 353
'object': null, // 354
'push': null, // 355
'string': null, // 356
'true': false, // 357
'undefined': false, // 358
'value': null // 359
}; // 360
} // 361
// 362
/** // 363
* Releases the given array back to the array pool. // 364
* // 365
* @private // 366
* @param {Array} [array] The array to release. // 367
*/ // 368
function releaseArray(array) { // 369
array.length = 0; // 370
if (arrayPool.length < maxPoolSize) { // 371
arrayPool.push(array); // 372
} // 373
} // 374
// 375
/** // 376
* Releases the given object back to the object pool. // 377
* // 378
* @private // 379
* @param {Object} [object] The object to release. // 380
*/ // 381
function releaseObject(object) { // 382
var cache = object.cache; // 383
if (cache) { // 384
releaseObject(cache); // 385
} // 386
object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null;
if (objectPool.length < maxPoolSize) { // 388
objectPool.push(object); // 389
} // 390
} // 391
// 392
/** // 393
* Slices the `collection` from the `start` index up to, but not including, // 394
* the `end` index. // 395
* // 396
* Note: This function is used instead of `Array#slice` to support node lists // 397
* in IE < 9 and to ensure dense arrays are returned. // 398
* // 399
* @private // 400
* @param {Array|Object|string} collection The collection to slice. // 401
* @param {number} start The start index. // 402
* @param {number} end The end index. // 403
* @returns {Array} Returns the new array. // 404
*/ // 405
function slice(array, start, end) { // 406
start || (start = 0); // 407
if (typeof end == 'undefined') { // 408
end = array ? array.length : 0; // 409
} // 410
var index = -1, // 411
length = end - start || 0, // 412
result = Array(length < 0 ? 0 : length); // 413
// 414
while (++index < length) { // 415
result[index] = array[start + index]; // 416
} // 417
return result; // 418
} // 419
// 420
/*--------------------------------------------------------------------------*/ // 421
// 422
/** // 423
* Create a new `lodash` function using the given context object. // 424
* // 425
* @static // 426
* @memberOf _ // 427
* @category Utilities // 428
* @param {Object} [context=root] The context object. // 429
* @returns {Function} Returns the `lodash` function. // 430
*/ // 431
function runInContext(context) { // 432
// Avoid issues with some ES3 environments that attempt to use values, named // 433
// after built-in constructors like `Object`, for the creation of literals. // 434
// ES5 clears this up by stating that literals must use built-in constructors. // 435
// See http://es5.github.io/#x11.1.5. // 436
context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; // 437
// 438
/** Native constructor references */ // 439
var Array = context.Array, // 440
Boolean = context.Boolean, // 441
Date = context.Date, // 442
Function = context.Function, // 443
Math = context.Math, // 444
Number = context.Number, // 445
Object = context.Object, // 446
RegExp = context.RegExp, // 447
String = context.String, // 448
TypeError = context.TypeError; // 449
// 450
/** // 451
* Used for `Array` method references. // 452
* // 453
* Normally `Array.prototype` would suffice, however, using an array literal // 454
* avoids issues in Narwhal. // 455
*/ // 456
var arrayRef = []; // 457
// 458
/** Used for native method references */ // 459
var objectProto = Object.prototype; // 460
// 461
/** Used to restore the original `_` reference in `noConflict` */ // 462
var oldDash = context._; // 463
// 464
/** Used to resolve the internal [[Class]] of values */ // 465
var toString = objectProto.toString; // 466
// 467
/** Used to detect if a method is native */ // 468
var reNative = RegExp('^' + // 469
String(toString) // 470
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // 471
.replace(/toString| for [^\]]+/g, '.*?') + '$' // 472
); // 473
// 474
/** Native method shortcuts */ // 475
var ceil = Math.ceil, // 476
clearTimeout = context.clearTimeout, // 477
floor = Math.floor, // 478
fnToString = Function.prototype.toString, // 479
getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, // 480
hasOwnProperty = objectProto.hasOwnProperty, // 481
push = arrayRef.push, // 482
setTimeout = context.setTimeout, // 483
splice = arrayRef.splice, // 484
unshift = arrayRef.unshift; // 485
// 486
/** Used to set meta data on functions */ // 487
var defineProperty = (function() { // 488
// IE 8 only accepts DOM elements // 489
try { // 490
var o = {}, // 491
func = isNative(func = Object.defineProperty) && func, // 492
result = func(o, o, o) && func; // 493
} catch(e) { } // 494
return result; // 495
}()); // 496
// 497
/* Native method shortcuts for methods with the same name as other `lodash` methods */ // 498
var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, // 499
nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, // 500
nativeIsFinite = context.isFinite, // 501
nativeIsNaN = context.isNaN, // 502
nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, // 503
nativeMax = Math.max, // 504
nativeMin = Math.min, // 505
nativeParseInt = context.parseInt, // 506
nativeRandom = Math.random; // 507
// 508
/** Used to lookup a built-in constructor by [[Class]] */ // 509
var ctorByClass = {}; // 510
ctorByClass[arrayClass] = Array; // 511
ctorByClass[boolClass] = Boolean; // 512
ctorByClass[dateClass] = Date; // 513
ctorByClass[funcClass] = Function; // 514
ctorByClass[objectClass] = Object; // 515
ctorByClass[numberClass] = Number; // 516
ctorByClass[regexpClass] = RegExp; // 517
ctorByClass[stringClass] = String; // 518
// 519
/*--------------------------------------------------------------------------*/ // 520
// 521
/** // 522
* Creates a `lodash` object which wraps the given value to enable intuitive // 523
* method chaining. // 524
* // 525
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods: // 526
* `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, // 527
* and `unshift` // 528
* // 529
* Chaining is supported in custom builds as long as the `value` method is // 530
* implicitly or explicitly included in the build. // 531
* // 532
* The chainable wrapper functions are: // 533
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, // 534
* `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`, // 535
* `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, // 536
* `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, // 537
* `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, // 538
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, // 539
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, // 540
* `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, // 541
* `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, // 542
* `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, // 543
* and `zip` // 544
* // 545
* The non-chainable wrapper functions are: // 546
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, // 547
* `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, // 548
* `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, // 549
* `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, // 550
* `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, // 551
* `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, // 552
* `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, // 553
* `template`, `unescape`, `uniqueId`, and `value` // 554
* // 555
* The wrapper functions `first` and `last` return wrapped values when `n` is // 556
* provided, otherwise they return unwrapped values. // 557
* // 558
* Explicit chaining can be enabled by using the `_.chain` method. // 559
* // 560
* @name _ // 561
* @constructor // 562
* @category Chaining // 563
* @param {*} value The value to wrap in a `lodash` instance. // 564
* @returns {Object} Returns a `lodash` instance. // 565
* @example // 566
* // 567
* var wrapped = _([1, 2, 3]); // 568
* // 569
* // returns an unwrapped value // 570
* wrapped.reduce(function(sum, num) { // 571
* return sum + num; // 572
* }); // 573
* // => 6 // 574
* // 575
* // returns a wrapped value // 576
* var squares = wrapped.map(function(num) { // 577
* return num * num; // 578
* }); // 579
* // 580
* _.isArray(squares); // 581
* // => false // 582
* // 583
* _.isArray(squares.value()); // 584
* // => true // 585
*/ // 586
function lodash(value) { // 587
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor // 588
return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__')) // 589
? value // 590
: new lodashWrapper(value); // 591
} // 592
// 593
/** // 594
* A fast path for creating `lodash` wrapper objects. // 595
* // 596
* @private // 597
* @param {*} value The value to wrap in a `lodash` instance. // 598
* @param {boolean} chainAll A flag to enable chaining for all methods // 599
* @returns {Object} Returns a `lodash` instance. // 600
*/ // 601
function lodashWrapper(value, chainAll) { // 602
this.__chain__ = !!chainAll; // 603
this.__wrapped__ = value; // 604
} // 605
// ensure `new lodashWrapper` is an instance of `lodash` // 606
lodashWrapper.prototype = lodash.prototype; // 607
// 608
/** // 609
* An object used to flag environments features. // 610
* // 611
* @static // 612
* @memberOf _ // 613
* @type Object // 614
*/ // 615
var support = lodash.support = {}; // 616
// 617
/** // 618
* Detect if functions can be decompiled by `Function#toString` // 619
* (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps). // 620
* // 621
* @memberOf _.support // 622
* @type boolean // 623
*/ // 624
support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); // 625
// 626
/** // 627
* Detect if `Function#name` is supported (all but IE). // 628
* // 629
* @memberOf _.support // 630
* @type boolean // 631
*/ // 632
support.funcNames = typeof Function.name == 'string'; // 633
// 634
/** // 635
* By default, the template delimiters used by Lo-Dash are similar to those in // 636
* embedded Ruby (ERB). Change the following template settings to use alternative // 637
* delimiters. // 638
* // 639
* @static // 640
* @memberOf _ // 641
* @type Object // 642
*/ // 643
lodash.templateSettings = { // 644
// 645
/** // 646
* Used to detect `data` property values to be HTML-escaped. // 647
* // 648
* @memberOf _.templateSettings // 649
* @type RegExp // 650
*/ // 651
'escape': /<%-([\s\S]+?)%>/g, // 652
// 653
/** // 654
* Used to detect code to be evaluated. // 655
* // 656
* @memberOf _.templateSettings // 657
* @type RegExp // 658
*/ // 659
'evaluate': /<%([\s\S]+?)%>/g, // 660
// 661
/** // 662
* Used to detect `data` property values to inject. // 663
* // 664
* @memberOf _.templateSettings // 665
* @type RegExp // 666
*/ // 667
'interpolate': reInterpolate, // 668
// 669
/** // 670
* Used to reference the data object in the template text. // 671
* // 672
* @memberOf _.templateSettings // 673
* @type string // 674
*/ // 675
'variable': '', // 676
// 677
/** // 678
* Used to import variables into the compiled template. // 679
* // 680
* @memberOf _.templateSettings // 681
* @type Object // 682
*/ // 683
'imports': { // 684
// 685
/** // 686
* A reference to the `lodash` function. // 687
* // 688
* @memberOf _.templateSettings.imports // 689
* @type Function // 690
*/ // 691
'_': lodash // 692
} // 693
}; // 694
// 695
/*--------------------------------------------------------------------------*/ // 696
// 697
/** // 698
* The base implementation of `_.bind` that creates the bound function and // 699
* sets its meta data. // 700
* // 701
* @private // 702
* @param {Array} bindData The bind data array. // 703
* @returns {Function} Returns the new bound function. // 704
*/ // 705
function baseBind(bindData) { // 706
var func = bindData[0], // 707
partialArgs = bindData[2], // 708
thisArg = bindData[4]; // 709
// 710
function bound() { // 711
// `Function#bind` spec // 712
// http://es5.github.io/#x15.3.4.5 // 713
if (partialArgs) { // 714
// avoid `arguments` object deoptimizations by using `slice` instead // 715
// of `Array.prototype.slice.call` and not assigning `arguments` to a // 716
// variable as a ternary expression // 717
var args = slice(partialArgs); // 718
push.apply(args, arguments); // 719
} // 720
// mimic the constructor's `return` behavior // 721
// http://es5.github.io/#x13.2.2 // 722
if (this instanceof bound) { // 723
// ensure `new bound` is an instance of `func` // 724
var thisBinding = baseCreate(func.prototype), // 725
result = func.apply(thisBinding, args || arguments); // 726
return isObject(result) ? result : thisBinding; // 727
} // 728
return func.apply(thisArg, args || arguments); // 729
} // 730
setBindData(bound, bindData); // 731
return bound; // 732
} // 733
// 734
/** // 735
* The base implementation of `_.clone` without argument juggling or support // 736
* for `thisArg` binding. // 737
* // 738
* @private // 739
* @param {*} value The value to clone. // 740
* @param {boolean} [isDeep=false] Specify a deep clone. // 741
* @param {Function} [callback] The function to customize cloning values. // 742
* @param {Array} [stackA=[]] Tracks traversed source objects. // 743
* @param {Array} [stackB=[]] Associates clones with source counterparts. // 744
* @returns {*} Returns the cloned value. // 745
*/ // 746
function baseClone(value, isDeep, callback, stackA, stackB) { // 747
if (callback) { // 748
var result = callback(value); // 749
if (typeof result != 'undefined') { // 750
return result; // 751
} // 752
} // 753
// inspect [[Class]] // 754
var isObj = isObject(value); // 755
if (isObj) { // 756
var className = toString.call(value); // 757
if (!cloneableClasses[className]) { // 758
return value; // 759
} // 760
var ctor = ctorByClass[className]; // 761
switch (className) { // 762
case boolClass: // 763
case dateClass: // 764
return new ctor(+value); // 765
// 766
case numberClass: // 767
case stringClass: // 768
return new ctor(value); // 769
// 770
case regexpClass: // 771
result = ctor(value.source, reFlags.exec(value)); // 772
result.lastIndex = value.lastIndex; // 773
return result; // 774
} // 775
} else { // 776
return value; // 777
} // 778
var isArr = isArray(value); // 779
if (isDeep) { // 780
// check for circular references and return corresponding clone // 781
var initedStack = !stackA; // 782
stackA || (stackA = getArray()); // 783
stackB || (stackB = getArray()); // 784
// 785
var length = stackA.length; // 786
while (length--) { // 787
if (stackA[length] == value) { // 788
return stackB[length]; // 789
} // 790
} // 791
result = isArr ? ctor(value.length) : {}; // 792
} // 793
else { // 794
result = isArr ? slice(value) : assign({}, value); // 795
} // 796
// add array properties assigned by `RegExp#exec` // 797
if (isArr) { // 798
if (hasOwnProperty.call(value, 'index')) { // 799
result.index = value.index; // 800
} // 801
if (hasOwnProperty.call(value, 'input')) { // 802
result.input = value.input; // 803
} // 804
} // 805
// exit for shallow clone // 806
if (!isDeep) { // 807
return result; // 808
} // 809
// add the source value to the stack of traversed objects // 810
// and associate it with its clone // 811
stackA.push(value); // 812
stackB.push(result); // 813
// 814
// recursively populate clone (susceptible to call stack limits) // 815
(isArr ? forEach : forOwn)(value, function(objValue, key) { // 816
result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); // 817
}); // 818
// 819
if (initedStack) { // 820
releaseArray(stackA); // 821
releaseArray(stackB); // 822
} // 823
return result; // 824
} // 825
// 826
/** // 827
* The base implementation of `_.create` without support for assigning // 828
* properties to the created object. // 829
* // 830
* @private // 831
* @param {Object} prototype The object to inherit from. // 832
* @returns {Object} Returns the new object. // 833
*/ // 834
function baseCreate(prototype, properties) { // 835
return isObject(prototype) ? nativeCreate(prototype) : {}; // 836
} // 837
// fallback for browsers without `Object.create` // 838
if (!nativeCreate) { // 839
baseCreate = (function() { // 840
function Object() {} // 841
return function(prototype) { // 842
if (isObject(prototype)) { // 843
Object.prototype = prototype; // 844
var result = new Object; // 845
Object.prototype = null; // 846
} // 847
return result || context.Object(); // 848
}; // 849
}()); // 850
} // 851
// 852
/** // 853
* The base implementation of `_.createCallback` without support for creating // 854
* "_.pluck" or "_.where" style callbacks. // 855
* // 856
* @private // 857
* @param {*} [func=identity] The value to convert to a callback. // 858
* @param {*} [thisArg] The `this` binding of the created callback. // 859
* @param {number} [argCount] The number of arguments the callback accepts. // 860
* @returns {Function} Returns a callback function. // 861
*/ // 862
function baseCreateCallback(func, thisArg, argCount) { // 863
if (typeof func != 'function') { // 864
return identity; // 865
} // 866
// exit early for no `thisArg` or already bound by `Function#bind` // 867
if (typeof thisArg == 'undefined' || !('prototype' in func)) { // 868
return func; // 869
} // 870
var bindData = func.__bindData__; // 871
if (typeof bindData == 'undefined') { // 872
if (support.funcNames) { // 873
bindData = !func.name; // 874
} // 875
bindData = bindData || !support.funcDecomp; // 876
if (!bindData) { // 877
var source = fnToString.call(func); // 878
if (!support.funcNames) { // 879
bindData = !reFuncName.test(source); // 880
} // 881
if (!bindData) { // 882
// checks if `func` references the `this` keyword and stores the result // 883
bindData = reThis.test(source); // 884
setBindData(func, bindData); // 885
} // 886
} // 887
} // 888
// exit early if there are no `this` references or `func` is bound // 889
if (bindData === false || (bindData !== true && bindData[1] & 1)) { // 890
return func; // 891
} // 892
switch (argCount) { // 893
case 1: return function(value) { // 894
return func.call(thisArg, value); // 895
}; // 896
case 2: return function(a, b) { // 897
return func.call(thisArg, a, b); // 898
}; // 899
case 3: return function(value, index, collection) { // 900
return func.call(thisArg, value, index, collection); // 901
}; // 902
case 4: return function(accumulator, value, index, collection) { // 903
return func.call(thisArg, accumulator, value, index, collection); // 904
}; // 905
} // 906
return bind(func, thisArg); // 907
} // 908
// 909
/** // 910
* The base implementation of `createWrapper` that creates the wrapper and // 911
* sets its meta data. // 912
* // 913
* @private // 914
* @param {Array} bindData The bind data array. // 915
* @returns {Function} Returns the new function. // 916
*/ // 917
function baseCreateWrapper(bindData) { // 918
var func = bindData[0], // 919
bitmask = bindData[1], // 920
partialArgs = bindData[2], // 921
partialRightArgs = bindData[3], // 922
thisArg = bindData[4], // 923
arity = bindData[5]; // 924
// 925
var isBind = bitmask & 1, // 926
isBindKey = bitmask & 2, // 927
isCurry = bitmask & 4, // 928
isCurryBound = bitmask & 8, // 929
key = func; // 930
// 931
function bound() { // 932
var thisBinding = isBind ? thisArg : this; // 933
if (partialArgs) { // 934
var args = slice(partialArgs); // 935
push.apply(args, arguments); // 936
} // 937
if (partialRightArgs || isCurry) { // 938
args || (args = slice(arguments)); // 939
if (partialRightArgs) { // 940
push.apply(args, partialRightArgs); // 941
} // 942
if (isCurry && args.length < arity) { // 943
bitmask |= 16 & ~32; // 944
return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); // 945
} // 946
} // 947
args || (args = arguments); // 948
if (isBindKey) { // 949
func = thisBinding[key]; // 950
} // 951
if (this instanceof bound) { // 952
thisBinding = baseCreate(func.prototype); // 953
var result = func.apply(thisBinding, args); // 954
return isObject(result) ? result : thisBinding; // 955
} // 956
return func.apply(thisBinding, args); // 957
} // 958
setBindData(bound, bindData); // 959
return bound; // 960
} // 961
// 962
/** // 963
* The base implementation of `_.difference` that accepts a single array // 964
* of values to exclude. // 965
* // 966
* @private // 967
* @param {Array} array The array to process. // 968
* @param {Array} [values] The array of values to exclude. // 969
* @returns {Array} Returns a new array of filtered values. // 970
*/ // 971
function baseDifference(array, values) { // 972
var index = -1, // 973
indexOf = getIndexOf(), // 974
length = array ? array.length : 0, // 975
isLarge = length >= largeArraySize && indexOf === baseIndexOf, // 976
result = []; // 977
// 978
if (isLarge) { // 979
var cache = createCache(values); // 980
if (cache) { // 981
indexOf = cacheIndexOf; // 982
values = cache; // 983
} else { // 984
isLarge = false; // 985
} // 986
} // 987
while (++index < length) { // 988
var value = array[index]; // 989
if (indexOf(values, value) < 0) { // 990
result.push(value); // 991
} // 992
} // 993
if (isLarge) { // 994
releaseObject(values); // 995
} // 996
return result; // 997
} // 998
// 999
/** // 1000
* The base implementation of `_.flatten` without support for callback // 1001
* shorthands or `thisArg` binding. // 1002
* // 1003
* @private // 1004
* @param {Array} array The array to flatten. // 1005
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. // 1006
* @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects. // 1007
* @param {number} [fromIndex=0] The index to start from. // 1008
* @returns {Array} Returns a new flattened array. // 1009
*/ // 1010
function baseFlatten(array, isShallow, isStrict, fromIndex) { // 1011
var index = (fromIndex || 0) - 1, // 1012
length = array ? array.length : 0, // 1013
result = []; // 1014
// 1015
while (++index < length) { // 1016
var value = array[index]; // 1017
// 1018
if (value && typeof value == 'object' && typeof value.length == 'number' // 1019
&& (isArray(value) || isArguments(value))) { // 1020
// recursively flatten arrays (susceptible to call stack limits) // 1021
if (!isShallow) { // 1022
value = baseFlatten(value, isShallow, isStrict); // 1023
} // 1024
var valIndex = -1, // 1025
valLength = value.length, // 1026
resIndex = result.length; // 1027
// 1028
result.length += valLength; // 1029
while (++valIndex < valLength) { // 1030
result[resIndex++] = value[valIndex]; // 1031
} // 1032
} else if (!isStrict) { // 1033
result.push(value); // 1034
} // 1035
} // 1036
return result; // 1037
} // 1038
// 1039
/** // 1040
* The base implementation of `_.isEqual`, without support for `thisArg` binding, // 1041
* that allows partial "_.where" style comparisons. // 1042
* // 1043
* @private // 1044
* @param {*} a The value to compare. // 1045
* @param {*} b The other value to compare. // 1046
* @param {Function} [callback] The function to customize comparing values. // 1047
* @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. // 1048
* @param {Array} [stackA=[]] Tracks traversed `a` objects. // 1049
* @param {Array} [stackB=[]] Tracks traversed `b` objects. // 1050
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. // 1051
*/ // 1052
function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { // 1053
// used to indicate that when comparing objects, `a` has at least the properties of `b` // 1054
if (callback) { // 1055
var result = callback(a, b); // 1056
if (typeof result != 'undefined') { // 1057
return !!result; // 1058
} // 1059
} // 1060
// exit early for identical values // 1061
if (a === b) { // 1062
// treat `+0` vs. `-0` as not equal // 1063
return a !== 0 || (1 / a == 1 / b); // 1064
} // 1065
var type = typeof a, // 1066
otherType = typeof b; // 1067
// 1068
// exit early for unlike primitive values // 1069
if (a === a && // 1070
!(a && objectTypes[type]) && // 1071
!(b && objectTypes[otherType])) { // 1072
return false; // 1073
} // 1074
// exit early for `null` and `undefined` avoiding ES3's Function#call behavior // 1075
// http://es5.github.io/#x15.3.4.4 // 1076
if (a == null || b == null) { // 1077
return a === b; // 1078
} // 1079
// compare [[Class]] names // 1080
var className = toString.call(a), // 1081
otherClass = toString.call(b); // 1082
// 1083
if (className == argsClass) { // 1084
className = objectClass; // 1085
} // 1086
if (otherClass == argsClass) { // 1087
otherClass = objectClass; // 1088
} // 1089
if (className != otherClass) { // 1090
return false; // 1091
} // 1092
switch (className) { // 1093
case boolClass: // 1094
case dateClass: // 1095
// coerce dates and booleans to numbers, dates to milliseconds and booleans // 1096
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal // 1097
return +a == +b; // 1098
// 1099
case numberClass: // 1100
// treat `NaN` vs. `NaN` as equal // 1101
return (a != +a) // 1102
? b != +b // 1103
// but treat `+0` vs. `-0` as not equal // 1104
: (a == 0 ? (1 / a == 1 / b) : a == +b); // 1105
// 1106
case regexpClass: // 1107
case stringClass: // 1108
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // 1109
// treat string primitives and their corresponding object instances as equal // 1110
return a == String(b); // 1111
} // 1112
var isArr = className == arrayClass; // 1113
if (!isArr) { // 1114
// unwrap any `lodash` wrapped values // 1115
var aWrapped = hasOwnProperty.call(a, '__wrapped__'), // 1116
bWrapped = hasOwnProperty.call(b, '__wrapped__'); // 1117
// 1118
if (aWrapped || bWrapped) { // 1119
return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB);
} // 1121
// exit for functions and DOM nodes // 1122
if (className != objectClass) { // 1123
return false; // 1124
} // 1125
// in older versions of Opera, `arguments` objects have `Array` constructors // 1126
var ctorA = a.constructor, // 1127
ctorB = b.constructor; // 1128
// 1129
// non `Object` object instances with different constructors are not equal // 1130
if (ctorA != ctorB && // 1131
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && // 1132
('constructor' in a && 'constructor' in b) // 1133
) { // 1134
return false; // 1135
} // 1136
} // 1137
// assume cyclic structures are equal // 1138
// the algorithm for detecting cyclic structures is adapted from ES 5.1 // 1139
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) // 1140
var initedStack = !stackA; // 1141
stackA || (stackA = getArray()); // 1142
stackB || (stackB = getArray()); // 1143
// 1144
var length = stackA.length; // 1145
while (length--) { // 1146
if (stackA[length] == a) { // 1147
return stackB[length] == b; // 1148
} // 1149
} // 1150
var size = 0; // 1151
result = true; // 1152
// 1153
// add `a` and `b` to the stack of traversed objects // 1154
stackA.push(a); // 1155
stackB.push(b); // 1156
// 1157
// recursively compare objects and arrays (susceptible to call stack limits) // 1158
if (isArr) { // 1159
// compare lengths to determine if a deep comparison is necessary // 1160
length = a.length; // 1161
size = b.length; // 1162
result = size == length; // 1163
// 1164
if (result || isWhere) { // 1165
// deep compare the contents, ignoring non-numeric properties // 1166
while (size--) { // 1167
var index = length, // 1168
value = b[size]; // 1169
// 1170
if (isWhere) { // 1171
while (index--) { // 1172
if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { // 1173
break; // 1174
} // 1175
} // 1176
} else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { // 1177
break; // 1178
} // 1179
} // 1180
} // 1181
} // 1182
else { // 1183
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // 1184
// which, in this case, is more costly // 1185
forIn(b, function(value, key, b) { // 1186
if (hasOwnProperty.call(b, key)) { // 1187
// count the number of properties. // 1188
size++; // 1189
// deep compare each property value. // 1190
return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB));
} // 1192
}); // 1193
// 1194
if (result && !isWhere) { // 1195
// ensure both objects have the same number of properties // 1196
forIn(a, function(value, key, a) { // 1197
if (hasOwnProperty.call(a, key)) { // 1198
// `size` will be `-1` if `a` has more properties than `b` // 1199
return (result = --size > -1); // 1200
} // 1201
}); // 1202
} // 1203
} // 1204
stackA.pop(); // 1205
stackB.pop(); // 1206
// 1207
if (initedStack) { // 1208
releaseArray(stackA); // 1209
releaseArray(stackB); // 1210
} // 1211
return result; // 1212
} // 1213
// 1214
/** // 1215
* The base implementation of `_.merge` without argument juggling or support // 1216
* for `thisArg` binding. // 1217
* // 1218
* @private // 1219
* @param {Object} object The destination object. // 1220
* @param {Object} source The source object. // 1221
* @param {Function} [callback] The function to customize merging properties. // 1222
* @param {Array} [stackA=[]] Tracks traversed source objects. // 1223
* @param {Array} [stackB=[]] Associates values with source counterparts. // 1224
*/ // 1225
function baseMerge(object, source, callback, stackA, stackB) { // 1226
(isArray(source) ? forEach : forOwn)(source, function(source, key) { // 1227
var found, // 1228
isArr, // 1229
result = source, // 1230
value = object[key]; // 1231
// 1232
if (source && ((isArr = isArray(source)) || isPlainObject(source))) { // 1233
// avoid merging previously merged cyclic sources // 1234
var stackLength = stackA.length; // 1235
while (stackLength--) { // 1236
if ((found = stackA[stackLength] == source)) { // 1237
value = stackB[stackLength]; // 1238
break; // 1239
} // 1240
} // 1241
if (!found) { // 1242
var isShallow; // 1243
if (callback) { // 1244
result = callback(value, source); // 1245
if ((isShallow = typeof result != 'undefined')) { // 1246
value = result; // 1247
} // 1248
} // 1249
if (!isShallow) { // 1250
value = isArr // 1251
? (isArray(value) ? value : []) // 1252
: (isPlainObject(value) ? value : {}); // 1253
} // 1254
// add `source` and associated `value` to the stack of traversed objects // 1255
stackA.push(source); // 1256
stackB.push(value); // 1257
// 1258
// recursively merge objects and arrays (susceptible to call stack limits) // 1259
if (!isShallow) { // 1260
baseMerge(value, source, callback, stackA, stackB); // 1261
} // 1262
} // 1263
} // 1264
else { // 1265
if (callback) { // 1266
result = callback(value, source); // 1267
if (typeof result == 'undefined') { // 1268
result = source; // 1269
} // 1270
} // 1271
if (typeof result != 'undefined') { // 1272
value = result; // 1273
} // 1274
} // 1275
object[key] = value; // 1276
}); // 1277
} // 1278
// 1279
/** // 1280
* The base implementation of `_.random` without argument juggling or support // 1281
* for returning floating-point numbers. // 1282
* // 1283
* @private // 1284
* @param {number} min The minimum possible value. // 1285
* @param {number} max The maximum possible value. // 1286
* @returns {number} Returns a random number. // 1287
*/ // 1288
function baseRandom(min, max) { // 1289
return min + floor(nativeRandom() * (max - min + 1)); // 1290
} // 1291
// 1292
/** // 1293
* The base implementation of `_.uniq` without support for callback shorthands // 1294
* or `thisArg` binding. // 1295
* // 1296
* @private // 1297
* @param {Array} array The array to process. // 1298
* @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. // 1299
* @param {Function} [callback] The function called per iteration. // 1300
* @returns {Array} Returns a duplicate-value-free array. // 1301
*/ // 1302
function baseUniq(array, isSorted, callback) { // 1303
var index = -1, // 1304
indexOf = getIndexOf(), // 1305
length = array ? array.length : 0, // 1306
result = []; // 1307
// 1308
var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, // 1309
seen = (callback || isLarge) ? getArray() : result; // 1310
// 1311
if (isLarge) { // 1312
var cache = createCache(seen); // 1313
indexOf = cacheIndexOf; // 1314
seen = cache; // 1315
} // 1316
while (++index < length) { // 1317
var value = array[index], // 1318
computed = callback ? callback(value, index, array) : value; // 1319
// 1320
if (isSorted // 1321
? !index || seen[seen.length - 1] !== computed // 1322
: indexOf(seen, computed) < 0 // 1323
) { // 1324
if (callback || isLarge) { // 1325
seen.push(computed); // 1326
} // 1327
result.push(value); // 1328
} // 1329
} // 1330
if (isLarge) { // 1331
releaseArray(seen.array); // 1332
releaseObject(seen); // 1333
} else if (callback) { // 1334
releaseArray(seen); // 1335
} // 1336
return result; // 1337
} // 1338
// 1339
/** // 1340
* Creates a function that aggregates a collection, creating an object composed // 1341
* of keys generated from the results of running each element of the collection // 1342
* through a callback. The given `setter` function sets the keys and values // 1343
* of the composed object. // 1344
* // 1345
* @private // 1346
* @param {Function} setter The setter function. // 1347
* @returns {Function} Returns the new aggregator function. // 1348
*/ // 1349
function createAggregator(setter) { // 1350
return function(collection, callback, thisArg) { // 1351
var result = {}; // 1352
callback = lodash.createCallback(callback, thisArg, 3); // 1353
// 1354
var index = -1, // 1355
length = collection ? collection.length : 0; // 1356
// 1357
if (typeof length == 'number') { // 1358
while (++index < length) { // 1359
var value = collection[index]; // 1360
setter(result, value, callback(value, index, collection), collection); // 1361
} // 1362
} else { // 1363
forOwn(collection, function(value, key, collection) { // 1364
setter(result, value, callback(value, key, collection), collection); // 1365
}); // 1366
} // 1367
return result; // 1368
}; // 1369
} // 1370
// 1371
/** // 1372
* Creates a function that, when called, either curries or invokes `func` // 1373
* with an optional `this` binding and partially applied arguments. // 1374
* // 1375
* @private // 1376
* @param {Function|string} func The function or method name to reference. // 1377
* @param {number} bitmask The bitmask of method flags to compose. // 1378
* The bitmask may be composed of the following flags: // 1379
* 1 - `_.bind` // 1380
* 2 - `_.bindKey` // 1381
* 4 - `_.curry` // 1382
* 8 - `_.curry` (bound) // 1383
* 16 - `_.partial` // 1384
* 32 - `_.partialRight` // 1385
* @param {Array} [partialArgs] An array of arguments to prepend to those // 1386
* provided to the new function. // 1387
* @param {Array} [partialRightArgs] An array of arguments to append to those // 1388
* provided to the new function. // 1389
* @param {*} [thisArg] The `this` binding of `func`. // 1390
* @param {number} [arity] The arity of `func`. // 1391
* @returns {Function} Returns the new function. // 1392
*/ // 1393
function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { // 1394
var isBind = bitmask & 1, // 1395
isBindKey = bitmask & 2, // 1396
isCurry = bitmask & 4, // 1397
isCurryBound = bitmask & 8, // 1398
isPartial = bitmask & 16, // 1399
isPartialRight = bitmask & 32; // 1400
// 1401
if (!isBindKey && !isFunction(func)) { // 1402
throw new TypeError; // 1403
} // 1404
if (isPartial && !partialArgs.length) { // 1405
bitmask &= ~16; // 1406
isPartial = partialArgs = false; // 1407
} // 1408
if (isPartialRight && !partialRightArgs.length) { // 1409
bitmask &= ~32; // 1410
isPartialRight = partialRightArgs = false; // 1411
} // 1412
var bindData = func && func.__bindData__; // 1413
if (bindData && bindData !== true) { // 1414
// clone `bindData` // 1415
bindData = slice(bindData); // 1416
if (bindData[2]) { // 1417
bindData[2] = slice(bindData[2]); // 1418
} // 1419
if (bindData[3]) { // 1420
bindData[3] = slice(bindData[3]); // 1421
} // 1422
// set `thisBinding` is not previously bound // 1423
if (isBind && !(bindData[1] & 1)) { // 1424
bindData[4] = thisArg; // 1425
} // 1426
// set if previously bound but not currently (subsequent curried functions) // 1427
if (!isBind && bindData[1] & 1) { // 1428
bitmask |= 8; // 1429
} // 1430
// set curried arity if not yet set // 1431
if (isCurry && !(bindData[1] & 4)) { // 1432
bindData[5] = arity; // 1433
} // 1434
// append partial left arguments // 1435
if (isPartial) { // 1436
push.apply(bindData[2] || (bindData[2] = []), partialArgs); // 1437
} // 1438
// append partial right arguments // 1439
if (isPartialRight) { // 1440
unshift.apply(bindData[3] || (bindData[3] = []), partialRightArgs); // 1441
} // 1442
// merge flags // 1443
bindData[1] |= bitmask; // 1444
return createWrapper.apply(null, bindData); // 1445
} // 1446
// fast path for `_.bind` // 1447
var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; // 1448
return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); // 1449
} // 1450
// 1451
/** // 1452
* Used by `escape` to convert characters to HTML entities. // 1453
* // 1454
* @private // 1455
* @param {string} match The matched character to escape. // 1456
* @returns {string} Returns the escaped character. // 1457
*/ // 1458
function escapeHtmlChar(match) { // 1459
return htmlEscapes[match]; // 1460
} // 1461
// 1462
/** // 1463
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is // 1464
* customized, this method returns the custom method, otherwise it returns // 1465
* the `baseIndexOf` function. // 1466
* // 1467
* @private // 1468
* @returns {Function} Returns the "indexOf" function. // 1469
*/ // 1470
function getIndexOf() { // 1471
var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; // 1472
return result; // 1473
} // 1474
// 1475
/** // 1476
* Checks if `value` is a native function. // 1477
* // 1478
* @private // 1479
* @param {*} value The value to check. // 1480
* @returns {boolean} Returns `true` if the `value` is a native function, else `false`. // 1481
*/ // 1482
function isNative(value) { // 1483
return typeof value == 'function' && reNative.test(value); // 1484
} // 1485
// 1486
/** // 1487
* Sets `this` binding data on a given function. // 1488
* // 1489
* @private // 1490
* @param {Function} func The function to set data on. // 1491
* @param {Array} value The data array to set. // 1492
*/ // 1493
var setBindData = !defineProperty ? noop : function(func, value) { // 1494
descriptor.value = value; // 1495
defineProperty(func, '__bindData__', descriptor); // 1496
}; // 1497
// 1498
/** // 1499
* A fallback implementation of `isPlainObject` which checks if a given value // 1500
* is an object created by the `Object` constructor, assuming objects created // 1501
* by the `Object` constructor have no inherited enumerable properties and that // 1502
* there are no `Object.prototype` extensions. // 1503
* // 1504
* @private // 1505
* @param {*} value The value to check. // 1506
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`. // 1507
*/ // 1508
function shimIsPlainObject(value) { // 1509
var ctor, // 1510
result; // 1511
// 1512
// avoid non Object objects, `arguments` objects, and DOM elements // 1513
if (!(value && toString.call(value) == objectClass) || // 1514
(ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) { // 1515
return false; // 1516
} // 1517
// In most environments an object's own properties are iterated before // 1518
// its inherited properties. If the last iterated property is an object's // 1519
// own property then there are no inherited enumerable properties. // 1520
forIn(value, function(value, key) { // 1521
result = key; // 1522
}); // 1523
return typeof result == 'undefined' || hasOwnProperty.call(value, result); // 1524
} // 1525
// 1526
/** // 1527
* Used by `unescape` to convert HTML entities to characters. // 1528
* // 1529
* @private // 1530
* @param {string} match The matched character to unescape. // 1531
* @returns {string} Returns the unescaped character. // 1532
*/ // 1533
function unescapeHtmlChar(match) { // 1534
return htmlUnescapes[match]; // 1535
} // 1536
// 1537
/*--------------------------------------------------------------------------*/ // 1538
// 1539
/** // 1540
* Checks if `value` is an `arguments` object. // 1541
* // 1542
* @static // 1543
* @memberOf _ // 1544
* @category Objects // 1545
* @param {*} value The value to check. // 1546
* @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. // 1547
* @example // 1548
* // 1549
* (function() { return _.isArguments(arguments); })(1, 2, 3); // 1550
* // => true // 1551
* // 1552
* _.isArguments([1, 2, 3]); // 1553
* // => false // 1554
*/ // 1555
function isArguments(value) { // 1556
return value && typeof value == 'object' && typeof value.length == 'number' && // 1557
toString.call(value) == argsClass || false; // 1558
} // 1559
// 1560
/** // 1561
* Checks if `value` is an array. // 1562
* // 1563
* @static // 1564
* @memberOf _ // 1565
* @type Function // 1566
* @category Objects // 1567
* @param {*} value The value to check. // 1568
* @returns {boolean} Returns `true` if the `value` is an array, else `false`. // 1569
* @example // 1570
* // 1571
* (function() { return _.isArray(arguments); })(); // 1572
* // => false // 1573
* // 1574
* _.isArray([1, 2, 3]); // 1575
* // => true // 1576
*/ // 1577
var isArray = nativeIsArray || function(value) { // 1578
return value && typeof value == 'object' && typeof value.length == 'number' && // 1579
toString.call(value) == arrayClass || false; // 1580
}; // 1581
// 1582
/** // 1583
* A fallback implementation of `Object.keys` which produces an array of the // 1584
* given object's own enumerable property names. // 1585
* // 1586
* @private // 1587
* @type Function // 1588
* @param {Object} object The object to inspect. // 1589
* @returns {Array} Returns an array of property names. // 1590
*/ // 1591
var shimKeys = function(object) { // 1592
var index, iterable = object, result = []; // 1593
if (!iterable) return result; // 1594
if (!(objectTypes[typeof object])) return result; // 1595
for (index in iterable) { // 1596
if (hasOwnProperty.call(iterable, index)) { // 1597
result.push(index); // 1598
} // 1599
} // 1600
return result // 1601
}; // 1602
// 1603
/** // 1604
* Creates an array composed of the own enumerable property names of an object. // 1605
* // 1606
* @static // 1607
* @memberOf _ // 1608
* @category Objects // 1609
* @param {Object} object The object to inspect. // 1610
* @returns {Array} Returns an array of property names. // 1611
* @example // 1612
* // 1613
* _.keys({ 'one': 1, 'two': 2, 'three': 3 }); // 1614
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments) // 1615
*/ // 1616
var keys = !nativeKeys ? shimKeys : function(object) { // 1617
if (!isObject(object)) { // 1618
return []; // 1619
} // 1620
return nativeKeys(object); // 1621
}; // 1622
// 1623
/** // 1624
* Used to convert characters to HTML entities: // 1625
* // 1626
* Though the `>` character is escaped for symmetry, characters like `>` and `/` // 1627
* don't require escaping in HTML and have no special meaning unless they're part // 1628
* of a tag or an unquoted attribute value. // 1629
* http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") // 1630
*/ // 1631
var htmlEscapes = { // 1632
'&': '&amp;', // 1633
'<': '&lt;', // 1634
'>': '&gt;', // 1635
'"': '&quot;', // 1636
"'": '&#39;' // 1637
}; // 1638
// 1639
/** Used to convert HTML entities to characters */ // 1640
var htmlUnescapes = invert(htmlEscapes); // 1641
// 1642
/** Used to match HTML entities and HTML characters */ // 1643
var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), // 1644
reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); // 1645
// 1646
/*--------------------------------------------------------------------------*/ // 1647
// 1648
/** // 1649
* Assigns own enumerable properties of source object(s) to the destination // 1650
* object. Subsequent sources will overwrite property assignments of previous // 1651
* sources. If a callback is provided it will be executed to produce the // 1652
* assigned values. The callback is bound to `thisArg` and invoked with two // 1653
* arguments; (objectValue, sourceValue). // 1654
* // 1655
* @static // 1656
* @memberOf _ // 1657
* @type Function // 1658
* @alias extend // 1659
* @category Objects // 1660
* @param {Object} object The destination object. // 1661
* @param {...Object} [source] The source objects. // 1662
* @param {Function} [callback] The function to customize assigning values. // 1663
* @param {*} [thisArg] The `this` binding of `callback`. // 1664
* @returns {Object} Returns the destination object. // 1665
* @example // 1666
* // 1667
* _.assign({ 'name': 'fred' }, { 'employer': 'slate' }); // 1668
* // => { 'name': 'fred', 'employer': 'slate' } // 1669
* // 1670
* var defaults = _.partialRight(_.assign, function(a, b) { // 1671
* return typeof a == 'undefined' ? b : a; // 1672
* }); // 1673
* // 1674
* var object = { 'name': 'barney' }; // 1675
* defaults(object, { 'name': 'fred', 'employer': 'slate' }); // 1676
* // => { 'name': 'barney', 'employer': 'slate' } // 1677
*/ // 1678
var assign = function(object, source, guard) { // 1679
var index, iterable = object, result = iterable; // 1680
if (!iterable) return result; // 1681
var args = arguments, // 1682
argsIndex = 0, // 1683
argsLength = typeof guard == 'number' ? 2 : args.length; // 1684
if (argsLength > 3 && typeof args[argsLength - 2] == 'function') { // 1685
var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2); // 1686
} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') { // 1687
callback = args[--argsLength]; // 1688
} // 1689
while (++argsIndex < argsLength) { // 1690
iterable = args[argsIndex]; // 1691
if (iterable && objectTypes[typeof iterable]) { // 1692
var ownIndex = -1, // 1693
ownProps = objectTypes[typeof iterable] && keys(iterable), // 1694
length = ownProps ? ownProps.length : 0; // 1695
// 1696
while (++ownIndex < length) { // 1697
index = ownProps[ownIndex]; // 1698
result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]; // 1699
} // 1700
} // 1701
} // 1702
return result // 1703
}; // 1704
// 1705
/** // 1706
* Creates a clone of `value`. If `isDeep` is `true` nested objects will also // 1707
* be cloned, otherwise they will be assigned by reference. If a callback // 1708
* is provided it will be executed to produce the cloned values. If the // 1709
* callback returns `undefined` cloning will be handled by the method instead. // 1710
* The callback is bound to `thisArg` and invoked with one argument; (value). // 1711
* // 1712
* @static // 1713
* @memberOf _ // 1714
* @category Objects // 1715
* @param {*} value The value to clone. // 1716
* @param {boolean} [isDeep=false] Specify a deep clone. // 1717
* @param {Function} [callback] The function to customize cloning values. // 1718
* @param {*} [thisArg] The `this` binding of `callback`. // 1719
* @returns {*} Returns the cloned value. // 1720
* @example // 1721
* // 1722
* var characters = [ // 1723
* { 'name': 'barney', 'age': 36 }, // 1724
* { 'name': 'fred', 'age': 40 } // 1725
* ]; // 1726
* // 1727
* var shallow = _.clone(characters); // 1728
* shallow[0] === characters[0]; // 1729
* // => true // 1730
* // 1731
* var deep = _.clone(characters, true); // 1732
* deep[0] === characters[0]; // 1733
* // => false // 1734
* // 1735
* _.mixin({ // 1736
* 'clone': _.partialRight(_.clone, function(value) { // 1737
* return _.isElement(value) ? value.cloneNode(false) : undefined; // 1738
* }) // 1739
* }); // 1740
* // 1741
* var clone = _.clone(document.body); // 1742
* clone.childNodes.length; // 1743
* // => 0 // 1744
*/ // 1745
function clone(value, isDeep, callback, thisArg) { // 1746
// allows working with "Collections" methods without using their `index` // 1747
// and `collection` arguments for `isDeep` and `callback` // 1748
if (typeof isDeep != 'boolean' && isDeep != null) { // 1749
thisArg = callback; // 1750
callback = isDeep; // 1751
isDeep = false; // 1752
} // 1753
return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); // 1754
} // 1755
// 1756
/** // 1757
* Creates a deep clone of `value`. If a callback is provided it will be // 1758
* executed to produce the cloned values. If the callback returns `undefined` // 1759
* cloning will be handled by the method instead. The callback is bound to // 1760
* `thisArg` and invoked with one argument; (value). // 1761
* // 1762
* Note: This method is loosely based on the structured clone algorithm. Functions // 1763
* and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and // 1764
* objects created by constructors other than `Object` are cloned to plain `Object` objects. // 1765
* See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. // 1766
* // 1767
* @static // 1768
* @memberOf _ // 1769
* @category Objects // 1770
* @param {*} value The value to deep clone. // 1771
* @param {Function} [callback] The function to customize cloning values. // 1772
* @param {*} [thisArg] The `this` binding of `callback`. // 1773
* @returns {*} Returns the deep cloned value. // 1774
* @example // 1775
* // 1776
* var characters = [ // 1777
* { 'name': 'barney', 'age': 36 }, // 1778
* { 'name': 'fred', 'age': 40 } // 1779
* ]; // 1780
* // 1781
* var deep = _.cloneDeep(characters); // 1782
* deep[0] === characters[0]; // 1783
* // => false // 1784
* // 1785
* var view = { // 1786
* 'label': 'docs', // 1787
* 'node': element // 1788
* }; // 1789
* // 1790
* var clone = _.cloneDeep(view, function(value) { // 1791
* return _.isElement(value) ? value.cloneNode(true) : undefined; // 1792
* }); // 1793
* // 1794
* clone.node == view.node; // 1795
* // => false // 1796
*/ // 1797
function cloneDeep(value, callback, thisArg) { // 1798
return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); // 1799
} // 1800
// 1801
/** // 1802
* Creates an object that inherits from the given `prototype` object. If a // 1803
* `properties` object is provided its own enumerable properties are assigned // 1804
* to the created object. // 1805
* // 1806
* @static // 1807
* @memberOf _ // 1808
* @category Objects // 1809
* @param {Object} prototype The object to inherit from. // 1810
* @param {Object} [properties] The properties to assign to the object. // 1811
* @returns {Object} Returns the new object. // 1812
* @example // 1813
* // 1814
* function Shape() { // 1815
* this.x = 0; // 1816
* this.y = 0; // 1817
* } // 1818
* // 1819
* function Circle() { // 1820
* Shape.call(this); // 1821
* } // 1822
* // 1823
* Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); // 1824
* // 1825
* var circle = new Circle; // 1826
* circle instanceof Circle; // 1827
* // => true // 1828
* // 1829
* circle instanceof Shape; // 1830
* // => true // 1831
*/ // 1832
function create(prototype, properties) { // 1833
var result = baseCreate(prototype); // 1834
return properties ? assign(result, properties) : result; // 1835
} // 1836
// 1837
/** // 1838
* Assigns own enumerable properties of source object(s) to the destination // 1839
* object for all destination properties that resolve to `undefined`. Once a // 1840
* property is set, additional defaults of the same property will be ignored. // 1841
* // 1842
* @static // 1843
* @memberOf _ // 1844
* @type Function // 1845
* @category Objects // 1846
* @param {Object} object The destination object. // 1847
* @param {...Object} [source] The source objects. // 1848
* @param- {Object} [guard] Allows working with `_.reduce` without using its // 1849
* `key` and `object` arguments as sources. // 1850
* @returns {Object} Returns the destination object. // 1851
* @example // 1852
* // 1853
* var object = { 'name': 'barney' }; // 1854
* _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); // 1855
* // => { 'name': 'barney', 'employer': 'slate' } // 1856
*/ // 1857
var defaults = function(object, source, guard) { // 1858
var index, iterable = object, result = iterable; // 1859
if (!iterable) return result; // 1860
var args = arguments, // 1861
argsIndex = 0, // 1862
argsLength = typeof guard == 'number' ? 2 : args.length; // 1863
while (++argsIndex < argsLength) { // 1864
iterable = args[argsIndex]; // 1865
if (iterable && objectTypes[typeof iterable]) { // 1866
var ownIndex = -1, // 1867
ownProps = objectTypes[typeof iterable] && keys(iterable), // 1868
length = ownProps ? ownProps.length : 0; // 1869
// 1870
while (++ownIndex < length) { // 1871
index = ownProps[ownIndex]; // 1872
if (typeof result[index] == 'undefined') result[index] = iterable[index]; // 1873
} // 1874
} // 1875
} // 1876
return result // 1877
}; // 1878
// 1879
/** // 1880
* This method is like `_.findIndex` except that it returns the key of the // 1881
* first element that passes the callback check, instead of the element itself. // 1882
* // 1883
* If a property name is provided for `callback` the created "_.pluck" style // 1884
* callback will return the property value of the given element. // 1885
* // 1886
* If an object is provided for `callback` the created "_.where" style callback // 1887
* will return `true` for elements that have the properties of the given object, // 1888
* else `false`. // 1889
* // 1890
* @static // 1891
* @memberOf _ // 1892
* @category Objects // 1893
* @param {Object} object The object to search. // 1894
* @param {Function|Object|string} [callback=identity] The function called per // 1895
* iteration. If a property name or object is provided it will be used to // 1896
* create a "_.pluck" or "_.where" style callback, respectively. // 1897
* @param {*} [thisArg] The `this` binding of `callback`. // 1898
* @returns {string|undefined} Returns the key of the found element, else `undefined`. // 1899
* @example // 1900
* // 1901
* var characters = { // 1902
* 'barney': { 'age': 36, 'blocked': false }, // 1903
* 'fred': { 'age': 40, 'blocked': true }, // 1904
* 'pebbles': { 'age': 1, 'blocked': false } // 1905
* }; // 1906
* // 1907
* _.findKey(characters, function(chr) { // 1908
* return chr.age < 40; // 1909
* }); // 1910
* // => 'barney' (property order is not guaranteed across environments) // 1911
* // 1912
* // using "_.where" callback shorthand // 1913
* _.findKey(characters, { 'age': 1 }); // 1914
* // => 'pebbles' // 1915
* // 1916
* // using "_.pluck" callback shorthand // 1917
* _.findKey(characters, 'blocked'); // 1918
* // => 'fred' // 1919
*/ // 1920
function findKey(object, callback, thisArg) { // 1921
var result; // 1922
callback = lodash.createCallback(callback, thisArg, 3); // 1923
forOwn(object, function(value, key, object) { // 1924
if (callback(value, key, object)) { // 1925
result = key; // 1926
return false; // 1927
} // 1928
}); // 1929
return result; // 1930
} // 1931
// 1932
/** // 1933
* This method is like `_.findKey` except that it iterates over elements // 1934
* of a `collection` in the opposite order. // 1935
* // 1936
* If a property name is provided for `callback` the created "_.pluck" style // 1937
* callback will return the property value of the given element. // 1938
* // 1939
* If an object is provided for `callback` the created "_.where" style callback // 1940
* will return `true` for elements that have the properties of the given object, // 1941
* else `false`. // 1942
* // 1943
* @static // 1944
* @memberOf _ // 1945
* @category Objects // 1946
* @param {Object} object The object to search. // 1947
* @param {Function|Object|string} [callback=identity] The function called per // 1948
* iteration. If a property name or object is provided it will be used to // 1949
* create a "_.pluck" or "_.where" style callback, respectively. // 1950
* @param {*} [thisArg] The `this` binding of `callback`. // 1951
* @returns {string|undefined} Returns the key of the found element, else `undefined`. // 1952
* @example // 1953
* // 1954
* var characters = { // 1955
* 'barney': { 'age': 36, 'blocked': true }, // 1956
* 'fred': { 'age': 40, 'blocked': false }, // 1957
* 'pebbles': { 'age': 1, 'blocked': true } // 1958
* }; // 1959
* // 1960
* _.findLastKey(characters, function(chr) { // 1961
* return chr.age < 40; // 1962
* }); // 1963
* // => returns `pebbles`, assuming `_.findKey` returns `barney` // 1964
* // 1965
* // using "_.where" callback shorthand // 1966
* _.findLastKey(characters, { 'age': 40 }); // 1967
* // => 'fred' // 1968
* // 1969
* // using "_.pluck" callback shorthand // 1970
* _.findLastKey(characters, 'blocked'); // 1971
* // => 'pebbles' // 1972
*/ // 1973
function findLastKey(object, callback, thisArg) { // 1974
var result; // 1975
callback = lodash.createCallback(callback, thisArg, 3); // 1976
forOwnRight(object, function(value, key, object) { // 1977
if (callback(value, key, object)) { // 1978
result = key; // 1979
return false; // 1980
} // 1981
}); // 1982
return result; // 1983
} // 1984
// 1985
/** // 1986
* Iterates over own and inherited enumerable properties of an object, // 1987
* executing the callback for each property. The callback is bound to `thisArg` // 1988
* and invoked with three arguments; (value, key, object). Callbacks may exit // 1989
* iteration early by explicitly returning `false`. // 1990
* // 1991
* @static // 1992
* @memberOf _ // 1993
* @type Function // 1994
* @category Objects // 1995
* @param {Object} object The object to iterate over. // 1996
* @param {Function} [callback=identity] The function called per iteration. // 1997
* @param {*} [thisArg] The `this` binding of `callback`. // 1998
* @returns {Object} Returns `object`. // 1999
* @example // 2000
* // 2001
* function Shape() { // 2002
* this.x = 0; // 2003
* this.y = 0; // 2004
* } // 2005
* // 2006
* Shape.prototype.move = function(x, y) { // 2007
* this.x += x; // 2008
* this.y += y; // 2009
* }; // 2010
* // 2011
* _.forIn(new Shape, function(value, key) { // 2012
* console.log(key); // 2013
* }); // 2014
* // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) // 2015
*/ // 2016
var forIn = function(collection, callback, thisArg) { // 2017
var index, iterable = collection, result = iterable; // 2018
if (!iterable) return result; // 2019
if (!objectTypes[typeof iterable]) return result; // 2020
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); // 2021
for (index in iterable) { // 2022
if (callback(iterable[index], index, collection) === false) return result; // 2023
} // 2024
return result // 2025
}; // 2026
// 2027
/** // 2028
* This method is like `_.forIn` except that it iterates over elements // 2029
* of a `collection` in the opposite order. // 2030
* // 2031
* @static // 2032
* @memberOf _ // 2033
* @category Objects // 2034
* @param {Object} object The object to iterate over. // 2035
* @param {Function} [callback=identity] The function called per iteration. // 2036
* @param {*} [thisArg] The `this` binding of `callback`. // 2037
* @returns {Object} Returns `object`. // 2038
* @example // 2039
* // 2040
* function Shape() { // 2041
* this.x = 0; // 2042
* this.y = 0; // 2043
* } // 2044
* // 2045
* Shape.prototype.move = function(x, y) { // 2046
* this.x += x; // 2047
* this.y += y; // 2048
* }; // 2049
* // 2050
* _.forInRight(new Shape, function(value, key) { // 2051
* console.log(key); // 2052
* }); // 2053
* // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move' // 2054
*/ // 2055
function forInRight(object, callback, thisArg) { // 2056
var pairs = []; // 2057
// 2058