Cleanup _.template docs and generate less unused code in compiled templates.

Former-commit-id: e6703414b83e9286d9ce5e14214375bbbaf9285f
This commit is contained in:
John-David Dalton
2012-08-19 02:13:43 -07:00
parent 985f4aafca
commit e4e41e5ef8
4 changed files with 66 additions and 56 deletions

View File

@@ -264,11 +264,8 @@
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), "['$1']");
// remove brackets from `_.escape()` in `tokenizeEscape`
source = source.replace(/_\['escape']\("/, '_.escape("');
// remove brackets from `_.escape()` in `_.template`
source = source.replace(/__e *= *_\['escape']/, '__e=_.escape');
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
// remove brackets from `collection.indexOf` in `_.contains`
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');

View File

@@ -152,7 +152,7 @@ The `lodash` function.
<!-- div -->
### <a id="_version"></a>`_.VERSION`
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4053 "View in source") [&#x24C9;][1]
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4060 "View in source") [&#x24C9;][1]
*(String)*: The semantic version number.
@@ -274,7 +274,7 @@ jQuery('#lodash_button').on('click', buttonView.onClick);
<!-- div -->
### <a id="_chainvalue"></a>`_.chain(value)`
<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3978 "View in source") [&#x24C9;][1]
<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3985 "View in source") [&#x24C9;][1]
Wraps the value in a `lodash` wrapper object.
@@ -2256,7 +2256,7 @@ _.sortedIndex(['twenty', 'thirty', 'fourty'], 'thirty-five', function(word) {
<!-- div -->
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4005 "View in source") [&#x24C9;][1]
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4012 "View in source") [&#x24C9;][1]
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
@@ -2286,7 +2286,7 @@ _.chain([1,2,3,200])
<!-- div -->
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3781 "View in source") [&#x24C9;][1]
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3787 "View in source") [&#x24C9;][1]
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. Note: For Chrome extensions use the `lodash csp` build and see http://code.google.com/chrome/extensions/trunk/sandboxingEval.html
@@ -2300,7 +2300,7 @@ A micro-templating method that handles arbitrary delimiters, preserves whitespac
#### Example
```js
// using compiled template
// using a compiled template
var compiled = _.template('hello: <%= name %>');
compiled({ 'name': 'moe' });
// => 'hello: moe'
@@ -2309,32 +2309,38 @@ var list = '<% _.forEach(people, function(name) { %> <li><%= name %></li> <% });
_.template(list, { 'people': ['moe', 'larry', 'curly'] });
// => '<li>moe</li><li>larry</li><li>curly</li>'
var template = _.template('<b><%- value %></b>');
template({ 'value': '<script>' });
// using the "escape" delimiter to escape HTML in data property values
_.template('<b><%- value %></b>', { 'value': '<script>' });
// => '<b>&lt;script></b>'
// using `print`
var compiled = _.template('<% print("Hello " + epithet); %>');
compiled({ 'epithet': 'stooge' });
// using the internal `print` function in "evaluate" delimiters
_.template('<% print("Hello " + epithet); %>', { 'epithet': 'stooge' });
// => 'Hello stooge.'
// using custom template settings
// using custom template delimiter settings
_.templateSettings = {
'interpolate': /\{\{(.+?)\}\}/g
};
var template = _.template('Hello {{ name }}!');
template({ 'name': 'Mustache' });
_.template('Hello {{ name }}!', { 'name': 'Mustache' });
// => 'Hello Mustache!'
// specify the `variable` option to avoid using a with-statement during compilation
_.template('Using a with-statement: <%= data.answer %>', { 'answer': 'no' }, { 'variable': 'data' });
// => 'Using a with-statement: no'
// using the `variable` option to ensure a with-statement isn't used in a compiled template
var compiled = _.template('hello: <%= data.name %>', null, { 'variable': 'data' });
compiled.source;
// => function(data) {
var __t, __p = '', __e = _.escape;
__p += 'hello: ' + ((__t = ( data.name )) == null ? '' : __t);
return __p;
}
// using the `source` property
<script>
JST.project = <%= _.template(jstText).source %>;
</script>
// using the `source` property to inline compiled templates for meaningful
// line numbers in error messages and a stack trace
fs.writeFileSync(path.join(cwd, 'jst.js'), '\
var JST = {\
"main": ' + _.template(mainText).source + '\
};\
');
```
* * *
@@ -2370,7 +2376,7 @@ jQuery(window).on('scroll', throttled);
<!-- div -->
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3921 "View in source") [&#x24C9;][1]
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3928 "View in source") [&#x24C9;][1]
Executes the `callback` function `n` times. The `callback` is bound to `thisArg` and invoked with `1` argument; *(index)*.
@@ -2480,7 +2486,7 @@ _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
<!-- div -->
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3948 "View in source") [&#x24C9;][1]
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3955 "View in source") [&#x24C9;][1]
Generates a unique id. If `prefix` is passed, the id will be appended to it.
@@ -2669,7 +2675,7 @@ _.zipObject(['moe', 'larry', 'curly'], [30, 40, 50]);
<!-- div -->
### <a id="_prototypechain"></a>`_.prototype.chain()`
<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4023 "View in source") [&#x24C9;][1]
<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4030 "View in source") [&#x24C9;][1]
Enables method chaining on the wrapper object.
@@ -2690,7 +2696,7 @@ _([1, 2, 3]).value();
<!-- div -->
### <a id="_prototypevalue"></a>`_.prototype.value()`
<a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4040 "View in source") [&#x24C9;][1]
<a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4047 "View in source") [&#x24C9;][1]
Extracts the wrapped value.

View File

@@ -311,7 +311,7 @@
* @memberOf _.templateSettings
* @type String
*/
'variable': 'obj'
'variable': ''
};
/*--------------------------------------------------------------------------*/
@@ -3742,7 +3742,7 @@
* is given, else it returns the interpolated text.
* @example
*
* // using compiled template
* // using a compiled template
* var compiled = _.template('hello: <%= name %>');
* compiled({ 'name': 'moe' });
* // => 'hello: moe'
@@ -3751,32 +3751,38 @@
* _.template(list, { 'people': ['moe', 'larry', 'curly'] });
* // => '<li>moe</li><li>larry</li><li>curly</li>'
*
* var template = _.template('<b><%- value %></b>');
* template({ 'value': '<script>' });
* // using the "escape" delimiter to escape HTML in data property values
* _.template('<b><%- value %></b>', { 'value': '<script>' });
* // => '<b>&lt;script></b>'
*
* // using `print`
* var compiled = _.template('<% print("Hello " + epithet); %>');
* compiled({ 'epithet': 'stooge' });
* // using the internal `print` function in "evaluate" delimiters
* _.template('<% print("Hello " + epithet); %>', { 'epithet': 'stooge' });
* // => 'Hello stooge.'
*
* // using custom template settings
* // using custom template delimiter settings
* _.templateSettings = {
* 'interpolate': /\{\{(.+?)\}\}/g
* };
*
* var template = _.template('Hello {{ name }}!');
* template({ 'name': 'Mustache' });
* _.template('Hello {{ name }}!', { 'name': 'Mustache' });
* // => 'Hello Mustache!'
*
* // specify the `variable` option to avoid using a with-statement during compilation
* _.template('Using a with-statement: <%= data.answer %>', { 'answer': 'no' }, { 'variable': 'data' });
* // => 'Using a with-statement: no'
* // using the `variable` option to ensure a with-statement isn't used in a compiled template
* var compiled = _.template('hello: <%= data.name %>', null, { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* var __t, __p = '', __e = _.escape;
* __p += 'hello: ' + ((__t = ( data.name )) == null ? '' : __t);
* return __p;
* }
*
* // using the `source` property
* <script>
* JST.project = <%= _.template(jstText).source %>;
* </script>
* // using the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and a stack trace
* fs.writeFileSync(path.join(cwd, 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(text, data, options) {
// based on John Resig's `tmpl` implementation
@@ -3791,7 +3797,8 @@
evaluateDelimiter = options.evaluate,
interpolateDelimiter = options.interpolate,
settings = lodash.templateSettings,
variable = options.variable;
variable = options.variable || settings.variable,
hasVariable = variable;
// use default settings if no options object is provided
if (escapeDelimiter == null) {
@@ -3835,11 +3842,11 @@
// clear stored code snippets
tokenized.length = 0;
// if `options.variable` is not specified and the template contains "evaluate"
// if `variable` is not specified and the template contains "evaluate"
// delimiters, wrap a with-statement around the generated code to add the
// data object to the top of the scope chain
if (!variable) {
variable = settings.variable || lastVariable || 'obj';
if (!hasVariable) {
variable = lastVariable || 'obj';
if (isEvaluating) {
text = 'with (' + variable + ') {\n' + text + '\n}\n';
@@ -3865,12 +3872,12 @@
// frame code as the function body
text = 'function(' + variable + ') {\n' +
variable + ' || (' + variable + ' = {});\n' +
(hasVariable ? '' : variable + ' || (' + variable + ' = {});\n') +
'var __t, __p = \'\', __e = _.escape' +
(isEvaluating
? ', __j = Array.prototype.join;\n' +
'function print() { __p += __j.call(arguments, \'\') }\n'
: ', __d = ' + variable + '.' + variable + ' || ' + variable + ';\n'
: (hasVariable ? '' : ', __d = ' + variable + '.' + variable + ' || ' + variable) + ';\n'
) +
text +
'return __p\n}';

10
lodash.min.js vendored
View File

@@ -19,8 +19,8 @@ s.concat(ft.call(o)):s),this instanceof n?(v.prototype=e.prototype,u=new v,(o=e.
,".+?")+"$"),Z=/__token__(\d+)/g,et=/[&<"']/g,tt=/['\n\r\t\u2028\u2029\\]/g,nt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),rt="__token__",it=[],st=I.concat,ot=R.hasOwnProperty,ut=I.push,at=R.propertyIsEnumerable,ft=I.slice,lt=R.toString,ct=Y.test(ct=ft.bind)&&ct,ht=Y.test(ht=Array.isArray)&&ht,pt=e.isFinite,dt=Y.test(dt=Object.keys)&&dt,vt="[object Arguments]",mt="[object Array]",gt="[object Boolean]",yt="[object Date]",bt="[object Number]"
,wt="[object Object]",Et="[object RegExp]",St="[object String]",xt=e.clearTimeout,Tt=e.setTimeout,Nt,Ct,kt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)kt=!n;Nt=4>(t+"").length,Ct="x"!=t[0]})(1);var Lt=!b(arguments),At="x"!=ft.call("x")[0],Ot="xx"!="x"[0]+Object("x")[0];try{var Mt=("[object Object]",lt.call(e.document||0)==wt)}catch(_t){}var Dt=ct&&/\n|Opera/.test(ct+lt.call(e.opera)),Pt=dt&&/^.+$|true/.test(dt+!!e.attachEvent
),Ht={"[object Arguments]":n,"[object Array]":n,"[object Boolean]":i,"[object Date]":i,"[object Function]":i,"[object Number]":i,"[object Object]":i,"[object RegExp]":i,"[object String]":n},Bt={"[object Arguments]":i,"[object Array]":n,"[object Boolean]":n,"[object Date]":n,"[object Function]":i,"[object Number]":n,"[object Object]":n,"[object RegExp]":n,"[object String]":n},jt={"&":"&amp;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Ft={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i
,unknown:n},It={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"obj"};var qt={a:"b,a,w",j:"b",q:"if(!a)a=f;else if(w)a=i(a,w)",i:"if(a(y,g,b)===false)return s"},Rt={j:"{}",q:"var o;if(typeof a!='function'){var ii=a;a=function(y){return y[ii]}}else if(w)a=i(a,w)",i:"o=a(y,g,b);(e.call(s,o)?s[o]++:s[o]=1)"},Ut={j:"true",i:"if(!a(y,g,b))return!s"},zt={r:i,s
:i,a:"l",j:"l",q:"for(var B=1,C=arguments.length;B<C;B++){if(h=arguments[B]){",i:"s[g]=y",e:"}}"},Wt={j:"[]",i:"a(y,g,b)&&s.push(y)"},Xt={q:"if(w)a=i(a,w)"},Vt={i:{l:qt.i}},$t={j:"",f:"if(!b)return[]",d:{b:"s=Array(j)",l:"s="+(Pt?"Array(j)":"[]")},i:{b:"s[g]=a(y,g,b)",l:"s"+(Pt?"[m]=":".push")+"(a(y,g,b))"}};Lt&&(b=function(e){return!!e&&!!ot.call(e,"callee")});var Jt=ht||function(e){return lt.call(e)==mt};w(/x/)&&(w=function(e){return"[object Function]"==lt.call(e)});var Kt=a({a:"l",j:"[]",i:"s.push(g)"
,unknown:n},It={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var qt={a:"b,a,w",j:"b",q:"if(!a)a=f;else if(w)a=i(a,w)",i:"if(a(y,g,b)===false)return s"},Rt={j:"{}",q:"var o;if(typeof a!='function'){var ii=a;a=function(y){return y[ii]}}else if(w)a=i(a,w)",i:"o=a(y,g,b);(e.call(s,o)?s[o]++:s[o]=1)"},Ut={j:"true",i:"if(!a(y,g,b))return!s"},zt={r:i,s:i,
a:"l",j:"l",q:"for(var B=1,C=arguments.length;B<C;B++){if(h=arguments[B]){",i:"s[g]=y",e:"}}"},Wt={j:"[]",i:"a(y,g,b)&&s.push(y)"},Xt={q:"if(w)a=i(a,w)"},Vt={i:{l:qt.i}},$t={j:"",f:"if(!b)return[]",d:{b:"s=Array(j)",l:"s="+(Pt?"Array(j)":"[]")},i:{b:"s[g]=a(y,g,b)",l:"s"+(Pt?"[m]=":".push")+"(a(y,g,b))"}};Lt&&(b=function(e){return!!e&&!!ot.call(e,"callee")});var Jt=ht||function(e){return lt.call(e)==mt};w(/x/)&&(w=function(e){return"[object Function]"==lt.call(e)});var Kt=a({a:"l",j:"[]",i:"s.push(g)"
}),Qt=a(zt,{i:"if(s[g]==null)"+zt.i}),Gt=a({r:i,a:"l",j:"{}",q:"var r=c.apply(E,arguments)",i:"if(N(r,g)<0)s[g]=y"}),Yt=a(zt),Zt=a(qt,Xt,Vt,{r:i}),en=a(qt,Xt,Vt),tn=a({r:i,a:"l",j:"[]",i:"if(T(y))s.push(g)",e:"s.sort()"}),nn=a({a:"y",j:"true",q:"var H=x.call(y),j=y.length;if(D[H]"+(Lt?"||P(y)":"")+"||(H==X&&j>-1&&j===j>>>0&&T(y.splice)))return!j",i:{l:"return false"}}),rn=dt?function(e){var t=typeof e;return"function"==t&&at.call(e,"prototype")?Kt(e):e&&Ft[t]?dt(e):[]}:Kt,sn=a(zt,{a:"l,ee,O,ff",q
:"var J,L,Q,gg,dd=O==U;if(!dd)ff=[];for(var B=1,C=dd?2:arguments.length;B<C;B++){if(h=arguments[B]){",i:"if(y&&((Q=R(y))||U(y))){L=false;gg=ff.length;while(gg--)if(L=ff[gg].c==y)break;if(L){s[g]=ff[gg].d}else{J=(J=s[g])&&Q?(R(J)?J:[]):(U(J)?J:{});ff.push({d:J,c:y});s[g]=G(J,y,U,ff)}}else if(y!=null)s[g]=y"}),on=a({a:"l",j:"[]",i:"s.push(y)"}),un=a({a:"b,hh",j:"false",o:i,d:{b:"if(x.call(h)==v)return b.indexOf(hh)>-1"},i:"if(y===hh)return true"}),an=a(qt,Rt),fn=a(qt,Ut),ln=a(qt,Wt),cn=a(qt,Xt,{j:""
,i:"if(a(y,g,b))return y"}),hn=a(qt,Xt),pn=a(qt,Rt,{i:"o=a(y,g,b);(e.call(s,o)?s[o]:s[o]=[]).push(y)"}),dn=a($t,{a:"b,V",q:"var A=u.call(arguments,2),S=typeof V=='function'",i:{b:"s[g]=(S?V:y[V]).apply(y,A)",l:"s"+(Pt?"[m]=":".push")+"((S?V:y[V]).apply(y,A))"}}),vn=a(qt,$t),mn=a($t,{a:"b,bb",i:{b:"s[g]=y[bb]",l:"s"+(Pt?"[m]=":".push")+"(y[bb])"}}),gn=a({a:"b,a,z,w",j:"z",q:"var W=arguments.length<3;if(w)a=i(a,w)",d:{b:"if(W)s=b[++g]"},i:{b:"s=a(s,y,g,b)",l:"s=W?(W=false,y):a(s,y,g,b)"}}),yn=a(qt,
@@ -32,9 +32,9 @@ dn,s.isArguments=b,s.isArray=Jt,s.isBoolean=function(e){return e===n||e===i||lt.
)}},s.lastIndexOf=function(e,t,n){if(!e)return-1;var r=e.length;for(n&&"number"==typeof n&&(r=(0>n?Math.max(0,r+n):Math.min(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=vn,s.max=k,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return ot.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=sn,s.min=function(e,t,n){var r=Infinity,i=r;if(!e)return i;var s=-1,o=e.length;if(!t){for(;++s<o;)e[s]<i&&(i=e[s]);return i}for(n&&(t=d(t,n));++s<o;)n=t(
e[s],s,e),n<r&&(r=n,i=e[s]);return i},s.mixin=D,s.noConflict=function(){return e._=X,this},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.partial=function(e){var t=ft.call(arguments,1),n=t.length;return function(){var r;return r=arguments,r.length&&(t.length=n,ut.apply(t,r)),r=1==t.length?e.call(this,t[0]):e.apply(this,t),t.length=n,r}},s.pick=function(e){var t={};if(!e)return t;for(var n,r=0,i=st.apply(I,arguments),s=i.length;++r<s;)n=i[r],n in
e&&(t[n]=e[n]);return t},s.pluck=mn,s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=Math.max(0,Math.ceil((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=gn,s.reduceRight=x,s.reject=yn,s.rest=L,s.result=function(e,t){if(!e)return r;var n=e[t];return w(n)?e[t]():n},s.shuffle=function(e){if(!e)return[];for(var t,n=-1,r=e.length,i=Array(r);++n<r;)t=Math.floor(Math.random()*(n+1)),i[n]=i[t],i[t]=e[n];return i},s.size=function(e){if(!e)return 0;var t=lt.call(e),n=e.length
;return Ht[t]||Lt&&b(e)||t==wt&&-1<n&&n===n>>>0&&w(e.splice)?n:rn(e).length},s.some=bn,s.sortBy=wn,s.sortedIndex=A,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){n||(n={});var o,u;o=n.escape;var a=n.evaluate,f=n.interpolate,h=s.templateSettings,n=n.variable;o==r&&(o=h.escape),a==r&&(a=h.evaluate||i),f==r&&(f=h.interpolate),o&&(e=e.replace(o,m)),f&&(e=e.replace(f,y)),a!=P&&(P=a,j=RegExp("<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>"+(a?"|"+a.source:""),"g")),o=it.length,e=e.replace(j,g),o=
o!=it.length,e="__p += '"+e.replace(tt,c).replace(Z,l)+"';",it.length=0,n||(n=h.variable||H||"obj",o?e="with("+n+"){"+e+"}":(n!=H&&(H=n,B=RegExp("(\\(\\s*)"+n+"\\."+n+"\\b","g")),e=e.replace(G,"$&"+n+".").replace(B,"$1__d"))),e=(o?e.replace($,""):e).replace(J,"$1").replace(K,"$1;"),e="function("+n+"){"+n+"||("+n+"={});var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":",__d="+n+"."+n+"||"+n+";")+e+"return __p}";try{u=Function("_","return "+e)
(s)}catch(p){u=function(){throw p}}return t?u(t):(u.source=e,u)},s.throttle=function(e,t){function n(){a=new Date,u=r,e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(a=r,s=e.apply(o,i)):u||(u=Tt(n,f)),s}},s.times=function(e,t,n){var r=-1;if(n)for(;++r<e;)t.call(n,r);else for(;++r<e;)t(r)},s.toArray=function(e){if(!e)return[];if(e.toArray&&w(e.toArray))return e.toArray();var t=e.length;return-1<t&&t===t>>>0?(At?lt.call(e)==St:"string"==typeof
;return Ht[t]||Lt&&b(e)||t==wt&&-1<n&&n===n>>>0&&w(e.splice)?n:rn(e).length},s.some=bn,s.sortBy=wn,s.sortedIndex=A,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){n||(n={});var o,u;o=n.escape;var a=n.evaluate,f=n.interpolate,h=s.templateSettings,p=n=n.variable||h.variable;o==r&&(o=h.escape),a==r&&(a=h.evaluate||i),f==r&&(f=h.interpolate),o&&(e=e.replace(o,m)),f&&(e=e.replace(f,y)),a!=P&&(P=a,j=RegExp("<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>"+(a?"|"+a.source:""),"g")),o=it.length,e=e.replace
(j,g),o=o!=it.length,e="__p += '"+e.replace(tt,c).replace(Z,l)+"';",it.length=0,p||(n=H||"obj",o?e="with("+n+"){"+e+"}":(n!=H&&(H=n,B=RegExp("(\\(\\s*)"+n+"\\."+n+"\\b","g")),e=e.replace(G,"$&"+n+".").replace(B,"$1__d"))),e=(o?e.replace($,""):e).replace(J,"$1").replace(K,"$1;"),e="function("+n+"){"+(p?"":n+"||("+n+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(p?"":",__d="+n+"."+n+"||"+n)+";")+e+"return __p}";try{u=Function("_"
,"return "+e)(s)}catch(d){u=function(){throw d}}return t?u(t):(u.source=e,u)},s.throttle=function(e,t){function n(){a=new Date,u=r,e.apply(o,i)}var i,s,o,u,a=0;return function(){var r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(a=r,s=e.apply(o,i)):u||(u=Tt(n,f)),s}},s.times=function(e,t,n){var r=-1;if(n)for(;++r<e;)t.call(n,r);else for(;++r<e;)t(r)},s.toArray=function(e){if(!e)return[];if(e.toArray&&w(e.toArray))return e.toArray();var t=e.length;return-1<t&&t===t>>>0?(At?lt.call(e)==St:"string"==typeof
e)?e.split(""):ft.call(e):on(e)},s.union=function(){for(var e=-1,t=[],n=st.apply(t,arguments),r=n.length;++e<r;)0>C(t,n[e])&&t.push(n[e]);return t},s.uniq=O,s.uniqueId=function(e){var t=W++;return e?e+t:t},s.values=on,s.where=En,s.without=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=u(arguments,1,20);++n<r;)i(e[n])||t.push(e[n]);return t},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&ut.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){if(!e)return[
];for(var t=-1,n=k(mn(arguments,"length")),r=Array(n);++t<n;)r[t]=mn(arguments,t);return r},s.zipObject=function(e,t){if(!e)return{};var n=-1,r=e.length,i={};for(t||(t=[]);++n<r;)i[e[n]]=t[n];return i},s.all=fn,s.any=bn,s.collect=vn,s.detect=cn,s.each=hn,s.foldl=gn,s.foldr=x,s.head=T,s.include=un,s.inject=gn,s.methods=tn,s.select=ln,s.tail=L,s.take=T,s.unique=O,hn({Date:yt,Number:bt,RegExp:Et,String:St},function(e,t){s["is"+t]=function(t){return lt.call(t)==e}}),o.prototype=s.prototype,D(s),o.prototype
.chain=function(){return this._chain=n,this},o.prototype.value=function(){return this._wrapped},hn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=I[e];o.prototype[e]=function(){var e=this._wrapped;return t.apply(e,arguments),e.length===0&&delete e[0],this._chain&&(e=new o(e),e._chain=n),e}}),hn(["concat","join","slice"],function(e){var t=I[e];o.prototype[e]=function(){var e=t.apply(this._wrapped,arguments);return this._chain&&(e=new o(e),e._chain=n),e}}),typeof define=="function"&&typeof