From 1d4ce28b625215d75aef95169cd0052368b39539 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 26 Apr 2012 01:10:45 -0400 Subject: [PATCH] lodash: Remove unused `afterLoop` iterationFactory option, optimize `sortedIndex`, and optimize exiting early from compiled functions. [jddalton] Former-commit-id: f56c93bfed623c5100d7cdf1c0d30b1e557d8a97 --- build/pre-compile.js | 2 +- lodash.js | 101 +++++++++++++++++++++---------------------- lodash.min.js | 44 +++++++++---------- 3 files changed, 73 insertions(+), 74 deletions(-) diff --git a/build/pre-compile.js b/build/pre-compile.js index 0ff0fe973..010267d89 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -56,12 +56,12 @@ /** Used to minify `iterationFactory` option properties */ var iterationFactoryOptions = [ - 'afterLoop', 'args', 'array', 'beforeLoop', 'bottom', 'exits', + 'exitsExp', 'inLoop', 'init', 'iterate', diff --git a/lodash.js b/lodash.js index f6060fb6e..2cccc36d3 100644 --- a/lodash.js +++ b/lodash.js @@ -81,8 +81,8 @@ /** Compilation options for `_.difference` */ var differenceFactoryOptions = { 'args': 'array', - 'top': 'var values = concat.apply([], slice.call(arguments, 1))', 'init': '[]', + 'top': 'var values = concat.apply([], slice.call(arguments, 1))', 'inLoop': 'if (indexOf(values, array[index]) < 0) result.push(array[index])' }; @@ -96,13 +96,13 @@ var extendFactoryOptions = { 'args': 'object', 'init': 'object', - 'beforeLoop': + 'top': 'for (var source, j = 1, length = arguments.length; j < length; j++) {\n' + 'source = arguments[j]', 'loopExp': 'index in source', - 'inLoop': 'object[index] = source[index]', 'useHas': false, - 'afterLoop': '}' + 'inLoop': 'object[index] = source[index]', + 'bottom': '}' }; /** Compilation options for `_.filter` */ @@ -114,6 +114,7 @@ /** Compilation options for `_.forEach` */ var forEachFactoryOptions = { 'args': 'collection, callback, thisArg', + 'init': 'collection', 'top': 'if (!callback) {\n' + 'callback = identity\n' + @@ -121,18 +122,9 @@ 'else if (thisArg) {\n' + 'callback = bind(callback, thisArg)\n' + '}', - 'init': 'collection', 'inLoop': 'callback(collection[index], index, collection)' }; - /** Compilation options for `_.keys` */ - var keysFactoryOptions = { - 'args': 'object', - 'top': 'if (object !== Object(object)) throw TypeError()', - 'init': '[]', - 'inLoop': 'result.push(index)' - }; - /** Compilation options for `_.map` */ var mapFactoryOptions = { 'init': '', @@ -143,7 +135,7 @@ }, 'inLoop': { 'array': 'result[index] = callback(collection[index], index, collection)', - 'object': 'result[result.length] = callback(collection[index], index, collection)' + 'object': 'result.push(callback(collection[index], index, collection))' } }; @@ -232,9 +224,10 @@ var isEmpty = iterationFactory({ 'args': 'value', 'iterate': 'objects', - 'top': 'var className = toString.call(value)', 'init': 'true', - 'beforeLoop': 'if (className == arrayClass || className == stringClass) return !value.length', + 'top': + 'var className = toString.call(value);\n' + + 'if (className == arrayClass || className == stringClass) return !value.length', 'inLoop': 'return false' }); @@ -253,7 +246,7 @@ array = {}, object = {}, options = {}, - props = ['beforeLoop', 'loopExp', 'inLoop', 'afterLoop']; + props = ['beforeLoop', 'loopExp', 'inLoop']; // use simple loops to merge options because `extend` isn't defined yet while (++index < arguments.length) { @@ -261,6 +254,7 @@ options[prop] = arguments[index][prop]; } } + // assign the `array` and `object` branch options while ((prop = props.pop())) { if (typeof options[prop] == 'object') { @@ -287,12 +281,13 @@ '"use strict";' + // compile the arguments the function accepts 'return function(' + args + ') {\n' + - // add code to the top of the iteration method - (options.top || '') + ';\n' + // assign the `result` variable an initial value ('var index, result' + (init ? '=' + init : '')) + ';\n' + - // exit early if the first argument, e.g. `collection`, is nullish - 'if (' + firstArg + ' == undefined) return ' + (options.exits || 'result') + ';\n' + + // exit early if first argument, e.g. `collection`, is nullish or custom expression + 'if (' + (options.exitsExp || firstArg + ' == undefined') + ')\n' + + 'return ' + (options.exits || 'result') + ';\n' + + // add code after the exits if-statement but before the array/object iteration branches + (options.top || '') + ';\n' + // the following branch is for iterating arrays and array-like objects (arrayBranch // initialize `length` and `index` variables @@ -307,8 +302,6 @@ // add code inside the while-loop array.inLoop + '\n}' + - // add code after the while-loop - (array.afterLoop || '') + ';\n' + // end the array-like if-statement (objectBranch ? '\n}\n' : '')) : '' @@ -327,8 +320,6 @@ object.inLoop + (useHas ? '\n}' : '') + '\n}' + - // add code after the for-in loop - (object.afterLoop || '') + ';\n' + // end the object iteration else-statement (arrayBranch ? '\n}\n' : '')) : '' @@ -494,7 +485,7 @@ */ var groupBy = iterationFactory(forEachFactoryOptions, { 'init': '{}', - 'beforeLoop': + 'top': 'var prop, isFunc = toString.call(callback) == funcClass;\n' + 'if (isFunc && thisArg) callback = bind(callback, thisArg)', 'inLoop': @@ -523,13 +514,10 @@ var invoke = iterationFactory(mapFactoryOptions, { 'args': 'collection, methodName', 'top': 'var args = slice.call(arguments, 2), isFunc = toString.call(methodName) == funcClass', - 'inLoop': (function() { - var value = '(isFunc ? methodName : collection[index][methodName]).apply(collection[index], args)'; - return { - 'array': 'result[index] = ' + value, - 'object': 'result[result.length] = ' + value - }; - }()) + 'inLoop': { + 'array': 'result[index] = (isFunc ? methodName : collection[index][methodName]).apply(collection[index], args)', + 'object': 'result.push(isFunc ? methodName : collection[index][methodName]).apply(collection[index], args)' + } }); /** @@ -631,7 +619,7 @@ 'args': 'collection, property', 'inLoop': { 'array': 'result[index] = collection[index][property]', - 'object': 'result[result.length] = collection[index][property]' + 'object': 'result.push(collection[index][property])' } }); @@ -658,13 +646,11 @@ * // => 6 */ var reduce = iterationFactory({ - 'args': - 'collection, callback, accumulator, thisArg', + 'args': 'collection, callback, accumulator, thisArg', + 'init': 'accumulator', 'top': 'var initial = arguments.length > 2;\n' + 'if (thisArg) callback = bind(callback, thisArg)', - 'init': - 'accumulator', 'beforeLoop': { 'array': 'if (!initial) result = collection[++index]' }, @@ -700,14 +686,16 @@ * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, callback, result, thisArg) { - var initial = arguments.length > 2; if (collection == undefined) { return result; } + + var initial = arguments.length > 2, + length = collection.length; + if(thisArg) { callback = bind(callback, thisArg); } - var length = collection.length; if (length === +length) { if (length && !initial) { result = collection[--length]; @@ -891,14 +879,18 @@ * _.sortedIndex([10, 20, 30, 40, 50], 35); * // => 3 */ - function sortedIndex(array, object, callback) { - var low = 0, + function sortedIndex(array, value, callback) { + var mid, + low = 0, high = array.length; - callback || (callback = identity); while (low < high) { - var mid = (low + high) >> 1; - callback(array[mid]) < callback(object) ? (low = mid + 1) : (high = mid); + mid = (low + high) >> 1; + if (callback ? callback(array[mid]) < callback(value) : array[mid] < value) { + low = mid + 1; + } else { + high = mid; + } } return low; } @@ -949,7 +941,7 @@ 'args': 'collection', 'inLoop': { 'array': 'result[index] = collection[index]', - 'object': 'result[result.length] = collection[index]' + 'object': 'result.push(collection[index])' } }); @@ -1324,8 +1316,8 @@ * // => [2, 3, 4] */ var without = iterationFactory(differenceFactoryOptions, { - 'top': 'var values = slice.call(arguments, 1)', - 'init': '[]' + 'init': '[]', + 'top': 'var values = slice.call(arguments, 1)' }); /** @@ -1771,8 +1763,9 @@ * _.functions(_); * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] */ - var functions = iterationFactory(keysFactoryOptions, { - 'top': '', + var functions = iterationFactory({ + 'args': 'object', + 'init': '[]', 'useHas': false, 'inLoop': 'if (toString.call(object[index]) == funcClass) result.push(index)', 'returns': 'result.sort()' @@ -2212,7 +2205,13 @@ * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); * // => ['one', 'two', 'three'] */ - var keys = nativeKeys || iterationFactory(keysFactoryOptions); + var keys = nativeKeys || iterationFactory({ + 'args': 'object', + 'exitsExp': 'object !== Object(object)', + 'exits': 'throw TypeError()', + 'init': '[]', + 'inLoop': 'result.push(index)' + }); /** * Creates an object composed of the specified properties. Property names may diff --git a/lodash.min.js b/lodash.min.js index d1bb9cc25..bf6eff445 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -2,25 +2,25 @@ Lo-Dash 0.1.0 github.com/bestiejs/lodash/blob/master/LICENSE.txt Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE */ -;(function(q,h){"use strict";var m=!0,o=!1;function R(a){return"[object Arguments]"==k.call(a)}function i(a){return new p(a)}function p(a){this.o=a}function g(){for(var a,b=-1,c={},d={},e={},f=["d","j","g","a"];++b>1;c(a[f])a.length&&(b=m);J(c,function(c,f,j){if(b?ha(c)!==f||!c.length:0>D(c,f))c.push(f),d.push(a[j]); -return c},[]);return d}function s(a,b){var c=n.call(arguments,2),d=c.length;return function(){c.length=d;G.apply(c,arguments);return a.apply(b,c)}}function ja(a,b,c){var d;return function(){var e=arguments,f=this;c&&!d&&a.apply(f,e);va(d);d=K(function(){d=h;c||a.apply(f,e)},b)}}function Y(a,b,c){c||(c=[]);if(a===b)return 0!==a||1/a==1/b;if(a==h||b==h)return a===b;a.p&&(a=a.o);b.p&&(b=b.o);if(a.isEqual&&t(a.isEqual))return a.isEqual(b);if(b.isEqual&&t(b.isEqual))return b.isEqual(a);var d=k.call(a); -if(d!=k.call(b))return o;switch(d){case F:return a==""+b;case L:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ka:case la:return+a==+b;case ma:return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return o;for(var e=c.length;e--;)if(c[e]==a)return m;var e=m,f=0;c.push(a);if(d==B){if(f=a.length,e=f==b.length)for(;f--&&(e=f in a==f in b&&Y(a[f],b[f],c)););}else{if("constructor"in a!="constructor"in b||a.constructor!= -b.constructor)return o;for(var j in a)if(r.call(a,j)&&(f++,!(e=r.call(b,j)&&Y(a[j],b[j],c))))break;if(e){for(j in b)if(r.call(b,j)&&!f--)break;e=!f}}c.pop();return e}function t(a){return k.call(a)==ba}function S(a){return a}function na(a){u(M(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=[this.o];G.apply(a,arguments);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]= -a})();var Z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(q=global),exports),wa=0,xa=q._,ya=/\\|'|\r|\n|\t|\u2028|\u2029/g,$=/.^/,ua=/\\(\\|'|r|n|t|u2028|u2029)/g,B="[object Array]",ka="[object Boolean]",la="[object Date]",ba="[object Function]",L="[object Number]",ma="[object RegExp]",F="[object String]",z=Array.prototype,N=Object.prototype,C=z.concat,r=N.hasOwnProperty,G=z.push,n=z.slice,k=N.toString,za=q.isFinite,N=Object.keys,va=q.clearTimeout,K= -q.setTimeout,O={b:"c",m:"var M=j.apply([],D.call(arguments,1))",h:"[]",g:"if(q(M,c[p])<0)C.push(c[p])"},v={h:"J",g:"if(!f(h[p],p,h))return!C"},aa={b:"x",h:"x",d:"for(var E,j=1,w=arguments.length;j=i)i=k,C=h[p]"},E=Array.isArray||function(a){return k.call(a)==B},ca=g({b:"L",i:"b",m:"var g=I.call(L)",h:"J",d:"if(g==d||g==F)return!L.length",g:"return l"}),pa=g({b:"h,G",h:"l",g:"if(h[p]===G)return J"}),X=g(l,v),W=g(l,A),qa=g(l,{g:"if(f(h[p],p,h))return h[p]"}),u=g(l),Aa=g(l,{h:"{}",d:"var A,v=I.call(f)==m;if(v&&H)f=e(f,H)",g:"A=v?f(h[p],p,h):h[p][f];(C[A]||(C[A]=[])).push(h[p])"}), -Ba=g(w,{b:"h,z",m:"var b=D.call(arguments,2),v=I.call(z)==m",g:{c:"C[p]=(v?z:h[p][z]).apply(h[p],b)",k:"C[C.length]=(v?z:h[p][z]).apply(h[p],b)"}}),I=g(l,w),ra=g(l,x),x=g(l,x,{m:x.m.replace("-","").replace("max","min"),g:x.g.replace(">=","<")}),P=g(w,{b:"h,B",g:{c:"C[p]=h[p][B]",k:"C[C.length]=h[p][B]"}}),J=g({b:"h,f,a,H",m:"var s=arguments.length>2;if(H)f=e(f,H)",h:"a",d:{c:"if(!s)C=h[++p]"},g:{c:"C=f(C,h[p],p,h)",k:"C=s?f(C,h[p],p,h):(s=J,h[p])"}}),A=g(l,A,{g:"!"+A.g}),v=g(l,v,{h:"l",g:v.g.replace("!", -"")}),sa=g(w,{b:"h",g:{c:"C[p]=h[p]",k:"C[C.length]=h[p]"}}),w=g({b:"c",h:"[]",g:"if(c[p])C.push(c[p])"}),l=g(O),O=g(O,{m:"var M=D.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(x[p]==K)"+aa.g}),Q=g(aa),M=g(oa,{m:"",n:o,g:"if(I.call(x[p])==m)C.push(p)",l:"C.sort()"});R(arguments)||(R=function(a){return!(!a||!r.call(a,"callee"))});var U=N||g(oa);Q(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},after:function(a,b){return 1>a?b(): -function(){if(1>--a)return b.apply(this,arguments)}},bind:s,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=M(a));for(var d=b.length;c/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:X,extend:Q,filter:W,find:qa,first:V,flatten:fa,forEach:u,functions:M,groupBy:Aa,has:function(a,b){return r.call(a,b)},identity:S,indexOf:D,initial:function(a,b,c){return n.call(a, -0,-(b==h||c?1:b))},intersection:ga,invoke:Ba,isArguments:R,isArray:E,isBoolean:function(a){return a===m||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:ca,isEqual:Y,isFinite:function(a){return za(a)&&k.call(a)==L},isFunction:t,isNaN:function(a){return k.call(a)==L&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==L},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)== -ma},isString:function(a){return k.call(a)==F},isUndefined:function(a){return a===h},keys:U,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:I,max:ra,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return r.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){q._=xa;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=m;return b=a.apply(this, -arguments)}},pick:function(a){for(var b,c=0,d=C.apply([],arguments),e=d.length,f={};++carguments.length&&(b=a||0,a=0);for(var d=-1,e=Math.max(Math.ceil((b-a)/c),0),f=Array(e);++dd?1:0}),"b")},sortedIndex:ea,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return e.call(this,a,i)}c=ta(c||{},i.templateSettings);a="__p+='"+a.replace(ya,function(a){return"\\"+y[a]}).replace(c.escape|| -$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+T(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+T(b)+";__p+='"})+"';\n";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",e=Function(c.variable||"object","_",a);if(b)return e(b,i);d.source="function("+(c.variable||"object")+"){"+a+"}";return d}, -throttle:function(a,b){var c,d,e,f,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;f=this;i||(i=K(function(){i=h;d&&a.apply(f,c);k()},b));g?d=m:e=a.apply(f,c);k();g=m;return e}},times:function(a,b,c){c&&(b=s(b,c));for(c=0;c>1,(c?c(a[d])a.length&&(b=m);J(c,function(c,f,j){if(b?ha(c)!==f||!c.length:0>D(c,f))c.push(f),d.push(a[j]);return c}, +[]);return d}function s(a,b){var c=n.call(arguments,2),d=c.length;return function(){c.length=d;G.apply(c,arguments);return a.apply(b,c)}}function ja(a,b,c){var d;return function(){var e=arguments,f=this;c&&!d&&a.apply(f,e);ua(d);d=K(function(){d=h;c||a.apply(f,e)},b)}}function X(a,b,c){c||(c=[]);if(a===b)return 0!==a||1/a==1/b;if(a==h||b==h)return a===b;a.p&&(a=a.o);b.p&&(b=b.o);if(a.isEqual&&t(a.isEqual))return a.isEqual(b);if(b.isEqual&&t(b.isEqual))return b.isEqual(a);var d=k.call(a);if(d!=k.call(b))return o; +switch(d){case F:return a==""+b;case L:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ka:case la:return+a==+b;case ma:return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return o;for(var e=c.length;e--;)if(c[e]==a)return m;var e=m,f=0;c.push(a);if(d==B){if(f=a.length,e=f==b.length)for(;f--&&(e=f in a==f in b&&X(a[f],b[f],c)););}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return o; +for(var j in a)if(r.call(a,j)&&(f++,!(e=r.call(b,j)&&X(a[j],b[j],c))))break;if(e){for(j in b)if(r.call(b,j)&&!f--)break;e=!f}}c.pop();return e}function t(a){return k.call(a)==aa}function ba(a){return a}function na(a){u(M(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=[this.o];G.apply(a,arguments);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]=a})();var Y="object"== +typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(q=global),exports),va=0,wa=q._,xa=/\\|'|\r|\n|\t|\u2028|\u2029/g,Z=/.^/,ta=/\\(\\|'|r|n|t|u2028|u2029)/g,B="[object Array]",ka="[object Boolean]",la="[object Date]",aa="[object Function]",L="[object Number]",ma="[object RegExp]",F="[object String]",z=Array.prototype,N=Object.prototype,C=z.concat,r=N.hasOwnProperty,G=z.push,n=z.slice,k=N.toString,ya=q.isFinite,N=Object.keys,ua=q.clearTimeout,K=q.setTimeout,O={a:"c", +h:"[]",m:"var M=j.apply([],D.call(arguments,1))",g:"if(q(M,c[p])<0)C.push(c[p])"},v={h:"J",g:"if(!f(h[p],p,h))return!C"},$={a:"x",h:"x",m:"for(var E,j=1,w=arguments.length;j=i)i=k,C=h[p]"},E=Array.isArray||function(a){return k.call(a)==B},ca=g({a:"L",i:"b",h:"J",m:"var g=I.call(L);if(g==d||g==F)return!L.length",g:"return l"}),oa=g({a:"h,G",h:"l",g:"if(h[p]===G)return J"}),W=g(l,v),V=g(l,A),pa=g(l,{g:"if(f(h[p],p,h))return h[p]"}),u=g(l),za=g(l,{h:"{}",m:"var A,v=I.call(f)==m;if(v&&H)f=e(f,H)",g:"A=v?f(h[p],p,h):h[p][f];(C[A]||(C[A]=[])).push(h[p])"}),Aa=g(w,{a:"h,z",m:"var b=D.call(arguments,2),v=I.call(z)==m",g:{b:"C[p]=(v?z:h[p][z]).apply(h[p],b)", +k:"C.push(v?z:h[p][z]).apply(h[p],b)"}}),I=g(l,w),qa=g(l,x),x=g(l,x,{m:x.m.replace("-","").replace("max","min"),g:x.g.replace(">=","<")}),P=g(w,{a:"h,B",g:{b:"C[p]=h[p][B]",k:"C.push(h[p][B])"}}),J=g({a:"h,f,a,H",h:"a",m:"var s=arguments.length>2;if(H)f=e(f,H)",c:{b:"if(!s)C=h[++p]"},g:{b:"C=f(C,h[p],p,h)",k:"C=s?f(C,h[p],p,h):(s=J,h[p])"}}),A=g(l,A,{g:"!"+A.g}),v=g(l,v,{h:"l",g:v.g.replace("!","")}),ra=g(w,{a:"h",g:{b:"C[p]=h[p]",k:"C.push(h[p])"}}),w=g({a:"c",h:"[]",g:"if(c[p])C.push(c[p])"}),l= +g(O),O=g(O,{h:"[]",m:"var M=D.call(arguments,1)"}),sa=g($,{g:"if(x[p]==K)"+$.g}),Q=g($),M=g({a:"x",h:"[]",n:o,g:"if(I.call(x[p])==m)C.push(p)",l:"C.sort()"});R(arguments)||(R=function(a){return!(!a||!r.call(a,"callee"))});var T=N||g({a:"x",f:"x!==Object(x)",e:"throw TypeError()",h:"[]",g:"C.push(p)"});Q(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},after:function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this, +arguments)}},bind:s,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=M(a));for(var d=b.length;c/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:W,extend:Q,filter:V,find:pa,first:U,flatten:fa,forEach:u,functions:M,groupBy:za,has:function(a,b){return r.call(a,b)},identity:ba,indexOf:D,initial:function(a,b,c){return n.call(a,0,-(b==h||c?1:b))},intersection:ga,invoke:Aa, +isArguments:R,isArray:E,isBoolean:function(a){return a===m||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:ca,isEqual:X,isFinite:function(a){return ya(a)&&k.call(a)==L},isFunction:t,isNaN:function(a){return k.call(a)==L&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==L},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)==ma},isString:function(a){return k.call(a)== +F},isUndefined:function(a){return a===h},keys:T,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:I,max:qa,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return r.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){q._=wa;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=m;return b=a.apply(this,arguments)}},pick:function(a){for(var b,c=0, +d=C.apply([],arguments),e=d.length,f={};++carguments.length&&(b=a||0,a=0);for(var d=-1,e=Math.max(Math.ceil((b-a)/c),0),f=Array(e);++dd?1:0}),"b")},sortedIndex:ea,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return e.call(this,a,i)}c=sa(c||{},i.templateSettings);a="__p+='"+a.replace(xa,function(a){return"\\"+y[a]}).replace(c.escape||Z,function(a,b){return"'+((__t=("+ +S(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||Z,function(a,b){return"'+((__t=("+S(b)+"))==null?'':__t)+'"}).replace(c.evaluate||Z,function(a,b){return"';"+S(b)+";__p+='"})+"';\n";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",e=Function(c.variable||"object","_",a);if(b)return e(b,i);d.source="function("+(c.variable||"object")+"){"+a+"}";return d},throttle:function(a,b){var c,d, +e,f,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;f=this;i||(i=K(function(){i=h;d&&a.apply(f,c);k()},b));g?d=m:e=a.apply(f,c);k();g=m;return e}},times:function(a,b,c){c&&(b=s(b,c));for(c=0;c