artdaq_node_server  v1_00_07
 All Classes Namespaces Files Variables Pages
core.js
1 
10 ;(function() {
11 
13  var undefined;
14 
16  var VERSION = '4.17.4';
17 
19  var FUNC_ERROR_TEXT = 'Expected a function';
20 
22  var COMPARE_PARTIAL_FLAG = 1,
23  COMPARE_UNORDERED_FLAG = 2;
24 
26  var WRAP_BIND_FLAG = 1,
27  WRAP_PARTIAL_FLAG = 32;
28 
30  var INFINITY = 1 / 0,
31  MAX_SAFE_INTEGER = 9007199254740991;
32 
34  var argsTag = '[object Arguments]',
35  arrayTag = '[object Array]',
36  asyncTag = '[object AsyncFunction]',
37  boolTag = '[object Boolean]',
38  dateTag = '[object Date]',
39  errorTag = '[object Error]',
40  funcTag = '[object Function]',
41  genTag = '[object GeneratorFunction]',
42  numberTag = '[object Number]',
43  objectTag = '[object Object]',
44  proxyTag = '[object Proxy]',
45  regexpTag = '[object RegExp]',
46  stringTag = '[object String]';
47 
49  var reUnescapedHtml = /[&<>"']/g,
50  reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
51 
53  var htmlEscapes = {
54  '&': '&amp;',
55  '<': '&lt;',
56  '>': '&gt;',
57  '"': '&quot;',
58  "'": '&#39;'
59  };
60 
62  var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
63 
65  var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
66 
68  var root = freeGlobal || freeSelf || Function('return this')();
69 
71  var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
72 
74  var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
75 
76  /*--------------------------------------------------------------------------*/
77 
86  function arrayPush(array, values) {
87  array.push.apply(array, values);
88  return array;
89  }
90 
102  function baseFindIndex(array, predicate, fromIndex, fromRight) {
103  var length = array.length,
104  index = fromIndex + (fromRight ? 1 : -1);
105 
106  while ((fromRight ? index-- : ++index < length)) {
107  if (predicate(array[index], index, array)) {
108  return index;
109  }
110  }
111  return -1;
112  }
113 
121  function baseProperty(key) {
122  return function(object) {
123  return object == null ? undefined : object[key];
124  };
125  }
126 
134  function basePropertyOf(object) {
135  return function(key) {
136  return object == null ? undefined : object[key];
137  };
138  }
139 
153  function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
154  eachFunc(collection, function(value, index, collection) {
155  accumulator = initAccum
156  ? (initAccum = false, value)
157  : iteratee(accumulator, value, index, collection);
158  });
159  return accumulator;
160  }
161 
172  function baseValues(object, props) {
173  return baseMap(props, function(key) {
174  return object[key];
175  });
176  }
177 
185  var escapeHtmlChar = basePropertyOf(htmlEscapes);
186 
195  function overArg(func, transform) {
196  return function(arg) {
197  return func(transform(arg));
198  };
199  }
200 
201  /*--------------------------------------------------------------------------*/
202 
204  var arrayProto = Array.prototype,
205  objectProto = Object.prototype;
206 
208  var hasOwnProperty = objectProto.hasOwnProperty;
209 
211  var idCounter = 0;
212 
218  var nativeObjectToString = objectProto.toString;
219 
221  var oldDash = root._;
222 
224  var objectCreate = Object.create,
225  propertyIsEnumerable = objectProto.propertyIsEnumerable;
226 
227  /* Built-in method references for those with the same name as other `lodash` methods. */
228  var nativeIsFinite = root.isFinite,
229  nativeKeys = overArg(Object.keys, Object),
230  nativeMax = Math.max;
231 
232  /*------------------------------------------------------------------------*/
233 
351  function lodash(value) {
352  return value instanceof LodashWrapper
353  ? value
354  : new LodashWrapper(value);
355  }
356 
365  var baseCreate = (function() {
366  function object() {}
367  return function(proto) {
368  if (!isObject(proto)) {
369  return {};
370  }
371  if (objectCreate) {
372  return objectCreate(proto);
373  }
374  object.prototype = proto;
375  var result = new object;
376  object.prototype = undefined;
377  return result;
378  };
379  }());
380 
388  function LodashWrapper(value, chainAll) {
389  this.__wrapped__ = value;
390  this.__actions__ = [];
391  this.__chain__ = !!chainAll;
392  }
393 
394  LodashWrapper.prototype = baseCreate(lodash.prototype);
395  LodashWrapper.prototype.constructor = LodashWrapper;
396 
397  /*------------------------------------------------------------------------*/
398 
409  function assignValue(object, key, value) {
410  var objValue = object[key];
411  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
412  (value === undefined && !(key in object))) {
413  baseAssignValue(object, key, value);
414  }
415  }
416 
426  function baseAssignValue(object, key, value) {
427  object[key] = value;
428  }
429 
440  function baseDelay(func, wait, args) {
441  if (typeof func != 'function') {
442  throw new TypeError(FUNC_ERROR_TEXT);
443  }
444  return setTimeout(function() { func.apply(undefined, args); }, wait);
445  }
446 
455  var baseEach = createBaseEach(baseForOwn);
456 
466  function baseEvery(collection, predicate) {
467  var result = true;
468  baseEach(collection, function(value, index, collection) {
469  result = !!predicate(value, index, collection);
470  return result;
471  });
472  return result;
473  }
474 
485  function baseExtremum(array, iteratee, comparator) {
486  var index = -1,
487  length = array.length;
488 
489  while (++index < length) {
490  var value = array[index],
491  current = iteratee(value);
492 
493  if (current != null && (computed === undefined
494  ? (current === current && !false)
495  : comparator(current, computed)
496  )) {
497  var computed = current,
498  result = value;
499  }
500  }
501  return result;
502  }
503 
512  function baseFilter(collection, predicate) {
513  var result = [];
514  baseEach(collection, function(value, index, collection) {
515  if (predicate(value, index, collection)) {
516  result.push(value);
517  }
518  });
519  return result;
520  }
521 
533  function baseFlatten(array, depth, predicate, isStrict, result) {
534  var index = -1,
535  length = array.length;
536 
537  predicate || (predicate = isFlattenable);
538  result || (result = []);
539 
540  while (++index < length) {
541  var value = array[index];
542  if (depth > 0 && predicate(value)) {
543  if (depth > 1) {
544  // Recursively flatten arrays (susceptible to call stack limits).
545  baseFlatten(value, depth - 1, predicate, isStrict, result);
546  } else {
547  arrayPush(result, value);
548  }
549  } else if (!isStrict) {
550  result[result.length] = value;
551  }
552  }
553  return result;
554  }
555 
567  var baseFor = createBaseFor();
568 
577  function baseForOwn(object, iteratee) {
578  return object && baseFor(object, iteratee, keys);
579  }
580 
590  function baseFunctions(object, props) {
591  return baseFilter(props, function(key) {
592  return isFunction(object[key]);
593  });
594  }
595 
603  function baseGetTag(value) {
604  return objectToString(value);
605  }
606 
616  function baseGt(value, other) {
617  return value > other;
618  }
619 
627  var baseIsArguments = noop;
628 
636  function baseIsDate(value) {
637  return isObjectLike(value) && baseGetTag(value) == dateTag;
638  }
639 
654  function baseIsEqual(value, other, bitmask, customizer, stack) {
655  if (value === other) {
656  return true;
657  }
658  if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
659  return value !== value && other !== other;
660  }
661  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
662  }
663 
678  function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
679  var objIsArr = isArray(object),
680  othIsArr = isArray(other),
681  objTag = objIsArr ? arrayTag : baseGetTag(object),
682  othTag = othIsArr ? arrayTag : baseGetTag(other);
683 
684  objTag = objTag == argsTag ? objectTag : objTag;
685  othTag = othTag == argsTag ? objectTag : othTag;
686 
687  var objIsObj = objTag == objectTag,
688  othIsObj = othTag == objectTag,
689  isSameTag = objTag == othTag;
690 
691  stack || (stack = []);
692  var objStack = find(stack, function(entry) {
693  return entry[0] == object;
694  });
695  var othStack = find(stack, function(entry) {
696  return entry[0] == other;
697  });
698  if (objStack && othStack) {
699  return objStack[1] == other;
700  }
701  stack.push([object, other]);
702  stack.push([other, object]);
703  if (isSameTag && !objIsObj) {
704  var result = (objIsArr)
705  ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
706  : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
707  stack.pop();
708  return result;
709  }
710  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
711  var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
712  othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
713 
714  if (objIsWrapped || othIsWrapped) {
715  var objUnwrapped = objIsWrapped ? object.value() : object,
716  othUnwrapped = othIsWrapped ? other.value() : other;
717 
718  var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
719  stack.pop();
720  return result;
721  }
722  }
723  if (!isSameTag) {
724  return false;
725  }
726  var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack);
727  stack.pop();
728  return result;
729  }
730 
738  function baseIsRegExp(value) {
739  return isObjectLike(value) && baseGetTag(value) == regexpTag;
740  }
741 
749  function baseIteratee(func) {
750  if (typeof func == 'function') {
751  return func;
752  }
753  if (func == null) {
754  return identity;
755  }
756  return (typeof func == 'object' ? baseMatches : baseProperty)(func);
757  }
758 
768  function baseLt(value, other) {
769  return value < other;
770  }
771 
780  function baseMap(collection, iteratee) {
781  var index = -1,
782  result = isArrayLike(collection) ? Array(collection.length) : [];
783 
784  baseEach(collection, function(value, key, collection) {
785  result[++index] = iteratee(value, key, collection);
786  });
787  return result;
788  }
789 
797  function baseMatches(source) {
798  var props = nativeKeys(source);
799  return function(object) {
800  var length = props.length;
801  if (object == null) {
802  return !length;
803  }
804  object = Object(object);
805  while (length--) {
806  var key = props[length];
807  if (!(key in object &&
808  baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG)
809  )) {
810  return false;
811  }
812  }
813  return true;
814  };
815  }
816 
826  function basePick(object, props) {
827  object = Object(object);
828  return reduce(props, function(result, key) {
829  if (key in object) {
830  result[key] = object[key];
831  }
832  return result;
833  }, {});
834  }
835 
844  function baseRest(func, start) {
845  return setToString(overRest(func, start, identity), func + '');
846  }
847 
857  function baseSlice(array, start, end) {
858  var index = -1,
859  length = array.length;
860 
861  if (start < 0) {
862  start = -start > length ? 0 : (length + start);
863  }
864  end = end > length ? length : end;
865  if (end < 0) {
866  end += length;
867  }
868  length = start > end ? 0 : ((end - start) >>> 0);
869  start >>>= 0;
870 
871  var result = Array(length);
872  while (++index < length) {
873  result[index] = array[index + start];
874  }
875  return result;
876  }
877 
886  function copyArray(source) {
887  return baseSlice(source, 0, source.length);
888  }
889 
899  function baseSome(collection, predicate) {
900  var result;
901 
902  baseEach(collection, function(value, index, collection) {
903  result = predicate(value, index, collection);
904  return !result;
905  });
906  return !!result;
907  }
908 
919  function baseWrapperValue(value, actions) {
920  var result = value;
921  return reduce(actions, function(result, action) {
922  return action.func.apply(action.thisArg, arrayPush([result], action.args));
923  }, result);
924  }
925 
934  function compareAscending(value, other) {
935  if (value !== other) {
936  var valIsDefined = value !== undefined,
937  valIsNull = value === null,
938  valIsReflexive = value === value,
939  valIsSymbol = false;
940 
941  var othIsDefined = other !== undefined,
942  othIsNull = other === null,
943  othIsReflexive = other === other,
944  othIsSymbol = false;
945 
946  if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
947  (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
948  (valIsNull && othIsDefined && othIsReflexive) ||
949  (!valIsDefined && othIsReflexive) ||
950  !valIsReflexive) {
951  return 1;
952  }
953  if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
954  (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
955  (othIsNull && valIsDefined && valIsReflexive) ||
956  (!othIsDefined && valIsReflexive) ||
957  !othIsReflexive) {
958  return -1;
959  }
960  }
961  return 0;
962  }
963 
974  function copyObject(source, props, object, customizer) {
975  var isNew = !object;
976  object || (object = {});
977 
978  var index = -1,
979  length = props.length;
980 
981  while (++index < length) {
982  var key = props[index];
983 
984  var newValue = customizer
985  ? customizer(object[key], source[key], key, object, source)
986  : undefined;
987 
988  if (newValue === undefined) {
989  newValue = source[key];
990  }
991  if (isNew) {
992  baseAssignValue(object, key, newValue);
993  } else {
994  assignValue(object, key, newValue);
995  }
996  }
997  return object;
998  }
999 
1007  function createAssigner(assigner) {
1008  return baseRest(function(object, sources) {
1009  var index = -1,
1010  length = sources.length,
1011  customizer = length > 1 ? sources[length - 1] : undefined;
1012 
1013  customizer = (assigner.length > 3 && typeof customizer == 'function')
1014  ? (length--, customizer)
1015  : undefined;
1016 
1017  object = Object(object);
1018  while (++index < length) {
1019  var source = sources[index];
1020  if (source) {
1021  assigner(object, source, index, customizer);
1022  }
1023  }
1024  return object;
1025  });
1026  }
1027 
1036  function createBaseEach(eachFunc, fromRight) {
1037  return function(collection, iteratee) {
1038  if (collection == null) {
1039  return collection;
1040  }
1041  if (!isArrayLike(collection)) {
1042  return eachFunc(collection, iteratee);
1043  }
1044  var length = collection.length,
1045  index = fromRight ? length : -1,
1046  iterable = Object(collection);
1047 
1048  while ((fromRight ? index-- : ++index < length)) {
1049  if (iteratee(iterable[index], index, iterable) === false) {
1050  break;
1051  }
1052  }
1053  return collection;
1054  };
1055  }
1056 
1064  function createBaseFor(fromRight) {
1065  return function(object, iteratee, keysFunc) {
1066  var index = -1,
1067  iterable = Object(object),
1068  props = keysFunc(object),
1069  length = props.length;
1070 
1071  while (length--) {
1072  var key = props[fromRight ? length : ++index];
1073  if (iteratee(iterable[key], key, iterable) === false) {
1074  break;
1075  }
1076  }
1077  return object;
1078  };
1079  }
1080 
1089  function createCtor(Ctor) {
1090  return function() {
1091  // Use a `switch` statement to work with class constructors. See
1092  // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
1093  // for more details.
1094  var args = arguments;
1095  var thisBinding = baseCreate(Ctor.prototype),
1096  result = Ctor.apply(thisBinding, args);
1097 
1098  // Mimic the constructor's `return` behavior.
1099  // See https://es5.github.io/#x13.2.2 for more details.
1100  return isObject(result) ? result : thisBinding;
1101  };
1102  }
1103 
1111  function createFind(findIndexFunc) {
1112  return function(collection, predicate, fromIndex) {
1113  var iterable = Object(collection);
1114  if (!isArrayLike(collection)) {
1115  var iteratee = baseIteratee(predicate, 3);
1116  collection = keys(collection);
1117  predicate = function(key) { return iteratee(iterable[key], key, iterable); };
1118  }
1119  var index = findIndexFunc(collection, predicate, fromIndex);
1120  return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
1121  };
1122  }
1123 
1136  function createPartial(func, bitmask, thisArg, partials) {
1137  if (typeof func != 'function') {
1138  throw new TypeError(FUNC_ERROR_TEXT);
1139  }
1140  var isBind = bitmask & WRAP_BIND_FLAG,
1141  Ctor = createCtor(func);
1142 
1143  function wrapper() {
1144  var argsIndex = -1,
1145  argsLength = arguments.length,
1146  leftIndex = -1,
1147  leftLength = partials.length,
1148  args = Array(leftLength + argsLength),
1149  fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
1150 
1151  while (++leftIndex < leftLength) {
1152  args[leftIndex] = partials[leftIndex];
1153  }
1154  while (argsLength--) {
1155  args[leftIndex++] = arguments[++argsIndex];
1156  }
1157  return fn.apply(isBind ? thisArg : this, args);
1158  }
1159  return wrapper;
1160  }
1161 
1174  function customDefaultsAssignIn(objValue, srcValue, key, object) {
1175  if (objValue === undefined ||
1176  (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
1177  return srcValue;
1178  }
1179  return objValue;
1180  }
1181 
1195  function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1196  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1197  arrLength = array.length,
1198  othLength = other.length;
1199 
1200  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1201  return false;
1202  }
1203  var index = -1,
1204  result = true,
1205  seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined;
1206 
1207  // Ignore non-index properties.
1208  while (++index < arrLength) {
1209  var arrValue = array[index],
1210  othValue = other[index];
1211 
1212  var compared;
1213  if (compared !== undefined) {
1214  if (compared) {
1215  continue;
1216  }
1217  result = false;
1218  break;
1219  }
1220  // Recursively compare arrays (susceptible to call stack limits).
1221  if (seen) {
1222  if (!baseSome(other, function(othValue, othIndex) {
1223  if (!indexOf(seen, othIndex) &&
1224  (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1225  return seen.push(othIndex);
1226  }
1227  })) {
1228  result = false;
1229  break;
1230  }
1231  } else if (!(
1232  arrValue === othValue ||
1233  equalFunc(arrValue, othValue, bitmask, customizer, stack)
1234  )) {
1235  result = false;
1236  break;
1237  }
1238  }
1239  return result;
1240  }
1241 
1259  function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1260  switch (tag) {
1261 
1262  case boolTag:
1263  case dateTag:
1264  case numberTag:
1265  // Coerce booleans to `1` or `0` and dates to milliseconds.
1266  // Invalid dates are coerced to `NaN`.
1267  return eq(+object, +other);
1268 
1269  case errorTag:
1270  return object.name == other.name && object.message == other.message;
1271 
1272  case regexpTag:
1273  case stringTag:
1274  // Coerce regexes to strings and treat strings, primitives and objects,
1275  // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1276  // for more details.
1277  return object == (other + '');
1278 
1279  }
1280  return false;
1281  }
1282 
1296  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1297  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1298  objProps = keys(object),
1299  objLength = objProps.length,
1300  othProps = keys(other),
1301  othLength = othProps.length;
1302 
1303  if (objLength != othLength && !isPartial) {
1304  return false;
1305  }
1306  var index = objLength;
1307  while (index--) {
1308  var key = objProps[index];
1309  if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
1310  return false;
1311  }
1312  }
1313  var result = true;
1314 
1315  var skipCtor = isPartial;
1316  while (++index < objLength) {
1317  key = objProps[index];
1318  var objValue = object[key],
1319  othValue = other[key];
1320 
1321  var compared;
1322  // Recursively compare objects (susceptible to call stack limits).
1323  if (!(compared === undefined
1324  ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
1325  : compared
1326  )) {
1327  result = false;
1328  break;
1329  }
1330  skipCtor || (skipCtor = key == 'constructor');
1331  }
1332  if (result && !skipCtor) {
1333  var objCtor = object.constructor,
1334  othCtor = other.constructor;
1335 
1336  // Non `Object` object instances with different constructors are not equal.
1337  if (objCtor != othCtor &&
1338  ('constructor' in object && 'constructor' in other) &&
1339  !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
1340  typeof othCtor == 'function' && othCtor instanceof othCtor)) {
1341  result = false;
1342  }
1343  }
1344  return result;
1345  }
1346 
1354  function flatRest(func) {
1355  return setToString(overRest(func, undefined, flatten), func + '');
1356  }
1357 
1365  function isFlattenable(value) {
1366  return isArray(value) || isArguments(value);
1367  }
1368 
1378  function nativeKeysIn(object) {
1379  var result = [];
1380  if (object != null) {
1381  for (var key in Object(object)) {
1382  result.push(key);
1383  }
1384  }
1385  return result;
1386  }
1387 
1395  function objectToString(value) {
1396  return nativeObjectToString.call(value);
1397  }
1398 
1408  function overRest(func, start, transform) {
1409  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
1410  return function() {
1411  var args = arguments,
1412  index = -1,
1413  length = nativeMax(args.length - start, 0),
1414  array = Array(length);
1415 
1416  while (++index < length) {
1417  array[index] = args[start + index];
1418  }
1419  index = -1;
1420  var otherArgs = Array(start + 1);
1421  while (++index < start) {
1422  otherArgs[index] = args[index];
1423  }
1424  otherArgs[start] = transform(array);
1425  return func.apply(this, otherArgs);
1426  };
1427  }
1428 
1437  var setToString = identity;
1438 
1439  /*------------------------------------------------------------------------*/
1440 
1456  function compact(array) {
1457  return baseFilter(array, Boolean);
1458  }
1459 
1482  function concat() {
1483  var length = arguments.length;
1484  if (!length) {
1485  return [];
1486  }
1487  var args = Array(length - 1),
1488  array = arguments[0],
1489  index = length;
1490 
1491  while (index--) {
1492  args[index - 1] = arguments[index];
1493  }
1494  return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
1495  }
1496 
1532  function findIndex(array, predicate, fromIndex) {
1533  var length = array == null ? 0 : array.length;
1534  if (!length) {
1535  return -1;
1536  }
1537  var index = fromIndex == null ? 0 : toInteger(fromIndex);
1538  if (index < 0) {
1539  index = nativeMax(length + index, 0);
1540  }
1541  return baseFindIndex(array, baseIteratee(predicate, 3), index);
1542  }
1543 
1558  function flatten(array) {
1559  var length = array == null ? 0 : array.length;
1560  return length ? baseFlatten(array, 1) : [];
1561  }
1562 
1577  function flattenDeep(array) {
1578  var length = array == null ? 0 : array.length;
1579  return length ? baseFlatten(array, INFINITY) : [];
1580  }
1581 
1600  function head(array) {
1601  return (array && array.length) ? array[0] : undefined;
1602  }
1603 
1627  function indexOf(array, value, fromIndex) {
1628  var length = array == null ? 0 : array.length;
1629  if (typeof fromIndex == 'number') {
1630  fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
1631  } else {
1632  fromIndex = 0;
1633  }
1634  var index = (fromIndex || 0) - 1,
1635  isReflexive = value === value;
1636 
1637  while (++index < length) {
1638  var other = array[index];
1639  if ((isReflexive ? other === value : other !== other)) {
1640  return index;
1641  }
1642  }
1643  return -1;
1644  }
1645 
1660  function last(array) {
1661  var length = array == null ? 0 : array.length;
1662  return length ? array[length - 1] : undefined;
1663  }
1664 
1681  function slice(array, start, end) {
1682  var length = array == null ? 0 : array.length;
1683  start = start == null ? 0 : +start;
1684  end = end === undefined ? length : +end;
1685  return length ? baseSlice(array, start, end) : [];
1686  }
1687 
1688  /*------------------------------------------------------------------------*/
1689 
1719  function chain(value) {
1720  var result = lodash(value);
1721  result.__chain__ = true;
1722  return result;
1723  }
1724 
1748  function tap(value, interceptor) {
1749  interceptor(value);
1750  return value;
1751  }
1752 
1776  function thru(value, interceptor) {
1777  return interceptor(value);
1778  }
1779 
1807  function wrapperChain() {
1808  return chain(this);
1809  }
1810 
1825  function wrapperValue() {
1826  return baseWrapperValue(this.__wrapped__, this.__actions__);
1827  }
1828 
1829  /*------------------------------------------------------------------------*/
1830 
1872  function every(collection, predicate, guard) {
1873  predicate = guard ? undefined : predicate;
1874  return baseEvery(collection, baseIteratee(predicate));
1875  }
1876 
1914  function filter(collection, predicate) {
1915  return baseFilter(collection, baseIteratee(predicate));
1916  }
1917 
1954  var find = createFind(findIndex);
1955 
1986  function forEach(collection, iteratee) {
1987  return baseEach(collection, baseIteratee(iteratee));
1988  }
1989 
2032  function map(collection, iteratee) {
2033  return baseMap(collection, baseIteratee(iteratee));
2034  }
2035 
2073  function reduce(collection, iteratee, accumulator) {
2074  return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach);
2075  }
2076 
2098  function size(collection) {
2099  if (collection == null) {
2100  return 0;
2101  }
2102  collection = isArrayLike(collection) ? collection : nativeKeys(collection);
2103  return collection.length;
2104  }
2105 
2142  function some(collection, predicate, guard) {
2143  predicate = guard ? undefined : predicate;
2144  return baseSome(collection, baseIteratee(predicate));
2145  }
2146 
2176  function sortBy(collection, iteratee) {
2177  var index = 0;
2178  iteratee = baseIteratee(iteratee);
2179 
2180  return baseMap(baseMap(collection, function(value, key, collection) {
2181  return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) };
2182  }).sort(function(object, other) {
2183  return compareAscending(object.criteria, other.criteria) || (object.index - other.index);
2184  }), baseProperty('value'));
2185  }
2186 
2187  /*------------------------------------------------------------------------*/
2188 
2206  function before(n, func) {
2207  var result;
2208  if (typeof func != 'function') {
2209  throw new TypeError(FUNC_ERROR_TEXT);
2210  }
2211  n = toInteger(n);
2212  return function() {
2213  if (--n > 0) {
2214  result = func.apply(this, arguments);
2215  }
2216  if (n <= 1) {
2217  func = undefined;
2218  }
2219  return result;
2220  };
2221  }
2222 
2258  var bind = baseRest(function(func, thisArg, partials) {
2259  return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials);
2260  });
2261 
2280  var defer = baseRest(function(func, args) {
2281  return baseDelay(func, 1, args);
2282  });
2283 
2303  var delay = baseRest(function(func, wait, args) {
2304  return baseDelay(func, toNumber(wait) || 0, args);
2305  });
2306 
2327  function negate(predicate) {
2328  if (typeof predicate != 'function') {
2329  throw new TypeError(FUNC_ERROR_TEXT);
2330  }
2331  return function() {
2332  var args = arguments;
2333  return !predicate.apply(this, args);
2334  };
2335  }
2336 
2355  function once(func) {
2356  return before(2, func);
2357  }
2358 
2359  /*------------------------------------------------------------------------*/
2360 
2387  function clone(value) {
2388  if (!isObject(value)) {
2389  return value;
2390  }
2391  return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value));
2392  }
2393 
2426  function eq(value, other) {
2427  return value === other || (value !== value && other !== other);
2428  }
2429 
2448  var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
2449  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
2450  !propertyIsEnumerable.call(value, 'callee');
2451  };
2452 
2476  var isArray = Array.isArray;
2477 
2503  function isArrayLike(value) {
2504  return value != null && isLength(value.length) && !isFunction(value);
2505  }
2506 
2524  function isBoolean(value) {
2525  return value === true || value === false ||
2526  (isObjectLike(value) && baseGetTag(value) == boolTag);
2527  }
2528 
2546  var isDate = baseIsDate;
2547 
2581  function isEmpty(value) {
2582  if (isArrayLike(value) &&
2583  (isArray(value) || isString(value) ||
2584  isFunction(value.splice) || isArguments(value))) {
2585  return !value.length;
2586  }
2587  return !nativeKeys(value).length;
2588  }
2589 
2618  function isEqual(value, other) {
2619  return baseIsEqual(value, other);
2620  }
2621 
2648  function isFinite(value) {
2649  return typeof value == 'number' && nativeIsFinite(value);
2650  }
2651 
2669  function isFunction(value) {
2670  if (!isObject(value)) {
2671  return false;
2672  }
2673  // The use of `Object#toString` avoids issues with the `typeof` operator
2674  // in Safari 9 which returns 'object' for typed arrays and other constructors.
2675  var tag = baseGetTag(value);
2676  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
2677  }
2678 
2705  function isLength(value) {
2706  return typeof value == 'number' &&
2707  value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2708  }
2709 
2735  function isObject(value) {
2736  var type = typeof value;
2737  return value != null && (type == 'object' || type == 'function');
2738  }
2739 
2764  function isObjectLike(value) {
2765  return value != null && typeof value == 'object';
2766  }
2767 
2796  function isNaN(value) {
2797  // An `NaN` primitive is the only value that is not equal to itself.
2798  // Perform the `toStringTag` check first to avoid errors with some
2799  // ActiveX objects in IE.
2800  return isNumber(value) && value != +value;
2801  }
2802 
2820  function isNull(value) {
2821  return value === null;
2822  }
2823 
2850  function isNumber(value) {
2851  return typeof value == 'number' ||
2852  (isObjectLike(value) && baseGetTag(value) == numberTag);
2853  }
2854 
2872  var isRegExp = baseIsRegExp;
2873 
2891  function isString(value) {
2892  return typeof value == 'string' ||
2893  (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
2894  }
2895 
2913  function isUndefined(value) {
2914  return value === undefined;
2915  }
2916 
2940  function toArray(value) {
2941  if (!isArrayLike(value)) {
2942  return values(value);
2943  }
2944  return value.length ? copyArray(value) : [];
2945  }
2946 
2973  var toInteger = Number;
2974 
2998  var toNumber = Number;
2999 
3021  function toString(value) {
3022  if (typeof value == 'string') {
3023  return value;
3024  }
3025  return value == null ? '' : (value + '');
3026  }
3027 
3028  /*------------------------------------------------------------------------*/
3029 
3062  var assign = createAssigner(function(object, source) {
3063  copyObject(source, nativeKeys(source), object);
3064  });
3065 
3097  var assignIn = createAssigner(function(object, source) {
3098  copyObject(source, nativeKeysIn(source), object);
3099  });
3100 
3130  var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
3131  copyObject(source, keysIn(source), object, customizer);
3132  });
3133 
3168  function create(prototype, properties) {
3169  var result = baseCreate(prototype);
3170  return properties == null ? result : assign(result, properties);
3171  }
3172 
3194  var defaults = baseRest(function(args) {
3195  args.push(undefined, customDefaultsAssignIn);
3196  return assignInWith.apply(undefined, args);
3197  });
3198 
3226  function has(object, path) {
3227  return object != null && hasOwnProperty.call(object, path);
3228  }
3229 
3258  var keys = nativeKeys;
3259 
3283  var keysIn = nativeKeysIn;
3284 
3302  var pick = flatRest(function(object, paths) {
3303  return object == null ? {} : basePick(object, paths);
3304  });
3305 
3335  function result(object, path, defaultValue) {
3336  var value = object == null ? undefined : object[path];
3337  if (value === undefined) {
3338  value = defaultValue;
3339  }
3340  return isFunction(value) ? value.call(object) : value;
3341  }
3342 
3369  function values(object) {
3370  return object == null ? [] : baseValues(object, keys(object));
3371  }
3372 
3373  /*------------------------------------------------------------------------*/
3374 
3403  function escape(string) {
3404  string = toString(string);
3405  return (string && reHasUnescapedHtml.test(string))
3406  ? string.replace(reUnescapedHtml, escapeHtmlChar)
3407  : string;
3408  }
3409 
3410  /*------------------------------------------------------------------------*/
3411 
3428  function identity(value) {
3429  return value;
3430  }
3431 
3474  var iteratee = baseIteratee;
3475 
3504  function matches(source) {
3505  return baseMatches(assign({}, source));
3506  }
3507 
3544  function mixin(object, source, options) {
3545  var props = keys(source),
3546  methodNames = baseFunctions(source, props);
3547 
3548  if (options == null &&
3549  !(isObject(source) && (methodNames.length || !props.length))) {
3550  options = source;
3551  source = object;
3552  object = this;
3553  methodNames = baseFunctions(source, keys(source));
3554  }
3555  var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
3556  isFunc = isFunction(object);
3557 
3558  baseEach(methodNames, function(methodName) {
3559  var func = source[methodName];
3560  object[methodName] = func;
3561  if (isFunc) {
3562  object.prototype[methodName] = function() {
3563  var chainAll = this.__chain__;
3564  if (chain || chainAll) {
3565  var result = object(this.__wrapped__),
3566  actions = result.__actions__ = copyArray(this.__actions__);
3567 
3568  actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
3569  result.__chain__ = chainAll;
3570  return result;
3571  }
3572  return func.apply(object, arrayPush([this.value()], arguments));
3573  };
3574  }
3575  });
3576 
3577  return object;
3578  }
3579 
3593  function noConflict() {
3594  if (root._ === this) {
3595  root._ = oldDash;
3596  }
3597  return this;
3598  }
3599 
3612  function noop() {
3613  // No operation performed.
3614  }
3615 
3633  function uniqueId(prefix) {
3634  var id = ++idCounter;
3635  return toString(prefix) + id;
3636  }
3637 
3638  /*------------------------------------------------------------------------*/
3639 
3658  function max(array) {
3659  return (array && array.length)
3660  ? baseExtremum(array, identity, baseGt)
3661  : undefined;
3662  }
3663 
3682  function min(array) {
3683  return (array && array.length)
3684  ? baseExtremum(array, identity, baseLt)
3685  : undefined;
3686  }
3687 
3688  /*------------------------------------------------------------------------*/
3689 
3690  // Add methods that return wrapped values in chain sequences.
3691  lodash.assignIn = assignIn;
3692  lodash.before = before;
3693  lodash.bind = bind;
3694  lodash.chain = chain;
3695  lodash.compact = compact;
3696  lodash.concat = concat;
3697  lodash.create = create;
3698  lodash.defaults = defaults;
3699  lodash.defer = defer;
3700  lodash.delay = delay;
3701  lodash.filter = filter;
3702  lodash.flatten = flatten;
3703  lodash.flattenDeep = flattenDeep;
3704  lodash.iteratee = iteratee;
3705  lodash.keys = keys;
3706  lodash.map = map;
3707  lodash.matches = matches;
3708  lodash.mixin = mixin;
3709  lodash.negate = negate;
3710  lodash.once = once;
3711  lodash.pick = pick;
3712  lodash.slice = slice;
3713  lodash.sortBy = sortBy;
3714  lodash.tap = tap;
3715  lodash.thru = thru;
3716  lodash.toArray = toArray;
3717  lodash.values = values;
3718 
3719  // Add aliases.
3720  lodash.extend = assignIn;
3721 
3722  // Add methods to `lodash.prototype`.
3723  mixin(lodash, lodash);
3724 
3725  /*------------------------------------------------------------------------*/
3726 
3727  // Add methods that return unwrapped values in chain sequences.
3728  lodash.clone = clone;
3729  lodash.escape = escape;
3730  lodash.every = every;
3731  lodash.find = find;
3732  lodash.forEach = forEach;
3733  lodash.has = has;
3734  lodash.head = head;
3735  lodash.identity = identity;
3736  lodash.indexOf = indexOf;
3737  lodash.isArguments = isArguments;
3738  lodash.isArray = isArray;
3739  lodash.isBoolean = isBoolean;
3740  lodash.isDate = isDate;
3741  lodash.isEmpty = isEmpty;
3742  lodash.isEqual = isEqual;
3743  lodash.isFinite = isFinite;
3744  lodash.isFunction = isFunction;
3745  lodash.isNaN = isNaN;
3746  lodash.isNull = isNull;
3747  lodash.isNumber = isNumber;
3748  lodash.isObject = isObject;
3749  lodash.isRegExp = isRegExp;
3750  lodash.isString = isString;
3751  lodash.isUndefined = isUndefined;
3752  lodash.last = last;
3753  lodash.max = max;
3754  lodash.min = min;
3755  lodash.noConflict = noConflict;
3756  lodash.noop = noop;
3757  lodash.reduce = reduce;
3758  lodash.result = result;
3759  lodash.size = size;
3760  lodash.some = some;
3761  lodash.uniqueId = uniqueId;
3762 
3763  // Add aliases.
3764  lodash.each = forEach;
3765  lodash.first = head;
3766 
3767  mixin(lodash, (function() {
3768  var source = {};
3769  baseForOwn(lodash, function(func, methodName) {
3770  if (!hasOwnProperty.call(lodash.prototype, methodName)) {
3771  source[methodName] = func;
3772  }
3773  });
3774  return source;
3775  }()), { 'chain': false });
3776 
3777  /*------------------------------------------------------------------------*/
3778 
3786  lodash.VERSION = VERSION;
3787 
3788  // Add `Array` methods to `lodash.prototype`.
3789  baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
3790  var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName],
3791  chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
3792  retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName);
3793 
3794  lodash.prototype[methodName] = function() {
3795  var args = arguments;
3796  if (retUnwrapped && !this.__chain__) {
3797  var value = this.value();
3798  return func.apply(isArray(value) ? value : [], args);
3799  }
3800  return this[chainName](function(value) {
3801  return func.apply(isArray(value) ? value : [], args);
3802  });
3803  };
3804  });
3805 
3806  // Add chain sequence methods to the `lodash` wrapper.
3807  lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
3808 
3809  /*--------------------------------------------------------------------------*/
3810 
3811  // Some AMD build optimizers, like r.js, check for condition patterns like:
3812  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
3813  // Expose Lodash on the global object to prevent errors when Lodash is
3814  // loaded by a script tag in the presence of an AMD loader.
3815  // See http://requirejs.org/docs/errors.html#mismatch for more details.
3816  // Use `_.noConflict` to remove Lodash from the global object.
3817  root._ = lodash;
3818 
3819  // Define as an anonymous module so, through path mapping, it can be
3820  // referenced as the "underscore" module.
3821  define(function() {
3822  return lodash;
3823  });
3824  }
3825  // Check for `exports` after `define` in case a build optimizer adds it.
3826  else if (freeModule) {
3827  // Export for Node.js.
3828  (freeModule.exports = lodash)._ = lodash;
3829  // Export for CommonJS support.
3830  freeExports._ = lodash;
3831  }
3832  else {
3833  // Export to the global object.
3834  root._ = lodash;
3835  }
3836 }.call(this));