(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define('underscore',factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,(function(){var current=global._;var exports=global._=factory();exports.noConflict=function(){global._=current;return exports;};}()));}(this,(function(){var VERSION='1.13.2';var root=typeof self=='object'&&self.self===self&&self||typeof global=='object'&&global.global===global&&global||Function('return this')()||{};var ArrayProto=Array.prototype,ObjProto=Object.prototype;var SymbolProto=typeof Symbol!=='undefined'?Symbol.prototype:null;var push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var supportsArrayBuffer=typeof ArrayBuffer!=='undefined',supportsDataView=typeof DataView!=='undefined';var nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView;var _isNaN=isNaN,_isFinite=isFinite;var hasEnumBug=!{toString:null}.propertyIsEnumerable('toString');var nonEnumerableProps=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'];var MAX_ARRAY_INDEX=Math.pow(2,53)-1;function restArguments(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0),rest=Array(length),index=0;for(;index=0&&sizeProperty<=MAX_ARRAY_INDEX;}} function shallowProperty(key){return function(obj){return obj==null?void 0:obj[key];};} var getByteLength=shallowProperty('byteLength');var isBufferLike=createSizePropertyCheck(getByteLength);var typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray(obj){return nativeIsView?(nativeIsView(obj)&&!isDataView$1(obj)):isBufferLike(obj)&&typedArrayPattern.test(toString.call(obj));} var isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(false);var getLength=shallowProperty('length');function emulatedSet(keys){var hash={};for(var l=keys.length,i=0;i':'>','"':'"',"'":''','`':'`'};var _escape=createEscaper(escapeMap);var unescapeMap=invert(escapeMap);var _unescape=createEscaper(unescapeMap);var templateSettings=_$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'};var escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(match){return'\\'+escapes[match];} var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=defaults({},settings,_$1.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join('|')+'|$','g');var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escapeRegExp,escapeChar);index=offset+match.length;if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'";}else if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'";}else if(evaluate){source+="';\n"+evaluate+"\n__p+='";} return match;});source+="';\n";var argument=settings.variable;if(argument){if(!bareIdentifier.test(argument))throw new Error('variable is not a bare identifier: '+argument);}else{source='with(obj||{}){\n'+source+'}\n';argument='obj';} source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+ source+'return __p;\n';var render;try{render=new Function(argument,'_',source);}catch(e){e.source=source;throw e;} var template=function(data){return render.call(this,data,_$1);};template.source='function('+argument+'){\n'+source+'}';return template;} function result(obj,path,fallback){path=toPath(path);var length=path.length;if(!length){return isFunction$1(fallback)?fallback.call(obj):fallback;} for(var i=0;i1){flatten$1(value,depth-1,strict,output);idx=output.length;}else{var j=0,len=value.length;while(jwait){if(timeout){clearTimeout(timeout);timeout=null;} previous=_now;result=func.apply(context,args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);} return result;};throttled.cancel=function(){clearTimeout(timeout);previous=0;timeout=context=args=null;};return throttled;} function debounce(func,wait,immediate){var timeout,previous,args,result,context;var later=function(){var passed=now()-previous;if(wait>passed){timeout=setTimeout(later,wait-passed);}else{timeout=null;if(!immediate)result=func.apply(context,args);if(!timeout)args=context=null;}};var debounced=restArguments(function(_args){context=this;args=_args;previous=now();if(!timeout){timeout=setTimeout(later,wait);if(immediate)result=func.apply(context,args);} return result;});debounced.cancel=function(){clearTimeout(timeout);timeout=args=context=null;};return debounced;} function wrap(func,wrapper){return partial(wrapper,func);} function negate(predicate){return function(){return!predicate.apply(this,arguments);};} function compose(){var args=arguments;var start=args.length-1;return function(){var i=start;var result=args[start].apply(this,arguments);while(i--)result=args[i].call(this,result);return result;};} function after(times,func){return function(){if(--times<1){return func.apply(this,arguments);}};} function before(times,func){var memo;return function(){if(--times>0){memo=func.apply(this,arguments);} if(times<=1)func=null;return memo;};} var once=partial(before,2);function findKey(obj,predicate,context){predicate=cb(predicate,context);var _keys=keys(obj),key;for(var i=0,length=_keys.length;i0?0:length-1;for(;index>=0&&index0){i=idx>=0?idx:Math.max(idx+length,i);}else{length=idx>=0?Math.min(idx+1,length):idx+length+1;}}else if(sortedIndex&&idx&&length){idx=sortedIndex(array,item);return array[idx]===item?idx:-1;} if(item!==item){idx=predicateFind(slice.call(array,i,length),isNaN$1);return idx>=0?idx+i:-1;} for(idx=dir>0?i:length-1;idx>=0&&idx0?0:length-1;if(!initial){memo=obj[_keys?_keys[index]:index];index+=dir;} for(;index>=0&&index=3;return reducer(obj,optimizeCb(iteratee,context,4),memo,initial);};} var reduce=createReduce(1);var reduceRight=createReduce(-1);function filter(obj,predicate,context){var results=[];predicate=cb(predicate,context);each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value);});return results;} function reject(obj,predicate,context){return filter(obj,negate(cb(predicate)),context);} function every(obj,predicate,context){predicate=cb(predicate,context);var _keys=!isArrayLike(obj)&&keys(obj),length=(_keys||obj).length;for(var index=0;index=0;} var invoke=restArguments(function(obj,path,args){var contextPath,func;if(isFunction$1(path)){func=path;}else{path=toPath(path);contextPath=path.slice(0,-1);path=path[path.length-1];} return map(obj,function(context){var method=func;if(!method){if(contextPath&&contextPath.length){context=deepGet(context,contextPath);} if(context==null)return void 0;method=context[path];} return method==null?method:method.apply(context,args);});});function pluck(obj,key){return map(obj,property(key));} function where(obj,attrs){return filter(obj,matcher(attrs));} function max(obj,iteratee,context){var result=-Infinity,lastComputed=-Infinity,value,computed;if(iteratee==null||typeof iteratee=='number'&&typeof obj[0]!='object'&&obj!=null){obj=isArrayLike(obj)?obj:values(obj);for(var i=0,length=obj.length;iresult){result=value;}}}else{iteratee=cb(iteratee,context);each(obj,function(v,index,list){computed=iteratee(v,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=v;lastComputed=computed;}});} return result;} function min(obj,iteratee,context){var result=Infinity,lastComputed=Infinity,value,computed;if(iteratee==null||typeof iteratee=='number'&&typeof obj[0]!='object'&&obj!=null){obj=isArrayLike(obj)?obj:values(obj);for(var i=0,length=obj.length;ib||a===void 0)return 1;if(a1)iteratee=optimizeCb(iteratee,keys[1]);keys=allKeys(obj);}else{iteratee=keyInObj;keys=flatten$1(keys,false,false);obj=Object(obj);} for(var i=0,length=keys.length;i1)context=keys[1];}else{keys=map(flatten$1(keys,false,false),String);iteratee=function(value,key){return!contains(keys,key);};} return pick(obj,iteratee,context);});function initial(array,n,guard){return slice.call(array,0,Math.max(0,array.length-(n==null||guard?1:n)));} function first(array,n,guard){if(array==null||array.length<1)return n==null||guard?void 0:[];if(n==null||guard)return array[0];return initial(array,array.length-n);} function rest(array,n,guard){return slice.call(array,n==null||guard?1:n);} function last(array,n,guard){if(array==null||array.length<1)return n==null||guard?void 0:[];if(n==null||guard)return array[array.length-1];return rest(array,Math.max(0,array.length-n));} function compact(array){return filter(array,Boolean);} function flatten(array,depth){return flatten$1(array,depth,false);} var difference=restArguments(function(array,rest){rest=flatten$1(rest,true,true);return filter(array,function(value){return!contains(rest,value);});});var without=restArguments(function(array,otherArrays){return difference(array,otherArrays);});function uniq(array,isSorted,iteratee,context){if(!isBoolean(isSorted)){context=iteratee;iteratee=isSorted;isSorted=false;} if(iteratee!=null)iteratee=cb(iteratee,context);var result=[];var seen=[];for(var i=0,length=getLength(array);i